@inspectr/mcplab 1.28.5 → 1.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/README.md +52 -5
  2. package/dist/app/assets/index-256LN2cO.css +2 -0
  3. package/dist/app/assets/index-DVIaEnjQ.js +243 -0
  4. package/dist/app/assets/sse-queue-worker-Iwmqd2oW.js +1 -0
  5. package/dist/app/index.html +2 -2
  6. package/dist/app-server/app-context.d.ts +75 -115
  7. package/dist/app-server/app-context.d.ts.map +1 -1
  8. package/dist/app-server/app-dist.d.ts +3 -3
  9. package/dist/app-server/app-dist.js.map +1 -1
  10. package/dist/app-server/app-run-artifacts.d.ts +4 -0
  11. package/dist/app-server/app-run-artifacts.d.ts.map +1 -0
  12. package/dist/app-server/app-run-artifacts.js +66 -0
  13. package/dist/app-server/app-run-artifacts.js.map +1 -0
  14. package/dist/app-server/assistant-common.d.ts +27 -37
  15. package/dist/app-server/assistant-common.d.ts.map +1 -1
  16. package/dist/app-server/assistant-common.js +110 -1
  17. package/dist/app-server/assistant-common.js.map +1 -1
  18. package/dist/app-server/assistant-events.d.ts +8 -28
  19. package/dist/app-server/browser-launch.d.ts +3 -3
  20. package/dist/app-server/browser-launch.js.map +1 -1
  21. package/dist/app-server/browser-provider-learning.d.ts +26 -0
  22. package/dist/app-server/browser-provider-learning.d.ts.map +1 -0
  23. package/dist/app-server/browser-provider-learning.js +353 -0
  24. package/dist/app-server/browser-provider-learning.js.map +1 -0
  25. package/dist/app-server/config-store.d.ts +13 -21
  26. package/dist/app-server/dev-mcp.d.ts +2 -5
  27. package/dist/app-server/evals-routes.d.ts +8 -18
  28. package/dist/app-server/evaluation-group-results.d.ts +11 -0
  29. package/dist/app-server/evaluation-group-results.d.ts.map +1 -0
  30. package/dist/app-server/evaluation-group-results.js +46 -0
  31. package/dist/app-server/evaluation-group-results.js.map +1 -0
  32. package/dist/app-server/evaluation-journal-projection.d.ts +9 -0
  33. package/dist/app-server/evaluation-journal-projection.d.ts.map +1 -0
  34. package/dist/app-server/evaluation-journal-projection.js +76 -0
  35. package/dist/app-server/evaluation-journal-projection.js.map +1 -0
  36. package/dist/app-server/evaluation-journal-writer.d.ts +23 -0
  37. package/dist/app-server/evaluation-journal-writer.d.ts.map +1 -0
  38. package/dist/app-server/evaluation-journal-writer.js +41 -0
  39. package/dist/app-server/evaluation-journal-writer.js.map +1 -0
  40. package/dist/app-server/evaluation-result-projection.d.ts +12 -0
  41. package/dist/app-server/evaluation-result-projection.d.ts.map +1 -0
  42. package/dist/app-server/evaluation-result-projection.js +107 -0
  43. package/dist/app-server/evaluation-result-projection.js.map +1 -0
  44. package/dist/app-server/execution-journal.d.ts +13 -0
  45. package/dist/app-server/execution-journal.d.ts.map +1 -0
  46. package/dist/app-server/execution-journal.js +39 -0
  47. package/dist/app-server/execution-journal.js.map +1 -0
  48. package/dist/app-server/http.d.ts +1 -1
  49. package/dist/app-server/index.d.ts +1 -1
  50. package/dist/app-server/inspectr-session-manager.d.ts +45 -0
  51. package/dist/app-server/inspectr-session-manager.d.ts.map +1 -0
  52. package/dist/app-server/inspectr-session-manager.js +203 -0
  53. package/dist/app-server/inspectr-session-manager.js.map +1 -0
  54. package/dist/app-server/jobs.d.ts +6 -9
  55. package/dist/app-server/libraries-store.d.ts +26 -10
  56. package/dist/app-server/libraries-store.d.ts.map +1 -1
  57. package/dist/app-server/libraries-store.js +130 -3
  58. package/dist/app-server/libraries-store.js.map +1 -1
  59. package/dist/app-server/live-tests-routes.d.ts +17 -0
  60. package/dist/app-server/live-tests-routes.d.ts.map +1 -0
  61. package/dist/app-server/live-tests-routes.js +82 -0
  62. package/dist/app-server/live-tests-routes.js.map +1 -0
  63. package/dist/app-server/live-tests.d.ts +81 -0
  64. package/dist/app-server/live-tests.d.ts.map +1 -0
  65. package/dist/app-server/live-tests.js +272 -0
  66. package/dist/app-server/live-tests.js.map +1 -0
  67. package/dist/app-server/markdown-reports.d.ts +7 -7
  68. package/dist/app-server/oauth-debugger-domain.d.ts +183 -207
  69. package/dist/app-server/oauth-debugger-domain.js.map +1 -1
  70. package/dist/app-server/oauth-debugger.d.ts +10 -17
  71. package/dist/app-server/oauth-debugger.js +1 -1
  72. package/dist/app-server/oauth-debugger.js.map +1 -1
  73. package/dist/app-server/oauth-runtime-domain.d.ts +42 -53
  74. package/dist/app-server/oauth-runtime-domain.js.map +1 -1
  75. package/dist/app-server/oauth-runtime-routes.d.ts +12 -12
  76. package/dist/app-server/oauth-session-manager.d.ts +44 -50
  77. package/dist/app-server/oauth-session-manager.d.ts.map +1 -1
  78. package/dist/app-server/oauth-session-manager.js.map +1 -1
  79. package/dist/app-server/provider-models.d.ts +5 -5
  80. package/dist/app-server/result-assistant-domain.d.ts +66 -82
  81. package/dist/app-server/result-assistant-domain.d.ts.map +1 -1
  82. package/dist/app-server/result-assistant-domain.js.map +1 -1
  83. package/dist/app-server/result-assistant-tools.d.ts +5 -5
  84. package/dist/app-server/result-assistant.d.ts +9 -21
  85. package/dist/app-server/result-assistant.js.map +1 -1
  86. package/dist/app-server/router.d.ts +9 -1
  87. package/dist/app-server/router.d.ts.map +1 -1
  88. package/dist/app-server/router.js +328 -10
  89. package/dist/app-server/router.js.map +1 -1
  90. package/dist/app-server/rover-connection.d.ts +48 -0
  91. package/dist/app-server/rover-connection.d.ts.map +1 -0
  92. package/dist/app-server/rover-connection.js +172 -0
  93. package/dist/app-server/rover-connection.js.map +1 -0
  94. package/dist/app-server/run-agent-selection.d.ts +2 -5
  95. package/dist/app-server/run-queue-domain.d.ts +89 -65
  96. package/dist/app-server/run-queue-domain.d.ts.map +1 -1
  97. package/dist/app-server/run-queue-domain.js +723 -9
  98. package/dist/app-server/run-queue-domain.js.map +1 -1
  99. package/dist/app-server/run-queue-events.d.ts +3 -10
  100. package/dist/app-server/run-queue-events.d.ts.map +1 -1
  101. package/dist/app-server/run-queue-events.js +114 -14
  102. package/dist/app-server/run-queue-events.js.map +1 -1
  103. package/dist/app-server/run-queue-executor.d.ts +33 -47
  104. package/dist/app-server/run-queue-executor.d.ts.map +1 -1
  105. package/dist/app-server/run-queue-executor.js +85 -15
  106. package/dist/app-server/run-queue-executor.js.map +1 -1
  107. package/dist/app-server/run-queue-state.d.ts +81 -47
  108. package/dist/app-server/run-queue-state.d.ts.map +1 -1
  109. package/dist/app-server/run-queue-state.js.map +1 -1
  110. package/dist/app-server/runs-routes.d.ts +13 -35
  111. package/dist/app-server/runs-routes.d.ts.map +1 -1
  112. package/dist/app-server/runs-routes.js +182 -16
  113. package/dist/app-server/runs-routes.js.map +1 -1
  114. package/dist/app-server/runs-routes.test-helpers.d.ts +42 -38
  115. package/dist/app-server/runs-routes.test-helpers.d.ts.map +1 -1
  116. package/dist/app-server/runs-routes.test-helpers.js +4 -1
  117. package/dist/app-server/runs-routes.test-helpers.js.map +1 -1
  118. package/dist/app-server/runs-store.d.ts +60 -43
  119. package/dist/app-server/runs-store.d.ts.map +1 -1
  120. package/dist/app-server/runs-store.js +157 -70
  121. package/dist/app-server/runs-store.js.map +1 -1
  122. package/dist/app-server/scenario-assistant-domain.d.ts +131 -157
  123. package/dist/app-server/scenario-assistant-domain.d.ts.map +1 -1
  124. package/dist/app-server/scenario-assistant-domain.js +7 -15
  125. package/dist/app-server/scenario-assistant-domain.js.map +1 -1
  126. package/dist/app-server/scenario-assistant.d.ts +10 -26
  127. package/dist/app-server/scenario-assistant.js.map +1 -1
  128. package/dist/app-server/settings-store.d.ts +4 -4
  129. package/dist/app-server/static-serving.d.ts +7 -13
  130. package/dist/app-server/store-utils.d.ts +1 -1
  131. package/dist/app-server/tool-analysis-domain.d.ts +167 -183
  132. package/dist/app-server/tool-analysis-domain.d.ts.map +1 -1
  133. package/dist/app-server/tool-analysis-domain.js +2 -59
  134. package/dist/app-server/tool-analysis-domain.js.map +1 -1
  135. package/dist/app-server/tool-analysis-storage.d.ts +20 -34
  136. package/dist/app-server/tool-analysis.d.ts +10 -19
  137. package/dist/app-server/types.d.ts +25 -25
  138. package/dist/app-server/version-info.d.ts +6 -6
  139. package/dist/app-server/version-info.js.map +1 -1
  140. package/dist/app-server/workspace-paths.d.ts +2 -1
  141. package/dist/app-server/workspace-paths.d.ts.map +1 -1
  142. package/dist/app-server/workspace-paths.js +5 -1
  143. package/dist/app-server/workspace-paths.js.map +1 -1
  144. package/dist/cli-branding.d.ts +1 -1
  145. package/dist/cli-branding.js.map +1 -1
  146. package/dist/cli.d.ts +1 -1
  147. package/dist/cli.js +1 -1
  148. package/dist/cli.js.map +1 -1
  149. package/dist/eval-config-files.d.ts +5 -8
  150. package/dist/interactive-helpers.d.ts +11 -15
  151. package/dist/migrate-utils.d.ts +1 -1
  152. package/dist/results/context.d.ts +1 -1
  153. package/dist/results/format.d.ts +7 -14
  154. package/dist/results/indexer.d.ts +2 -9
  155. package/dist/results/search.d.ts +1 -1
  156. package/dist/results/types.d.ts +2 -11
  157. package/dist/run-interactive.d.ts +21 -23
  158. package/dist/test-results-fixture.d.ts +4 -4
  159. package/package.json +8 -6
  160. package/dist/app/assets/index-Bxq-wlTN.css +0 -1
  161. package/dist/app/assets/index-j_NpCqyK.js +0 -258
  162. package/dist/app/assets/sse-queue-worker-BMo6aPaB.js +0 -1
@@ -0,0 +1,243 @@
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,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.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.provider`),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.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): 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`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)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 M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(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 P={current:null},F={transition:null},I={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:F,ReactCurrentOwner:C};function ee(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(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.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,e.act=ee,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},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:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=F.transition;F.transition={};try{e()}finally{F.transition=t}},e.unstable_act=ee,e.useCallback=function(e,t){return P.current.useCallback(e,t)},e.useContext=function(e){return P.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return P.current.useDeferredValue(e)},e.useEffect=function(e,t){return P.current.useEffect(e,t)},e.useId=function(){return P.current.useId()},e.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return P.current.useMemo(e,t)},e.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},e.useRef=function(e){return P.current.useRef(e)},e.useState=function(e){return P.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return P.current.useTransition()},e.version=`18.3.1`})),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(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=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(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 b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function N(t,n){w=g(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_continueExecution=function(){m||p||(m=!0,M(x))},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`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},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_pauseExecution=function(){},e.unstable_requestPaint=function(){},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?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,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(),n=p();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;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.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,f={},m={};function h(e){return l.call(m,e)?!0:l.call(f,e)?!1:u.test(e)?m[e]=!0:(f[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?h(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),N=Symbol.for(`react.suspense_list`),P=Symbol.for(`react.memo`),F=Symbol.for(`react.lazy`),I=Symbol.for(`react.offscreen`),ee=Symbol.iterator;function L(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var R=Object.assign,z;function te(e){if(z===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);z=t&&t[1]||``}return`
2
+ `+z+e}var ne=!1;function re(e,t){if(!e||ne)return``;ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
3
+ `),a=r.stack.split(`
4
+ `),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
5
+ `+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?te(e):``}function ie(e){switch(e.tag){case 5:return te(e.type);case 16:return te(`Lazy`);case 13:return te(`Suspense`);case 19:return te(`SuspenseList`);case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return``}}function ae(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}function oe(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return ae(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function se(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function ce(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function B(e){var t=ce(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function le(e){e._valueTracker||=B(e)}function ue(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=ce(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function de(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function V(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=se(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function pe(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function me(e,t){pe(e,t);var n=se(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?ge(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&ge(e,t.type,se(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function he(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function ge(e,t,n){(t!==`number`||de(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var _e=Array.isArray;function ve(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=``+se(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 ye(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return R({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function be(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(_e(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:se(n)}}function xe(e,t){var n=se(t.value),r=se(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function Se(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function Ce(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function we(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?Ce(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Te,Ee=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(Te||=document.createElement(`div`),Te.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Te.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function De(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Oe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ke=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Oe).forEach(function(e){ke.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Oe[t]=Oe[e]})});function Ae(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Oe.hasOwnProperty(e)&&Oe[e]?(``+t).trim():t+`px`}function je(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Ae(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Me=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ne(e,t){if(t){if(Me[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function H(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;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 Pe=null;function Fe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ie=null,Le=null,Re=null;function ze(e){if(e=U(e)){if(typeof Ie!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Vi(t),Ie(e.stateNode,e.type,t))}}function Be(e){Le?Re?Re.push(e):Re=[e]:Le=e}function Ve(){if(Le){var e=Le,t=Re;if(Re=Le=null,ze(e),t)for(e=0;e<t.length;e++)ze(t[e])}}function He(e,t){return e(t)}function Ue(){}var We=!1;function Ge(e,t,n){if(We)return e(t,n);We=!0;try{return He(e,t,n)}finally{We=!1,(Le!==null||Re!==null)&&(Ue(),Ve())}}function Ke(e,t){var n=e.stateNode;if(n===null)return null;var i=Vi(n);if(i===null)return null;n=i[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`:(i=!i.disabled)||(e=e.type,i=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var qe=!1;if(c)try{var Je={};Object.defineProperty(Je,"passive",{get:function(){qe=!0}}),window.addEventListener(`test`,Je,Je),window.removeEventListener(`test`,Je,Je)}catch{qe=!1}function Ye(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Xe=!1,Ze=null,Qe=!1,$e=null,et={onError:function(e){Xe=!0,Ze=e}};function tt(e,t,n,r,i,a,o,s,c){Xe=!1,Ze=null,Ye.apply(et,arguments)}function nt(e,t,n,i,a,o,s,c,l){if(tt.apply(this,arguments),Xe){if(Xe){var u=Ze;Xe=!1,Ze=null}else throw Error(r(198));Qe||(Qe=!0,$e=u)}}function rt(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 it(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 at(e){if(rt(e)!==e)throw Error(r(188))}function ot(e){var t=e.alternate;if(!t){if(t=rt(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return at(a),e;if(o===i)return at(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function st(e){return e=ot(e),e===null?null:ct(e)}function ct(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ct(e);if(t!==null)return t;e=e.sibling}return null}var lt=n.unstable_scheduleCallback,ut=n.unstable_cancelCallback,dt=n.unstable_shouldYield,ft=n.unstable_requestPaint,pt=n.unstable_now,mt=n.unstable_getCurrentPriorityLevel,ht=n.unstable_ImmediatePriority,gt=n.unstable_UserBlockingPriority,_t=n.unstable_NormalPriority,vt=n.unstable_LowPriority,yt=n.unstable_IdlePriority,bt=null,xt=null;function St(e){if(xt&&typeof xt.onCommitFiberRoot==`function`)try{xt.onCommitFiberRoot(bt,e,void 0,(e.current.flags&128)==128)}catch{}}var Ct=Math.clz32?Math.clz32:Et,wt=Math.log,Tt=Math.LN2;function Et(e){return e>>>=0,e===0?32:31-(wt(e)/Tt|0)|0}var Dt=64,Ot=4194304;function kt(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function At(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=kt(a))):r=kt(s)}else o=n&~i,o===0?a!==0&&(r=kt(a)):r=kt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Ct(t),i=1<<n,r|=e[n],t&=~i;return r}function jt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Mt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Ct(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=jt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Nt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Pt(){var e=Dt;return Dt<<=1,!(Dt&4194240)&&(Dt=64),e}function Ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function It(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ct(t),e[t]=n}function Lt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Ct(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ct(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var zt=0;function Bt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Vt,Ht,Ut,Wt,Gt,Kt=!1,qt=[],Jt=null,Yt=null,Xt=null,Zt=new Map,Qt=new Map,$t=[],en=`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 submit`.split(` `);function tn(e,t){switch(e){case`focusin`:case`focusout`:Jt=null;break;case`dragenter`:case`dragleave`:Yt=null;break;case`mouseover`:case`mouseout`:Xt=null;break;case`pointerover`:case`pointerout`:Zt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Qt.delete(t.pointerId)}}function nn(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=U(t),t!==null&&Ht(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function rn(e,t,n,r,i){switch(t){case`focusin`:return Jt=nn(Jt,e,t,n,r,i),!0;case`dragenter`:return Yt=nn(Yt,e,t,n,r,i),!0;case`mouseover`:return Xt=nn(Xt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Zt.set(a,nn(Zt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Qt.set(a,nn(Qt.get(a)||null,e,t,n,r,i)),!0}return!1}function an(e){var t=zi(e.target);if(t!==null){var n=rt(t);if(n!==null){if(t=n.tag,t===13){if(t=it(n),t!==null){e.blockedOn=t,Gt(e.priority,function(){Ut(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 on(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_n(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Pe=r,n.target.dispatchEvent(r),Pe=null}else return t=U(n),t!==null&&Ht(t),e.blockedOn=n,!1;t.shift()}return!0}function sn(e,t,n){on(e)&&n.delete(t)}function cn(){Kt=!1,Jt!==null&&on(Jt)&&(Jt=null),Yt!==null&&on(Yt)&&(Yt=null),Xt!==null&&on(Xt)&&(Xt=null),Zt.forEach(sn),Qt.forEach(sn)}function ln(e,t){e.blockedOn===t&&(e.blockedOn=null,Kt||(Kt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,cn)))}function un(e){function t(t){return ln(t,e)}if(0<qt.length){ln(qt[0],e);for(var n=1;n<qt.length;n++){var r=qt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Jt!==null&&ln(Jt,e),Yt!==null&&ln(Yt,e),Xt!==null&&ln(Xt,e),Zt.forEach(t),Qt.forEach(t),n=0;n<$t.length;n++)r=$t[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<$t.length&&(n=$t[0],n.blockedOn===null);)an(n),n.blockedOn===null&&$t.shift()}var dn=C.ReactCurrentBatchConfig,fn=!0;function pn(e,t,n,r){var i=zt,a=dn.transition;dn.transition=null;try{zt=1,hn(e,t,n,r)}finally{zt=i,dn.transition=a}}function mn(e,t,n,r){var i=zt,a=dn.transition;dn.transition=null;try{zt=4,hn(e,t,n,r)}finally{zt=i,dn.transition=a}}function hn(e,t,n,r){if(fn){var i=_n(e,t,n,r);if(i===null)di(e,t,r,gn,n),tn(e,r);else if(rn(i,e,t,n,r))r.stopPropagation();else if(tn(e,r),t&4&&-1<en.indexOf(e)){for(;i!==null;){var a=U(i);if(a!==null&&Vt(a),a=_n(e,t,n,r),a===null&&di(e,t,r,gn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else di(e,t,r,null,n)}}var gn=null;function _n(e,t,n,r){if(gn=null,e=Fe(r),e=zi(e),e!==null){if(t=rt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=it(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 gn=e,null}function vn(e){switch(e){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`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 1;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`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(mt()){case ht:return 1;case gt:return 4;case _t:case vt:return 16;case yt:return 536870912;default:return 16}default:return 16}}var yn=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in yn?yn.value:yn.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 xn=i.slice(e,1<r?1-r:void 0)}function Cn(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 wn(){return!0}function Tn(){return!1}function En(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)?wn:Tn,this.isPropagationStopped=Tn,this}return R(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=wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),t}var Dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},On=En(Dn),kn=R({},Dn,{view:0,detail:0}),An=En(kn),jn,Mn,Nn,Pn=R({},kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gn,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!==Nn&&(Nn&&e.type===`mousemove`?(jn=e.screenX-Nn.screenX,Mn=e.screenY-Nn.screenY):Mn=jn=0,Nn=e),jn)},movementY:function(e){return`movementY`in e?e.movementY:Mn}}),Fn=En(Pn),In=En(R({},Pn,{dataTransfer:0})),Ln=En(R({},kn,{relatedTarget:0})),Rn=En(R({},Dn,{animationName:0,elapsedTime:0,pseudoElement:0})),zn=En(R({},Dn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Bn=En(R({},Dn,{data:0})),Vn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Hn={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`},Un={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Un[e])?!!t[e]:!1}function Gn(){return Wn}var Kn=En(R({},kn,{key:function(e){if(e.key){var t=Vn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Cn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Hn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gn,charCode:function(e){return e.type===`keypress`?Cn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Cn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),qn=En(R({},Pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Jn=En(R({},kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gn})),Yn=En(R({},Dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Xn=En(R({},Pn,{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})),Zn=[9,13,27,32],Qn=c&&`CompositionEvent`in window,$n=null;c&&`documentMode`in document&&($n=document.documentMode);var er=c&&`TextEvent`in window&&!$n,tr=c&&(!Qn||$n&&8<$n&&11>=$n),nr=` `,rr=!1;function ir(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ar(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var or=!1;function sr(e,t){switch(e){case`compositionend`:return ar(t);case`keypress`:return t.which===32?(rr=!0,nr):null;case`textInput`:return e=t.data,e===nr&&rr?null:e;default:return null}}function cr(e,t){if(or)return e===`compositionend`||!Qn&&ir(e,t)?(e=Sn(),xn=bn=yn=null,or=!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 tr&&t.locale!==`ko`?null:t.data;default:return null}}var lr={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 ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!lr[e.type]:t===`textarea`}function dr(e,t,n,r){Be(r),t=pi(t,`onChange`),0<t.length&&(n=new On(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var fr=null,pr=null;function mr(e){ai(e,0)}function hr(e){if(ue(Bi(e)))return e}function gr(e,t){if(e===`change`)return t}var _r=!1;if(c){var vr;if(c){var yr=`oninput`in document;if(!yr){var br=document.createElement(`div`);br.setAttribute(`oninput`,`return;`),yr=typeof br.oninput==`function`}vr=yr}else vr=!1;_r=vr&&(!document.documentMode||9<document.documentMode)}function xr(){fr&&(fr.detachEvent(`onpropertychange`,Sr),pr=fr=null)}function Sr(e){if(e.propertyName===`value`&&hr(pr)){var t=[];dr(t,pr,e,Fe(e)),Ge(mr,t)}}function Cr(e,t,n){e===`focusin`?(xr(),fr=t,pr=n,fr.attachEvent(`onpropertychange`,Sr)):e===`focusout`&&xr()}function wr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return hr(pr)}function Tr(e,t){if(e===`click`)return hr(t)}function Er(e,t){if(e===`input`||e===`change`)return hr(t)}function Dr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Or=typeof Object.is==`function`?Object.is:Dr;function kr(e,t){if(Or(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(!l.call(t,i)||!Or(e[i],t[i]))return!1}return!0}function Ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jr(e,t){var n=Ar(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=Ar(n)}}function Mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nr(){for(var e=window,t=de();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=de(e.document)}return t}function Pr(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`)}function Fr(e){var t=Nr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Mr(n.ownerDocument.documentElement,n)){if(r!==null&&Pr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=jr(n,a);var o=jr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Ir=c&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==de(r)||(r=Lr,`selectionStart`in r&&Pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&kr(zr,r)||(zr=r,r=pi(Rr,`onSelect`),0<r.length&&(t=new On(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Lr)))}function Hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ur={animationend:Hr(`Animation`,`AnimationEnd`),animationiteration:Hr(`Animation`,`AnimationIteration`),animationstart:Hr(`Animation`,`AnimationStart`),transitionend:Hr(`Transition`,`TransitionEnd`)},Wr={},Gr={};c&&(Gr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),`TransitionEvent`in window||delete Ur.transitionend.transition);function Kr(e){if(Wr[e])return Wr[e];if(!Ur[e])return e;var t=Ur[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Gr)return Wr[e]=t[n];return e}var qr=Kr(`animationend`),Jr=Kr(`animationiteration`),Yr=Kr(`animationstart`),Xr=Kr(`transitionend`),Zr=new Map,Qr=`abort auxClick 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(` `);function $r(e,t){Zr.set(e,t),o(t,[e])}for(var ei=0;ei<Qr.length;ei++){var ti=Qr[ei];$r(ti.toLowerCase(),`on`+(ti[0].toUpperCase()+ti.slice(1)))}$r(qr,`onAnimationEnd`),$r(Jr,`onAnimationIteration`),$r(Yr,`onAnimationStart`),$r(`dblclick`,`onDoubleClick`),$r(`focusin`,`onFocus`),$r(`focusout`,`onBlur`),$r(Xr,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var ni=`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(` `),ri=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ni));function ii(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,nt(r,t,void 0,e),e.currentTarget=null}function ai(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ii(i,s,l),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;ii(i,s,l),a=c}}}if(Qe)throw e=$e,Qe=!1,$e=null,e}function oi(e,t){var n=t[Ii];n===void 0&&(n=t[Ii]=new Set);var r=e+`__bubble`;n.has(r)||(ui(t,e,2,!1),n.add(r))}function si(e,t,n){var r=0;t&&(r|=4),ui(n,e,r,t)}var ci=`_reactListening`+Math.random().toString(36).slice(2);function li(e){if(!e[ci]){e[ci]=!0,i.forEach(function(t){t!==`selectionchange`&&(ri.has(t)||si(t,!1,e),si(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ci]||(t[ci]=!0,si(`selectionchange`,!1,t))}}function ui(e,t,n,r){switch(vn(t)){case 1:var i=pn;break;case 4:i=mn;break;default:i=hn}n=i.bind(null,t,n,e),i=void 0,!qe||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 di(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=zi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}Ge(function(){var r=a,i=Fe(n),o=[];a:{var s=Zr.get(e);if(s!==void 0){var c=On,l=e;switch(e){case`keypress`:if(Cn(n)===0)break a;case`keydown`:case`keyup`:c=Kn;break;case`focusin`:l=`focus`,c=Ln;break;case`focusout`:l=`blur`,c=Ln;break;case`beforeblur`:case`afterblur`:c=Ln;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`:c=Fn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=In;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Jn;break;case qr:case Jr:case Yr:c=Rn;break;case Xr:c=Yn;break;case`scroll`:c=An;break;case`wheel`:c=Xn;break;case`copy`:case`cut`:case`paste`:c=zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=qn}var u=!!(t&4),d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=Ke(p,f),h!=null&&u.push(fi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Pe&&(l=n.relatedTarget||n.fromElement)&&(zi(l)||l[Fi]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?zi(l):null,l!==null&&(d=rt(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Fn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=qn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Bi(c),m=l==null?s:Bi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,zi(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=mi(m))p++;for(m=0,h=f;h;h=mi(h))m++;for(;0<p-m;)u=mi(u),p--;for(;0<m-p;)f=mi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=mi(u),f=mi(f)}u=null}else u=null;c!==null&&hi(o,s,c,u,!1),l!==null&&d!==null&&hi(o,d,l,u,!0)}}a:{if(s=r?Bi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=gr;else if(ur(s)){if(_r)g=Er;else{g=wr;var _=Cr}}else(c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Tr);if(g&&=g(e,r)){dr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&ge(s,`number`,s.value)}switch(_=r?Bi(r):window,e){case`focusin`:(ur(_)||_.contentEditable===`true`)&&(Lr=_,Rr=r,zr=null);break;case`focusout`:zr=Rr=Lr=null;break;case`mousedown`:Br=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Br=!1,Vr(o,n,i);break;case`selectionchange`:if(Ir)break;case`keydown`:case`keyup`:Vr(o,n,i)}var v;if(Qn)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else or?ir(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(tr&&n.locale!==`ko`&&(or||y!==`onCompositionStart`?y===`onCompositionEnd`&&or&&(v=Sn()):(yn=i,bn=`value`in yn?yn.value:yn.textContent,or=!0)),_=pi(r,y),0<_.length&&(y=new Bn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=ar(n),v!==null&&(y.data=v)))),(v=er?sr(e,n):cr(e,n))&&(r=pi(r,`onBeforeInput`),0<r.length&&(i=new Bn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}ai(o,t)})}function fi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function pi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Ke(e,n),a!=null&&r.unshift(fi(e,a,i)),a=Ke(e,t),a!=null&&r.push(fi(e,a,i))),e=e.return}return r}function mi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function hi(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(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=Ke(n,a),c!=null&&o.unshift(fi(n,c,s))):i||(c=Ke(n,a),c!=null&&o.push(fi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var gi=/\r\n?/g,_i=/\u0000|\uFFFD/g;function vi(e){return(typeof e==`string`?e:``+e).replace(gi,`
6
+ `).replace(_i,``)}function yi(e,t,n){if(t=vi(t),vi(e)!==t&&n)throw Error(r(425))}function bi(){}var xi=null,Si=null;function Ci(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wi=typeof setTimeout==`function`?setTimeout:void 0,Ti=typeof clearTimeout==`function`?clearTimeout:void 0,Ei=typeof Promise==`function`?Promise:void 0,Di=typeof queueMicrotask==`function`?queueMicrotask:Ei===void 0?wi:function(e){return Ei.resolve(null).then(e).catch(Oi)};function Oi(e){setTimeout(function(){throw e})}function ki(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===`/$`){if(r===0){e.removeChild(i),un(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++}n=i}while(n);un(t)}function Ai(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===`$?`)break;if(t===`/$`)return null}}return e}function ji(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Mi=Math.random().toString(36).slice(2),Ni=`__reactFiber$`+Mi,Pi=`__reactProps$`+Mi,Fi=`__reactContainer$`+Mi,Ii=`__reactEvents$`+Mi,Li=`__reactListeners$`+Mi,Ri=`__reactHandles$`+Mi;function zi(e){var t=e[Ni];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Fi]||n[Ni]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ji(e);e!==null;){if(n=e[Ni])return n;e=ji(e)}return t}e=n,n=e.parentNode}return null}function U(e){return e=e[Ni]||e[Fi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Bi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Vi(e){return e[Pi]||null}var Hi=[],Ui=-1;function Wi(e){return{current:e}}function Gi(e){0>Ui||(e.current=Hi[Ui],Hi[Ui]=null,Ui--)}function Ki(e,t){Ui++,Hi[Ui]=e.current,e.current=t}var qi={},Ji=Wi(qi),Yi=Wi(!1),Xi=qi;function Zi(e,t){var n=e.type.contextTypes;if(!n)return qi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Qi(e){return e=e.childContextTypes,e!=null}function $i(){Gi(Yi),Gi(Ji)}function ea(e,t,n){if(Ji.current!==qi)throw Error(r(168));Ki(Ji,t),Ki(Yi,n)}function ta(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,oe(e)||`Unknown`,a));return R({},n,i)}function na(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qi,Xi=Ji.current,Ki(Ji,e),Ki(Yi,Yi.current),!0}function ra(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=ta(e,t,Xi),i.__reactInternalMemoizedMergedChildContext=e,Gi(Yi),Gi(Ji),Ki(Ji,e)):Gi(Yi),Ki(Yi,n)}var ia=null,aa=!1,oa=!1;function sa(e){ia===null?ia=[e]:ia.push(e)}function ca(e){aa=!0,sa(e)}function la(){if(!oa&&ia!==null){oa=!0;var e=0,t=zt;try{var n=ia;for(zt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ia=null,aa=!1}catch(t){throw ia!==null&&(ia=ia.slice(e+1)),lt(ht,la),t}finally{zt=t,oa=!1}}return null}var ua=[],da=0,fa=null,pa=0,ma=[],ha=0,ga=null,_a=1,va=``;function ya(e,t){ua[da++]=pa,ua[da++]=fa,fa=e,pa=t}function ba(e,t,n){ma[ha++]=_a,ma[ha++]=va,ma[ha++]=ga,ga=e;var r=_a;e=va;var i=32-Ct(r)-1;r&=~(1<<i),n+=1;var a=32-Ct(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,_a=1<<32-Ct(t)+i|n<<i|r,va=a+e}else _a=1<<a|n<<i|r,va=e}function xa(e){e.return!==null&&(ya(e,1),ba(e,1,0))}function Sa(e){for(;e===fa;)fa=ua[--da],ua[da]=null,pa=ua[--da],ua[da]=null;for(;e===ga;)ga=ma[--ha],ma[ha]=null,va=ma[--ha],ma[ha]=null,_a=ma[--ha],ma[ha]=null}var Ca=null,wa=null,Ta=!1,Ea=null;function Da(e,t){var n=nu(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Oa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null&&(e.stateNode=t,Ca=e,wa=Ai(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t!==null&&(e.stateNode=t,Ca=e,wa=null,!0);case 13:return t=t.nodeType===8?t:null,t!==null&&(n=ga===null?null:{id:_a,overflow:va},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=nu(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ca=e,wa=null,!0);default:return!1}}function ka(e){return!!(e.mode&1)&&!(e.flags&128)}function Aa(e){if(Ta){var t=wa;if(t){var n=t;if(!Oa(e,t)){if(ka(e))throw Error(r(418));t=Ai(n.nextSibling);var i=Ca;t&&Oa(e,t)?Da(i,n):(e.flags=e.flags&-4097|2,Ta=!1,Ca=e)}}else{if(ka(e))throw Error(r(418));e.flags=e.flags&-4097|2,Ta=!1,Ca=e}}}function ja(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ca=e}function Ma(e){if(e!==Ca)return!1;if(!Ta)return ja(e),Ta=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Ci(e.type,e.memoizedProps)),t&&=wa){if(ka(e))throw Na(),Error(r(418));for(;t;)Da(e,t),t=Ai(t.nextSibling)}if(ja(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){wa=Ai(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}wa=null}}else wa=Ca?Ai(e.stateNode.nextSibling):null;return!0}function Na(){for(var e=wa;e;)e=Ai(e.nextSibling)}function Pa(){wa=Ca=null,Ta=!1}function Fa(e){Ea===null?Ea=[e]:Ea.push(e)}var Ia=C.ReactCurrentBatchConfig;function La(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Ra(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function za(e){var t=e._init;return t(e._payload)}function Ba(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 i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=au(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|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=lu(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===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===F&&za(i)===t.type)?(r=a(t,n.props),r.ref=La(e,t,n),r.return=e,r):(r=ou(n.type,n.key,n.props,null,e.mode,r),r.ref=La(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=uu(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=su(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`)return t=lu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=ou(t.type,t.key,t.props,null,e.mode,n),n.ref=La(e,null,t),n.return=e,n;case T:return t=uu(t,e.mode,n),t.return=e,t;case F:var r=t._init;return f(e,r(t._payload),n)}if(_e(t)||L(t))return t=su(t,e.mode,n,null),t.return=e,t;Ra(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`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case F:return i=n._init,p(e,t,i(n._payload),r)}if(_e(n)||L(n))return i===null?d(e,t,n,r,null):null;Ra(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case F:var a=r._init;return m(e,t,n,a(r._payload),i)}if(_e(r)||L(r))return e=e.get(n)||null,d(t,e,r,i,null);Ra(t,r)}return null}function h(r,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(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Ta&&ya(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ta&&ya(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,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(r,e)}),Ta&&ya(r,h),l}function g(a,s,c,l){var u=L(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=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),Ta&&ya(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 Ta&&ya(a,g),u}for(h=i(a,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)}),Ta&&ya(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&za(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=La(e,l,i),r.return=e,e=r;break a}n(e,l);break}t(e,l),l=l.sibling}i.type===E?(r=su(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=ou(i.type,i.key,i.props,null,e.mode,o),o.ref=La(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}r=uu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(_e(i))return h(e,r,i,o);if(L(i))return g(e,r,i,o);Ra(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=lu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Va=Ba(!0),Ha=Ba(!1),Ua=Wi(null),Wa=null,Ga=null,Ka=null;function qa(){Ka=Ga=Wa=null}function Ja(e){var t=Ua.current;Gi(Ua),e._currentValue=t}function Ya(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 Xa(e,t){Wa=e,Ka=Ga=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Bs=!0),e.firstContext=null)}function Za(e){var t=e._currentValue;if(Ka!==e){if(e={context:e,memoizedValue:t,next:null},Ga===null){if(Wa===null)throw Error(r(308));Ga=e,Wa.dependencies={lanes:0,firstContext:e}}else Ga=Ga.next=e}return t}var Qa=null;function $a(e){Qa===null?Qa=[e]:Qa.push(e)}function eo(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,$a(t)):(n.next=i.next,i.next=n),t.interleaved=n,to(e,r)}function to(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var no=!1;function ro(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function io(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ao(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function oo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,to(e,n)}return i=r.interleaved,i===null?(t.next=t,$a(r)):(t.next=i.next,i.next=t),r.interleaved=t,to(e,n)}function so(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rt(e,n)}}function co(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={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,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,effects:r.effects},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function lo(e,t,n,r){var i=e.updateQueue;no=!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,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=R({},d,f);break a;case 2:no=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime: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;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);il|=o,e.lanes=o,e.memoizedState=d}}function uo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var fo={},po=Wi(fo),mo=Wi(fo),ho=Wi(fo);function go(e){if(e===fo)throw Error(r(174));return e}function _o(e,t){switch(Ki(ho,t),Ki(mo,e),Ki(po,fo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:we(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=we(t,e)}Gi(po),Ki(po,t)}function vo(){Gi(po),Gi(mo),Gi(ho)}function yo(e){go(ho.current);var t=go(po.current),n=we(t,e.type);t!==n&&(Ki(mo,e),Ki(po,n))}function bo(e){mo.current===e&&(Gi(po),Gi(mo))}var xo=Wi(0);function So(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 Co=[];function wo(){for(var e=0;e<Co.length;e++)Co[e]._workInProgressVersionPrimary=null;Co.length=0}var To=C.ReactCurrentDispatcher,Eo=C.ReactCurrentBatchConfig,Do=0,Oo=null,ko=null,Ao=null,jo=!1,Mo=!1,No=0,Po=0;function Fo(){throw Error(r(321))}function Io(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Or(e[n],t[n]))return!1;return!0}function Lo(e,t,n,i,a,o){if(Do=o,Oo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,To.current=e===null||e.memoizedState===null?bs:xs,e=n(i,a),Mo){o=0;do{if(Mo=!1,No=0,25<=o)throw Error(r(301));o+=1,Ao=ko=null,t.updateQueue=null,To.current=Ss,e=n(i,a)}while(Mo)}if(To.current=ys,t=ko!==null&&ko.next!==null,Do=0,Ao=ko=Oo=null,jo=!1,t)throw Error(r(300));return e}function Ro(){var e=No!==0;return No=0,e}function zo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ao===null?Oo.memoizedState=Ao=e:Ao=Ao.next=e,Ao}function Bo(){if(ko===null){var e=Oo.alternate;e=e===null?null:e.memoizedState}else e=ko.next;var t=Ao===null?Oo.memoizedState:Ao.next;if(t!==null)Ao=t,ko=e;else{if(e===null)throw Error(r(310));ko=e,e={memoizedState:ko.memoizedState,baseState:ko.baseState,baseQueue:ko.baseQueue,queue:ko.queue,next:null},Ao===null?Oo.memoizedState=Ao=e:Ao=Ao.next=e}return Ao}function Vo(e,t){return typeof t==`function`?t(e):t}function Ho(e){var t=Bo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=ko,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Do&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,Oo.lanes|=d,il|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Or(i,t.memoizedState)||(Bs=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,Oo.lanes|=o,il|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Uo(e){var t=Bo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=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);Or(o,t.memoizedState)||(Bs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Wo(){}function Go(e,t){var n=Oo,i=Bo(),a=t(),o=!Or(i.memoizedState,a);if(o&&(i.memoizedState=a,Bs=!0),i=i.queue,rs(Jo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||Ao!==null&&Ao.memoizedState.tag&1){if(n.flags|=2048,Qo(9,qo.bind(null,n,i,a,t),void 0,null),Zc===null)throw Error(r(349));Do&30||Ko(n,t,a)}return a}function Ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Oo.updateQueue,t===null?(t={lastEffect:null,stores:null},Oo.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,Yo(t)&&Xo(e)}function Jo(e,t,n){return n(function(){Yo(t)&&Xo(e)})}function Yo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Or(e,n)}catch{return!0}}function Xo(e){var t=to(e,1);t!==null&&wl(t,e,1,-1)}function Zo(e){var t=zo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:e},t.queue=e,e=e.dispatch=hs.bind(null,Oo,e),[t.memoizedState,e]}function Qo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Oo.updateQueue,t===null?(t={lastEffect:null,stores:null},Oo.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function $o(){return Bo().memoizedState}function es(e,t,n,r){var i=zo();Oo.flags|=e,i.memoizedState=Qo(1|t,n,void 0,r===void 0?null:r)}function ts(e,t,n,r){var i=Bo();r=r===void 0?null:r;var a=void 0;if(ko!==null){var o=ko.memoizedState;if(a=o.destroy,r!==null&&Io(r,o.deps)){i.memoizedState=Qo(t,n,a,r);return}}Oo.flags|=e,i.memoizedState=Qo(1|t,n,a,r)}function ns(e,t){return es(8390656,8,e,t)}function rs(e,t){return ts(2048,8,e,t)}function is(e,t){return ts(4,2,e,t)}function as(e,t){return ts(4,4,e,t)}function os(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ss(e,t,n){return n=n==null?null:n.concat([e]),ts(4,4,os.bind(null,t,e),n)}function cs(){}function ls(e,t){var n=Bo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Io(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function us(e,t){var n=Bo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Io(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ds(e,t,n){return Do&21?(Or(n,t)||(n=Pt(),Oo.lanes|=n,il|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Bs=!0),e.memoizedState=n)}function fs(e,t){var n=zt;zt=n!==0&&4>n?n:4,e(!0);var r=Eo.transition;Eo.transition={};try{e(!1),t()}finally{zt=n,Eo.transition=r}}function ps(){return Bo().memoizedState}function ms(e,t,n){var r=Cl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},gs(e))_s(t,n);else if(n=eo(e,t,n,r),n!==null){var i=Sl();wl(n,e,r,i),vs(n,t,r)}}function hs(e,t,n){var r=Cl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(gs(e))_s(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,Or(s,o)){var c=t.interleaved;c===null?(i.next=i,$a(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=eo(e,t,i,r),n!==null&&(i=Sl(),wl(n,e,r,i),vs(n,t,r))}}function gs(e){var t=e.alternate;return e===Oo||t!==null&&t===Oo}function _s(e,t){Mo=jo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rt(e,n)}}var ys={readContext:Za,useCallback:Fo,useContext:Fo,useEffect:Fo,useImperativeHandle:Fo,useInsertionEffect:Fo,useLayoutEffect:Fo,useMemo:Fo,useReducer:Fo,useRef:Fo,useState:Fo,useDebugValue:Fo,useDeferredValue:Fo,useTransition:Fo,useMutableSource:Fo,useSyncExternalStore:Fo,useId:Fo,unstable_isNewReconciler:!1},bs={readContext:Za,useCallback:function(e,t){return zo().memoizedState=[e,t===void 0?null:t],e},useContext:Za,useEffect:ns,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),es(4194308,4,os.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){return es(4,2,e,t)},useMemo:function(e,t){var n=zo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=zo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ms.bind(null,Oo,e),[r.memoizedState,e]},useRef:function(e){var t=zo();return e={current:e},t.memoizedState=e},useState:Zo,useDebugValue:cs,useDeferredValue:function(e){return zo().memoizedState=e},useTransition:function(){var e=Zo(!1),t=e[0];return e=fs.bind(null,e[1]),zo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Oo,a=zo();if(Ta){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Zc===null)throw Error(r(349));Do&30||Ko(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ns(Jo.bind(null,i,o,e),[e]),i.flags|=2048,Qo(9,qo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=zo(),t=Zc.identifierPrefix;if(Ta){var n=va,r=_a;n=(r&~(1<<32-Ct(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=No++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Po++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},xs={readContext:Za,useCallback:ls,useContext:Za,useEffect:rs,useImperativeHandle:ss,useInsertionEffect:is,useLayoutEffect:as,useMemo:us,useReducer:Ho,useRef:$o,useState:function(){return Ho(Vo)},useDebugValue:cs,useDeferredValue:function(e){return ds(Bo(),ko.memoizedState,e)},useTransition:function(){return[Ho(Vo)[0],Bo().memoizedState]},useMutableSource:Wo,useSyncExternalStore:Go,useId:ps,unstable_isNewReconciler:!1},Ss={readContext:Za,useCallback:ls,useContext:Za,useEffect:rs,useImperativeHandle:ss,useInsertionEffect:is,useLayoutEffect:as,useMemo:us,useReducer:Uo,useRef:$o,useState:function(){return Uo(Vo)},useDebugValue:cs,useDeferredValue:function(e){var t=Bo();return ko===null?t.memoizedState=e:ds(t,ko.memoizedState,e)},useTransition:function(){return[Uo(Vo)[0],Bo().memoizedState]},useMutableSource:Wo,useSyncExternalStore:Go,useId:ps,unstable_isNewReconciler:!1};function Cs(e,t){if(e&&e.defaultProps){for(var n in t=R({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ws(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:R({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ts={isMounted:function(e){return(e=e._reactInternals)?rt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Sl(),i=Cl(e),a=ao(r,i);a.payload=t,n!=null&&(a.callback=n),t=oo(e,a,i),t!==null&&(wl(t,e,i,r),so(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Sl(),i=Cl(e),a=ao(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=oo(e,a,i),t!==null&&(wl(t,e,i,r),so(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Sl(),r=Cl(e),i=ao(n,r);i.tag=2,t!=null&&(i.callback=t),t=oo(e,i,r),t!==null&&(wl(t,e,r,n),so(t,e,r))}};function Es(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!kr(n,r)||!kr(i,a):!0}function Ds(e,t,n){var r=!1,i=qi,a=t.contextType;return typeof a==`object`&&a?a=Za(a):(i=Qi(t)?Xi:Ji.current,r=t.contextTypes,a=(r=r!=null)?Zi(e,i):qi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ts,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Os(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&&Ts.enqueueReplaceState(t,t.state,null)}function ks(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},ro(e);var a=t.contextType;typeof a==`object`&&a?i.context=Za(a):(a=Qi(t)?Xi:Ji.current,i.context=Zi(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(ws(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Ts.enqueueReplaceState(i,i.state,null),lo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function As(e,t){try{var n=``,r=t;do n+=ie(r),r=r.return;while(r);var i=n}catch(e){i=`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}return{value:e,source:t,stack:i,digest:null}}function js(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ms(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ns=typeof WeakMap==`function`?WeakMap:Map;function Ps(e,t,n){n=ao(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){fl||(fl=!0,pl=r),Ms(e,t)},n}function Fs(e,t,n){n=ao(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ms(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Ms(e,t),typeof r!=`function`&&(ml===null?ml=new Set([this]):ml.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Is(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ns;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)||(i.add(n),e=Yl.bind(null,e,t,n),t.then(e,e))}function Ls(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Rs(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ao(-1,1),t.tag=2,oo(n,t,1))),n.lanes|=1),e)}var zs=C.ReactCurrentOwner,Bs=!1;function Vs(e,t,n,r){t.child=e===null?Ha(t,null,n,r):Va(t,e.child,n,r)}function Hs(e,t,n,r,i){n=n.render;var a=t.ref;return Xa(t,i),r=Lo(e,t,n,r,a,i),n=Ro(),e!==null&&!Bs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,cc(e,t,i)):(Ta&&n&&xa(t),t.flags|=1,Vs(e,t,r,i),t.child)}function Us(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ru(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Ws(e,t,a,r,i)):(e=ou(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?kr:n,n(o,r)&&e.ref===t.ref)return cc(e,t,i)}return t.flags|=1,e=au(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ws(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(kr(a,r)&&e.ref===t.ref){if(Bs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Bs=!0);else return t.lanes=e.lanes,cc(e,t,i)}}return qs(e,t,n,r,i)}function Gs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`){if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ki(tl,el),el|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ki(tl,el),el|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Ki(tl,el),el|=r}}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Ki(tl,el),el|=r;return Vs(e,t,i,n),t.child}function Ks(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function qs(e,t,n,r,i){var a=Qi(n)?Xi:Ji.current;return a=Zi(t,a),Xa(t,i),n=Lo(e,t,n,r,a,i),r=Ro(),e!==null&&!Bs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,cc(e,t,i)):(Ta&&r&&xa(t),t.flags|=1,Vs(e,t,n,i),t.child)}function Js(e,t,n,r,i){if(Qi(n)){var a=!0;na(t)}else a=!1;if(Xa(t,i),t.stateNode===null)sc(e,t),Ds(t,n,r),ks(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Za(l):(l=Qi(n)?Xi:Ji.current,l=Zi(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Os(t,o,r,l),no=!1;var f=t.memoizedState;o.state=f,lo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Yi.current||no?(typeof u==`function`&&(ws(t,n,u,r),c=t.memoizedState),(s=no||Es(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,io(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Cs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Za(c):(c=Qi(n)?Xi:Ji.current,c=Zi(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Os(t,o,r,c),no=!1,f=t.memoizedState,o.state=f,lo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Yi.current||no?(typeof p==`function`&&(ws(t,n,p,r),m=t.memoizedState),(l=no||Es(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Ys(e,t,n,r,a,i)}function Ys(e,t,n,r,i,a){Ks(e,t);var o=!!(t.flags&128);if(!r&&!o)return i&&ra(t,n,!1),cc(e,t,a);r=t.stateNode,zs.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Va(t,e.child,null,a),t.child=Va(t,null,s,a)):Vs(e,t,s,a),t.memoizedState=r.state,i&&ra(t,n,!0),t.child}function Xs(e){var t=e.stateNode;t.pendingContext?ea(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ea(e,t.context,!1),_o(e,t.containerInfo)}function Zs(e,t,n,r,i){return Pa(),Fa(i),t.flags|=256,Vs(e,t,n,r),t.child}var Qs={dehydrated:null,treeContext:null,retryLane:0};function $s(e){return{baseLanes:e,cachePool:null,transitions:null}}function ec(e,t,n){var r=t.pendingProps,i=xo.current,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(i&2)),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ki(xo,i&1),e===null)return Aa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.lanes=t.mode&1?e.data===`$!`?8:1073741824:1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=cu(o,r,0,null),e=su(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=$s(n),t.memoizedState=Qs,e):tc(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return rc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=au(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=su(a,o,n,null),a.flags|=2):a=au(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?$s(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Qs,r}return a=e.child,e=a.sibling,r=au(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function tc(e,t){return t=cu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function nc(e,t,n,r){return r!==null&&Fa(r),Va(t,e.child,null,n),e=tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=js(Error(r(422))),nc(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=cu({mode:`visible`,children:i.children},a,0,null),o=su(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Va(t,e.child,null,s),t.child.memoizedState=$s(s),t.memoizedState=Qs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return nc(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=js(o,i,void 0),nc(e,t,s,i)}if(c=(s&e.childLanes)!==0,Bs||c){if(i=Zc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,to(e,a),wl(i,e,a,-1))}return Rl(),i=js(Error(r(421))),nc(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Zl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,wa=Ai(a.nextSibling),Ca=t,Ta=!0,Ea=null,e!==null&&(ma[ha++]=_a,ma[ha++]=va,ma[ha++]=ga,_a=e.id,va=e.overflow,ga=t),t=tc(t,i.children),t.flags|=4096,t)}function ic(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ya(e.return,t,n)}function ac(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function oc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Vs(e,t,r.children,n),r=xo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ic(e,n,t);else if(e.tag===19)ic(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}r&=1}if(Ki(xo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&So(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ac(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&So(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ac(t,!0,n,null,a);break;case`together`:ac(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),il|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=au(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=au(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function lc(e,t,n){switch(t.tag){case 3:Xs(t),Pa();break;case 5:yo(t);break;case 1:Qi(t.type)&&na(t);break;case 4:_o(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ki(Ua,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ki(xo,xo.current&1),e=cc(e,t,n),e===null?null:e.sibling):ec(e,t,n):(Ki(xo,xo.current&1),t.flags|=128,null);Ki(xo,xo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return oc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ki(xo,xo.current),r)break;return null;case 22:case 23:return t.lanes=0,Gs(e,t,n)}return cc(e,t,n)}var uc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},dc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,go(po.current);var o=null;switch(n){case`input`:i=V(e,i),r=V(e,r),o=[];break;case`select`:i=R({},i,{value:void 0}),r=R({},r,{value:void 0}),o=[];break;case`textarea`:i=ye(e,i),r=ye(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=bi)}Ne(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null){if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null))}for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null)){if(u===`style`){if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l}else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&oi(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},fc=function(e,t,n,r){n!==r&&(t.flags|=4)};function pc(e,t){if(!Ta)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 mc(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&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hc(e,t,n){var i=t.pendingProps;switch(Sa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mc(t),null;case 1:return Qi(t.type)&&$i(),mc(t),null;case 3:return i=t.stateNode,vo(),Gi(Yi),Gi(Ji),wo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ma(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ea!==null&&(Ol(Ea),Ea=null))),mc(t),null;case 5:bo(t);var o=go(ho.current);if(n=t.type,e!==null&&t.stateNode!=null)dc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return mc(t),null}if(e=go(po.current),Ma(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Ni]=t,i[Pi]=s,e=!!(t.mode&1),n){case`dialog`:oi(`cancel`,i),oi(`close`,i);break;case`iframe`:case`object`:case`embed`:oi(`load`,i);break;case`video`:case`audio`:for(o=0;o<ni.length;o++)oi(ni[o],i);break;case`source`:oi(`error`,i);break;case`img`:case`image`:case`link`:oi(`error`,i),oi(`load`,i);break;case`details`:oi(`toggle`,i);break;case`input`:fe(i,s),oi(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},oi(`invalid`,i);break;case`textarea`:be(i,s),oi(`invalid`,i)}for(var c in Ne(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&yi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&yi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&oi(`scroll`,i)}switch(n){case`input`:le(i),he(i,s,!0);break;case`textarea`:le(i),Se(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=bi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=Ce(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ni]=t,e[Pi]=i,uc(e,t,!1,!1),t.stateNode=e;a:{switch(c=H(n,i),n){case`dialog`:oi(`cancel`,e),oi(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:oi(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ni.length;o++)oi(ni[o],e);o=i;break;case`source`:oi(`error`,e),o=i;break;case`img`:case`image`:case`link`:oi(`error`,e),oi(`load`,e),o=i;break;case`details`:oi(`toggle`,e),o=i;break;case`input`:fe(e,i),o=V(e,i),oi(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=R({},i,{value:void 0}),oi(`invalid`,e);break;case`textarea`:be(e,i),o=ye(e,i),oi(`invalid`,e);break;default:o=i}for(s in Ne(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?je(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Ee(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&De(e,u):typeof u==`number`&&De(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&oi(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:le(e),he(e,i,!1);break;case`textarea`:le(e),Se(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+se(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&ve(e,!!i.multiple,i.defaultValue,!0):ve(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=bi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return mc(t),null;case 6:if(e&&t.stateNode!=null)fc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=go(ho.current),go(po.current),Ma(t)){if(i=t.stateNode,n=t.memoizedProps,i[Ni]=t,(s=i.nodeValue!==n)&&(e=Ca,e!==null))switch(e.tag){case 3:yi(i.nodeValue,n,!!(e.mode&1));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&yi(i.nodeValue,n,!!(e.mode&1))}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Ni]=t,t.stateNode=i}return mc(t),null;case 13:if(Gi(xo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ta&&wa!==null&&t.mode&1&&!(t.flags&128))Na(),Pa(),t.flags|=98560,s=!1;else if(s=Ma(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Ni]=t}else Pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;mc(t),s=!1}else Ea!==null&&(Ol(Ea),Ea=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||xo.current&1?nl===0&&(nl=3):Rl())),t.updateQueue!==null&&(t.flags|=4),mc(t),null);case 4:return vo(),e===null&&li(t.stateNode.containerInfo),mc(t),null;case 10:return Ja(t.type._context),mc(t),null;case 17:return Qi(t.type)&&$i(),mc(t),null;case 19:if(Gi(xo),s=t.memoizedState,s===null)return mc(t),null;if(i=!!(t.flags&128),c=s.rendering,c===null){if(i)pc(s,!1);else{if(nl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=So(e),c!==null){for(t.flags|=128,pc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ki(xo,xo.current&1|2),t.child}e=e.sibling}s.tail!==null&&pt()>ul&&(t.flags|=128,i=!0,pc(s,!1),t.lanes=4194304)}}else{if(!i){if(e=So(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),pc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Ta)return mc(t),null}else 2*pt()-s.renderingStartTime>ul&&n!==1073741824&&(t.flags|=128,i=!0,pc(s,!1),t.lanes=4194304)}s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(mc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=pt(),t.sibling=null,n=xo.current,Ki(xo,i?n&1|2:n&1),t);case 22:case 23:return Pl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?el&1073741824&&(mc(t),t.subtreeFlags&6&&(t.flags|=8192)):mc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function gc(e,t){switch(Sa(t),t.tag){case 1:return Qi(t.type)&&$i(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vo(),Gi(Yi),Gi(Ji),wo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bo(t),null;case 13:if(Gi(xo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Gi(xo),null;case 4:return vo(),null;case 10:return Ja(t.type._context),null;case 22:case 23:return Pl(),null;case 24:return null;default:return null}}var _c=!1,vc=!1,yc=typeof WeakSet==`function`?WeakSet:Set,bc=null;function xc(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`)try{n(null)}catch(n){Jl(e,t,n)}else n.current=null}}function Sc(e,t,n){try{n()}catch(n){Jl(e,t,n)}}var Cc=!1;function wc(e,t){if(xi=fn,e=Nr(),Pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.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||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(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(Si={focusedElem:e,selectionRange:n},fn=!1,bc=t;bc!==null;)if(t=bc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,bc=e;else for(;bc!==null;){t=bc;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Cs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Jl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,bc=e;break}bc=t.return}return h=Cc,Cc=!1,h}function Tc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Sc(t,n,a)}i=i.next}while(i!==r)}}function Ec(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Dc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Oc(e){var t=e.alternate;t!==null&&(e.alternate=null,Oc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ni],delete t[Pi],delete t[Ii],delete t[Li],delete t[Ri])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function kc(e){return e.tag===5||e.tag===3||e.tag===4}function Ac(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||kc(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.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 jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bi));else if(r!==4&&(e=e.child,e!==null))for(jc(e,t,n),e=e.sibling;e!==null;)jc(e,t,n),e=e.sibling}function Mc(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&&(e=e.child,e!==null))for(Mc(e,t,n),e=e.sibling;e!==null;)Mc(e,t,n),e=e.sibling}var Nc=null,Pc=!1;function Fc(e,t,n){for(n=n.child;n!==null;)Ic(e,t,n),n=n.sibling}function Ic(e,t,n){if(xt&&typeof xt.onCommitFiberUnmount==`function`)try{xt.onCommitFiberUnmount(bt,n)}catch{}switch(n.tag){case 5:vc||xc(n,t);case 6:var r=Nc,i=Pc;Nc=null,Fc(e,t,n),Nc=r,Pc=i,Nc!==null&&(Pc?(e=Nc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nc.removeChild(n.stateNode));break;case 18:Nc!==null&&(Pc?(e=Nc,n=n.stateNode,e.nodeType===8?ki(e.parentNode,n):e.nodeType===1&&ki(e,n),un(e)):ki(Nc,n.stateNode));break;case 4:r=Nc,i=Pc,Nc=n.stateNode.containerInfo,Pc=!0,Fc(e,t,n),Nc=r,Pc=i;break;case 0:case 11:case 14:case 15:if(!vc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Sc(n,t,o),i=i.next}while(i!==r)}Fc(e,t,n);break;case 1:if(!vc&&(xc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Jl(n,t,e)}Fc(e,t,n);break;case 21:Fc(e,t,n);break;case 22:n.mode&1?(vc=(r=vc)||n.memoizedState!==null,Fc(e,t,n),vc=r):Fc(e,t,n);break;default:Fc(e,t,n)}}function Lc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yc),t.forEach(function(t){var r=Ql.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Rc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Nc=c.stateNode,Pc=!1;break a;case 3:Nc=c.stateNode.containerInfo,Pc=!0;break a;case 4:Nc=c.stateNode.containerInfo,Pc=!0;break a}c=c.return}if(Nc===null)throw Error(r(160));Ic(o,s,a),Nc=null,Pc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Jl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)zc(t,e),t=t.sibling}function zc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Rc(t,e),Bc(e),i&4){try{Tc(3,e,e.return),Ec(3,e)}catch(t){Jl(e,e.return,t)}try{Tc(5,e,e.return)}catch(t){Jl(e,e.return,t)}}break;case 1:Rc(t,e),Bc(e),i&512&&n!==null&&xc(n,n.return);break;case 5:if(Rc(t,e),Bc(e),i&512&&n!==null&&xc(n,n.return),e.flags&32){var a=e.stateNode;try{De(a,``)}catch(t){Jl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&pe(a,o),H(c,s);var u=H(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?je(a,f):d===`dangerouslySetInnerHTML`?Ee(a,f):d===`children`?De(a,f):S(a,d,f,u)}switch(c){case`input`:me(a,o);break;case`textarea`:xe(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?ve(a,!!o.multiple,o.multiple?[]:``,!1):ve(a,!!o.multiple,o.defaultValue,!0)):ve(a,!!o.multiple,m,!1)}a[Pi]=o}catch(t){Jl(e,e.return,t)}}break;case 6:if(Rc(t,e),Bc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Jl(e,e.return,t)}}break;case 3:if(Rc(t,e),Bc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{un(t.containerInfo)}catch(t){Jl(e,e.return,t)}break;case 4:Rc(t,e),Bc(e);break;case 13:Rc(t,e),Bc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(ll=pt())),i&4&&Lc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(vc=(u=vc)||d,Rc(t,e),vc=u):Rc(t,e),Bc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(bc=e,d=e.child;d!==null;){for(f=bc=d;bc!==null;){switch(p=bc,m=p.child,p.tag){case 0:case 11:case 14:case 15:Tc(4,p,p.return);break;case 1:xc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Jl(i,n,e)}}break;case 5:xc(p,p.return);break;case 22:if(p.memoizedState!==null){Wc(f);continue}}m===null?Wc(f):(m.return=p,bc=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Ae(`display`,s))}catch(t){Jl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Jl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Rc(t,e),Bc(e),i&4&&Lc(e);break;case 21:break;default:Rc(t,e),Bc(e)}}function Bc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(kc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(De(a,``),i.flags&=-33),Mc(e,Ac(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;jc(e,Ac(e),o);break;default:throw Error(r(161))}}catch(t){Jl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vc(e,t,n){bc=e,Hc(e,t,n)}function Hc(e,t,n){for(var r=!!(e.mode&1);bc!==null;){var i=bc,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||_c;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||vc;s=_c;var l=vc;if(_c=o,(vc=c)&&!l)for(bc=i;bc!==null;)o=bc,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Gc(i):(c.return=o,bc=c);for(;a!==null;)bc=a,Hc(a,t,n),a=a.sibling;bc=i,_c=s,vc=l}Uc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,bc=a):Uc(e,t,n)}}function Uc(e){for(;bc!==null;){var t=bc;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:vc||Ec(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!vc){if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Cs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}}var o=t.updateQueue;o!==null&&uo(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}uo(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&un(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}vc||t.flags&512&&Dc(t)}catch(e){Jl(t,t.return,e)}}if(t===e){bc=null;break}if(n=t.sibling,n!==null){n.return=t.return,bc=n;break}bc=t.return}}function Wc(e){for(;bc!==null;){var t=bc;if(t===e){bc=null;break}var n=t.sibling;if(n!==null){n.return=t.return,bc=n;break}bc=t.return}}function Gc(e){for(;bc!==null;){var t=bc;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ec(4,t)}catch(e){Jl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Jl(t,i,e)}}var a=t.return;try{Dc(t)}catch(e){Jl(t,a,e)}break;case 5:var o=t.return;try{Dc(t)}catch(e){Jl(t,o,e)}}}catch(e){Jl(t,t.return,e)}if(t===e){bc=null;break}var s=t.sibling;if(s!==null){s.return=t.return,bc=s;break}bc=t.return}}var Kc=Math.ceil,qc=C.ReactCurrentDispatcher,Jc=C.ReactCurrentOwner,Yc=C.ReactCurrentBatchConfig,Xc=0,Zc=null,Qc=null,$c=0,el=0,tl=Wi(0),nl=0,rl=null,il=0,al=0,ol=0,sl=null,cl=null,ll=0,ul=1/0,dl=null,fl=!1,pl=null,ml=null,hl=!1,gl=null,_l=0,vl=0,yl=null,bl=-1,xl=0;function Sl(){return Xc&6?pt():bl===-1?bl=pt():bl}function Cl(e){return e.mode&1?Xc&2&&$c!==0?$c&-$c:Ia.transition===null?(e=zt,e===0&&(e=window.event,e=e===void 0?16:vn(e.type)),e):(xl===0&&(xl=Pt()),xl):1}function wl(e,t,n,i){if(50<vl)throw vl=0,yl=null,Error(r(185));It(e,n,i),(!(Xc&2)||e!==Zc)&&(e===Zc&&(!(Xc&2)&&(al|=n),nl===4&&Al(e,$c)),Tl(e,i),n===1&&Xc===0&&!(t.mode&1)&&(ul=pt()+500,aa&&la()))}function Tl(e,t){var n=e.callbackNode;Mt(e,t);var r=At(e,e===Zc?$c:0);if(r===0)n!==null&&ut(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ut(n),t===1)e.tag===0?ca(jl.bind(null,e)):sa(jl.bind(null,e)),Di(function(){!(Xc&6)&&la()}),n=null;else{switch(Bt(r)){case 1:n=ht;break;case 4:n=gt;break;case 16:n=_t;break;case 536870912:n=yt;break;default:n=_t}n=eu(n,El.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function El(e,t){if(bl=-1,xl=0,Xc&6)throw Error(r(327));var n=e.callbackNode;if(Kl()&&e.callbackNode!==n)return null;var i=At(e,e===Zc?$c:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=zl(e,i);else{t=i;var a=Xc;Xc|=2;var o=Ll();(Zc!==e||$c!==t)&&(dl=null,ul=pt()+500,Fl(e,t));do try{Vl();break}catch(t){Il(e,t)}while(1);qa(),qc.current=o,Xc=a,Qc===null?(Zc=null,$c=0,t=nl):t=0}if(t!==0){if(t===2&&(a=Nt(e),a!==0&&(i=a,t=Dl(e,a))),t===1)throw n=rl,Fl(e,0),Al(e,i),Tl(e,pt()),n;if(t===6)Al(e,i);else{if(a=e.current.alternate,!(i&30)&&!kl(a)&&(t=zl(e,i),t===2&&(o=Nt(e),o!==0&&(i=o,t=Dl(e,o))),t===1))throw n=rl,Fl(e,0),Al(e,i),Tl(e,pt()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Wl(e,cl,dl);break;case 3:if(Al(e,i),(i&130023424)===i&&(t=ll+500-pt(),10<t)){if(At(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){Sl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=wi(Wl.bind(null,e,cl,dl),t);break}Wl(e,cl,dl);break;case 4:if(Al(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-Ct(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=pt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Kc(i/1960))-i,10<i){e.timeoutHandle=wi(Wl.bind(null,e,cl,dl),i);break}Wl(e,cl,dl);break;case 5:Wl(e,cl,dl);break;default:throw Error(r(329))}}}return Tl(e,pt()),e.callbackNode===n?El.bind(null,e):null}function Dl(e,t){var n=sl;return e.current.memoizedState.isDehydrated&&(Fl(e,t).flags|=256),e=zl(e,t),e!==2&&(t=cl,cl=n,t!==null&&Ol(t)),e}function Ol(e){cl===null?cl=e:cl.push.apply(cl,e)}function kl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(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(!Or(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 Al(e,t){for(t&=~ol,t&=~al,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ct(t),r=1<<n;e[n]=-1,t&=~r}}function jl(e){if(Xc&6)throw Error(r(327));Kl();var t=At(e,0);if(!(t&1))return Tl(e,pt()),null;var n=zl(e,t);if(e.tag!==0&&n===2){var i=Nt(e);i!==0&&(t=i,n=Dl(e,i))}if(n===1)throw n=rl,Fl(e,0),Al(e,t),Tl(e,pt()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wl(e,cl,dl),Tl(e,pt()),null}function Ml(e,t){var n=Xc;Xc|=1;try{return e(t)}finally{Xc=n,Xc===0&&(ul=pt()+500,aa&&la())}}function Nl(e){gl!==null&&gl.tag===0&&!(Xc&6)&&Kl();var t=Xc;Xc|=1;var n=Yc.transition,r=zt;try{if(Yc.transition=null,zt=1,e)return e()}finally{zt=r,Yc.transition=n,Xc=t,!(Xc&6)&&la()}}function Pl(){el=tl.current,Gi(tl)}function Fl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ti(n)),Qc!==null)for(n=Qc.return;n!==null;){var r=n;switch(Sa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&$i();break;case 3:vo(),Gi(Yi),Gi(Ji),wo();break;case 5:bo(r);break;case 4:vo();break;case 13:Gi(xo);break;case 19:Gi(xo);break;case 10:Ja(r.type._context);break;case 22:case 23:Pl()}n=n.return}if(Zc=e,Qc=e=au(e.current,null),$c=el=t,nl=0,rl=null,ol=al=il=0,cl=sl=null,Qa!==null){for(t=0;t<Qa.length;t++)if(n=Qa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Qa=null}return e}function Il(e,t){do{var n=Qc;try{if(qa(),To.current=ys,jo){for(var i=Oo.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}jo=!1}if(Do=0,Ao=ko=Oo=null,Mo=!1,No=0,Jc.current=null,n===null||n.return===null){nl=1,rl=t,Qc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=$c,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ls(s);if(m!==null){m.flags&=-257,Rs(m,s,c,o,t),m.mode&1&&Is(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}if(!(t&1)){Is(o,u,t),Rl();break a}l=Error(r(426))}else if(Ta&&c.mode&1){var _=Ls(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Rs(_,s,c,o,t),Fa(As(l,c));break a}}o=l=As(l,c),nl!==4&&(nl=2),sl===null?sl=[o]:sl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Ps(o,l,t);co(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(ml===null||!ml.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Fs(o,c,t);co(o,x);break a}}o=o.return}while(o!==null)}Ul(n)}catch(e){t=e,Qc===n&&n!==null&&(Qc=n=n.return);continue}break}while(1)}function Ll(){var e=qc.current;return qc.current=ys,e===null?ys:e}function Rl(){(nl===0||nl===3||nl===2)&&(nl=4),Zc===null||!(il&268435455)&&!(al&268435455)||Al(Zc,$c)}function zl(e,t){var n=Xc;Xc|=2;var i=Ll();(Zc!==e||$c!==t)&&(dl=null,Fl(e,t));do try{Bl();break}catch(t){Il(e,t)}while(1);if(qa(),Xc=n,qc.current=i,Qc!==null)throw Error(r(261));return Zc=null,$c=0,nl}function Bl(){for(;Qc!==null;)Hl(Qc)}function Vl(){for(;Qc!==null&&!dt();)Hl(Qc)}function Hl(e){var t=$l(e.alternate,e,el);e.memoizedProps=e.pendingProps,t===null?Ul(e):Qc=t,Jc.current=null}function Ul(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=gc(n,t),n!==null){n.flags&=32767,Qc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{nl=6,Qc=null;return}}else if(n=hc(n,t,el),n!==null){Qc=n;return}if(t=t.sibling,t!==null){Qc=t;return}Qc=t=e}while(t!==null);nl===0&&(nl=5)}function Wl(e,t,n){var r=zt,i=Yc.transition;try{Yc.transition=null,zt=1,Gl(e,t,n,r)}finally{Yc.transition=i,zt=r}return null}function Gl(e,t,n,i){do Kl();while(gl!==null);if(Xc&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Lt(e,o),e===Zc&&(Qc=Zc=null,$c=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||hl||(hl=!0,eu(_t,function(){return Kl(),null})),o=!!(n.flags&15990),n.subtreeFlags&15990||o){o=Yc.transition,Yc.transition=null;var s=zt;zt=1;var c=Xc;Xc|=4,Jc.current=null,wc(e,n),zc(n,e),Fr(Si),fn=!!xi,Si=xi=null,e.current=n,Vc(n,e,a),ft(),Xc=c,zt=s,Yc.transition=o}else e.current=n;if(hl&&(hl=!1,gl=e,_l=a),o=e.pendingLanes,o===0&&(ml=null),St(n.stateNode,i),Tl(e,pt()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(fl)throw fl=!1,e=pl,pl=null,e;return _l&1&&e.tag!==0&&Kl(),o=e.pendingLanes,o&1?e===yl?vl++:(vl=0,yl=e):vl=0,la(),null}function Kl(){if(gl!==null){var e=Bt(_l),t=Yc.transition,n=zt;try{if(Yc.transition=null,zt=16>e?16:e,gl===null)var i=!1;else{if(e=gl,gl=null,_l=0,Xc&6)throw Error(r(331));var a=Xc;for(Xc|=4,bc=e.current;bc!==null;){var o=bc,s=o.child;if(bc.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(bc=u;bc!==null;){var d=bc;switch(d.tag){case 0:case 11:case 15:Tc(8,d,o)}var f=d.child;if(f!==null)f.return=d,bc=f;else for(;bc!==null;){d=bc;var p=d.sibling,m=d.return;if(Oc(d),d===u){bc=null;break}if(p!==null){p.return=m,bc=p;break}bc=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}bc=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,bc=s;else b:for(;bc!==null;){if(o=bc,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Tc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,bc=v;break b}bc=o.return}}var y=e.current;for(bc=y;bc!==null;){s=bc;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,bc=b;else b:for(s=y;bc!==null;){if(c=bc,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Ec(9,c)}}catch(e){Jl(c,c.return,e)}if(c===s){bc=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,bc=x;break b}bc=c.return}}if(Xc=a,la(),xt&&typeof xt.onPostCommitFiberRoot==`function`)try{xt.onPostCommitFiberRoot(bt,e)}catch{}i=!0}return i}finally{zt=n,Yc.transition=t}}return!1}function ql(e,t,n){t=As(n,t),t=Ps(e,t,1),e=oo(e,t,1),t=Sl(),e!==null&&(It(e,1,t),Tl(e,t))}function Jl(e,t,n){if(e.tag===3)ql(e,e,n);else for(;t!==null;){if(t.tag===3){ql(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ml===null||!ml.has(r))){e=As(n,e),e=Fs(t,e,1),t=oo(t,e,1),e=Sl(),t!==null&&(It(t,1,e),Tl(t,e));break}}t=t.return}}function Yl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Sl(),e.pingedLanes|=e.suspendedLanes&n,Zc===e&&($c&n)===n&&(nl===4||nl===3&&($c&130023424)===$c&&500>pt()-ll?Fl(e,0):ol|=n),Tl(e,t)}function Xl(e,t){t===0&&(e.mode&1?(t=Ot,Ot<<=1,!(Ot&130023424)&&(Ot=4194304)):t=1);var n=Sl();e=to(e,t),e!==null&&(It(e,t,n),Tl(e,n))}function Zl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xl(e,n)}function Ql(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Xl(e,n)}var $l=function(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps||Yi.current)Bs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Bs=!1,lc(e,t,n);Bs=!!(e.flags&131072)}}else Bs=!1,Ta&&t.flags&1048576&&ba(t,pa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;sc(e,t),e=t.pendingProps;var a=Zi(t,Ji.current);Xa(t,n),a=Lo(null,t,i,e,a,n);var o=Ro();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qi(i)?(o=!0,na(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,ro(t),a.updater=Ts,t.stateNode=a,a._reactInternals=t,ks(t,i,e,n),t=Ys(null,t,i,!0,o,n)):(t.tag=0,Ta&&o&&xa(t),Vs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(sc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=iu(i),e=Cs(i,e),a){case 0:t=qs(null,t,i,e,n);break a;case 1:t=Js(null,t,i,e,n);break a;case 11:t=Hs(null,t,i,e,n);break a;case 14:t=Us(null,t,i,Cs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),qs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),Js(e,t,i,a,n);case 3:a:{if(Xs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,io(e,t),lo(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=As(Error(r(423)),t),t=Zs(e,t,i,n,a);break a}if(i!==a){a=As(Error(r(424)),t),t=Zs(e,t,i,n,a);break a}for(wa=Ai(t.stateNode.containerInfo.firstChild),Ca=t,Ta=!0,Ea=null,n=Ha(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pa(),i===a){t=cc(e,t,n);break a}Vs(e,t,i,n)}t=t.child}return t;case 5:return yo(t),e===null&&Aa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Ci(i,a)?s=null:o!==null&&Ci(i,o)&&(t.flags|=32),Ks(e,t),Vs(e,t,s,n),t.child;case 6:return e===null&&Aa(t),null;case 13:return ec(e,t,n);case 4:return _o(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Va(t,null,i,n):Vs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),Hs(e,t,i,a,n);case 7:return Vs(e,t,t.pendingProps,n),t.child;case 8:return Vs(e,t,t.pendingProps.children,n),t.child;case 12:return Vs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ki(Ua,i._currentValue),i._currentValue=s,o!==null){if(Or(o.value,s)){if(o.children===a.children&&!Yi.current){t=cc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=ao(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ya(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Ya(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}}Vs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Xa(t,n),a=Za(a),i=i(a),t.flags|=1,Vs(e,t,i,n),t.child;case 14:return i=t.type,a=Cs(i,t.pendingProps),a=Cs(i.type,a),Us(e,t,i,a,n);case 15:return Ws(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),sc(e,t),t.tag=1,Qi(i)?(e=!0,na(t)):e=!1,Xa(t,n),Ds(t,i,a),ks(t,i,a,n),Ys(null,t,i,!0,e,n);case 19:return oc(e,t,n);case 22:return Gs(e,t,n)}throw Error(r(156,t.tag))};function eu(e,t){return lt(e,t)}function tu(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.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 nu(e,t,n,r){return new tu(e,t,n,r)}function ru(e){return e=e.prototype,!(!e||!e.isReactComponent)}function iu(e){if(typeof e==`function`)return+!!ru(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function au(e,t){var n=e.alternate;return n===null?(n=nu(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&14680064,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}function ou(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ru(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return su(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=nu(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=nu(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=nu(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return cu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=nu(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function su(e,t,n,r){return e=nu(7,e,r,t),e.lanes=n,e}function cu(e,t,n,r){return e=nu(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function lu(e,t,n){return e=nu(6,e,null,t),e.lanes=n,e}function uu(e,t,n){return t=nu(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function du(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ft(0),this.expirationTimes=Ft(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ft(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function fu(e,t,n,r,i,a,o,s,c){return e=new du(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=nu(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ro(a),e}function pu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function mu(e){if(!e)return qi;e=e._reactInternals;a:{if(rt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(Qi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(Qi(n))return ta(e,n,t)}return t}function hu(e,t,n,r,i,a,o,s,c){return e=fu(n,r,!0,e,i,a,o,s,c),e.context=mu(null),n=e.current,r=Sl(),i=Cl(n),a=ao(r,i),a.callback=t??null,oo(n,a,i),e.current.lanes=i,It(e,i,r),Tl(e,r),e}function gu(e,t,n,r){var i=t.current,a=Sl(),o=Cl(i);return n=mu(n),t.context===null?t.context=n:t.pendingContext=n,t=ao(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=oo(i,t,o),e!==null&&(wl(e,i,o,a),so(e,i,o)),o}function _u(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function vu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yu(e,t){vu(e,t),(e=e.alternate)&&vu(e,t)}function bu(){return null}var xu=typeof reportError==`function`?reportError:function(e){console.error(e)};function Su(e){this._internalRoot=e}Cu.prototype.render=Su.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));gu(e,t,null,null)},Cu.prototype.unmount=Su.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nl(function(){gu(null,e,null,null)}),t[Fi]=null}};function Cu(e){this._internalRoot=e}Cu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Wt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$t.length&&t!==0&&t<$t[n].priority;n++);$t.splice(n,0,e),n===0&&an(e)}};function wu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Tu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function Eu(){}function Du(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=_u(o);a.call(e)}}var o=hu(t,r,e,0,null,!1,!1,``,Eu);return e._reactRootContainer=o,e[Fi]=o.current,li(e.nodeType===8?e.parentNode:e),Nl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=_u(c);s.call(e)}}var c=fu(e,0,!1,null,null,!1,!1,``,Eu);return e._reactRootContainer=c,e[Fi]=c.current,li(e.nodeType===8?e.parentNode:e),Nl(function(){gu(t,c,n,r)}),c}function Ou(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=_u(o);s.call(e)}}gu(t,o,e,i)}else o=Du(n,t,e,i,r);return _u(o)}Vt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=kt(t.pendingLanes);n!==0&&(Rt(t,n|1),Tl(t,pt()),!(Xc&6)&&(ul=pt()+500,la()))}break;case 13:Nl(function(){var t=to(e,1);t!==null&&wl(t,e,1,Sl())}),yu(e,1)}},Ht=function(e){if(e.tag===13){var t=to(e,134217728);t!==null&&wl(t,e,134217728,Sl()),yu(e,134217728)}},Ut=function(e){if(e.tag===13){var t=Cl(e),n=to(e,t);n!==null&&wl(n,e,t,Sl()),yu(e,t)}},Wt=function(){return zt},Gt=function(e,t){var n=zt;try{return zt=e,t()}finally{zt=n}},Ie=function(e,t,n){switch(t){case`input`:if(me(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Vi(i);if(!a)throw Error(r(90));ue(i),me(i,a)}}}break;case`textarea`:xe(e,n);break;case`select`:t=n.value,t!=null&&ve(e,!!n.multiple,t,!1)}},He=Ml,Ue=Nl;var ku={usingClientEntryPoint:!1,Events:[U,Bi,Vi,Be,Ve,Ml]},Au={findFiberByHostInstance:zi,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},ju={bundleType:Au.bundleType,version:Au.version,rendererPackageName:Au.rendererPackageName,rendererConfig:Au.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=st(e),e===null?null:e.stateNode},findFiberByHostInstance:Au.findFiberByHostInstance||bu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mu.isDisabled&&Mu.supportsFiber)try{bt=Mu.inject(ju),xt=Mu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ku,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wu(t))throw Error(r(200));return pu(e,t,null,n)},e.createRoot=function(e,t){if(!wu(e))throw Error(r(299));var n=!1,i=``,a=xu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=fu(e,1,!1,null,null,n,!1,i,a),e[Fi]=t.current,li(e.nodeType===8?e.parentNode:e),new Su(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=st(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Nl(e)},e.hydrate=function(e,t,n){if(!Tu(t))throw Error(r(200));return Ou(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!wu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=xu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=hu(t,null,e,1,n??null,a,!1,o,s),e[Fi]=t.current,li(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Cu(t)},e.render=function(e,t,n){if(!Tu(t))throw Error(r(200));return Ou(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!Tu(e))throw Error(r(40));return e._reactRootContainer?(Nl(function(){Ou(null,null,e,!1,function(){e._reactRootContainer=null,e[Fi]=null})}),!0):!1},e.unstable_batchedUpdates=Ml,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Tu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Ou(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),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=h();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}))(),_=l(d(),1),v=1,y=1e6,b=0;function x(){return b=(b+1)%(2**53-1),b.toString()}var S=new Map,C=e=>{if(S.has(e))return;let t=setTimeout(()=>{S.delete(e),D({type:`REMOVE_TOAST`,toastId:e})},y);S.set(e,t)},w=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,v)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?C(n):e.toasts.forEach(e=>{C(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},T=[],E={toasts:[]};function D(e){E=w(E,e),T.forEach(e=>{e(E)})}function O({...e}){let t=x(),n=e=>D({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>D({type:`DISMISS_TOAST`,toastId:t});return D({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function k(){let[e,t]=_.useState(E);return _.useEffect(()=>(T.push(t),()=>{let e=T.indexOf(t);e>-1&&T.splice(e,1)}),[e]),{...e,toast:O,dismiss:e=>D({type:`DISMISS_TOAST`,toastId:e})}}var A=l(h(),1);typeof window<`u`&&window.document&&window.document.createElement;function j(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function M(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function N(...e){return t=>{let n=!1,r=e.map(e=>{let r=M(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():M(e[t],null)}}}}function P(...e){return _.useCallback(N(...e),e)}var F=o((e=>{var t=d(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),I=o(((e,t)=>{t.exports=F()}))();function ee(e,t){let n=_.createContext(t),r=e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,I.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=_.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function L(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,I.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.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=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,R(i,...t)]}function R(...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 _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function z(e){let t=te(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(re);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function te(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=ae(n),i=ie(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ne=Symbol(`radix.slottable`);function re(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ne}function ie(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 ae(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 oe(e){let t=e+`CollectionProvider`,[n,r]=L(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,I.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=z(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=P(t,a(s,n).collectionRef);return(0,I.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=z(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=P(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,I.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}function se(e){let t=ce(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(le);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function ce(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=de(n),i=ue(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var B=Symbol(`radix.slottable`);function le(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===B}function ue(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 de(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 V=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=se(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function fe(e,t){e&&A.flushSync(()=>e.dispatchEvent(t))}function pe(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...e)=>t.current?.(...e),[])}function me(e,t=globalThis?.document){let n=pe(e);_.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 he=`DismissableLayer`,ge=`dismissableLayer.update`,_e=`dismissableLayer.pointerDownOutside`,ve=`dismissableLayer.focusOutside`,ye,be=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xe=_.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=_.useContext(be),[u,d]=_.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=_.useState({}),m=P(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g),y=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=we(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));x&&!n&&(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=Te(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return me(e=>{y===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(ye=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Ee(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ye)}},[u,f,n,l]),_.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Ee())},[u,l]),_.useEffect(()=>{let e=()=>p({});return document.addEventListener(ge,e),()=>document.removeEventListener(ge,e)},[]),(0,I.jsx)(V.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:j(e.onFocusCapture,C.onFocusCapture),onBlurCapture:j(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:j(e.onPointerDownCapture,S.onPointerDownCapture)})});xe.displayName=he;var Se=`DismissableLayerBranch`,Ce=_.forwardRef((e,t)=>{let n=_.useContext(be),r=_.useRef(null),i=P(t,r);return _.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,I.jsx)(V.div,{...e,ref:i})});Ce.displayName=Se;function we(e,t=globalThis?.document){let n=pe(e),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){De(_e,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Te(e,t=globalThis?.document){let n=pe(e),r=_.useRef(!1);return _.useEffect(()=>{let e=e=>{e.target&&!r.current&&De(ve,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 Ee(){let e=new CustomEvent(ge);document.dispatchEvent(e)}function De(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?fe(i,a):i.dispatchEvent(a)}var Oe=xe,ke=Ce,Ae=globalThis?.document?_.useLayoutEffect:()=>{},je=`Portal`,Me=_.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=_.useState(!1);Ae(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?A.createPortal((0,I.jsx)(V.div,{...r,ref:t}),o):null});Me.displayName=je;function Ne(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var H=e=>{let{present:t,children:n}=e,r=Pe(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=P(r.ref,Ie(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null};H.displayName=`Presence`;function Pe(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),[o,s]=Ne(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{let e=Fe(r.current);a.current=o===`mounted`?e:`none`},[o]),Ae(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Fe(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Ae(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Fe(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=Fe(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)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:_.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Fe(e){return e?.animationName||`none`}function Ie(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 Le=_.useInsertionEffect||Ae;function Re({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=ze({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=_.useRef(e!==void 0);_.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,_.useCallback(t=>{if(s){let n=Be(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function ze({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Le(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Be(e){return typeof e==`function`}var Ve=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),He=`VisuallyHidden`,Ue=_.forwardRef((e,t)=>(0,I.jsx)(V.span,{...e,ref:t,style:{...Ve,...e.style}}));Ue.displayName=He;var We=Ue,Ge=`ToastProvider`,[Ke,qe,Je]=oe(`Toast`),[Ye,Xe]=L(`Toast`,[Je]),[Ze,Qe]=Ye(Ge),$e=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=_.useState(null),[l,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ge}\`. Expected non-empty \`string\`.`),(0,I.jsx)(Ke.Provider,{scope:t,children:(0,I.jsx)(Ze,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:_.useCallback(()=>u(e=>e+1),[]),onToastRemove:_.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};$e.displayName=Ge;var et=`ToastViewport`,tt=[`F8`],nt=`toast.viewportPause`,rt=`toast.viewportResume`,it=_.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=tt,label:i=`Notifications ({hotkey})`,...a}=e,o=Qe(et,n),s=qe(n),c=_.useRef(null),l=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=P(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;_.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),_.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(nt);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(rt);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=_.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...jt(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return _.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Mt(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,I.jsxs)(ke,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,I.jsx)(ot,{ref:l,onFocusFromOutsideViewport:()=>{Mt(h({tabbingDirection:`forwards`}))}}),(0,I.jsx)(Ke.Slot,{scope:n,children:(0,I.jsx)(V.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,I.jsx)(ot,{ref:u,onFocusFromOutsideViewport:()=>{Mt(h({tabbingDirection:`backwards`}))}})]})});it.displayName=et;var at=`ToastFocusProxy`,ot=_.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Qe(at,n);return(0,I.jsx)(Ue,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});ot.displayName=at;var st=`Toast`,ct=`toast.swipeStart`,lt=`toast.swipeMove`,ut=`toast.swipeCancel`,dt=`toast.swipeEnd`,ft=_.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Re({prop:r,defaultProp:i??!0,onChange:a,caller:st});return(0,I.jsx)(H,{present:n||s,children:(0,I.jsx)(ht,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:pe(e.onPause),onResume:pe(e.onResume),onSwipeStart:j(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:j(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:j(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:j(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});ft.displayName=st;var[pt,mt]=Ye(st,{onClose(){}}),ht=_.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=Qe(st,n),[g,v]=_.useState(null),y=P(t,e=>v(e)),b=_.useRef(null),x=_.useRef(null),S=i||h.duration,C=_.useRef(0),w=_.useRef(S),T=_.useRef(0),{onToastAdd:E,onToastRemove:D}=h,O=pe(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),k=_.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(O,e))},[O]);_.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{k(w.current),l?.()},n=()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()};return e.addEventListener(nt,n),e.addEventListener(rt,t),()=>{e.removeEventListener(nt,n),e.removeEventListener(rt,t)}}},[h.viewport,S,c,l,k]),_.useEffect(()=>{a&&!h.isClosePausedRef.current&&k(S)},[a,S,h.isClosePausedRef,k]),_.useEffect(()=>(E(),()=>D()),[E,D]);let M=_.useMemo(()=>g?Et(g):null,[g]);return h.viewport?(0,I.jsxs)(I.Fragment,{children:[M&&(0,I.jsx)(gt,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:M}),(0,I.jsx)(pt,{scope:n,onClose:O,children:A.createPortal((0,I.jsx)(Ke.ItemSlot,{scope:n,children:(0,I.jsx)(Oe,{asChild:!0,onEscapeKeyDown:j(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,I.jsx)(V.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:j(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:j(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:j(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,Dt(lt,d,f,{discrete:!1})):Ot(l,h.swipeDirection,c)?(x.current=l,Dt(ct,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:j(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Ot(t,h.swipeDirection,h.swipeThreshold)?Dt(dt,p,r,{discrete:!0}):Dt(ut,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),gt=e=>{let{__scopeToast:t,children:n,...r}=e,i=Qe(st,t),[a,o]=_.useState(!1),[s,c]=_.useState(!1);return kt(()=>o(!0)),_.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,I.jsx)(Me,{asChild:!0,children:(0,I.jsx)(Ue,{...r,children:a&&(0,I.jsxs)(I.Fragment,{children:[i.label,` `,n]})})})},_t=`ToastTitle`,vt=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,I.jsx)(V.div,{...r,ref:t})});vt.displayName=_t;var yt=`ToastDescription`,bt=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,I.jsx)(V.div,{...r,ref:t})});bt.displayName=yt;var xt=`ToastAction`,St=_.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,I.jsx)(Tt,{altText:n,asChild:!0,children:(0,I.jsx)(wt,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${xt}\`. Expected non-empty \`string\`.`),null)});St.displayName=xt;var Ct=`ToastClose`,wt=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=mt(Ct,n);return(0,I.jsx)(Tt,{asChild:!0,children:(0,I.jsx)(V.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,i.onClose)})})});wt.displayName=Ct;var Tt=_.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,I.jsx)(V.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Et(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),At(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Et(e))}}}),t}function Dt(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?fe(i,a):i.dispatchEvent(a)}var Ot=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function kt(e=()=>{}){let t=pe(e);Ae(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function At(e){return e.nodeType===e.ELEMENT_NODE}function jt(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 Mt(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}var Nt=$e,Pt=it,Ft=ft,It=vt,Lt=bt,Rt=St,zt=wt;function Bt(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Bt(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Vt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Bt(e))&&(r&&(r+=` `),r+=t);return r}var Ht=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ut=Vt,Wt=(e,t)=>n=>{if(t?.variants==null)return Ut(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ht(t)||Ht(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ut(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Gt=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Kt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),qt={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Jt=(0,_.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,_.createElement)(`svg`,{ref:c,...qt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Kt(`lucide`,i),...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Yt=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(Jt,{ref:i,iconNode:t,className:Kt(`lucide-${Gt(e)}`,n),...r}));return n.displayName=`${e}`,n},Xt=Yt(`Activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Zt=Yt(`ArrowLeftRight`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),Qt=Yt(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),$t=Yt(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),en=Yt(`CalendarRange`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M17 14h-6`,key:`bkmgh3`}],[`path`,{d:`M13 18H7`,key:`bb0bb7`}],[`path`,{d:`M7 14h.01`,key:`1qa3f1`}],[`path`,{d:`M17 18h.01`,key:`1bdyru`}]]),tn=Yt(`ChartColumn`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),nn=Yt(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),rn=Yt(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),an=Yt(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),on=Yt(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),sn=Yt(`ChevronsUpDown`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),cn=Yt(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),ln=Yt(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),un=Yt(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),dn=Yt(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),fn=Yt(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),pn=Yt(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),mn=Yt(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),hn=Yt(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),gn=Yt(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),_n=Yt(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),vn=Yt(`Ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),yn=Yt(`ExternalLink`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),bn=Yt(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),xn=Yt(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Sn=Yt(`FileCode`,[[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z`,key:`1mlx9k`}]]),Cn=Yt(`FileSpreadsheet`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),wn=Yt(`FileText`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Tn=Yt(`FlaskConical`,[[`path`,{d:`M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2`,key:`pzvekw`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}],[`path`,{d:`M7 16h10`,key:`wp8him`}]]),En=Yt(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Dn=Yt(`GitCompare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),On=Yt(`Github`,[[`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`,key:`tonef`}],[`path`,{d:`M9 18c-4.51 2-5-2-7-2`,key:`9comsn`}]]),kn=Yt(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),An=Yt(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),jn=Yt(`Layers`,[[`path`,{d:`m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z`,key:`8b97xw`}],[`path`,{d:`m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65`,key:`dd6zsq`}],[`path`,{d:`m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65`,key:`ep9fru`}]]),Mn=Yt(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Nn=Yt(`Lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Pn=Yt(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),Fn=Yt(`ListPlus`,[[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 6H3`,key:`1wxfjs`}],[`path`,{d:`M16 18H3`,key:`12xzn7`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),In=Yt(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ln=Yt(`Microscope`,[[`path`,{d:`M6 18h8`,key:`1borvv`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M14 22a7 7 0 1 0 0-14h-1`,key:`1jwaiy`}],[`path`,{d:`M9 14h2`,key:`197e7h`}],[`path`,{d:`M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z`,key:`1bmzmy`}],[`path`,{d:`M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3`,key:`1drr47`}]]),Rn=Yt(`Minimize2`,[[`polyline`,{points:`4 14 10 14 10 20`,key:`11kfnr`}],[`polyline`,{points:`20 10 14 10 14 4`,key:`rlmsce`}],[`line`,{x1:`14`,x2:`21`,y1:`10`,y2:`3`,key:`o5lafz`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),zn=Yt(`NotebookTabs`,[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M15 2v20`,key:`dcj49h`}],[`path`,{d:`M15 7h5`,key:`1xj5lc`}],[`path`,{d:`M15 12h5`,key:`w5shd9`}],[`path`,{d:`M15 17h5`,key:`1qaofu`}]]),Bn=Yt(`NotepadText`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`16`,height:`18`,x:`4`,y:`4`,rx:`2`,key:`1u9h20`}],[`path`,{d:`M8 10h6`,key:`3oa6kw`}],[`path`,{d:`M8 14h8`,key:`1fgep2`}],[`path`,{d:`M8 18h5`,key:`17enja`}]]),Vn=Yt(`PanelLeft`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Hn=Yt(`PanelRightClose`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Un=Yt(`PanelRightOpen`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Wn=Yt(`Paperclip`,[[`path`,{d:`m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48`,key:`1u3ebp`}]]),Gn=Yt(`Pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Kn=Yt(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),qn=Yt(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Jn=Yt(`RectangleEllipsis`,[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`2`,key:`9lu3g6`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M17 12h.01`,key:`1m0b6t`}],[`path`,{d:`M7 12h.01`,key:`eqddd0`}]]),Yn=Yt(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Xn=Yt(`Save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Zn=Yt(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Qn=Yt(`Send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),$n=Yt(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),er=Yt(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),tr=Yt(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),nr=Yt(`SquarePen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),rr=Yt(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ir=Yt(`Timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),ar=Yt(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),or=Yt(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),sr=Yt(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),cr=Yt(`User`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),lr=Yt(`Wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),ur=Yt(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),dr=Yt(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),fr=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},pr=(e,t)=>({classGroupId:e,validator:t}),mr=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hr=`-`,gr=[],_r=`arbitrary..`,vr=e=>{let t=xr(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return br(e);let n=e.split(hr);return yr(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?fr(i,t):t:i||gr}return n[e]||gr}}},yr=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=yr(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(hr):e.slice(t).join(hr),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},br=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?_r+r:void 0})(),xr=e=>{let{theme:t,classGroups:n}=e;return Sr(n,t)},Sr=(e,t)=>{let n=mr();for(let r in e){let i=e[r];Cr(i,n,r,t)}return n},Cr=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];wr(i,t,n,r)}},wr=(e,t,n,r)=>{typeof e==`string`?Tr(e,t,n):typeof e==`function`?Er(e,t,n,r):Dr(e,t,n,r)},Tr=(e,t,n)=>{let r=e===``?t:Or(t,e);r.classGroupId=n},Er=(e,t,n,r)=>{kr(e)?Cr(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(pr(n,e)))},Dr=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Cr(o,Or(t,a),n,r)}},Or=(e,t)=>{let n=e,r=t.split(hr),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=mr(),n.nextPart.set(t,i)),n=i}return n},kr=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Ar=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},jr=`!`,Mr=`:`,Nr=[],Pr=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Fr=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Mr){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(jr)?(c=s.slice(0,-1),l=!0):s.startsWith(jr)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Pr(t,l,c,u)};if(t){let e=t+Mr,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Pr(Nr,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Ir=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Lr=e=>({cache:Ar(e.cacheSize),parseClassName:Fr(e),sortModifiers:Ir(e),postfixLookupClassGroupIds:Rr(e),...vr(e)}),Rr=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},zr=/\s+/,Br=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(zr),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+jr:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Vr=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Hr(n))&&(i&&(i+=` `),i+=r);return i},Hr=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Hr(e[r]))&&(n&&(n+=` `),n+=t);return n},Ur=(e,...t)=>{let n,r,i,a,o=o=>(n=Lr(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Br(e,n);return i(e,a),a};return a=o,(...e)=>a(Vr(...e))},Wr=[],Gr=e=>{let t=t=>t[e]||Wr;return t.isThemeGetter=!0,t.themeKey=e,t},Kr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Jr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Yr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Zr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Qr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$r=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ei=e=>Jr.test(e),ti=e=>!!e&&!Number.isNaN(Number(e)),ni=e=>!!e&&Number.isInteger(Number(e)),ri=e=>e.endsWith(`%`)&&ti(e.slice(0,-1)),ii=e=>Yr.test(e),ai=()=>!0,oi=e=>Xr.test(e)&&!Zr.test(e),si=()=>!1,ci=e=>Qr.test(e),li=e=>$r.test(e),ui=e=>!pi(e)&&!xi(e),di=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),fi=e=>ki(e,Ni,si),pi=e=>Kr.test(e),mi=e=>ki(e,Pi,oi),hi=e=>ki(e,Fi,ti),gi=e=>ki(e,Li,ai),_i=e=>ki(e,Ii,si),vi=e=>ki(e,ji,si),yi=e=>ki(e,Mi,li),bi=e=>ki(e,Ri,ci),xi=e=>qr.test(e),Si=e=>Ai(e,Pi),Ci=e=>Ai(e,Ii),wi=e=>Ai(e,ji),Ti=e=>Ai(e,Ni),Ei=e=>Ai(e,Mi),Di=e=>Ai(e,Ri,!0),Oi=e=>Ai(e,Li,!0),ki=(e,t,n)=>{let r=Kr.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ai=(e,t,n=!1)=>{let r=qr.exec(e);return r?r[1]?t(r[1]):n:!1},ji=e=>e===`position`||e===`percentage`,Mi=e=>e===`image`||e===`url`,Ni=e=>e===`length`||e===`size`||e===`bg-size`,Pi=e=>e===`length`,Fi=e=>e===`number`,Ii=e=>e===`family-name`,Li=e=>e===`number`||e===`weight`,Ri=e=>e===`shadow`,zi=Ur(()=>{let e=Gr(`color`),t=Gr(`font`),n=Gr(`text`),r=Gr(`font-weight`),i=Gr(`tracking`),a=Gr(`leading`),o=Gr(`breakpoint`),s=Gr(`container`),c=Gr(`spacing`),l=Gr(`radius`),u=Gr(`shadow`),d=Gr(`inset-shadow`),f=Gr(`text-shadow`),p=Gr(`drop-shadow`),m=Gr(`blur`),h=Gr(`perspective`),g=Gr(`aspect`),_=Gr(`ease`),v=Gr(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),xi,pi],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[xi,pi,c],T=()=>[ei,`full`,`auto`,...w()],E=()=>[ni,`none`,`subgrid`,xi,pi],D=()=>[`auto`,{span:[`full`,ni,xi,pi]},ni,xi,pi],O=()=>[ni,`auto`,xi,pi],k=()=>[`auto`,`min`,`max`,`fr`,xi,pi],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ei,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,ei,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[ei,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,xi,pi],ee=()=>[...b(),wi,vi,{position:[xi,pi]}],L=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],R=()=>[`auto`,`cover`,`contain`,Ti,fi,{size:[xi,pi]}],z=()=>[ri,Si,mi],te=()=>[``,`none`,`full`,l,xi,pi],ne=()=>[``,ti,Si,mi],re=()=>[`solid`,`dashed`,`dotted`,`double`],ie=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ae=()=>[ti,ri,wi,vi],oe=()=>[``,`none`,m,xi,pi],se=()=>[`none`,ti,xi,pi],ce=()=>[`none`,ti,xi,pi],B=()=>[ti,xi,pi],le=()=>[ei,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ii],breakpoint:[ii],color:[ai],container:[ii],"drop-shadow":[ii],ease:[`in`,`out`,`in-out`],font:[ui],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ii],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ii],shadow:[ii],spacing:[`px`,ti],text:[ii],"text-shadow":[ii],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ei,pi,xi,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,xi,pi]}],"container-named":[di],columns:[{columns:[ti,`auto`,pi,xi,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ni,`auto`,xi,pi]}],basis:[{basis:[ei,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[ti,ei,`auto`,`initial`,`none`,pi]}],grow:[{grow:[``,ti,xi,pi]}],shrink:[{shrink:[``,ti,xi,pi]}],order:[{order:[ni,`first`,`last`,`none`,xi,pi]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,Si,mi]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Oi,gi]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ri,pi]}],"font-family":[{font:[Ci,_i,t]}],"font-features":[{"font-features":[pi]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,xi,pi]}],"line-clamp":[{"line-clamp":[ti,`none`,xi,hi]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,xi,pi]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,xi,pi]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...re(),`wavy`]}],"text-decoration-thickness":[{decoration:[ti,`from-font`,`auto`,xi,mi]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[ti,`auto`,xi,pi]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[ni,xi,pi]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,xi,pi]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,xi,pi]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:R()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ni,xi,pi],radial:[``,xi,pi],conic:[``,ni,xi,pi]},Ei,yi]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...re(),`hidden`,`none`]}],"divide-style":[{divide:[...re(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...re(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[ti,xi,pi]}],"outline-w":[{outline:[``,ti,Si,mi]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,Di,bi]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Di,bi]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ne()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[ti,mi]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Di,bi]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[ti,xi,pi]}],"mix-blend":[{"mix-blend":[...ie(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ie()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[ti]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[xi,pi]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ti]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,xi,pi]}],filter:[{filter:[``,`none`,xi,pi]}],blur:[{blur:oe()}],brightness:[{brightness:[ti,xi,pi]}],contrast:[{contrast:[ti,xi,pi]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Di,bi]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,ti,xi,pi]}],"hue-rotate":[{"hue-rotate":[ti,xi,pi]}],invert:[{invert:[``,ti,xi,pi]}],saturate:[{saturate:[ti,xi,pi]}],sepia:[{sepia:[``,ti,xi,pi]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,xi,pi]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[ti,xi,pi]}],"backdrop-contrast":[{"backdrop-contrast":[ti,xi,pi]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,ti,xi,pi]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ti,xi,pi]}],"backdrop-invert":[{"backdrop-invert":[``,ti,xi,pi]}],"backdrop-opacity":[{"backdrop-opacity":[ti,xi,pi]}],"backdrop-saturate":[{"backdrop-saturate":[ti,xi,pi]}],"backdrop-sepia":[{"backdrop-sepia":[``,ti,xi,pi]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,xi,pi]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[ti,`initial`,xi,pi]}],ease:[{ease:[`linear`,`initial`,_,xi,pi]}],delay:[{delay:[ti,xi,pi]}],animate:[{animate:[`none`,v,xi,pi]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,xi,pi]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:B()}],"skew-x":[{"skew-x":B()}],"skew-y":[{"skew-y":B()}],transform:[{transform:[xi,pi,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":[`translate-none`],zoom:[{zoom:[ni,xi,pi]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,xi,pi]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,xi,pi]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[ti,Si,mi,hi]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function U(...e){return zi(Vt(e))}function Bi(e){return e===null?`–`:`${Math.round(e*100)}%`}function Vi(e,t=``){return typeof e==`string`&&e.trim().length>0?e.trim():t}var Hi=Nt,Ui=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Pt,{ref:n,className:U(`fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]`,e),...t}));Ui.displayName=Pt.displayName;var Wi=Wt(`group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full`,{variants:{variant:{default:`border bg-background text-foreground`,destructive:`destructive group border-destructive bg-destructive text-destructive-foreground`}},defaultVariants:{variant:`default`}}),Gi=_.forwardRef(({className:e,variant:t,...n},r)=>(0,I.jsx)(Ft,{ref:r,className:U(Wi({variant:t}),e),...n}));Gi.displayName=Ft.displayName;var Ki=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Rt,{ref:n,className:U(`inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:group-[.destructive]:ring-destructive disabled:pointer-events-none disabled:opacity-50`,e),...t}));Ki.displayName=Rt.displayName;var qi=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(zt,{ref:n,className:U(`absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground hover:group-[.destructive]:text-red-50 focus:opacity-100 focus:outline-hidden focus:ring-2 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600`,e),"toast-close":``,...t,children:(0,I.jsx)(dr,{className:`h-4 w-4`})}));qi.displayName=zt.displayName;var Ji=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(It,{ref:n,className:U(`text-sm font-semibold`,e),...t}));Ji.displayName=It.displayName;var Yi=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Lt,{ref:n,className:U(`text-sm opacity-90`,e),...t}));Yi.displayName=Lt.displayName;function Xi(){let{toasts:e}=k();return(0,I.jsxs)(Hi,{children:[e.map(function({id:e,title:t,description:n,action:r,...i}){return(0,I.jsxs)(Gi,{...i,children:[(0,I.jsxs)(`div`,{className:`grid gap-1`,children:[t&&(0,I.jsx)(Ji,{children:t}),n&&(0,I.jsx)(Yi,{children:n})]}),r,(0,I.jsx)(qi,{})]},e)}),(0,I.jsx)(Ui,{})]})}var Zi=[`light`,`dark`],Qi=`(prefers-color-scheme: dark)`,$i=_.createContext(void 0),ea={setTheme:e=>{},themes:[]},ta=()=>_.useContext($i)??ea;_.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,attrs:s,nonce:c})=>{let l=a===`system`,u=n===`class`?`var d=document.documentElement,c=d.classList;${`c.remove(${s.map(e=>`'${e}'`).join(`,`)})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?Zi.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:`if(e==='light'||e==='dark')d.style.colorScheme=e`:``,f=(e,t=!1,r=!0)=>{let a=o?o[e]:e,s=t?e+`|| ''`:`'${a}'`,c=``;return i&&r&&!t&&Zi.includes(e)&&(c+=`d.style.colorScheme = '${e}';`),n===`class`?c+=t||a?`c.add(${s})`:`null`:a&&(c+=`d[s](n,${s})`),c},p=e?`!function(){${u}${f(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${l})){var t='${Qi}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f(`dark`)}}else{${f(`light`)}}}else if(e){${o?`var x=${JSON.stringify(o)};`:``}${f(o?`x[e]`:`e`,!0)}}${l?``:`else{`+f(a,!1,!1)+`}`}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:``}${f(o?`x[e]`:`e`,!0)}}else{${f(a,!1,!1)};}${d}}catch(t){}}();`;return _.createElement(`script`,{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var na=e=>{switch(e){case`success`:return aa;case`info`:return sa;case`warning`:return oa;case`error`:return ca;default:return null}},ra=Array(12).fill(0),ia=({visible:e,className:t})=>_.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},_.createElement(`div`,{className:`sonner-spinner`},ra.map((e,t)=>_.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),aa=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),oa=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),sa=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),ca=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),la=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},_.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),_.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ua=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},da=1,fa=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:da++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=e instanceof Promise?e:e(),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],_.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(ma(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:n,type:`error`,message:r,description:a})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description;this.create({id:n,type:`success`,message:r,description:a})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description;this.create({id:n,type:`error`,message:r,description:a})}}).finally(()=>{var e;i&&(this.dismiss(n),n=void 0),(e=t.finally)==null||e.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||da++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},pa=(e,t)=>{let n=t?.id||da++;return fa.addToast({title:e,...t,id:n}),n},ma=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`;Object.assign(pa,{success:fa.success,info:fa.info,warning:fa.warning,error:fa.error,custom:fa.custom,message:fa.message,promise:fa.promise,dismiss:fa.dismiss,loading:fa.loading},{getHistory:()=>fa.toasts,getToasts:()=>fa.getActiveToasts()});function ha(e,{insertAt:t}={}){if(!e||typeof document>`u`)return;let n=document.head||document.getElementsByTagName(`head`)[0],r=document.createElement(`style`);r.type=`text/css`,t===`top`&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}ha(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
9
+ `);function ga(e){return e.label!==void 0}var _a=3,va=`32px`,ya=`16px`,ba=4e3,xa=356,Sa=14,Ca=20,wa=200;function Ta(...e){return e.filter(Boolean).join(` `)}function Ea(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Da=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,loadingIcon:C,expandByDefault:w,classNames:T,icons:E,closeButtonAriaLabel:D=`Close toast`,pauseWhenPageIsHidden:O}=e,[k,A]=_.useState(null),[j,M]=_.useState(null),[N,P]=_.useState(!1),[F,I]=_.useState(!1),[ee,L]=_.useState(!1),[R,z]=_.useState(!1),[te,ne]=_.useState(!1),[re,ie]=_.useState(0),[ae,oe]=_.useState(0),se=_.useRef(n.duration||b||ba),ce=_.useRef(null),B=_.useRef(null),le=c===0,ue=c+1<=o,de=n.type,V=n.dismissible!==!1,fe=n.className||``,pe=n.descriptionClassName||``,me=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),he=_.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ge=_.useMemo(()=>n.duration||b||ba,[n.duration,b]),_e=_.useRef(0),ve=_.useRef(0),ye=_.useRef(0),be=_.useRef(null),[xe,Se]=x.split(`-`),Ce=_.useMemo(()=>s.reduce((e,t,n)=>n>=me?e:e+t.height,0),[s,me]),we=ua(),Te=n.invert||t,Ee=de===`loading`;ve.current=_.useMemo(()=>me*S+Ce,[me,Ce]),_.useEffect(()=>{se.current=ge},[ge]),_.useEffect(()=>{P(!0)},[]),_.useEffect(()=>{let e=B.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!N)return;let e=B.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[N,n.title,n.description,a,n.id]);let De=_.useCallback(()=>{I(!0),ie(ve.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},wa)},[n,d,a,ve]);_.useEffect(()=>{if(n.promise&&de===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||O&&we?(()=>{if(ye.current<_e.current){let e=new Date().getTime()-_e.current;se.current-=e}ye.current=new Date().getTime()})():se.current!==1/0&&(_e.current=new Date().getTime(),e=setTimeout(()=>{var e;(e=n.onAutoClose)==null||e.call(n,n),De()},se.current)),()=>clearTimeout(e)},[u,i,n,de,O,we,De]),_.useEffect(()=>{n.delete&&De()},[De,n.delete]);function Oe(){return E!=null&&E.loading?_.createElement(`div`,{className:Ta(T?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":de===`loading`},E.loading):C?_.createElement(`div`,{className:Ta(T?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":de===`loading`},C):_.createElement(ia,{className:Ta(T?.loader,n?.classNames?.loader),visible:de===`loading`})}return _.createElement(`li`,{tabIndex:0,ref:B,className:Ta(v,fe,T?.toast,n?.classNames?.toast,T?.default,T?.[de],n?.classNames?.[de]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":N,"data-promise":!!n.promise,"data-swiped":te,"data-removed":F,"data-visible":ue,"data-y-position":xe,"data-x-position":Se,"data-index":c,"data-front":le,"data-swiping":ee,"data-dismissible":V,"data-type":de,"data-invert":Te,"data-swipe-out":R,"data-swipe-direction":j,"data-expanded":!!(u||w&&N),style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${F?re:ve.current}px`,"--initial-height":w?`auto`:`${ae}px`,...m,...n.style},onDragEnd:()=>{L(!1),A(null),be.current=null},onPointerDown:e=>{Ee||!V||(ce.current=new Date,ie(ve.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(L(!0),be.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e;if(R||!V)return;be.current=null;let t=Number(B.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),r=Number(B.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),i=new Date().getTime()-ce.current?.getTime(),a=k===`x`?t:r,o=Math.abs(a)/i;Math.abs(a)>=Ca||o>.11?(ie(ve.current),(e=n.onDismiss)==null||e.call(n,n),M(k===`x`?t>0?`right`:`left`:r>0?`down`:`up`),De(),z(!0),ne(!1)):(L(!1),A(null))},onPointerMove:t=>{var n,r;if(!be.current||!V||window.getSelection()?.toString().length>0)return;let i=t.clientY-be.current.y,a=t.clientX-be.current.x,o=e.swipeDirections??Ea(x);!k&&(Math.abs(a)>1||Math.abs(i)>1)&&A(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0};k===`y`?(o.includes(`top`)||o.includes(`bottom`))&&(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)&&(s.y=i):k===`x`&&(o.includes(`left`)||o.includes(`right`))&&(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)&&(s.x=a),(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ne(!0),(n=B.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=B.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},he&&!n.jsx?_.createElement(`button`,{"aria-label":D,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!V?()=>{}:()=>{var e;De(),(e=n.onDismiss)==null||e.call(n,n)},className:Ta(T?.closeButton,n?.classNames?.closeButton)},E?.close??la):null,n.jsx||(0,_.isValidElement)(n.title)?n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title:_.createElement(_.Fragment,null,de||n.icon||n.promise?_.createElement(`div`,{"data-icon":``,className:Ta(T?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Oe():null,n.type===`loading`?null:n.icon||E?.[de]||na(de)):null,_.createElement(`div`,{"data-content":``,className:Ta(T?.content,n?.classNames?.content)},_.createElement(`div`,{"data-title":``,className:Ta(T?.title,n?.classNames?.title)},typeof n.title==`function`?n.title():n.title),n.description?_.createElement(`div`,{"data-description":``,className:Ta(y,pe,T?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),(0,_.isValidElement)(n.cancel)?n.cancel:n.cancel&&ga(n.cancel)?_.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{var t,r;ga(n.cancel)&&V&&((r=(t=n.cancel).onClick)==null||r.call(t,e),De())},className:Ta(T?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,(0,_.isValidElement)(n.action)?n.action:n.action&&ga(n.action)?_.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{var t,r;ga(n.action)&&((r=(t=n.action).onClick)==null||r.call(t,e),!e.defaultPrevented&&De())},className:Ta(T?.actionButton,n?.classNames?.actionButton)},n.action.label):null))};function Oa(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function ka(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?ya:va;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Aa=(0,_.forwardRef)(function(e,t){let{invert:n,position:r=`bottom-right`,hotkey:i=[`altKey`,`KeyT`],expand:a,closeButton:o,className:s,offset:c,mobileOffset:l,theme:u=`light`,richColors:d,duration:f,style:p,visibleToasts:m=_a,toastOptions:h,dir:g=Oa(),gap:v=Sa,loadingIcon:y,icons:b,containerAriaLabel:x=`Notifications`,pauseWhenPageIsHidden:S}=e,[C,w]=_.useState([]),T=_.useMemo(()=>Array.from(new Set([r].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,r]),[E,D]=_.useState([]),[O,k]=_.useState(!1),[j,M]=_.useState(!1),[N,P]=_.useState(u===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:u),F=_.useRef(null),I=i.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ee=_.useRef(null),L=_.useRef(!1),R=_.useCallback(e=>{w(t=>{var n;return(n=t.find(t=>t.id===e.id))!=null&&n.delete||fa.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return _.useEffect(()=>fa.subscribe(e=>{e.dismiss?w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t)):setTimeout(()=>{A.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),_.useEffect(()=>{if(u!==`system`){P(u);return}if(u===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[u]),_.useEffect(()=>{C.length<=1&&k(!1)},[C]),_.useEffect(()=>{let e=e=>{var t,n;i.every(t=>e[t]||e.code===t)&&(k(!0),(t=F.current)==null||t.focus()),e.code===`Escape`&&(document.activeElement===F.current||(n=F.current)!=null&&n.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i]),_.useEffect(()=>{if(F.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,L.current=!1)}},[F.current]),_.createElement(`section`,{ref:t,"aria-label":`${x} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},T.map((t,r)=>{let[i,u]=t.split(`-`);return C.length?_.createElement(`ol`,{key:t,dir:g===`auto`?Oa():g,tabIndex:-1,ref:F,className:s,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":i,"data-lifted":O&&C.length>1&&!a,"data-x-position":u,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${xa}px`,"--gap":`${v}px`,...p,...ka(c,l)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,ee.current&&=(ee.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||L.current||(L.current=!0,ee.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{j||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},C.filter(e=>!e.position&&r===0||e.position===t).map((r,i)=>_.createElement(Da,{key:r.id,icons:b,index:i,toast:r,defaultRichColors:d,duration:h?.duration??f,className:h?.className,descriptionClassName:h?.descriptionClassName,invert:n,visibleToasts:m,closeButton:h?.closeButton??o,interacting:j,position:t,style:h?.style,unstyled:h?.unstyled,classNames:h?.classNames,cancelButtonStyle:h?.cancelButtonStyle,actionButtonStyle:h?.actionButtonStyle,removeToast:R,toasts:C.filter(e=>e.position==r.position),heights:E.filter(e=>e.position==r.position),setHeights:D,expandByDefault:a,gap:v,loadingIcon:y,expanded:O,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections}))):null}))}),ja=({...e})=>{let{theme:t=`system`}=ta();return(0,I.jsx)(Aa,{theme:t,className:`toaster group`,toastOptions:{classNames:{toast:`group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:bg-primary group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-muted group-[.toast]:text-muted-foreground`}},...e})},Ma=_.useId||(()=>void 0),Na=0;function Pa(e){let[t,n]=_.useState(Ma());return Ae(()=>{e||n(e=>e??String(Na++))},[e]),e||(t?`radix-${t}`:``)}var Fa=[`top`,`right`,`bottom`,`left`],Ia=Math.min,La=Math.max,Ra=Math.round,za=Math.floor,Ba=e=>({x:e,y:e}),Va={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Ha={start:`end`,end:`start`};function Ua(e,t,n){return La(e,Ia(t,n))}function Wa(e,t){return typeof e==`function`?e(t):e}function Ga(e){return e.split(`-`)[0]}function Ka(e){return e.split(`-`)[1]}function qa(e){return e===`x`?`y`:`x`}function Ja(e){return e===`y`?`height`:`width`}var Ya=new Set([`top`,`bottom`]);function Xa(e){return Ya.has(Ga(e))?`y`:`x`}function Za(e){return qa(Xa(e))}function Qa(e,t,n){n===void 0&&(n=!1);let r=Ka(e),i=Za(e),a=Ja(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=so(o)),[o,so(o)]}function $a(e){let t=so(e);return[eo(e),t,eo(t)]}function eo(e){return e.replace(/start|end/g,e=>Ha[e])}var to=[`left`,`right`],no=[`right`,`left`],ro=[`top`,`bottom`],io=[`bottom`,`top`];function ao(e,t,n){switch(e){case`top`:case`bottom`:return n?t?no:to:t?to:no;case`left`:case`right`:return t?ro:io;default:return[]}}function oo(e,t,n,r){let i=Ka(e),a=ao(Ga(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(eo)))),a}function so(e){return e.replace(/left|right|bottom|top/g,e=>Va[e])}function co(e){return{top:0,right:0,bottom:0,left:0,...e}}function lo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:co(e)}function uo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fo(e,t,n){let{reference:r,floating:i}=e,a=Xa(t),o=Za(t),s=Ja(o),c=Ga(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ka(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function po(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Wa(t,e),p=lo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=uo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=uo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var mo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=fo(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??po},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=fo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},ho=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Wa(e,t)||{};if(l==null)return{};let d=lo(u),f={x:n,y:r},p=Za(i),m=Ja(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ia(d[_],T),D=Ia(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Ua(O,A,k),M=!c.arrow&&Ka(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),go=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Wa(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ga(r),_=Xa(o),v=Ga(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[so(o)]:$a(o)),x=p!==`none`;!d&&x&&b.push(...oo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Qa(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Xa(t)||T.every(e=>Xa(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Xa(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function _o(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vo(e){return Fa.some(t=>e[t]>=0)}var yo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Wa(e,t);switch(i){case`referenceHidden`:{let e=_o(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:vo(e)}}}case`escaped`:{let e=_o(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:vo(e)}}}default:return{}}}}},bo=new Set([`left`,`top`]);async function xo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ga(n),s=Ka(n),c=Xa(n)===`y`,l=bo.has(o)?-1:1,u=a&&c?-1:1,d=Wa(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var So=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await xo(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Co=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Wa(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Xa(Ga(i)),p=qa(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Ua(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Ua(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},wo=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Wa(e,t),u={x:n,y:r},d=Xa(i),f=qa(d),p=u[f],m=u[d],h=Wa(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=bo.has(Ga(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},To=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Wa(e,t),u=await o.detectOverflow(t,l),d=Ga(i),f=Ka(i),p=Xa(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ia(h-u[g],v),x=Ia(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=La(u.left,0),t=La(u.right,0),n=La(u.top,0),r=La(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:La(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:La(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Eo(){return typeof window<`u`}function Do(e){return Ao(e)?(e.nodeName||``).toLowerCase():`#document`}function Oo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ko(e){return((Ao(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ao(e){return Eo()?e instanceof Node||e instanceof Oo(e).Node:!1}function jo(e){return Eo()?e instanceof Element||e instanceof Oo(e).Element:!1}function Mo(e){return Eo()?e instanceof HTMLElement||e instanceof Oo(e).HTMLElement:!1}function No(e){return!Eo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Oo(e).ShadowRoot}var Po=new Set([`inline`,`contents`]);function Fo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Jo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Po.has(i)}var Io=new Set([`table`,`td`,`th`]);function Lo(e){return Io.has(Do(e))}var Ro=[`:popover-open`,`:modal`];function zo(e){return Ro.some(t=>{try{return e.matches(t)}catch{return!1}})}var Bo=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Vo=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Ho=[`paint`,`layout`,`strict`,`content`];function Uo(e){let t=Go(),n=jo(e)?Jo(e):e;return Bo.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Vo.some(e=>(n.willChange||``).includes(e))||Ho.some(e=>(n.contain||``).includes(e))}function Wo(e){let t=Xo(e);for(;Mo(t)&&!qo(t);){if(Uo(t))return t;if(zo(t))return null;t=Xo(t)}return null}function Go(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Ko=new Set([`html`,`body`,`#document`]);function qo(e){return Ko.has(Do(e))}function Jo(e){return Oo(e).getComputedStyle(e)}function Yo(e){return jo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xo(e){if(Do(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||No(e)&&e.host||ko(e);return No(t)?t.host:t}function Zo(e){let t=Xo(e);return qo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mo(t)&&Fo(t)?t:Zo(t)}function Qo(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Zo(e),i=r===e.ownerDocument?.body,a=Oo(r);if(i){let e=$o(a);return t.concat(a,a.visualViewport||[],Fo(r)?r:[],e&&n?Qo(e):[])}return t.concat(r,Qo(r,[],n))}function $o(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function es(e){let t=Jo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Mo(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ra(n)!==a||Ra(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ts(e){return jo(e)?e:e.contextElement}function ns(e){let t=ts(e);if(!Mo(t))return Ba(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=es(t),o=(a?Ra(n.width):n.width)/r,s=(a?Ra(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var rs=Ba(0);function is(e){let t=Oo(e);return!Go()||!t.visualViewport?rs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function as(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Oo(e)?!1:t}function os(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ts(e),o=Ba(1);t&&(r?jo(r)&&(o=ns(r)):o=ns(e));let s=as(a,n,r)?is(a):Ba(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Oo(a),t=r&&jo(r)?Oo(r):r,n=e,i=$o(n);for(;i&&r&&t!==n;){let e=ns(i),t=i.getBoundingClientRect(),r=Jo(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Oo(i),i=$o(n)}}return uo({width:u,height:d,x:c,y:l})}function ss(e,t){let n=Yo(e).scrollLeft;return t?t.left+n:os(ko(e)).left+n}function cs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ss(e,n),y:n.top+t.scrollTop}}function ls(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ko(r),s=t?zo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ba(1),u=Ba(0),d=Mo(r);if((d||!d&&!a)&&((Do(r)!==`body`||Fo(o))&&(c=Yo(r)),Mo(r))){let e=os(r);l=ns(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?cs(o,c):Ba(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function us(e){return Array.from(e.getClientRects())}function ds(e){let t=ko(e),n=Yo(e),r=e.ownerDocument.body,i=La(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=La(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ss(e),s=-n.scrollTop;return Jo(r).direction===`rtl`&&(o+=La(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var fs=25;function ps(e,t){let n=Oo(e),r=ko(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Go();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=ss(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=fs&&(a-=o)}else l<=fs&&(a+=l);return{width:a,height:o,x:s,y:c}}var ms=new Set([`absolute`,`fixed`]);function hs(e,t){let n=os(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Mo(e)?ns(e):Ba(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function gs(e,t,n){let r;if(t===`viewport`)r=ps(e,n);else if(t===`document`)r=ds(ko(e));else if(jo(t))r=hs(t,n);else{let n=is(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return uo(r)}function _s(e,t){let n=Xo(e);return n===t||!jo(n)||qo(n)?!1:Jo(n).position===`fixed`||_s(n,t)}function vs(e,t){let n=t.get(e);if(n)return n;let r=Qo(e,[],!1).filter(e=>jo(e)&&Do(e)!==`body`),i=null,a=Jo(e).position===`fixed`,o=a?Xo(e):e;for(;jo(o)&&!qo(o);){let t=Jo(o),n=Uo(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&ms.has(i.position)||Fo(o)&&!n&&_s(e,o))?r=r.filter(e=>e!==o):i=t,o=Xo(o)}return t.set(e,r),r}function ys(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?zo(t)?[]:vs(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=gs(t,n,i);return e.top=La(r.top,e.top),e.right=Ia(r.right,e.right),e.bottom=Ia(r.bottom,e.bottom),e.left=La(r.left,e.left),e},gs(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function bs(e){let{width:t,height:n}=es(e);return{width:t,height:n}}function xs(e,t,n){let r=Mo(t),i=ko(t),a=n===`fixed`,o=os(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ba(0);function l(){c.x=ss(i)}if(r||!r&&!a){if((Do(t)!==`body`||Fo(i))&&(s=Yo(t)),r){let e=os(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?cs(i,s):Ba(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ss(e){return Jo(e).position===`static`}function Cs(e,t){if(!Mo(e)||Jo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ko(e)===n&&(n=n.ownerDocument.body),n}function ws(e,t){let n=Oo(e);if(zo(e))return n;if(!Mo(e)){let t=Xo(e);for(;t&&!qo(t);){if(jo(t)&&!Ss(t))return t;t=Xo(t)}return n}let r=Cs(e,t);for(;r&&Lo(r)&&Ss(r);)r=Cs(r,t);return r&&qo(r)&&Ss(r)&&!Uo(r)?n:r||Wo(e)||n}var Ts=async function(e){let t=this.getOffsetParent||ws,n=this.getDimensions,r=await n(e.floating);return{reference:xs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Es(e){return Jo(e).direction===`rtl`}var Ds={convertOffsetParentRelativeRectToViewportRelativeRect:ls,getDocumentElement:ko,getClippingRect:ys,getOffsetParent:ws,getElementRects:Ts,getClientRects:us,getDimensions:bs,getScale:ns,isElement:jo,isRTL:Es};function Os(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ks(e,t){let n=null,r,i=ko(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=za(d),h=za(i.clientWidth-(u+f)),g=za(i.clientHeight-(d+p)),_=za(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:La(0,Ia(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Os(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function As(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ts(e),u=i||a?[...l?Qo(l):[],...Qo(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?ks(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?os(e):null;c&&g();function g(){let t=os(e);h&&!Os(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var js=So,Ms=Co,Ns=go,Ps=To,Fs=yo,Is=ho,Ls=wo,Rs=(e,t,n)=>{let r=new Map,i={platform:Ds,...n},a={...i.platform,_c:r};return mo(e,t,{...i,platform:a})},zs=typeof document<`u`?_.useLayoutEffect:function(){};function Bs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Bs(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Bs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Vs(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hs(e,t){let n=Vs(e);return Math.round(t*n)/n}function Us(e){let t=_.useRef(e);return zs(()=>{t.current=e}),t}function Ws(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Bs(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=Us(c),O=Us(i),k=Us(l),j=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Rs(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};M.current&&!Bs(T.current,t)&&(T.current=t,A.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);zs(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=_.useRef(!1);zs(()=>(M.current=!0,()=>{M.current=!1}),[]),zs(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,j);j()}},[x,S,j,D,E]);let N=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=_.useMemo(()=>({reference:x,floating:S}),[x,S]),F=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Hs(P.floating,u.x),r=Hs(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Vs(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Gs=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Is({element:r.current,padding:i}).fn(n):r?Is({element:r,padding:i}).fn(n):{}}}},Ks=(e,t)=>({...js(e),options:[e,t]}),qs=(e,t)=>({...Ms(e),options:[e,t]}),Js=(e,t)=>({...Ls(e),options:[e,t]}),Ys=(e,t)=>({...Ns(e),options:[e,t]}),Xs=(e,t)=>({...Ps(e),options:[e,t]}),Zs=(e,t)=>({...Fs(e),options:[e,t]}),Qs=(e,t)=>({...Gs(e),options:[e,t]}),$s=`Arrow`,ec=_.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,I.jsx)(V.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,I.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});ec.displayName=$s;var tc=ec;function nc(e){let[t,n]=_.useState(void 0);return Ae(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}var rc=`Popper`,[ic,ac]=L(rc),[oc,sc]=ic(rc),cc=e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null);return(0,I.jsx)(oc,{scope:t,anchor:r,onAnchorChange:i,children:n})};cc.displayName=rc;var lc=`PopperAnchor`,uc=_.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=sc(lc,n),o=_.useRef(null),s=P(t,o),c=_.useRef(null);return _.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,I.jsx)(V.div,{...i,ref:s})});uc.displayName=lc;var dc=`PopperContent`,[fc,pc]=ic(dc),mc=_.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=sc(dc,n),[v,y]=_.useState(null),b=P(t,e=>y(e)),[x,S]=_.useState(null),C=nc(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(vc),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:F,middlewareData:ee}=Ws({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>As(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Ks({mainAxis:i+T,alignmentAxis:o}),c&&qs({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Js():void 0,...A}),c&&Ys({...A}),Xs({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&Qs({element:x,padding:s}),yc({arrowWidth:w,arrowHeight:T}),f&&Zs({strategy:`referenceHidden`,...A})]}),[L,R]=bc(N),z=pe(m);Ae(()=>{F&&z?.()},[F,z]);let te=ee.arrow?.x,ne=ee.arrow?.y,re=ee.arrow?.centerOffset!==0,[ie,ae]=_.useState();return Ae(()=>{v&&ae(window.getComputedStyle(v).zIndex)},[v]),(0,I.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:F?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ie,"--radix-popper-transform-origin":[ee.transformOrigin?.x,ee.transformOrigin?.y].join(` `),...ee.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,I.jsx)(fc,{scope:n,placedSide:L,onArrowChange:S,arrowX:te,arrowY:ne,shouldHideArrow:re,children:(0,I.jsx)(V.div,{"data-side":L,"data-align":R,...h,ref:b,style:{...h.style,animation:F?void 0:`none`}})})})});mc.displayName=dc;var hc=`PopperArrow`,gc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},_c=_.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=pc(hc,n),a=gc[i.placedSide];return(0,I.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,I.jsx)(tc,{...r,ref:t,style:{...r.style,display:`block`}})})});_c.displayName=hc;function vc(e){return e!==null}var yc=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=bc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function bc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var xc=cc,Sc=uc,Cc=mc,wc=_c,Tc=Symbol(`radix.slottable`);function Ec(e){let t=({children:e})=>(0,I.jsx)(I.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Tc,t}var[Dc,Oc]=L(`Tooltip`,[ac]),kc=ac(),Ac=`TooltipProvider`,jc=700,Mc=`tooltip.open`,[Nc,Pc]=Dc(Ac),Fc=e=>{let{__scopeTooltip:t,delayDuration:n=jc,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,I.jsx)(Nc,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Fc.displayName=Ac;var Ic=`Tooltip`,[Lc,Rc]=Dc(Ic),zc=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Pc(Ic,e.__scopeTooltip),l=kc(t),[u,d]=_.useState(null),f=Pa(),p=_.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=_.useRef(!1),[v,y]=Re({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Mc))):c.onClose(),a?.(e)},caller:Ic}),b=_.useMemo(()=>v?g.current?`delayed-open`:`instant-open`:`closed`,[v]),x=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return _.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,I.jsx)(xc,{...l,children:(0,I.jsx)(Lc,{scope:t,contentId:f,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:_.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};zc.displayName=Ic;var Bc=`TooltipTrigger`,Vc=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Rc(Bc,n),a=Pc(Bc,n),o=kc(n),s=P(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,I.jsx)(Sc,{asChild:!0,...o,children:(0,I.jsx)(V.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:j(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:j(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:j(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:j(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:j(e.onBlur,i.onClose),onClick:j(e.onClick,i.onClose)})})});Vc.displayName=Bc;var Hc=`TooltipPortal`,[Uc,Wc]=Dc(Hc,{forceMount:void 0}),Gc=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Rc(Hc,t);return(0,I.jsx)(Uc,{scope:t,forceMount:n,children:(0,I.jsx)(H,{present:n||a.open,children:(0,I.jsx)(Me,{asChild:!0,container:i,children:r})})})};Gc.displayName=Hc;var Kc=`TooltipContent`,qc=_.forwardRef((e,t)=>{let n=Wc(Kc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Rc(Kc,e.__scopeTooltip);return(0,I.jsx)(H,{present:r||o.open,children:o.disableHoverableContent?(0,I.jsx)(Qc,{side:i,...a,ref:t}):(0,I.jsx)(Jc,{side:i,...a,ref:t})})}),Jc=_.forwardRef((e,t)=>{let n=Rc(Kc,e.__scopeTooltip),r=Pc(Kc,e.__scopeTooltip),i=_.useRef(null),a=P(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=nl(r,tl(r,n.getBoundingClientRect())),a=rl(t.getBoundingClientRect()),o=al([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!il(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,I.jsx)(Qc,{...e,ref:a})}),[Yc,Xc]=Dc(Ic,{isInside:!1}),Zc=Ec(`TooltipContent`),Qc=_.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Rc(Kc,n),l=kc(n),{onClose:u}=c;return _.useEffect(()=>(document.addEventListener(Mc,u),()=>document.removeEventListener(Mc,u)),[u]),_.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,I.jsx)(xe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,I.jsxs)(Cc,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,I.jsx)(Zc,{children:r}),(0,I.jsx)(Yc,{scope:n,isInside:!0,children:(0,I.jsx)(We,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});qc.displayName=Kc;var $c=`TooltipArrow`,el=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=kc(n);return Xc($c,n).isInside?null:(0,I.jsx)(wc,{...i,...r,ref:t})});el.displayName=$c;function tl(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function nl(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}function rl(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function il(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function al(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ol(t)}function ol(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var sl=Fc,cl=zc,ll=Vc,ul=Gc,dl=qc,fl=sl,pl=cl,ml=ll,hl=_.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,I.jsx)(ul,{children:(0,I.jsx)(dl,{ref:r,sideOffset:t,className:U(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));hl.displayName=dl.displayName;var gl=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(){}},_l=new class extends gl{#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`}},vl={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},yl=new class{#e=vl;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 bl(e){setTimeout(e,0)}var xl=typeof window>`u`||`Deno`in globalThis;function Sl(){}function Cl(e,t){return typeof e==`function`?e(t):e}function wl(e){return typeof e==`number`&&e>=0&&e!==1/0}function Tl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function El(e,t){return typeof e==`function`?e(t):e}function Dl(e,t){return typeof e==`function`?e(t):e}function Ol(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Al(o,t.options))return!1}else if(!Ml(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 kl(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(jl(t.options.mutationKey)!==jl(a))return!1}else if(!Ml(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Al(e,t){return(t?.queryKeyHashFn||jl)(e)}function jl(e){return JSON.stringify(e,(e,t)=>Il(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ml(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Ml(e[n],t[n])):!1}var Nl=Object.prototype.hasOwnProperty;function Pl(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Fl(e)&&Fl(t);if(!r&&!(Il(e)&&Il(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:Nl.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Pl(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Fl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Il(e){if(!Ll(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ll(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ll(e){return Object.prototype.toString.call(e)===`[object Object]`}function Rl(e){return new Promise(t=>{yl.setTimeout(t,e)})}function zl(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Pl(e,t)}function Bl(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Vl(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Hl=Symbol();function Ul(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Hl?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Wl(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var Gl=(()=>{let e=()=>xl;return{isServer(){return e()},setIsServer(t){e=t}}})();function Kl(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ql=bl;function Jl(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ql,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 Yl=Jl(),Xl=new class extends gl{#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 Zl(e){return Math.min(1e3*2**e,3e4)}function Ql(e){return(e??`online`)!==`online`||Xl.isOnline()}var $l=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function eu(e){let t=!1,n=0,r,i=Kl(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new $l(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>_l.isFocused()&&(e.networkMode===`always`||Xl.isOnline())&&e.canRun(),u=()=>Ql(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Gl.isServer()?0:3),o=e.retryDelay??Zl,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!c?f(r):(n++,e.onFail?.(n,r),Rl(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()}))})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var tu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wl(this.gcTime)&&(this.#e=yl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Gl.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(yl.clearTimeout(this.#e),this.#e=void 0)}};function nu(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=>{Wl(e,()=>t.signal,()=>n=!0)},u=Ul(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Vl:Bl;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?iu:ru,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:ru(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function ru(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 iu(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var au=class extends tu{#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=cu(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=cu(this.options);e.data!==void 0&&(this.setState(su(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=zl(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Sl).catch(Sl):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=>Dl(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Hl||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>El(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Tl(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){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({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=Ul(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`?nu(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=eu({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof $l&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.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 $l){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(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,...ou(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...su(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),Yl.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ou(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ql(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function su(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function cu(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 lu=class extends tu{#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||uu(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=eu({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){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),Yl.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function uu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var du=class extends gl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new lu({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=fu(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=fu(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=fu(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=fu(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Yl.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=>kl(t,e))}findAll(e={}){return this.getAll().filter(t=>kl(e,t))}notify(e){Yl.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Yl.batch(()=>Promise.all(e.map(e=>e.continue().catch(Sl))))}};function fu(e){return e.options.scope?.id}var pu=class extends gl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Al(r,t),a=this.get(i);return a||(a=new au({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(){Yl.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=>Ol(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ol(e,t)):t}notify(e){Yl.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Yl.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Yl.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},mu=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new pu,this.#t=e.mutationCache||new du,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=_l.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Xl.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(El(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=Cl(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Yl.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;Yl.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Yl.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Yl.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Sl).catch(Sl)}invalidateQueries(e,t={}){return Yl.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=Yl.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(Sl)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Sl)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(El(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Sl).catch(Sl)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Sl).catch(Sl)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Xl.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(jl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Ml(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(jl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Ml(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||=Al(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===Hl&&(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()}},hu=_.createContext(void 0),gu=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(hu.Provider,{value:e,children:t})),_u=`modulepreload`,vu=function(e){return`/`+e},yu={},bu=function(e){return e.pathname.endsWith(`.css`)},xu=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Su=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,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?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=vu(t,n);let r=s(t),i=bu(r);return xu(yu,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:_u,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Cu=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,wu=/^[\\/]{2}/;function Tu(e,t){return t+e.replace(/\\/g,`/`)}var Eu=`popstate`;function Du(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Ou(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Nu(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Pu(t)}return Iu(t,n,null,e)}function ku(e,t){if(e===!1||e==null)throw Error(t)}function Au(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ju(){return Math.random().toString(36).substring(2,10)}function Mu(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 Nu(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Fu(t):t,state:n,key:t&&t.key||r||ju(),mask:i}}function Pu({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 Fu(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 Iu(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=Du(e)?e:Nu(h.location,e,t);n&&n(r,e),l=u()+1;let d=Mu(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=Du(e)?e:Nu(h.location,e,t);n&&n(r,e),l=u();let i=Mu(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 Lu(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(Eu,d),c=e,()=>{i.removeEventListener(Eu,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 Lu(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),ku(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Pu(t);return i=i.replace(/ $/,`%20`),!n&&wu.test(i)&&(i=r+i),new URL(i,r)}function Ru(e,t,n=`/`){return zu(e,t,n,!1)}function zu(e,t,n,r,i){let a=rd((typeof t==`string`?Fu(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Bu(e),s=null,c=nd(a);for(let e=0;s==null&&e<o.length;++e)s=Qu(o[e],c,r);return s}function Bu(e){let t=Vu(e);return Uu(t),t}function Vu(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;ku(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=ud([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(ku(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Vu(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Xu(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=td(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 Hu(e.path))a(e,t,!0,n)}),t}function Hu(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=Hu(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 Uu(e){e.sort((e,t)=>e.score===t.score?Zu(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Wu=/^:[\w-]+$/,Gu=3,Ku=2,qu=1,Ju=10,eee=-2,Yu=e=>e===`*`;function Xu(e,t){let n=e.split(`/`),r=n.length;return n.some(Yu)&&(r+=eee),t&&(r+=Ku),n.filter(e=>!Yu(e)).reduce((e,t)=>e+(Wu.test(t)?Gu:t===``?qu:Ju),r)}function Zu(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 Qu(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?ed(u,l,s.matcher,s.compiledParams):$u(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=$u({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:ud([a,d.pathname]),pathnameBase:fd(ud([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=ud([a,d.pathnameBase]))}return o}function $u(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=td(e.path,e.caseSensitive,e.end);return ed(e,t,n,r)}function ed(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 e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function td(e,t=!1,n=!0){Au(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 nd(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Au(!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 rd(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 tee(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Fu(e):e,a;return n?(n=ld(n),a=n.startsWith(`/`)?id(n.substring(1),`/`):id(n,t)):a=t,{pathname:a,search:pd(r),hash:md(i)}}function id(e,t){let n=dd(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ad(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 od(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function sd(e){let t=od(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function cd(e,t,n,r=!1){let i;typeof e==`string`?i=Fu(e):(i={...e},ku(!i.pathname||!i.pathname.includes(`?`),ad(`?`,`pathname`,`search`,i)),ku(!i.pathname||!i.pathname.includes(`#`),ad(`#`,`pathname`,`hash`,i)),ku(!i.search||!i.search.includes(`#`),ad(`#`,`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=tee(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ld=e=>e.replace(/[\\/]{2,}/g,`/`),ud=e=>ld(e.join(`/`)),dd=e=>e.replace(/\/+$/,``),fd=e=>dd(e).replace(/^\/*/,`/`),pd=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,md=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,hd=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 gd(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function _d(e){return ud(e.map(e=>e.route.path).filter(Boolean))||`/`}var vd=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function yd(e,t){let n=e;if(typeof n!=`string`||!Cu.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(vd)try{let e=new URL(window.location.href),r=wu.test(n)?new URL(Tu(n,e.protocol)):new URL(n),a=rd(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Au(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var bd=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(bd);var xd=[`GET`,...bd];new Set(xd);var Sd=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Cd(e){try{return Sd.includes(new URL(e).protocol)}catch{return!1}}var wd=_.createContext(null);wd.displayName=`DataRouter`;var Td=_.createContext(null);Td.displayName=`DataRouterState`;var Ed=_.createContext(!1);function Dd(){return _.useContext(Ed)}var Od=_.createContext({isTransitioning:!1});Od.displayName=`ViewTransition`;var kd=_.createContext(new Map);kd.displayName=`Fetchers`;var Ad=_.createContext(null);Ad.displayName=`Await`;var jd=_.createContext(null);jd.displayName=`Navigation`;var Md=_.createContext(null);Md.displayName=`Location`;var Nd=_.createContext({outlet:null,matches:[],isDataRoute:!1});Nd.displayName=`Route`;var Pd=_.createContext(null);Pd.displayName=`RouteError`;var Fd=`REACT_ROUTER_ERROR`,nee=`REDIRECT`,Id=`ROUTE_ERROR_RESPONSE`;function Ld(e){if(e.startsWith(`${Fd}:${nee}:{`))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 Rd(e){if(e.startsWith(`${Fd}:${Id}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new hd(t.status,t.statusText,t.data)}catch{}}function zd(e,{relative:t}={}){ku(Bd(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext(jd),{hash:i,pathname:a,search:o}=Yd(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:ud([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Bd(){return _.useContext(Md)!=null}function Vd(){return ku(Bd(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext(Md).location}var Hd=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Ud(e){_.useContext(jd).static||_.useLayoutEffect(e)}function Wd(){let{isDataRoute:e}=_.useContext(Nd);return e?pf():Gd()}function Gd(){ku(Bd(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext(wd),{basename:t,navigator:n}=_.useContext(jd),{matches:r}=_.useContext(Nd),{pathname:i}=Vd(),a=JSON.stringify(sd(r)),o=_.useRef(!1);return Ud(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(Au(o.current,Hd),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=cd(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:ud([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Kd=_.createContext(null);function qd(e){let t=_.useContext(Nd).outlet;return _.useMemo(()=>t&&_.createElement(Kd.Provider,{value:e},t),[t,e])}function Jd(){let{matches:e}=_.useContext(Nd);return e[e.length-1]?.params??{}}function Yd(e,{relative:t}={}){let{matches:n}=_.useContext(Nd),{pathname:r}=Vd(),i=JSON.stringify(sd(n));return _.useMemo(()=>cd(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Xd(e,t){return Zd(e,t)}function Zd(e,t,n){ku(Bd(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext(jd),{matches:i}=_.useContext(Nd),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||``;hf(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.
10
+
11
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Vd(),d;if(t){let e=typeof t==`string`?Fu(t):t;ku(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})):Ru(e,{pathname:p});Au(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Au(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=af(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:ud([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:ud([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(Md.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Qd(){let e=ff(),t=gd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=_.createElement(_.Fragment,null,_.createElement(`p`,null,`💿 Hey developer 👋`),_.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,_.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,_.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),_.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:i},n):null,o)}var $d=_.createElement(Qd,null),ef=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Rd(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(Nd.Provider,{value:this.props.routeContext},_.createElement(Pd.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(nf,{error:e},t):t}};ef.contextType=Ed;var tf=new WeakMap;function nf({children:e,error:t}){let{basename:n}=_.useContext(jd);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ld(t.digest);if(e){let r=tf.get(t);if(r)throw r;let i=yd(e.location,n),a=i.absoluteURL||i.to;if(Cd(a))throw Error(`Invalid redirect location`);if(vd&&!tf.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 tf.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function rf({routeContext:e,match:t,children:n}){let r=_.useContext(wd);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(Nd.Provider,{value:e},n)}function af(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);ku(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:_d(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||$d,o&&(s<0&&c===0?(hf(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(rf,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(ef,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function of(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sf(e){let t=_.useContext(wd);return ku(t,of(e)),t}function cf(e){let t=_.useContext(Td);return ku(t,of(e)),t}function lf(e){let t=_.useContext(Nd);return ku(t,of(e)),t}function uf(e){let t=lf(e),n=t.matches[t.matches.length-1];return ku(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function df(){return uf(`useRouteId`)}function ff(){let e=_.useContext(Pd),t=cf(`useRouteError`),n=uf(`useRouteError`);return e===void 0?t.errors?.[n]:e}function pf(){let{router:e}=sf(`useNavigate`),t=uf(`useNavigate`),n=_.useRef(!1);return Ud(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{Au(n.current,Hd),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var mf={};function hf(e,t,n){!t&&!mf[e]&&(mf[e]=!0,Au(!1,n))}_.memo(gf);function gf({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Zd(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function _f({to:e,replace:t,state:n,relative:r}){ku(Bd(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=_.useContext(jd);Au(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=_.useContext(Nd),{pathname:o}=Vd(),s=Wd(),c=cd(e,sd(a),o,r===`path`),l=JSON.stringify(c);return _.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function vf(e){return qd(e.context)}function yf(e){ku(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function bf({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){ku(!Bd(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=_.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Fu(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=rd(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 Au(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:_.createElement(jd.Provider,{value:c},_.createElement(Md.Provider,{children:t,value:h}))}function xf({children:e,location:t}){return Xd(Sf(e),t)}_.Component;function Sf(e,t=[]){let n=[];return _.Children.forEach(e,(e,r)=>{if(!_.isValidElement(e))return;let i=[...t,r];if(e.type===_.Fragment){n.push.apply(n,Sf(e.props.children,i));return}ku(e.type===yf,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ku(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Sf(e.props.children,i)),n.push(a)}),n}var Cf=`get`,wf=`application/x-www-form-urlencoded`;function Tf(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Ef(e){return Tf(e)&&e.tagName.toLowerCase()===`button`}function Df(e){return Tf(e)&&e.tagName.toLowerCase()===`form`}function Of(e){return Tf(e)&&e.tagName.toLowerCase()===`input`}function kf(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Af(e,t){return e.button===0&&(!t||t===`_self`)&&!kf(e)}function jf(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Mf(e,t){let n=jf(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Nf=null;function Pf(){if(Nf===null)try{new FormData(document.createElement(`form`),0),Nf=!1}catch{Nf=!0}return Nf}var Ff=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function If(e){return e!=null&&!Ff.has(e)?(Au(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wf}"`),null):e}function Lf(e,t){let n,r,i,a,o;if(Df(e)){let o=e.getAttribute(`action`);r=o?rd(o,t):null,n=e.getAttribute(`method`)||Cf,i=If(e.getAttribute(`enctype`))||wf,a=new FormData(e)}else if(Ef(e)||Of(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?rd(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Cf,i=If(e.getAttribute(`formenctype`))||If(o.getAttribute(`enctype`))||wf,a=new FormData(o,e),!Pf()){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(Tf(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Cf,r=null,i=wf,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Rf(e,t){if(e===!1||e==null)throw Error(t)}function zf(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&rd(i.pathname,t)===`/`?`${dd(t)}/_root.${r}`:`${dd(i.pathname)}.${r}`,i}async function Bf(e,t){if(e.id in t)return t[e.id];try{let n=await Su(()=>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 Vf(e){return e!=null&&typeof e.page==`string`}function Hf(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 Uf(e,t,n){return Jf((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Bf(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Hf).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Wf(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Gf(e,t,{includeHydrateFallback:n}={}){return Kf(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 Kf(e){return[...new Set(e)]}function qf(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Jf(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Vf(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(qf(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Yf(){let e=_.useContext(wd);return Rf(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Xf(){let e=_.useContext(Td);return Rf(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Zf=_.createContext(void 0);Zf.displayName=`FrameworkContext`;function Qf(){let e=_.useContext(Zf);return Rf(e,`You must render this element inside a <HydratedRouter> element`),e}function $f(e,t){let n=_.useContext(Zf),[r,i]=_.useState(!1),[a,o]=_.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=_.useRef(null);_.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),_.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:ep(s,p),onBlur:ep(c,m),onMouseEnter:ep(l,p),onMouseLeave:ep(u,m),onTouchStart:ep(d,p)}]:[a,f,{}]:[!1,f,{}]}function ep(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function tp({page:e,...t}){let n=Dd(),{nonce:r}=Qf(),{router:i}=Yf(),a=_.useMemo(()=>Ru(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(rp,{page:e,matches:a,...t}):_.createElement(ip,{page:e,matches:a,...t})):null}function np(e){let{manifest:t,routeModules:n}=Qf(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return Uf(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function rp({page:e,matches:t,...n}){let r=Vd(),{future:i}=Qf(),{basename:a}=Yf(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=zf(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return _.createElement(_.Fragment,null,o.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function ip({page:e,matches:t,...n}){let r=Vd(),{future:i,manifest:a,routeModules:o}=Qf(),{basename:s}=Yf(),{loaderData:c,matches:l}=Xf(),u=_.useMemo(()=>Wf(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>Wf(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=zf(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=_.useMemo(()=>Gf(d,a),[d,a]),m=np(d);return _.createElement(_.Fragment,null,f.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>_.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>_.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function ap(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var op=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{op&&(window.__reactRouterVersion=`7.18.2`)}catch{}function sp({basename:e,children:t,useTransitions:n,window:r}){let i=_.useRef();i.current??=Ou({window:r,v5Compat:!0});let a=i.current,[o,s]=_.useState({action:a.action,location:a.location}),c=_.useCallback(e=>{n===!1?s(e):_.startTransition(()=>s(e))},[n]);return _.useLayoutEffect(()=>a.listen(c),[a,c]),_.createElement(bf,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var cp=_.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(jd),y=typeof l==`string`&&Cu.test(l),b=yd(l,h);l=b.to;let x=zd(l,{relative:r}),S=Vd(),C=null;if(o){let e=cd(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:ud([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=$f(n,p),D=pp(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=_.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:ap(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?_.createElement(_.Fragment,null,A,_.createElement(tp,{page:x})):A});cp.displayName=`Link`;var lp=_.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=Yd(a,{relative:c.relative}),d=Vd(),f=_.useContext(Td),{navigator:p,basename:m}=_.useContext(jd),h=f!=null&&yp(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=rd(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return _.createElement(cp,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});lp.displayName=`NavLink`;var up=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Cf,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext(jd),g=_p(),v=vp(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&Cu.test(s);return _.createElement(`form`,{ref:m,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?_.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});up.displayName=`Form`;function dp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fp(e){let t=_.useContext(wd);return ku(t,dp(e)),t}function pp(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Wd(),d=Vd(),f=Yd(e,{relative:o});return _.useCallback(p=>{if(Af(p,t)){p.preventDefault();let t=n===void 0?Pu(d)===Pu(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?_.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function mp(e){Au(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(jf(e)),n=_.useRef(!1),r=Vd(),i=_.useMemo(()=>Mf(r.search,n.current?null:t.current),[r.search]),a=Wd();return[i,_.useCallback((e,t)=>{let r=jf(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var hp=0,gp=()=>`__${String(++hp)}__`;function _p(){let{router:e}=fp(`useSubmit`),{basename:t}=_.useContext(jd),n=df(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Lf(e,t);if(a.navigate===!1){let e=a.fetcherKey||gp();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function vp(e,{relative:t}={}){let{basename:n}=_.useContext(jd),r=_.useContext(Nd);ku(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Yd(e||`.`,{relative:t})},o=Vd();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:ud([n,a.pathname])),Pu(a)}function yp(e,{relative:t}={}){let n=_.useContext(Od);ku(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=fp(`useViewTransitionState`),i=Yd(e,{relative:t});if(!n.isTransitioning)return!1;let a=rd(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=rd(n.nextLocation.pathname,r)||n.nextLocation.pathname;return $u(i.pathname,o)!=null||$u(i.pathname,a)!=null}var bp=Symbol.for(`react.lazy`),xp=_.use;function Sp(e){return typeof e==`object`&&!!e&&`then`in e}function Cp(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===bp&&`_payload`in e&&Sp(e._payload)}function wp(e){let t=Ep(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e;Cp(r)&&typeof xp==`function`&&(r=xp(r._payload));let a=_.Children.toArray(r),o=a.find(Op);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var Tp=wp(`Slot`);function Ep(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(Cp(n)&&typeof xp==`function`&&(n=xp(n._payload)),_.isValidElement(n)){let e=Ap(n),i=kp(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Dp=Symbol(`radix.slottable`);function Op(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Dp}function kp(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 Ap(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 jp=768;function Mp(){let[e,t]=_.useState(void 0);return _.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<jp)};return e.addEventListener(`change`,n),t(window.innerWidth<jp),()=>e.removeEventListener(`change`,n)},[]),!!e}var Np=Wt(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-4 py-2`,sm:`h-9 rounded-md px-3`,lg:`h-11 rounded-md px-8`,icon:`h-10 w-10`}},defaultVariants:{variant:`default`,size:`default`}}),W=_.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,I.jsx)(r?Tp:`button`,{className:U(Np({variant:t,size:n,className:e})),ref:a,...i}));W.displayName=`Button`;var Pp=_.forwardRef(({className:e,type:t,...n},r)=>(0,I.jsx)(`input`,{type:t,className:U(`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:r,...n}));Pp.displayName=`Input`;var Fp=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=wp(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ip=`Separator`,Lp=`horizontal`,Rp=[`horizontal`,`vertical`],zp=_.forwardRef((e,t)=>{let{decorative:n,orientation:r=Lp,...i}=e,a=Bp(r)?r:Lp,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,I.jsx)(Fp.div,{"data-orientation":a,...o,...i,ref:t})});zp.displayName=Ip;function Bp(e){return Rp.includes(e)}var Vp=zp,Hp=_.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,I.jsx)(Vp,{ref:i,decorative:n,orientation:t,className:U(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...r}));Hp.displayName=Vp.displayName;var Up=`focusScope.autoFocusOnMount`,Wp=`focusScope.autoFocusOnUnmount`,Gp={bubbles:!1,cancelable:!0},Kp=`FocusScope`,qp=_.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=pe(i),u=pe(a),d=_.useRef(null),f=P(t,e=>c(e)),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Zp(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Zp(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Zp(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]),_.useEffect(()=>{if(s){Qp.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Up,Gp);s.addEventListener(Up,l),s.dispatchEvent(t),t.defaultPrevented||(Jp(tm(Yp(s)),{select:!0}),document.activeElement===e&&Zp(s))}return()=>{s.removeEventListener(Up,l),setTimeout(()=>{let t=new CustomEvent(Wp,Gp);s.addEventListener(Wp,u),s.dispatchEvent(t),t.defaultPrevented||Zp(e??document.body,{select:!0}),s.removeEventListener(Wp,u),Qp.remove(p)},0)}}},[s,l,u,p]);let m=_.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]=ree(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Zp(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Zp(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,I.jsx)(V.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});qp.displayName=Kp;function Jp(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Zp(r,{select:t}),document.activeElement!==n)return}function ree(e){let t=Yp(e);return[Xp(t,e),Xp(t.reverse(),e)]}function Yp(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 Xp(e,t){for(let n of e)if(!iee(n,{upTo:t}))return n}function iee(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 aee(e){return e instanceof HTMLInputElement&&`select`in e}function Zp(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&aee(e)&&t&&e.select()}}var Qp=$p();function $p(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=em(e,t),e.unshift(t)},remove(t){e=em(e,t),e[0]?.resume()}}}function em(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function tm(e){return e.filter(e=>e.tagName!==`A`)}var nm=0;function rm(){_.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??im()),document.body.insertAdjacentElement(`beforeend`,e[1]??im()),nm++,()=>{nm===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),nm--}},[])}function im(){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 am=function(){return am=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},am.apply(this,arguments)};function om(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 sm(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 cm=`right-scroll-bar-position`,lm=`width-before-scroll-bar`,oee=`with-scroll-bars-hidden`,um=`--removed-body-scroll-bar-size`;function dm(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function fm(e,t){var n=(0,_.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 pm=typeof window<`u`?_.useLayoutEffect:_.useEffect,mm=new WeakMap;function hm(e,t){var n=fm(t||null,function(t){return e.forEach(function(e){return dm(e,t)})});return pm(function(){var t=mm.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||dm(e,null)}),i.forEach(function(e){r.has(e)||dm(e,a)})}mm.set(n,e)},[e]),n}function gm(e){return e}function _m(e,t){t===void 0&&(t=gm);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 vm(e){e===void 0&&(e={});var t=_m(null);return t.options=am({async:!0,ssr:!1},e),t}var ym=function(e){var t=e.sideCar,n=om(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 _.createElement(r,am({},n))};ym.isSideCarExport=!0;function bm(e,t){return e.useMedium(t),ym}var xm=vm(),Sm=function(){},Cm=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:Sm,onWheelCapture:Sm,onTouchMoveCapture:Sm}),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,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=om(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=hm([n,t]),w=am(am({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:xm,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),am(am({},w),{ref:C})):_.createElement(y,am({},w,{className:c,ref:C}),s))});Cm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Cm.classNames={fullWidth:lm,zeroRight:cm};var wm=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Tm(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=wm();return t&&e.setAttribute(`nonce`,t),e}function Em(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Dm(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Om=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Tm())&&(Em(t,n),Dm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},km=function(){var e=Om();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Am=function(){var e=km();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},jm={left:0,top:0,right:0,gap:0},Mm=function(e){return parseInt(e||``,10)||0},Nm=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[Mm(n),Mm(r),Mm(i)]},Pm=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return jm;var t=Nm(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])}},Fm=Am(),Im=`data-scroll-locked`,Lm=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
12
+ .${oee} {
13
+ overflow: hidden ${r};
14
+ padding-right: ${s}px ${r};
15
+ }
16
+ body[${Im}] {
17
+ overflow: hidden ${r};
18
+ overscroll-behavior: contain;
19
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
20
+ padding-left: ${i}px;
21
+ padding-top: ${a}px;
22
+ padding-right: ${o}px;
23
+ margin-left:0;
24
+ margin-top:0;
25
+ margin-right: ${s}px ${r};
26
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
27
+ }
28
+
29
+ .${cm} {
30
+ right: ${s}px ${r};
31
+ }
32
+
33
+ .${lm} {
34
+ margin-right: ${s}px ${r};
35
+ }
36
+
37
+ .${cm} .${cm} {
38
+ right: 0 ${r};
39
+ }
40
+
41
+ .${lm} .${lm} {
42
+ margin-right: 0 ${r};
43
+ }
44
+
45
+ body[${Im}] {
46
+ ${um}: ${s}px;
47
+ }
48
+ `},Rm=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},zm=function(){_.useEffect(function(){return document.body.setAttribute(Im,(Rm()+1).toString()),function(){var e=Rm()-1;e<=0?document.body.removeAttribute(Im):document.body.setAttribute(Im,e.toString())}},[])},Bm=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;zm();var a=_.useMemo(function(){return Pm(i)},[i]);return _.createElement(Fm,{styles:Lm(a,!t,i,n?``:`!important`)})},Vm=!1;if(typeof window<`u`)try{var Hm=Object.defineProperty({},"passive",{get:function(){return Vm=!0,!0}});window.addEventListener(`test`,Hm,Hm),window.removeEventListener(`test`,Hm,Hm)}catch{Vm=!1}var Um=Vm?{passive:!1}:!1,Wm=function(e){return e.tagName===`TEXTAREA`},Gm=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Wm(e)&&n[t]===`visible`)},Km=function(e){return Gm(e,`overflowY`)},qm=function(e){return Gm(e,`overflowX`)},Jm=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Zm(e,r)){var i=Qm(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ym=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Xm=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Zm=function(e,t){return e===`v`?Km(t):qm(t)},Qm=function(e,t){return e===`v`?Ym(t):Xm(t)},see=function(e,t){return e===`h`&&t===`rtl`?-1:1},cee=function(e,t,n,r,i){var a=see(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=Qm(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Zm(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},$m=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eh=function(e){return[e.deltaX,e.deltaY]},th=function(e){return e&&`current`in e?e.current:e},lee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},nh=function(e){return`
49
+ .block-interactivity-${e} {pointer-events: none;}
50
+ .allow-interactivity-${e} {pointer-events: all;}
51
+ `},rh=0,ih=[];function ah(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(rh++)[0],a=_.useState(Am)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=sm([e.lockRef.current],(e.shards||[]).map(th),!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=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=$m(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=Jm(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Jm(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 cee(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(ih.length&&ih[ih.length-1]===a){var r=`deltaY`in n?eh(n):$m(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&lee(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(th).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=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:oh(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=$m(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,eh(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,$m(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return ih.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Um),document.addEventListener(`touchmove`,c,Um),document.addEventListener(`touchstart`,u,Um),function(){ih=ih.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Um),document.removeEventListener(`touchmove`,c,Um),document.removeEventListener(`touchstart`,u,Um)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:nh(i)}):null,p?_.createElement(Bm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function oh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var sh=bm(xm,ah),ch=_.forwardRef(function(e,t){return _.createElement(Cm,am({},e,{ref:t,sideCar:sh}))});ch.classNames=Cm.classNames;var lh=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},uh=new WeakMap,dh=new WeakMap,fh={},ph=0,mh=function(e){return e&&(e.host||mh(e.parentNode))},hh=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=mh(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})},gh=function(e,t,n,r){var i=hh(t,Array.isArray(e)?e:[e]);fh[n]||(fh[n]=new WeakMap);var a=fh[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=(uh.get(e)||0)+1,l=(a.get(e)||0)+1;uh.set(e,c),a.set(e,l),o.push(e),c===1&&i&&dh.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(),ph++,function(){o.forEach(function(e){var t=uh.get(e)-1,i=a.get(e)-1;uh.set(e,t),a.set(e,i),t||(dh.has(e)||e.removeAttribute(r),dh.delete(e)),i||e.removeAttribute(n)}),ph--,ph||(uh=new WeakMap,uh=new WeakMap,dh=new WeakMap,fh={})}},_h=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||lh(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),gh(r,i,n,`aria-hidden`)):function(){return null}};function vh(e){let t=yh(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(xh);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function yh(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=Ch(n),i=Sh(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bh=Symbol(`radix.slottable`);function xh(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===bh}function Sh(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 Ch(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 wh=`Dialog`,[Th,Eh]=L(wh),[Dh,Oh]=Th(wh),kh=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=Re({prop:r,defaultProp:i??!1,onChange:a,caller:wh});return(0,I.jsx)(Dh,{scope:t,triggerRef:s,contentRef:c,contentId:Pa(),titleId:Pa(),descriptionId:Pa(),open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};kh.displayName=wh;var Ah=`DialogTrigger`,jh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oh(Ah,n),a=P(t,i.triggerRef);return(0,I.jsx)(V.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Zh(i.open),...r,ref:a,onClick:j(e.onClick,i.onOpenToggle)})});jh.displayName=Ah;var Mh=`DialogPortal`,[Nh,Ph]=Th(Mh,{forceMount:void 0}),Fh=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Oh(Mh,t);return(0,I.jsx)(Nh,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,I.jsx)(H,{present:n||a.open,children:(0,I.jsx)(Me,{asChild:!0,container:i,children:e})}))})};Fh.displayName=Mh;var Ih=`DialogOverlay`,Lh=_.forwardRef((e,t)=>{let n=Ph(Ih,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Oh(Ih,e.__scopeDialog);return a.modal?(0,I.jsx)(H,{present:r||a.open,children:(0,I.jsx)(zh,{...i,ref:t})}):null});Lh.displayName=Ih;var Rh=vh(`DialogOverlay.RemoveScroll`),zh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oh(Ih,n);return(0,I.jsx)(ch,{as:Rh,allowPinchZoom:!0,shards:[i.contentRef],children:(0,I.jsx)(V.div,{"data-state":Zh(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Bh=`DialogContent`,Vh=_.forwardRef((e,t)=>{let n=Ph(Bh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Oh(Bh,e.__scopeDialog);return(0,I.jsx)(H,{present:r||a.open,children:a.modal?(0,I.jsx)(Hh,{...i,ref:t}):(0,I.jsx)(Uh,{...i,ref:t})})});Vh.displayName=Bh;var Hh=_.forwardRef((e,t)=>{let n=Oh(Bh,e.__scopeDialog),r=_.useRef(null),i=P(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return _h(e)},[]),(0,I.jsx)(Wh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:j(e.onFocusOutside,e=>e.preventDefault())})}),Uh=_.forwardRef((e,t)=>{let n=Oh(Bh,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,I.jsx)(Wh,{...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()}})}),Wh=_.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Oh(Bh,n),c=_.useRef(null),l=P(t,c);return rm(),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(qp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(xe,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Zh(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(tg,{titleId:s.titleId}),(0,I.jsx)(rg,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Gh=`DialogTitle`,Kh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oh(Gh,n);return(0,I.jsx)(V.h2,{id:i.titleId,...r,ref:t})});Kh.displayName=Gh;var qh=`DialogDescription`,Jh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oh(qh,n);return(0,I.jsx)(V.p,{id:i.descriptionId,...r,ref:t})});Jh.displayName=qh;var Yh=`DialogClose`,Xh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oh(Yh,n);return(0,I.jsx)(V.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,()=>i.onOpenChange(!1))})});Xh.displayName=Yh;function Zh(e){return e?`open`:`closed`}var Qh=`DialogTitleWarning`,[$h,eg]=ee(Qh,{contentName:Bh,titleName:Gh,docsSlug:`dialog`}),tg=({titleId:e})=>{let t=eg(Qh),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
52
+
53
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
54
+
55
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return _.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ng=`DialogDescriptionWarning`,rg=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${eg(ng).contentName}}.`;return _.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},ig=kh,ag=jh,og=Fh,sg=Lh,cg=Vh,lg=Kh,ug=Jh,dg=Xh,fg=ig,pg=og,mg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(sg,{className:U(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));mg.displayName=sg.displayName;var hg=Wt(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),gg=_.forwardRef(({side:e=`right`,className:t,children:n,...r},i)=>(0,I.jsxs)(pg,{children:[(0,I.jsx)(mg,{}),(0,I.jsxs)(cg,{ref:i,className:U(hg({side:e}),t),...r,children:[n,(0,I.jsxs)(dg,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none`,children:[(0,I.jsx)(dr,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));gg.displayName=cg.displayName;var _g=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});_g.displayName=`SheetHeader`;var vg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(lg,{ref:n,className:U(`text-lg font-semibold text-foreground`,e),...t}));vg.displayName=lg.displayName;var yg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(ug,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));yg.displayName=ug.displayName;function bg({className:e,...t}){return(0,I.jsx)(`div`,{className:U(`animate-pulse rounded-md bg-muted`,e),...t})}var xg=`sidebar:state`,Sg=604800,Cg=`16rem`,wg=`18rem`,Tg=`3rem`,Eg=`b`,Dg=_.createContext(null);function Og(){let e=_.useContext(Dg);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var kg=_.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o},s)=>{let c=Mp(),[l,u]=_.useState(!1),[d,f]=_.useState(e),p=t??d,m=_.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`${xg}=${t}; path=/; max-age=${Sg}`},[n,p]),h=_.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);_.useEffect(()=>{let e=e=>{e.key===Eg&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,v=_.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,u,h]);return(0,I.jsx)(Dg.Provider,{value:v,children:(0,I.jsx)(fl,{delayDuration:0,children:(0,I.jsx)(`div`,{style:{"--sidebar-width":Cg,"--sidebar-width-icon":Tg,...i},className:U(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),ref:s,...o,children:a})})})});kg.displayName=`SidebarProvider`;var Ag=_.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},o)=>{let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=Og();return n===`none`?(0,I.jsx)(`div`,{className:U(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),ref:o,...a,children:i}):s?(0,I.jsx)(fg,{open:l,onOpenChange:u,...a,children:(0,I.jsx)(gg,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":wg},side:e,children:(0,I.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})})}):(0,I.jsxs)(`div`,{ref:o,className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,children:[(0,I.jsx)(`div`,{className:U(`relative h-svh w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,I.jsx)(`div`,{className:U(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:-left-(--sidebar-width)`:`right-0 group-data-[collapsible=offcanvas]:-right-(--sidebar-width)`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,I.jsx)(`div`,{"data-sidebar":`sidebar`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm`,children:i})})]})});Ag.displayName=`Sidebar`;var jg=_.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=Og();return(0,I.jsxs)(W,{ref:r,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:U(`h-7 w-7`,e),onClick:e=>{t?.(e),i()},...n,children:[(0,I.jsx)(Vn,{}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})});jg.displayName=`SidebarTrigger`;var Mg=_.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=Og();return(0,I.jsx)(`button`,{ref:n,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:r,title:`Toggle Sidebar`,className:U(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})});Mg.displayName=`SidebarRail`;var Ng=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`main`,{ref:n,className:U(`relative flex min-h-svh flex-1 flex-col bg-background`,`peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm`,e),...t}));Ng.displayName=`SidebarInset`;var Pg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Pp,{ref:n,"data-sidebar":`input`,className:U(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,e),...t}));Pg.displayName=`SidebarInput`;var Fg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:U(`flex flex-col gap-2 p-2`,e),...t}));Fg.displayName=`SidebarHeader`;var Ig=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:U(`flex flex-col gap-2 p-2`,e),...t}));Ig.displayName=`SidebarFooter`;var Lg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Hp,{ref:n,"data-sidebar":`separator`,className:U(`mx-2 w-auto bg-sidebar-border`,e),...t}));Lg.displayName=`SidebarSeparator`;var Rg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:U(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t}));Rg.displayName=`SidebarContent`;var zg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`group`,className:U(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));zg.displayName=`SidebarGroup`;var Bg=_.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,I.jsx)(t?Tp:`div`,{ref:r,"data-sidebar":`group-label`,className:U(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...n}));Bg.displayName=`SidebarGroupLabel`;var Vg=_.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,I.jsx)(t?Tp:`button`,{ref:r,"data-sidebar":`group-action`,className:U(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n}));Vg.displayName=`SidebarGroupAction`;var Hg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:U(`w-full text-sm`,e),...t}));Hg.displayName=`SidebarGroupContent`;var Ug=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:U(`flex w-full min-w-0 flex-col gap-1`,e),...t}));Ug.displayName=`SidebarMenu`;var Wg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:U(`group/menu-item relative`,e),...t}));Wg.displayName=`SidebarMenuItem`;var Gg=Wt(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}}),Kg=_.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o},s)=>{let c=e?Tp:`button`,{isMobile:l,state:u}=Og(),d=(0,I.jsx)(c,{ref:s,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:U(Gg({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:d}),(0,I.jsx)(hl,{side:`right`,align:`center`,hidden:u!==`collapsed`||l,...i})]})):d});Kg.displayName=`SidebarMenuButton`;var qg=_.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,I.jsx)(t?Tp:`button`,{ref:i,"data-sidebar":`menu-action`,className:U(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,e),...r}));qg.displayName=`SidebarMenuAction`;var Jg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`menu-badge`,className:U(`pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,e),...t}));Jg.displayName=`SidebarMenuBadge`;var Yg=_.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{let i=_.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,I.jsxs)(`div`,{ref:r,"data-sidebar":`menu-skeleton`,className:U(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,I.jsx)(bg,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,I.jsx)(bg,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});Yg.displayName=`SidebarMenuSkeleton`;var Xg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:U(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t}));Xg.displayName=`SidebarMenuSub`;var Zg=_.forwardRef(({...e},t)=>(0,I.jsx)(`li`,{ref:t,...e}));Zg.displayName=`SidebarMenuSubItem`;var Qg=_.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,I.jsx)(e?Tp:`a`,{ref:a,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:U(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,r),...i}));Qg.displayName=`SidebarMenuSubButton`;var $g=(0,_.forwardRef)(({className:e,activeClassName:t,pendingClassName:n,to:r,...i},a)=>(0,I.jsx)(lp,{ref:a,to:r,className:({isActive:r,isPending:i})=>U(e,r&&t,i&&n),...i}));$g.displayName=`NavLink`;function e_({width:e=24,height:t=24,from:n=`#53afba`,to:r=`#76fffb`,...i}){let a=`grad-${(0,_.useId)().slice(1)}`;return(0,I.jsxs)(`svg`,{className:`inline-block`,width:e,height:t,viewBox:`0 0 1648 1648`,xmlns:`http://www.w3.org/2000/svg`,...i,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:a,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,children:[(0,I.jsx)(`stop`,{offset:`0%`,style:{stopColor:n}}),(0,I.jsx)(`stop`,{offset:`100%`,style:{stopColor:r}})]})}),(0,I.jsx)(`path`,{d:`m610 216.654c-66.158 4.092-126.119 35.849-164.917 87.346-8.408 11.16-13.344 19.191-19.983 32.513-12.431 24.946-19.521 50.434-22.11 79.487-1.665 18.687-.854 826.238.841 837.939 7.867 54.284 32.465 101.134 70.706 134.667 16.297 14.291 32.283 24.657 53.963 34.991 16.889 8.05 34.568 13.468 60.5 18.541 9.019 1.764 52.201 1.795 61.5.044 26.487-4.989 43.97-10.341 61-18.675 15.131-7.406 21.53-11.135 60.5-35.267 20.813-12.887 23.095-14.298 29.5-18.24l13-8 13-8c6.901-4.247 12.593-7.767 29.54-18.271 5.796-3.593 12.771-7.863 15.5-9.49 2.728-1.626 8.56-5.19 12.96-7.921 4.4-2.73 72.575-44.711 151.5-93.29s150.925-92.918 160-98.531c9.075-5.612 24.15-14.936 33.5-20.719s23.075-14.234 30.5-18.78c85.169-52.142 120.029-73.942 130.014-81.304 40.974-30.211 68.344-69.764 81.788-118.194 13.864-49.94 8.549-104.847-14.809-153-16.836-34.708-41.252-62.432-74.993-85.154-4.125-2.778-17.625-11.26-30-18.849s-27-16.594-32.5-20.009c-5.5-3.416-109.45-67.427-231-142.246-306.386-188.593-335.221-206.352-350-215.553-30.562-19.028-59.301-29.911-90-34.083-11.697-1.59-30.408-2.514-39.5-1.952m-10.5 77.269c-39.541 6.402-76.013 29.73-97.661 62.467-13.001 19.66-19.718 38.39-22.802 63.584-1.472 12.028-1.434 802.191.04 818.026 1.861 19.998 6.142 35.48 14.415 52.133 17.942 36.114 53.025 64.18 91.508 73.203 3.575.839 8.975 2.118 12 2.844 8.221 1.973 40.343 1.613 49.971-.56 32.301-7.289 65.233-26.686 94.817-55.849 15.26-15.042 22.884-24.803 33.571-42.979 13.939-23.706 20.949-43.36 27.745-77.792 1.004-5.086 1.428-50 1.949-206.5.465-139.686 1.001-201.809 1.777-206 .611-3.3 1.608-9.15 2.217-13 1.672-10.583 4.039-21.117 7.191-32 8.179-28.247 20.714-55.13 37.188-79.751 24.262-36.262 53.189-63.572 93.074-87.872 4.95-3.016 12.825-7.435 17.5-9.82s8.95-4.668 9.5-5.074c3.565-2.63 34.688-13.266 52.465-17.93 6.2-1.627 11.49-3.174 11.754-3.439 1.003-1.002-1.016-2.602-10.967-8.689-5.639-3.449-16.552-10.172-24.252-14.94-13.435-8.319-31.76-19.604-58.5-36.029-6.875-4.222-16.1-9.911-20.5-12.641-7.667-4.758-73.088-45.103-122.5-75.546-75.227-46.348-108.509-66.591-116.5-70.86-9.422-5.033-25.23-10.76-37.043-13.419-7.967-1.794-40.076-2.843-47.957-1.567m473.5 305.564c-5.775.685-11.625 1.491-13 1.792-1.375.3-5.2 1.088-8.5 1.749-7.914 1.587-27.103 7.461-36.5 11.174-38.797 15.33-75.171 44.925-98.829 80.41-11.24 16.86-21.329 38.407-26.167 55.888-2.443 8.825-3.85 14.608-4.866 20-.621 3.3-1.653 8.475-2.292 11.5-.846 4.008-1.345 59.624-1.837 205-.618 182.331-.824 200.361-2.399 209.5-1.629 9.459-4.196 22.506-6.744 34.279-.628 2.903-.881 5.54-.561 5.859.596.596 455.986-279.084 472.195-290.001 17.547-11.819 36.335-33.412 46.291-53.203 3.956-7.863 9.527-23.924 11.597-33.434 4.848-22.272 3.572-48.26-3.506-71.387-6.907-22.572-18.055-40.93-35.316-58.158-12.705-12.681-16.829-15.485-79.066-53.756-7.15-4.397-15.7-9.654-19-11.684-3.3-2.029-8.925-5.504-12.5-7.722-53.826-33.397-67.199-40.611-88.616-47.8-29.343-9.85-61.599-13.421-90.384-10.006m-1066.25 1048.256c3.988.189 10.513.189 14.5 0 3.988-.19.725-.346-7.25-.346s-11.238.156-7.25.346`,fill:`url(#${a})`,fillRule:`evenodd`})]})}function t_(e){return(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,...e})}var n_=[{title:`Home`,items:[{title:`Dashboard`,url:`/`,icon:Mn}]},{title:`Lab`,items:[{title:`MCP Evaluations`,url:`/mcp-evaluations`,icon:Tn},{title:`Analyze MCP`,url:`/tool-analysis`,icon:Ln},{title:`OAuth Debugger`,url:`/oauth-debugger`,icon:er}]},{title:`Libraries`,items:[{title:`Test Cases`,url:`/libraries/test-cases`,icon:Sn},{title:`MCP servers`,url:`/libraries/servers`,icon:t_},{title:`Agents`,url:`/libraries/agents`,icon:$t}]},{title:`Execution`,items:[{title:`Run Evaluation`,url:`/run`,icon:Kn},{title:`Evaluation Results`,url:`/results`,icon:tn},{title:`Compare Evaluations`,url:`/compare`,icon:Dn},{title:`MCP Analysis Results`,url:`/tool-analysis-results`,icon:zn},{title:`Custom Reports`,url:`/markdown-reports`,icon:Bn}]},{title:`Workspace`,items:[{title:`Settings`,url:`/settings`,icon:$n},{title:`MCPLab MCP server`,url:`/settings/mcp`,icon:Pn}]}];function r_(e={version:null}){let t=e.version??null,{state:n}=Og(),r=n===`collapsed`,i=Vd(),a=(0,_.useMemo)(()=>n_,[]);return(0,I.jsxs)(Ag,{collapsible:`icon`,children:[(0,I.jsx)(Fg,{className:`border-b border-sidebar-border py-3 ${r?`px-2`:`px-4`}`,children:(0,I.jsxs)(`div`,{className:`flex items-center ${r?`justify-center overflow-visible`:`gap-2.5 overflow-hidden`}`,children:[(0,I.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-sidebar-accent/50 border border-primary/60`,children:(0,I.jsx)(e_,{width:22,height:22,from:`#f97316`,to:`#fb923c`})}),!r&&(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[(0,I.jsx)(`span`,{className:`text-sm font-semibold text-sidebar-foreground`,children:`MCPLab`}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`MCP Evaluation Lab`})]})]})}),(0,I.jsx)(Rg,{children:a.map((e,t)=>(0,I.jsxs)(`div`,{children:[t>0&&!r&&(0,I.jsx)(Lg,{className:`my-1.5`}),(0,I.jsxs)(zg,{className:r?`px-2`:`px-3 py-2`,children:[!r&&(0,I.jsx)(Bg,{className:`px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90`,children:e.title}),(0,I.jsx)(Hg,{children:(0,I.jsx)(Ug,{children:e.items.map(e=>(0,I.jsx)(Wg,{children:(0,I.jsx)(Kg,{asChild:!0,isActive:e.url===`/`?i.pathname===`/`:e.url===`/settings`?i.pathname===`/settings`:i.pathname.startsWith(e.url),tooltip:e.title,children:(0,I.jsxs)($g,{to:e.url,end:e.url===`/`||e.url===`/settings`,activeClassName:`bg-sidebar-accent text-sidebar-accent-foreground`,children:[(0,I.jsx)(e.icon,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{children:e.title})]})})},e.title))})})]})]},e.title))}),(0,I.jsxs)(Ig,{className:r?`px-2 py-2`:`px-3 py-3`,children:[(0,I.jsx)(Lg,{className:`my-1.5`}),(0,I.jsxs)(`div`,{className:`flex ${r?`justify-center`:`items-center justify-center gap-2`} w-full`,children:[(0,I.jsxs)(`a`,{href:`https://github.com/inspectr-hq/mcplab`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center rounded-md border border-sidebar-border/70 bg-sidebar-accent/20 text-sidebar-foreground/85 transition-colors hover:bg-sidebar-accent/35 hover:text-sidebar-foreground ${r?`justify-center p-2`:`gap-2 px-2.5 py-1.5`}`,title:`GitHub${t?` · v${t}`:``}`,"aria-label":`GitHub repository`,children:[(0,I.jsx)(On,{className:`h-4 w-4 shrink-0`}),!r&&(0,I.jsx)(`span`,{className:`text-xs text-sidebar-foreground/85`,children:`v${t??`unknown`}`})]}),!r&&(0,I.jsxs)(`a`,{href:`https://inspectr.dev`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-muted-foreground transition-colors hover:text-sidebar-foreground`,children:[`Built by `,(0,I.jsx)(`span`,{className:`text-[#00e5ff] hover:text-[#00b8d4]`,children:`Inspectr`})]})]})]})]})}function i_({label:e=`Queue processing`}){return(0,I.jsx)(`span`,{role:`img`,"aria-label":e,className:`inline-block h-3 w-3 shrink-0 animate-spin rounded-full border-2 border-emerald-500 border-t-transparent motion-reduce:animate-none`})}var a_=_.forwardRef(({...e},t)=>(0,I.jsx)(`nav`,{ref:t,"aria-label":`breadcrumb`,...e}));a_.displayName=`Breadcrumb`;var o_=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`ol`,{ref:n,className:U(`flex flex-wrap items-center gap-1.5 wrap-break-word text-sm text-muted-foreground sm:gap-2.5`,e),...t}));o_.displayName=`BreadcrumbList`;var s_=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`li`,{ref:n,className:U(`inline-flex items-center gap-1.5`,e),...t}));s_.displayName=`BreadcrumbItem`;var c_=_.forwardRef(({asChild:e,className:t,...n},r)=>(0,I.jsx)(e?Tp:`a`,{ref:r,className:U(`transition-colors hover:text-foreground`,t),...n}));c_.displayName=`BreadcrumbLink`;var l_=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`span`,{ref:n,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:U(`font-normal text-foreground`,e),...t}));l_.displayName=`BreadcrumbPage`;var u_=({children:e,className:t,...n})=>(0,I.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:U(`[&>svg]:size-3.5`,t),...n,children:e??(0,I.jsx)(an,{})});u_.displayName=`BreadcrumbSeparator`;function d_(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function f_(e,t){t&&(typeof t.inputTokens==`number`&&(e.input+=t.inputTokens,e.hasInput=!0),typeof t.outputTokens==`number`&&(e.output+=t.outputTokens,e.hasOutput=!0),typeof t.totalTokens==`number`&&(e.total+=t.totalTokens,e.hasTotal=!0))}function p_(e){return!e.hasInput&&!e.hasOutput&&!e.hasTotal?null:{inputTokens:e.hasInput?e.input:null,outputTokens:e.hasOutput?e.output:null,totalTokens:e.hasTotal?e.total:null}}function m_(e){let t=d_();for(let n of e)f_(t,n);return p_(t)}var h_={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,pdf:`application/pdf`,txt:`text/plain`,md:`text/markdown`,csv:`text/csv`};function g_(e){return e.startsWith(`image/`)?`image`:`document`}function __(e){return e?.split(`.`).pop()?.toLowerCase()??``}function v_(e){if(e.media_type)return e.media_type;if(e.path)return h_[__(e.path)]}function y_(e){let t={passed:0,failed:0,not_evaluated:0,not_executed:0,total:0};for(let n of e){if(n.status===`passed`)t.passed+=1;else if(n.status===`failed`)t.failed+=1;else if(n.status===`not_evaluated`||n.status===`not_applicable`)t.not_evaluated+=1;else if(n.status===`not_executed`)t.not_executed=(t.not_executed??0)+1;else continue;t.total+=1}return t}var b_=class{add(e,t,n){if(typeof arguments[0]!=`string`)for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?`unshift`:`push`](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},x_=class{constructor(e){this.jsep=e,this.registered={}}register(){[...arguments].forEach(e=>{if(typeof e!=`object`||!e.name||!e.init)throw Error(`Invalid JSEP plugin format`);this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}},S_=class e{static get version(){return`1.4.0`}static toString(){return`JavaScript Expression Parser (JSEP) v`+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,r){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,r?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(e){let t=Error(e+` at character `+this.index);throw t.index=this.index,t.description=e,t}runHook(t,n){if(e.hooks[t]){let r={context:this,node:n};return e.hooks.run(t,r),r.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(e){return e.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook(`gobble-spaces`)}parse(){this.runHook(`before-all`);let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook(`after-all`,n)}gobbleExpressions(t){let n=[],r,i;for(;this.index<this.expr.length;)if(r=this.code,r===e.SEMCOL_CODE||r===e.COMMA_CODE)this.index++;else if(i=this.gobbleExpression())n.push(i);else if(this.index<this.expr.length){if(r===t)break;this.throwError(`Unexpected "`+this.char+`"`)}return n}gobbleExpression(){let e=this.searchHook(`gobble-expression`)||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook(`after-expression`,e)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,r,i,a,o,s,c,l;if(o=this.gobbleToken(),!o||(n=this.gobbleBinaryOp(),!n))return o;for(a={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},s=this.gobbleToken(),s||this.throwError(`Expected expression after `+n),i=[o,a,s];n=this.gobbleBinaryOp();){if(r=e.binaryPrecedence(n),r===0){this.index-=n.length;break}a={value:n,prec:r,right_a:e.right_associative.has(n)},l=n;let c=e=>a.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;i.length>2&&c(i[i.length-2]);)s=i.pop(),n=i.pop().value,o=i.pop(),t={type:e.BINARY_EXP,operator:n,left:o,right:s},i.push(t);t=this.gobbleToken(),t||this.throwError(`Expected expression after `+l),i.push(a,t)}for(c=i.length-1,t=i[c];c>1;)t={type:e.BINARY_EXP,operator:i[c-1].value,left:i[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,r,i;if(this.gobbleSpaces(),i=this.searchHook(`gobble-token`),i)return this.runHook(`after-token`,i);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)i=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),r=n.length;r>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=r;let t=this.gobbleToken();return t||this.throwError(`missing unaryOp argument`),this.runHook(`after-token`,{type:e.UNARY_EXP,operator:n,argument:t,prefix:!0})}n=n.substr(0,--r)}e.isIdentifierStart(t)?(i=this.gobbleIdentifier(),e.literals.hasOwnProperty(i.name)?i={type:e.LITERAL,value:e.literals[i.name],raw:i.name}:i.name===e.this_str&&(i={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook(`after-token`,i)):this.runHook(`after-token`,!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let r;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError(`Unexpected "`+this.char+`"`),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError(`Unclosed [`),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),r&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t=``,n,r;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n===`e`||n===`E`){for(t+=this.expr.charAt(this.index++),n=this.char,(n===`+`||n===`-`)&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError(`Expected exponent (`+t+this.char+`)`)}return r=this.code,e.isIdentifierStart(r)?this.throwError(`Variable names cannot start with a number (`+t+this.char+`)`):(r===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError(`Unexpected period`),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t=``,n=this.index,r=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let e=this.expr.charAt(this.index++);if(e===r){i=!0;break}if(e===`\\`)switch(e=this.expr.charAt(this.index++),e){case`n`:t+=`
56
+ `;break;case`r`:t+=`\r`;break;case`t`:t+=` `;break;case`b`:t+=`\b`;break;case`f`:t+=`\f`;break;case`v`:t+=`\v`;break;default:t+=e}else t+=e}return i||this.throwError(`Unclosed quote after "`+t+`"`),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError(`Unexpected `+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],r=!1,i=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let a=this.code;if(a===t){r=!0,this.index++,t===e.CPAREN_CODE&&i&&i>=n.length&&this.throwError(`Unexpected token `+String.fromCharCode(t));break}if(a===e.COMMA_CODE){if(this.index++,i++,i!==n.length){if(t===e.CPAREN_CODE)this.throwError(`Unexpected token ,`);else if(t===e.CBRACK_CODE)for(let e=n.length;e<i;e++)n.push(null)}}else if(n.length!==i&&i!==0)this.throwError(`Expected comma`);else{let t=this.gobbleExpression();(!t||t.type===e.COMPOUND)&&this.throwError(`Expected comma`),n.push(t)}}return r||this.throwError(`Expected `+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError(`Unclosed (`)}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},C_=new b_;Object.assign(S_,{hooks:C_,plugins:new x_(S_),COMPOUND:`Compound`,SEQUENCE_EXP:`SequenceExpression`,IDENTIFIER:`Identifier`,MEMBER_EXP:`MemberExpression`,LITERAL:`Literal`,THIS_EXP:`ThisExpression`,CALL_EXP:`CallExpression`,UNARY_EXP:`UnaryExpression`,BINARY_EXP:`BinaryExpression`,ARRAY_EXP:`ArrayExpression`,TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set([`**`]),additional_identifier_chars:new Set([`$`,`_`]),literals:{true:!0,false:!1,null:null},this_str:`this`}),S_.max_unop_len=S_.getMaxKeyLen(S_.unary_ops),S_.max_binop_len=S_.getMaxKeyLen(S_.binary_ops);var w_=e=>new S_(e).parse(),T_=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(S_).filter(e=>!T_.includes(e)&&w_[e]===void 0).forEach(e=>{w_[e]=S_[e]}),w_.Jsep=S_;var uee=`ConditionalExpression`;w_.plugins.register({name:`ternary`,init(e){e.hooks.add(`after-expression`,function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,r=this.gobbleExpression();if(r||this.throwError(`Expected expression`),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError(`Expected expression`),t.node={type:uee,test:n,consequent:r,alternate:i},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError(`Expected :`)}})}});var E_=47,dee=92,fee={name:`regex`,init(e){e.hooks.add(`gobble-token`,function(t){if(this.code===E_){let n=++this.index,r=!1;for(;this.index<this.expr.length;){if(this.code===E_&&!r){let r=this.expr.slice(n,this.index),i=``;for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)i+=this.char;else break}let a;try{a=new RegExp(r,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:a,raw:this.expr.slice(n-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?r=!0:r&&this.code===e.CBRACK_CODE&&(r=!1),this.index+=this.code===dee?2:1}this.throwError(`Unclosed Regex`)}})}},D_=43,O_={name:`assignment`,assignmentOperators:new Set([`=`,`*=`,`**=`,`/=`,`%=`,`+=`,`-=`,`<<=`,`>>=`,`>>>=`,`&=`,`^=`,`|=`,`||=`,`&&=`,`??=`]),updateOperators:[D_,45],assignmentPrecedence:.9,init(e){let t=[e.IDENTIFIER,e.MEMBER_EXP];O_.assignmentOperators.forEach(t=>e.addBinaryOp(t,O_.assignmentPrecedence,!0)),e.hooks.add(`gobble-token`,function(e){let n=this.code;O_.updateOperators.some(e=>e===n&&e===this.expr.charCodeAt(this.index+1))&&(this.index+=2,e.node={type:`UpdateExpression`,operator:n===D_?`++`:`--`,argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!e.node.argument||!t.includes(e.node.argument.type))&&this.throwError(`Unexpected ${e.node.operator}`))}),e.hooks.add(`after-token`,function(e){if(e.node){let n=this.code;O_.updateOperators.some(e=>e===n&&e===this.expr.charCodeAt(this.index+1))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:`UpdateExpression`,operator:n===D_?`++`:`--`,argument:e.node,prefix:!1})}}),e.hooks.add(`after-expression`,function(e){e.node&&n(e.node)});function n(e){O_.assignmentOperators.has(e.operator)?(e.type=`AssignmentExpression`,n(e.left),n(e.right)):e.operator||Object.values(e).forEach(e=>{e&&typeof e==`object`&&n(e)})}}};w_.plugins.register(fee,O_),w_.addUnaryOp(`typeof`),w_.addUnaryOp(`void`),w_.addLiteral(`null`,null),w_.addLiteral(`undefined`,void 0);var pee=new Set([`constructor`,`__proto__`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`]),k_={evalAst(e,t){switch(e.type){case`BinaryExpression`:case`LogicalExpression`:return k_.evalBinaryExpression(e,t);case`Compound`:return k_.evalCompound(e,t);case`ConditionalExpression`:return k_.evalConditionalExpression(e,t);case`Identifier`:return k_.evalIdentifier(e,t);case`Literal`:return k_.evalLiteral(e,t);case`MemberExpression`:return k_.evalMemberExpression(e,t);case`UnaryExpression`:return k_.evalUnaryExpression(e,t);case`ArrayExpression`:return k_.evalArrayExpression(e,t);case`CallExpression`:return k_.evalCallExpression(e,t);case`AssignmentExpression`:return k_.evalAssignmentExpression(e,t);default:throw SyntaxError(`Unexpected expression`,e)}},evalBinaryExpression(e,t){return{"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e<t(),">":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<<t(),">>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](k_.evalAst(e.left,t),()=>k_.evalAst(e.right,t))},evalCompound(e,t){let n;for(let r=0;r<e.body.length;r++){e.body[r].type===`Identifier`&&[`var`,`let`,`const`].includes(e.body[r].name)&&e.body[r+1]&&e.body[r+1].type===`AssignmentExpression`&&(r+=1);let i=e.body[r];n=k_.evalAst(i,t)}return n},evalConditionalExpression(e,t){return k_.evalAst(e.test,t)?k_.evalAst(e.consequent,t):k_.evalAst(e.alternate,t)},evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral(e){return e.value},evalMemberExpression(e,t){let n=String(e.computed?k_.evalAst(e.property):e.property.name),r=k_.evalAst(e.object,t);if(r==null||!Object.hasOwn(r,n)&&pee.has(n))throw TypeError(`Cannot read properties of ${r} (reading '${n}')`);let i=r[n];return typeof i==`function`?i.bind(r):i},evalUnaryExpression(e,t){return{"-":e=>-k_.evalAst(e,t),"!":e=>!k_.evalAst(e,t),"~":e=>~k_.evalAst(e,t),"+":e=>+k_.evalAst(e,t),typeof:e=>typeof k_.evalAst(e,t),void:e=>void k_.evalAst(e,t)}[e.operator](e.argument)},evalArrayExpression(e,t){return e.elements.map(e=>k_.evalAst(e,t))},evalCallExpression(e,t){let n=e.arguments.map(e=>k_.evalAst(e,t)),r=k_.evalAst(e.callee,t);if(r===Function)throw Error(`Function constructor is disabled`);return r(...n)},evalAssignmentExpression(e,t){if(e.left.type!==`Identifier`)throw SyntaxError(`Invalid left-hand side in assignment`);let n=e.left.name;return t[n]=k_.evalAst(e.right,t),t[n]}},A_=class{constructor(e){this.code=e,this.ast=w_(this.code)}runInNewContext(e){let t=Object.assign(Object.create(null),e);return k_.evalAst(this.ast,t)}};function j_(e,t){return e=e.slice(),e.push(t),e}function M_(e,t){return t=t.slice(),t.unshift(e),t}var N_=class extends Error{constructor(e){super(`JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)`),this.avoidNew=!0,this.value=e,this.name=`NewError`}};function P_(e,t,n,r,i){if(!(this instanceof P_))try{return new P_(e,t,n,r,i)}catch(e){if(!e.avoidNew)throw e;return e.value}typeof e==`string`&&(i=r,r=n,n=t,t=e,e=null);let a=e&&typeof e==`object`;if(e||={},this.json=e.json||n,this.path=e.path||t,this.resultType=e.resultType||`value`,this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,`wrap`)||e.wrap,this.sandbox=e.sandbox||{},this.eval=e.eval===void 0?`safe`:e.eval,this.ignoreEvalErrors=e.ignoreEvalErrors!==void 0&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||r||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw TypeError(`You must supply an otherTypeCallback callback option with the @other() operator.`)},e.autostart!==!1){let r={path:a?e.path:t};a?`json`in e&&(r.json=e.json):r.json=n;let i=this.evaluate(r);if(!i||typeof i!=`object`)throw new N_(i);return i}}P_.prototype.evaluate=function(e,t,n,r){let i=this.parent,a=this.parentProperty,{flatten:o,wrap:s}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,n||=this.callback,this.currOtherTypeCallback=r||this.otherTypeCallback,t||=this.json,e||=this.path,e&&typeof e==`object`&&!Array.isArray(e)){if(!e.path&&e.path!==``)throw TypeError(`You must supply a "path" property when providing an object argument to JSONPath.evaluate().`);if(!Object.hasOwn(e,`json`))throw TypeError(`You must supply a "json" property when providing an object argument to JSONPath.evaluate().`);({json:t}=e),o=Object.hasOwn(e,`flatten`)?e.flatten:o,this.currResultType=Object.hasOwn(e,`resultType`)?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,`sandbox`)?e.sandbox:this.currSandbox,s=Object.hasOwn(e,`wrap`)?e.wrap:s,this.currEval=Object.hasOwn(e,`eval`)?e.eval:this.currEval,n=Object.hasOwn(e,`callback`)?e.callback:n,this.currOtherTypeCallback=Object.hasOwn(e,`otherTypeCallback`)?e.otherTypeCallback:this.currOtherTypeCallback,i=Object.hasOwn(e,`parent`)?e.parent:i,a=Object.hasOwn(e,`parentProperty`)?e.parentProperty:a,e=e.path}if(i||=null,a||=null,Array.isArray(e)&&(e=P_.toPathString(e)),!e&&e!==``||!t)return;let c=P_.toPathArray(e);c[0]===`$`&&c.length>1&&c.shift(),this._hasParentSelector=null;let l=this._trace(c,t,[`$`],i,a,n).filter(function(e){return e&&!e.isParentSelector});return l.length?!s&&l.length===1&&!l[0].hasArrExpr?this._getPreferredOutput(l[0]):l.reduce((e,t)=>{let n=this._getPreferredOutput(t);return o&&Array.isArray(n)?e=e.concat(n):e.push(n),e},[]):s?[]:void 0},P_.prototype._getPreferredOutput=function(e){let t=this.currResultType;switch(t){case`all`:{let t=Array.isArray(e.path)?e.path:P_.toPathArray(e.path);return e.pointer=P_.toPointer(t),e.path=typeof e.path==`string`?e.path:P_.toPathString(e.path),e}case`value`:case`parent`:case`parentProperty`:return e[t];case`path`:return P_.toPathString(e[t]);case`pointer`:return P_.toPointer(e.path);default:throw TypeError(`Unknown result type`)}},P_.prototype._handleCallback=function(e,t,n){if(t){let r=this._getPreferredOutput(e);e.path=typeof e.path==`string`?e.path:P_.toPathString(e.path),t(r,n,e)}},P_.prototype._trace=function(e,t,n,r,i,a,o,s){let c;if(!e.length)return c={path:n,value:t,parent:r,parentProperty:i,hasArrExpr:o},this._handleCallback(c,a,`value`),c;let l=e[0],u=e.slice(1),d=[];function f(e){Array.isArray(e)?e.forEach(e=>{d.push(e)}):d.push(e)}if((typeof l!=`string`||s)&&t&&Object.hasOwn(t,l))f(this._trace(u,t[l],j_(n,l),t,l,a,o));else if(l===`*`)this._walk(t,e=>{f(this._trace(u,t[e],j_(n,e),t,e,a,!0,!0))});else if(l===`..`)f(this._trace(u,t,n,r,i,a,o)),this._walk(t,r=>{typeof t[r]==`object`&&f(this._trace(e.slice(),t[r],j_(n,r),t,r,a,!0))});else if(l===`^`)return this._hasParentSelector=!0,{path:n.slice(0,-1),expr:u,isParentSelector:!0};else if(l===`~`)return c={path:j_(n,l),value:i,parent:r,parentProperty:null},this._handleCallback(c,a,`property`),c;else if(l===`$`)f(this._trace(u,t,n,null,null,a,o));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))f(this._slice(l,u,t,n,r,i,a));else if(l.indexOf(`?(`)===0){if(this.currEval===!1)throw Error(`Eval [?(expr)] prevented in JSONPath expression.`);let e=l.replace(/^\?\((.*?)\)$/u,`$1`),o=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);o?this._walk(t,e=>{let s=[o[2]],c=o[1]?t[e][o[1]]:t[e];this._trace(s,c,n,r,i,a,!0).length>0&&f(this._trace(u,t[e],j_(n,e),t,e,a,!0))}):this._walk(t,o=>{this._eval(e,t[o],o,n,r,i)&&f(this._trace(u,t[o],j_(n,o),t,o,a,!0))})}else if(l[0]===`(`){if(this.currEval===!1)throw Error(`Eval [(expr)] prevented in JSONPath expression.`);f(this._trace(M_(this._eval(l,t,n.at(-1),n.slice(0,-1),r,i),u),t,n,r,i,a,o))}else if(l[0]===`@`){let e=!1,o=l.slice(1,-2);switch(o){case`scalar`:(!t||![`object`,`function`].includes(typeof t))&&(e=!0);break;case`boolean`:case`string`:case`undefined`:case`function`:typeof t===o&&(e=!0);break;case`integer`:Number.isFinite(t)&&!(t%1)&&(e=!0);break;case`number`:Number.isFinite(t)&&(e=!0);break;case`nonFinite`:typeof t==`number`&&!Number.isFinite(t)&&(e=!0);break;case`object`:t&&typeof t===o&&(e=!0);break;case`array`:Array.isArray(t)&&(e=!0);break;case`other`:e=this.currOtherTypeCallback(t,n,r,i);break;case`null`:t===null&&(e=!0);break;default:throw TypeError(`Unknown value type `+o)}if(e)return c={path:n,value:t,parent:r,parentProperty:i},this._handleCallback(c,a,`value`),c}else if(l[0]==="`"&&t&&Object.hasOwn(t,l.slice(1))){let e=l.slice(1);f(this._trace(u,t[e],j_(n,e),t,e,a,o,!0))}else if(l.includes(`,`)){let e=l.split(`,`);for(let o of e)f(this._trace(M_(o,u),t,n,r,i,a,!0))}else!s&&t&&Object.hasOwn(t,l)&&f(this._trace(u,t[l],j_(n,l),t,l,a,o,!0));if(this._hasParentSelector)for(let e=0;e<d.length;e++){let n=d[e];if(n&&n.isParentSelector){let s=this._trace(n.expr,t,n.path,r,i,a,o);if(Array.isArray(s)){d[e]=s[0];let t=s.length;for(let n=1;n<t;n++)e++,d.splice(e,0,s[n])}else d[e]=s}}return d},P_.prototype._walk=function(e,t){if(Array.isArray(e)){let n=e.length;for(let e=0;e<n;e++)t(e)}else e&&typeof e==`object`&&Object.keys(e).forEach(e=>{t(e)})},P_.prototype._slice=function(e,t,n,r,i,a,o){if(!Array.isArray(n))return;let s=n.length,c=e.split(`:`),l=c[2]&&Number.parseInt(c[2])||1,u=c[0]&&Number.parseInt(c[0])||0,d=c[1]&&Number.parseInt(c[1])||s;u=u<0?Math.max(0,u+s):Math.min(s,u),d=d<0?Math.max(0,d+s):Math.min(s,d);let f=[];for(let e=u;e<d;e+=l)this._trace(M_(e,t),n,r,i,a,o,!0).forEach(e=>{f.push(e)});return f},P_.prototype._eval=function(e,t,n,r,i,a){this.currSandbox._$_parentProperty=a,this.currSandbox._$_parent=i,this.currSandbox._$_property=n,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;let o=e.includes(`@path`);o&&(this.currSandbox._$_path=P_.toPathString(r.concat([n])));let s=this.currEval+`Script:`+e;if(!P_.cache[s]){let t=e.replaceAll(`@parentProperty`,`_$_parentProperty`).replaceAll(`@parent`,`_$_parent`).replaceAll(`@property`,`_$_property`).replaceAll(`@root`,`_$_root`).replaceAll(/@([.\s)[])/gu,`_$_v$1`);if(o&&(t=t.replaceAll(`@path`,`_$_path`)),this.currEval===`safe`||this.currEval===!0||this.currEval===void 0)P_.cache[s]=new this.safeVm.Script(t);else if(this.currEval===`native`)P_.cache[s]=new this.vm.Script(t);else if(typeof this.currEval==`function`&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,`runInNewContext`)){let e=this.currEval;P_.cache[s]=new e(t)}else if(typeof this.currEval==`function`)P_.cache[s]={runInNewContext:e=>this.currEval(t,e)};else throw TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return P_.cache[s].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw Error(`jsonPath: `+t.message+`: `+e)}},P_.cache={},P_.toPathString=function(e){let t=e,n=t.length,r=`$`;for(let e=1;e<n;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(r+=/^[0-9*]+$/u.test(t[e])?`[`+t[e]+`]`:`['`+t[e]+`']`);return r},P_.toPointer=function(e){let t=e,n=t.length,r=``;for(let e=1;e<n;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(r+=`/`+t[e].toString().replaceAll(`~`,`~0`).replaceAll(`/`,`~1`));return r},P_.toPathArray=function(e){let{cache:t}=P_;if(t[e])return t[e].concat();let n=[];return t[e]=e.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,`;$&;`).replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(e,t){return`[#`+(n.push(t)-1)+`]`}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(e,t){return`['`+t.replaceAll(`.`,`%@%`).replaceAll(`~`,`%%@@%%`)+`']`}).replaceAll(`~`,`;~;`).replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,`;`).replaceAll(`%@%`,`.`).replaceAll(`%%@@%%`,`~`).replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(e,t){return`;`+t.split(``).join(`;`)+`;`}).replaceAll(/;;;|;;/gu,`;..;`).replaceAll(/;$|'?\]|'$/gu,``).split(`;`).map(function(e){let t=e.match(/#(\d+)/u);return!t||!t[1]?e:n[t[1]]}),t[e].concat()},P_.prototype.safeVm={Script:A_};var F_=function(e,t,n){let r=e.length;for(let i=0;i<r;i++){let r=e[i];n(r)&&t.push(e.splice(i--,1)[0])}},I_=class{constructor(e){this.code=e}runInNewContext(e){let t=this.code,n=Object.keys(e),r=[];F_(n,r,t=>typeof e[t]==`function`);let i=n.map(t=>e[t]);t=r.reduce((t,n)=>{let r=e[n].toString();return/function/u.test(r)||(r=`function `+r),`var `+n+`=`+r+`;`+t},``)+t,!/(['"])use strict\1/u.test(t)&&!n.includes(`arguments`)&&(t=`var arguments = undefined;`+t),t=t.replace(/;\s*$/u,``);let a=t.lastIndexOf(`;`),o=a===-1?` return `+t:t.slice(0,a+1)+` return `+t.slice(a+1);return Function(...n,o)(...i)}};P_.prototype.vm={Script:I_};function L_(e){let t=e.type===`contains`?`contains ${e.value}`:e.type===`regex`?`matches regex ${e.pattern}`:e.equals===void 0?`JSONPath ${e.path} exists`:`JSONPath ${e.path} == ${String(e.equals)}`;return`Tool input · ${e.tool} ${t}`}function R_(e){return e.type===`contains`||e.type===`regex`}function z_(e,t){if(t===`tool_not_used`)return`Tool input assertion failed: tool not used: ${e.tool}`;if(t===`invalid_regex`&&e.type===`regex`)return`Tool input assertion failed: invalid regex ${e.pattern}`;let n=e.type===`contains`?`contains ${e.value}`:e.type===`regex`?`regex ${e.pattern}`:e.equals===void 0?`JSONPath ${e.path} exists`:`JSONPath ${e.path} == ${String(e.equals)}`;return t===`invalid_jsonpath`&&e.type===`jsonpath`?`Tool input assertion failed: invalid JSONPath ${e.path} (expected: ${n})`:t===`serialization`&&R_(e)?`Tool input assertion failed: could not serialize tool input for ${e.tool} (expected: ${n})`:`Tool input assertion failed: ${e.tool} input did not match (expected: ${n})`}function B_(e){return e.length>0?`Tool sequence · ${e.join(` -> `)}`:`Tool sequence`}function V_(e,t,n=0){let r=t-n;return r<=0?null:e/r}function H_(e){return e==null?void 0:String(e)}function U_(e,t){return`${e}-${t+1}`}function W_(e,t){return t.type===`browser`?{id:e,name:String(t.name||e),type:`browser`,provider:t.provider,model:``,maxTokens:0,url:t.url,newConversationBetweenScenarios:t.newConversationBetweenScenarios}:{id:e,name:String(t.name||e),type:`llm`,provider:t.provider===`azure_openai`?`azure`:t.provider,model:t.model,...q_(t.temperature),maxTokens:t.max_tokens??2048,maxTurns:t.max_turns,systemPrompt:t.system}}function G_(e){return e.type===`browser`?{id:e.id,name:e.name,type:`browser`,provider:e.provider,url:e.url,...e.newConversationBetweenScenarios===void 0?{}:{new_conversation_between_scenarios:e.newConversationBetweenScenarios}}:{id:e.id,name:e.name,provider:e.provider===`azure`?`azure_openai`:e.provider===`anthropic`?`anthropic`:`openai`,model:e.model,...q_(e.temperature),max_tokens:e.maxTokens,max_turns:e.maxTurns,system:e.systemPrompt}}function K_(e){return Vi(e)||void 0}function q_(e){return e===void 0?{}:{temperature:e}}function J_(e){let t=e.media_type??v_(e)??`application/octet-stream`;return{type:g_(t),media_type:t,data:e.data??``,...e.url?{url:e.url}:{},...e.name?{name:e.name}:{}}}function Y_(e){switch(e.type){case`regex`:return{type:`response_regex`,value:e.pattern};case`contains`:return{type:`response_contains`,value:e.value};case`not_contains`:return{type:`response_not_contains`,value:e.value};case`starts_with`:return{type:`response_starts_with`,value:e.value};case`ends_with`:return{type:`response_ends_with`,value:e.value};case`equals`:return{type:`response_equals`,value:e.value};case`jsonpath`:return{type:`response_jsonpath`,path:e.path,equals:e.equals};case`jsonpath_exists`:return{type:`response_jsonpath_exists`,path:e.path};case`jsonpath_not_exists`:return{type:`response_jsonpath_not_exists`,path:e.path};default:throw Error(`Unsupported response assertion type in config: ${String(e?.type??`(missing type)`)}`)}}function X_(e){return{type:`tool_input_${e.type}`,tool:e.tool,...e.path?{path:e.path}:{},...e.equals===void 0?{}:{equals:e.equals},...e.value===void 0?{}:{value:e.value},...e.pattern===void 0?{}:{value:e.pattern}}}function Z_(e){if(e.type===`required_tool`||e.type===`forbidden_tool`||e.type===`tool_sequence`||e.type.startsWith(`tool_input_`)||e.type===`agent_check`)return null;let t=H_(e.value);return e.type===`response_contains`?t?{type:`contains`,value:t}:null:e.type===`response_not_contains`?t?{type:`not_contains`,value:t}:null:e.type===`response_starts_with`?t?{type:`starts_with`,value:t}:null:e.type===`response_ends_with`?t?{type:`ends_with`,value:t}:null:e.type===`response_equals`?t?{type:`equals`,value:t}:null:e.type===`response_regex`?t?{type:`regex`,pattern:t}:null:e.type===`response_jsonpath`?e.path?.trim()?e.equals===void 0?{type:`jsonpath`,path:e.path.trim()}:{type:`jsonpath`,path:e.path.trim(),equals:e.equals}:null:e.type===`response_jsonpath_exists`?e.path?.trim()?{type:`jsonpath_exists`,path:e.path.trim()}:null:e.type===`response_jsonpath_not_exists`&&e.path?.trim()?{type:`jsonpath_not_exists`,path:e.path.trim()}:null}function Q_(e,t){let n=e.filter(e=>e.type===`required_tool`).map(e=>e.value).filter(e=>typeof e==`string`&&e.length>0),r=e.filter(e=>e.type===`forbidden_tool`).map(e=>e.value).filter(e=>typeof e==`string`&&e.length>0),i=e.find(e=>e.type===`tool_sequence`)?.sequence?.map(e=>e.trim()).filter(e=>typeof e==`string`&&e.length>0),a=e.map(e=>Z_(e)).filter(e=>!!e),o=e.filter(e=>e.type.startsWith(`tool_input_`)).flatMap(e=>{if(!e.tool)return[];let t=H_(e.value);return e.type===`tool_input_contains`&&t!==void 0?[{type:`contains`,tool:e.tool,value:t}]:e.type===`tool_input_regex`&&t!==void 0?[{type:`regex`,tool:e.tool,pattern:t}]:e.type===`tool_input_jsonpath`&&e.path?[{type:`jsonpath`,tool:e.tool,path:e.path,...e.equals===void 0?{}:{equals:e.equals}}]:[]}),s=e.filter(e=>e.type===`agent_check`).flatMap(e=>e.label?.trim()&&e.prompt?.trim()?[{label:e.label.trim(),prompt:e.prompt.trim()}]:[]),c=n.length>0||r.length>0?{...n.length>0?{required_tools:n}:{},...r.length>0?{forbidden_tools:r}:{}}:void 0,l={...t?.include_prompt?{include_prompt:!0}:{},...t?.include_tool_sequence?{include_tool_sequence:!0}:{},...t?.include_tool_inputs?{include_tool_inputs:!0}:{}},u=Object.keys(l).length>0;if(c||i?.length||o.length!==0||a.length!==0||s.length!==0||u)return{...c?{tool_constraints:c}:{},...i&&i.length>0?{tool_sequence:i}:{},...o.length>0?{tool_input_assertions:o}:{},...a.length>0?{response_assertions:a}:{},...s.length>0?{agent_assertions:s}:{},...u?{agent_context:l}:{}}}function $_(e){if(e.length!==0)return e.map(e=>({name:e.name,from:`final_text`,regex:e.pattern}))}function ev(e,t){let n=Q_(e.evalRules,e.agentContext),r=$_(e.extractRules);return{id:e.id,name:K_(e.name),mcp_servers:t,prompt:e.prompt,attachments:e.attachments,eval:n,extract:r}}function tv(e){if(!(`id`in e)||!e.id)return null;let t=String(e.id),n=e.auth;return{id:t,server:{id:t,name:String(e.name||t),transport:`streamable-http`,url:String(e.url||``),authType:n?.type===`bearer`?`bearer`:n?.type===`api_key`||n?.type===`oauth_client_credentials`?`api-key`:n?.type===`oauth_authorization_code`?`oauth2`:`none`,authValue:n?.type===`bearer`?String(n.token||``)||(n.env?`\${${n.env}}`:void 0):n?.type===`api_key`?String(n.value||``):void 0,apiKeyHeaderName:n?.type===`api_key`?String(n.header_name||``):void 0,oauthClientId:n?.type===`oauth_authorization_code`&&String(n.client_id||``)||void 0,oauthClientSecret:n?.type===`oauth_authorization_code`&&String(n.client_secret||``)||void 0,oauthRedirectUrl:n?.type===`oauth_authorization_code`&&String(n.redirect_url||``)||void 0,oauthScope:(n?.type===`oauth_authorization_code`||n?.type===`oauth_client_credentials`)&&String(n.scope||``)||void 0,oauthMode:n?.type===`oauth_authorization_code`?n.mode:void 0,oauthAuthorizationUrl:n?.type===`oauth_authorization_code`&&String(n.authorization_url||``)||void 0,oauthTokenEndpoint:n?.type===`oauth_authorization_code`&&String(n.token_url||``)||void 0,oauthTokenUrl:n?.type===`oauth_client_credentials`?String(n.token_url||``):void 0,oauthClientIdEnv:n?.type===`oauth_client_credentials`?String(n.client_id_env||``):void 0,oauthClientSecretEnv:n?.type===`oauth_client_credentials`?String(n.client_secret_env||``):void 0,oauthAudience:n?.type===`oauth_client_credentials`&&String(n.audience||``)||void 0}}}function nv(e){let t=typeof e.config.name==`string`&&e.config.name.trim().length>0?e.config.name.trim():void 0,n=Array.isArray(e.config.servers)?e.config.servers:[],r=Array.isArray(e.config.agents)?e.config.agents:[],i=new Map,a=[],o=[];for(let e of n){if(`ref`in e){let t=String(e.ref||``).trim();if(!t)continue;i.set(t,t),o.push({kind:`referenced`,ref:t});continue}let t=String(e.id||e.name||``).trim();if(!t)continue;let n=t;i.set(t,n);let r=e.auth?.type===`bearer`?`bearer`:e.auth?.type===`api_key`||e.auth?.type===`oauth_client_credentials`?`api-key`:e.auth?.type===`oauth_authorization_code`?`oauth2`:`none`,s={id:n,name:String(e.name||t),transport:`streamable-http`,url:e.url,authType:r,authValue:e.auth?.type===`bearer`?e.auth.token??(e.auth.env?`\${${e.auth.env}}`:void 0):e.auth?.type===`api_key`?e.auth.value:void 0,apiKeyHeaderName:e.auth?.type===`api_key`?e.auth.header_name:void 0,oauthClientId:e.auth?.type===`oauth_authorization_code`?e.auth.client_id:void 0,oauthClientSecret:e.auth?.type===`oauth_authorization_code`?e.auth.client_secret:void 0,oauthRedirectUrl:e.auth?.type===`oauth_authorization_code`?e.auth.redirect_url:void 0,oauthScope:e.auth?.type===`oauth_authorization_code`||e.auth?.type===`oauth_client_credentials`?e.auth.scope:void 0,oauthMode:e.auth?.type===`oauth_authorization_code`?e.auth.mode:void 0,oauthAuthorizationUrl:e.auth?.type===`oauth_authorization_code`?e.auth.authorization_url:void 0,oauthTokenEndpoint:e.auth?.type===`oauth_authorization_code`?e.auth.token_url:void 0,oauthTokenUrl:e.auth?.type===`oauth_client_credentials`?e.auth.token_url:void 0,oauthClientIdEnv:e.auth?.type===`oauth_client_credentials`?e.auth.client_id_env:void 0,oauthClientSecretEnv:e.auth?.type===`oauth_client_credentials`?e.auth.client_secret_env:void 0,oauthAudience:e.auth?.type===`oauth_client_credentials`?e.auth.audience:void 0};a.push(s),o.push({kind:`inline`,server:s})}let s=[],c=[];for(let e of r){if(`ref`in e){let t=String(e.ref||``).trim();if(!t)continue;c.push({kind:`referenced`,ref:t});continue}let t=String(e.id||e.name||``).trim();if(!t)continue;let n=W_(t,e);s.push(n),c.push({kind:`inline`,agent:n})}let l=[],u=[];return e.config.scenarios.forEach((e,t)=>{if(`ref`in e){let t=String(e.ref||``).trim();if(!t)return;let n=e.mcp_servers,r=Array.isArray(n)?n.flatMap(e=>{let t=e;if(`ref`in t&&t.ref)return[{kind:`referenced`,ref:String(t.ref)}];let n=tv(t);return n?[{kind:`inline`,server:n.server}]:[]}):void 0;u.push({kind:`referenced`,ref:t,...r?{mcpServers:r}:{}});return}let n=[];for(let t of e.eval?.tool_constraints?.required_tools??[])n.push({type:`required_tool`,value:t});for(let t of e.eval?.tool_constraints?.forbidden_tools??[])n.push({type:`forbidden_tool`,value:t});e.eval?.tool_sequence?.length&&n.push({type:`tool_sequence`,sequence:[...e.eval.tool_sequence]});for(let t of e.eval?.response_assertions??[])n.push(Y_(t));for(let t of e.eval?.tool_input_assertions??[])n.push(X_(t));for(let t of e.eval?.agent_assertions??[])n.push({type:`agent_check`,label:t.label,prompt:t.prompt});let r=e.eval?.agent_context&&(e.eval.agent_context.include_prompt||e.eval.agent_context.include_tool_sequence||e.eval.agent_context.include_tool_inputs)?{include_prompt:e.eval.agent_context.include_prompt,include_tool_sequence:e.eval.agent_context.include_tool_sequence,include_tool_inputs:e.eval.agent_context.include_tool_inputs}:void 0,s={id:e.id||U_(`scn`,t),name:K_(e.name)||e.id||`Scenario ${t+1}`,serverIds:(()=>{if((e.servers??[]).length>0)return e.servers.map(e=>i.get(e)??e).filter(Boolean);let t=e.mcp_servers;return Array.isArray(t)?t.flatMap(e=>{if(`ref`in e&&e.ref)return[String(e.ref)];let t=tv(e);if(t){let e=t.id;return i.has(e)||(i.set(e,e),a.push(t.server),o.push({kind:`inline`,server:a[a.length-1]})),[e]}return[]}):[]})(),prompt:e.prompt,attachments:e.attachments?.map(J_),evalRules:n,extractRules:(e.extract??[]).map(e=>({name:e.name,pattern:e.regex})),...r?{agentContext:r}:{}};l.push(s),u.push({kind:`inline`,scenario:s})}),{id:e.id,name:t||e.name,configName:t,configHash:e.hash,...typeof e.config.description==`string`&&e.config.description.trim()?{description:e.config.description.trim()}:{},...e.relativePath?{relativePath:e.relativePath}:{},...e.suitePath===void 0?{}:{suitePath:e.suitePath},loadError:e.error,loadWarnings:e.warnings,servers:a,serverEntries:o,agents:s,agentEntries:c,scenarios:l,scenarioEntries:u,runDefaults:e.config.run_defaults?.selected_agents&&e.config.run_defaults.selected_agents.length>0?{selectedAgentNames:[...e.config.run_defaults.selected_agents]}:void 0,createdAt:e.mtime,updatedAt:e.mtime,sourcePath:e.path}}function rv(e){let t=nv({id:`library`,name:`library`,path:`library`,mtime:new Date(0).toISOString(),hash:``,config:{servers:Object.entries(e.servers).map(([e,t])=>({id:e,name:K_(t.name)||e,transport:t.transport,url:t.url,auth:t.auth})),agents:Object.entries(e.agents).map(([e,t])=>({id:e,...t})),scenarios:e.scenarios.map((e,t)=>({...e,name:K_(e.name)||e.id||`Scenario ${t+1}`}))}});return{servers:t.servers,agents:t.agents,scenarios:t.scenarios,browserProviders:e.browserProviders??{}}}function iv(e){let t=new Map,n=e=>{let t=e.id,n=e.authValue?.trim()??``,r=e.apiKeyHeaderName?.trim()??``,i=e.authType===`bearer`?(()=>{if(!n)throw Error(`Server '${t}' is missing bearer token value`);return{type:`bearer`,token:n}})():e.authType===`api-key`&&!e.oauthTokenUrl?{type:`api_key`,...r?{header_name:r}:{},value:(()=>{if(!n)throw Error(`Server '${t}' is missing API key value`);return n})()}:e.authType===`api-key`?{type:`oauth_client_credentials`,token_url:e.oauthTokenUrl||``,client_id_env:e.oauthClientIdEnv||``,client_secret_env:e.oauthClientSecretEnv||``,...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAudience?{audience:e.oauthAudience}:{}}:e.authType===`oauth2`?{type:`oauth_authorization_code`,...e.oauthMode===`dcr`?{mode:`dcr`}:{},...e.oauthMode!==`dcr`&&e.oauthClientId?{client_id:e.oauthClientId}:{},...e.oauthClientSecret?{client_secret:e.oauthClientSecret}:{},...e.oauthRedirectUrl?{redirect_url:e.oauthRedirectUrl}:{},...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAuthorizationUrl?{authorization_url:e.oauthAuthorizationUrl}:{},...e.oauthTokenEndpoint?{token_url:e.oauthTokenEndpoint}:{}}:void 0;return{id:t,...e.name&&e.name!==t?{name:e.name}:{},transport:`http`,url:e.url||`http://localhost:3000/mcp`,...i===void 0?{}:{auth:i}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(e=>({kind:`inline`,server:e}))],i=new Set,a=new Map,o=r.flatMap(e=>{if(e.kind===`referenced`){let n=String(e.ref||``).trim();return!n||i.has(n)?[]:(i.add(n),t.set(n,n),[{ref:n}])}let r=n(e.server);return t.set(e.server.id,r.id),a.set(r.id,r),[r]}),s=e=>G_(e),c=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(e=>({kind:`inline`,agent:e}))],l=new Set,u=c.flatMap(e=>{if(e.kind===`referenced`){let t=String(e.ref||``).trim();return!t||l.has(t)?[]:(l.add(t),[{ref:t}])}return[s(e.agent)]}),d=e=>ev(e,e.serverIds.length>0?e.serverIds.map(e=>{let n=t.get(e)??e;return a.get(n)??{ref:n}}):void 0),f=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(e=>e.kind===`referenced`?{ref:e.ref,...Array.isArray(e.mcpServers)?{mcp_servers:e.mcpServers.map(e=>e.kind===`referenced`?{ref:e.ref}:n(e.server))}:{}}:d(e.scenario)):[...e.scenarios.map(e=>d(e))];return{name:e.configName?.trim()||void 0,description:e.description?.trim()||void 0,servers:o,agents:u,scenarios:f,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0}}function av(e){return{servers:Object.fromEntries((e.servers??[]).map(e=>[e.id,(()=>{let t=e.authValue?.trim()??``,n=e.apiKeyHeaderName?.trim()??``;return{...e.name&&e.name!==e.id?{name:e.name}:{},transport:`http`,url:e.url||`http://localhost:3000/mcp`,auth:e.authType===`bearer`?(()=>{if(!t)throw Error(`Server '${e.id}' is missing bearer token value`);return{type:`bearer`,token:t}})():e.authType===`api-key`&&!e.oauthTokenUrl?{type:`api_key`,...n?{header_name:n}:{},value:(()=>{if(!t)throw Error(`Server '${e.id}' is missing API key value`);return t})()}:e.authType===`api-key`?{type:`oauth_client_credentials`,token_url:e.oauthTokenUrl||``,client_id_env:e.oauthClientIdEnv||``,client_secret_env:e.oauthClientSecretEnv||``,...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAudience?{audience:e.oauthAudience}:{}}:e.authType===`oauth2`?{type:`oauth_authorization_code`,...e.oauthMode===`dcr`?{mode:`dcr`}:{},...e.oauthMode!==`dcr`&&e.oauthClientId?{client_id:e.oauthClientId}:{},...e.oauthClientSecret?{client_secret:e.oauthClientSecret}:{},...e.oauthRedirectUrl?{redirect_url:e.oauthRedirectUrl}:{},...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAuthorizationUrl?{authorization_url:e.oauthAuthorizationUrl}:{},...e.oauthTokenEndpoint?{token_url:e.oauthTokenEndpoint}:{}}:void 0}})()])),agents:Object.fromEntries(e.agents.map(e=>{let{id:t,...n}=G_(e);return[e.id,n]})),scenarios:e.scenarios.map(e=>ev(e,e.serverIds.length>0?e.serverIds.map(e=>({ref:e})):void 0)),browserProviders:e.browserProviders}}function ov(e,t){if(e)return`${e}::${t??``}`}function sv(e){return e.type===`text`}function cv(e,t){if(!t)return e.tool_calls.map((t,n)=>({name:t,arguments:{},duration:e.tool_durations_ms[n]??0,timestamp:new Date().toISOString()}));let n=[],r=new Map;for(let e of t.messages)for(let t of e.content)t.type===`tool_use`?n.push({id:t.id,name:t.name,input:t.input??{},ts:e.ts}):t.type===`tool_result`&&r.set(t.tool_use_id,{durationMs:t.duration_ms,tsEnd:t.ts_end});return n.map((t,n)=>{let i=r.get(t.id);return{name:t.name,arguments:t.input,duration:i?.durationMs??e.tool_durations_ms[n]??0,timestamp:i?.tsEnd??t.ts??new Date().toISOString()}})}function lv(e,t){let n=[];if(!e)return t&&n.push({id:`user_prompt-0`,kind:`user_prompt`,text:t,timestamp:void 0}),n;let r,i=e.messages??[];for(let e=0;e<i.length;e+=1){let t=i[e];if(t.role===`user`)for(let e of t.content)e.type===`text`?n.push({id:`user_prompt-${n.length}`,kind:`user_prompt`,text:e.text,timestamp:t.ts}):e.type===`image`?n.push({id:`attachment-${n.length}`,kind:`user_prompt`,text:`[Attached image: ${e.name??`image`}]`,timestamp:t.ts}):e.type===`document`&&n.push({id:`attachment-${n.length}`,kind:`user_prompt`,text:`[Attached document: ${e.name??`document`} (${e.media_type})]`,timestamp:t.ts});else if(t.role===`assistant`){let a=t.content.filter(e=>e.type===`tool_use`);for(let e of t.content)e.type===`text`&&(n.push({id:`assistant_thought-${n.length}`,kind:`assistant_thought`,text:e.text,timestamp:t.ts}),r=n.length-1);let o=i[e+1],s=o?.role===`tool`;if(a.length>0&&s){let r=new Map,i=[];for(let e of o.content)e.type===`tool_result`&&(e.tool_use_id?r.set(e.tool_use_id,e):i.push(e));for(let e of a){n.push({id:`tool_call-${n.length}`,kind:`tool_call`,text:uv(e.input??{}),toolName:e.name,timestamp:t.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method});let i=r.get(e.id);if(!i)continue;let a=i.content.filter(sv).map(e=>e.text).join(`
57
+ `);n.push({id:`tool_result-${n.length}`,kind:`tool_result`,text:a,toolName:i.name,ok:!i.is_error,durationMs:i.duration_ms,timestamp:i.ts_end??o.ts,estimatedTokens:i.estimated_tokens?{inputTokens:i.estimated_tokens.input,outputTokens:i.estimated_tokens.output,totalTokens:i.estimated_tokens.total}:void 0,estimatedTokenMethod:i.estimated_tokens?.method}),r.delete(e.id)}for(let e of[...r.values(),...i]){let t=e.content.filter(sv).map(e=>e.text).join(`
58
+ `);n.push({id:`tool_result-${n.length}`,kind:`tool_result`,text:t,toolName:e.name,ok:!e.is_error,durationMs:e.duration_ms,timestamp:e.ts_end??o.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method})}e+=1}else for(let e of a)n.push({id:`tool_call-${n.length}`,kind:`tool_call`,text:uv(e.input??{}),toolName:e.name,timestamp:t.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method})}else if(t.role===`tool`)for(let e of t.content){if(e.type!==`tool_result`)continue;let r=e.content.filter(sv).map(e=>e.text).join(`
59
+ `);n.push({id:`tool_result-${n.length}`,kind:`tool_result`,text:r,toolName:e.name,ok:!e.is_error,durationMs:e.duration_ms,timestamp:e.ts_end??t.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method})}}return typeof r==`number`&&n[r]&&(n[r]={...n[r],kind:`assistant_final`}),n}function uv(e){try{return JSON.stringify(e)}catch{return String(e)}}function dv(e,t){t&&(typeof t.input_tokens==`number`&&(e.input+=t.input_tokens,e.hasInput=!0),typeof t.output_tokens==`number`&&(e.output+=t.output_tokens,e.hasOutput=!0),typeof t.total_tokens==`number`&&(e.total+=t.total_tokens,e.hasTotal=!0))}function fv(e,t){if(typeof e!=`number`||t<=0)return Array(t).fill(void 0);let n=Math.floor(e/t),r=e%t;return Array.from({length:t},(e,t)=>n+ +(t<r))}function pv(e){let t=d_(),n=d_(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(let i of e.messages??[]){if(i.role!==`assistant`)continue;dv(t,i.usage);let e=i.content.filter(e=>e.type===`tool_use`);if(e.length===0)continue;if(e.every(e=>!!e.estimated_tokens)){for(let t of e){let e=t.estimated_tokens;n.input+=e.input,n.hasInput=!0,n.output+=e.output,n.hasOutput=!0,n.total+=e.total,n.hasTotal=!0;let i=r.get(t.name)??d_();i.input+=e.input,i.hasInput=!0,i.output+=e.output,i.hasOutput=!0,i.total+=e.total,i.hasTotal=!0,r.set(t.name,i)}continue}dv(n,i.usage);let a=fv(i.usage?.input_tokens,e.length),o=fv(i.usage?.output_tokens,e.length),s=fv(i.usage?.total_tokens,e.length);for(let t=0;t<e.length;t+=1){let n=e[t].name,i=r.get(n)??d_(),c=a[t],l=o[t],u=s[t];typeof c==`number`&&(i.input+=c,i.hasInput=!0),typeof l==`number`&&(i.output+=l,i.hasOutput=!0),typeof u==`number`&&(i.total+=u,i.hasTotal=!0),r.set(n,i)}}let i={};for(let[e,t]of Array.from(r.entries()).sort((e,t)=>e[0].localeCompare(t[0]))){let n=p_(t);n&&(i[e]=n)}return{assistant:p_(t),tool:p_(n),perTool:i}}function mv(e,t){if(t){let e=Date.parse(t.ts_start),n=Date.parse(t.ts_end);if(Number.isFinite(e)&&Number.isFinite(n))return Math.max(0,n-e)}return e.tool_durations_ms.reduce((e,t)=>e+t,0)}function hv(e){return y_(e.flatMap(e=>e.checkResults??[]))}function gv(e){return e?.map(e=>({...e,status:e.status===`not_applicable`?`not_evaluated`:e.status}))}function _v(e,t=[],n){let r=new Map;for(let e of t){let t=ov(e.scenario_id,e.agent);if(!t)continue;let n=r.get(t)??[];n.push(e),r.set(t,n)}let i=e.scenarios.map(e=>{let t=r.get(`${e.scenario_id}::${e.agent}`)??[],n=new Map;for(let e of t)n.set(e.run_index,e);let i=e.runs.map((e,r)=>{let i=n.get(e.run_index)??t[r],a=pv(i);return{runIndex:e.run_index,passed:e.pass,outcome:e.outcome,error:e.error,stopReason:e.stop_reason,toolCalls:cv(e,i),assistantTokenUsage:a.assistant,toolTokenUsage:a.tool,toolTokenUsageByTool:a.perTool,finalAnswer:e.final_text,conversation:lv(i),duration:mv(e,i),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([e,t])=>[e,String(t??``)])),failureReasons:e.failures,checkResults:gv(e.check_results)}}),a=d_(),o=d_(),s=new Map;for(let e of i){f_(a,e.assistantTokenUsage),f_(o,e.toolTokenUsage);for(let[t,n]of Object.entries(e.toolTokenUsageByTool??{})){let e=s.get(t)??d_();f_(e,n),s.set(t,e)}}let c={};for(let[e,t]of Array.from(s.entries()).sort((e,t)=>e[0].localeCompare(t[0]))){let n=p_(t);n&&(c[e]=n)}let l=i.length===0?0:Math.round(i.reduce((e,t)=>e+t.duration,0)/i.length),u=i.length===0?0:i.reduce((e,t)=>e+t.toolCalls.length,0)/i.length;return{scenarioId:e.scenario_id,scenarioName:e.scenario_name||e.scenario_id,agentId:e.agent,agentName:e.agent,provider:e.provider,model:e.model,runs:i,passRate:i.some(e=>e.outcome!==`stopped`)?e.pass_rate:null,avgToolCalls:u,avgDuration:l,checkCounts:hv(i),assistantTokenUsage:p_(a),toolTokenUsage:p_(o),toolTokenUsageByTool:c}}),a=d_(),o=d_();for(let e of i)f_(a,e.assistantTokenUsage),f_(o,e.toolTokenUsage);let s=i.reduce((e,t)=>(e.passed+=t.checkCounts?.passed??0,e.failed+=t.checkCounts?.failed??0,e.not_evaluated+=t.checkCounts?.not_evaluated??0,e.not_executed+=t.checkCounts?.not_executed??0,e.total+=t.checkCounts?.total??0,e),{passed:0,failed:0,not_evaluated:0,not_executed:0,total:0});return{id:n??e.metadata.run_id,configId:``,configHash:e.metadata.config_hash,configPath:e.metadata.config_path,configName:e.metadata.config_name,langsmithTraceUrls:e.metadata.langsmith_trace_urls,rerunAgents:e.metadata.rerun_agents,rerunScenarioIds:e.metadata.rerun_scenario_ids,rerunServerOverrideAll:e.metadata.rerun_server_override_all,rerunNewConversationBeforeStart:e.metadata.rerun_new_conversation_before_start,rerunNewConversationBetweenScenarios:e.metadata.rerun_new_conversation_between_scenarios,rerunScenarioServerOverrides:e.metadata.rerun_scenario_server_overrides,timestamp:e.metadata.timestamp,runNote:e.metadata.run_note,mcpServerVersions:e.metadata.mcp_server_versions??{},scenarios:i,assistantTokenUsage:p_(a),toolTokenUsage:p_(o),overallPassRate:e.summary.total_runs<=(e.summary.outcomes?.stopped??i.flatMap(e=>e.runs).filter(e=>e.outcome===`stopped`).length)?null:e.summary.pass_rate,totalScenarios:e.summary.total_scenarios,totalRuns:e.summary.total_runs,avgToolCalls:e.summary.avg_tool_calls_per_run,avgLatency:Math.round(e.summary.avg_tool_latency_ms??0),checkCounts:s,totalToolDurationMs:typeof e.metadata.total_tool_duration_ms==`number`?Math.max(0,e.metadata.total_tool_duration_ms??0):0,outcomes:e.summary.outcomes,executionSource:e.metadata.execution_source,executionClient:e.metadata.execution_client,evaluationRunId:e.metadata.evaluation_run_id??e.metadata.evaluation_group_id}}function vv(e,t){let n=pv(t??void 0);return{runIndex:e.run_index,passed:e.pass,outcome:e.outcome,error:e.error,stopReason:e.stop_reason,toolCalls:cv(e,t??void 0),assistantTokenUsage:n.assistant,toolTokenUsage:n.tool,toolTokenUsageByTool:n.perTool,finalAnswer:e.final_text,conversation:lv(t??void 0),duration:mv(e,t??void 0),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([e,t])=>[e,String(t??``)])),failureReasons:e.failures,checkResults:gv(e.check_results)}}function yv(){return typeof window>`u`?``:window.location.port===`8685`?`http://127.0.0.1:8787`:``}var bv=yv(),xv=class extends Error{status;constructor(e,t){super(t),this.status=e,this.name=`ApiError`}};async function Sv(e,t){let n=await fetch(`${bv}${e}`,{...t,headers:{"content-type":`application/json`,...t?.headers||{}}});if(!n.ok){let e=await n.text();throw new xv(n.status,`Request failed (${n.status}): ${e}`)}return await n.json()}async function Cv(e,t){let n=await fetch(`${bv}${e}`,{...t,headers:{...t?.body?{"content-type":`application/json`}:{},...t?.headers||{}}});if(!n.ok){let e=await n.text();throw new xv(n.status,`Request failed (${n.status}): ${e}`)}return n.text()}function wv(e,t){let n=new EventSource(`${bv}${e}`),r=e.replace(/\/events$/,``),i=[`session_started`,`turn_started`,`tool_call_requested`,`tool_call_approved`,`tool_call_denied`,`tool_call_resolved`,`assistant_message_completed`,`session_warning`,`session_error`,`session_finished`],a=!1,o=()=>{a||(a=!0,n.close())},s=e=>{if(!a&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);n.type===`session_finished`&&o(),t(n)}catch{}};for(let e of i)n.addEventListener(e,s);return n.onerror=()=>{a||(n.readyState===2?o():fetch(`${bv}${r}`,{method:`GET`,cache:`no-store`,headers:{accept:`application/json`}}).then(e=>{(e.status===404||e.status===410)&&o()}).catch(()=>{}))},()=>o()}function Tv(e,t,n){if(typeof n!=`number`||!Number.isFinite(n))return;let r=Math.floor(n);r<=0||e.set(t,String(r))}function Ev(e,t,n){if(typeof n!=`number`||!Number.isFinite(n))return;let r=Math.floor(n);r<0||e.set(t,String(r))}var G={health:()=>Sv(`/api/health`),getSettings:()=>Sv(`/api/settings`),updateSettings:e=>Sv(`/api/settings`,{method:`PUT`,body:JSON.stringify(e)}),listConfigs:()=>Sv(`/api/evals`),createConfig:(e,t)=>Sv(`/api/evals`,{method:`POST`,body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>Sv(`/api/evals/${e}`,{method:`PUT`,body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>Sv(`/api/evals/${e}`,{method:`DELETE`}),listRuns:e=>{let t=new URLSearchParams;return e?.since?.trim()&&t.set(`since`,e.since.trim()),e?.until?.trim()&&t.set(`until`,e.until.trim()),typeof e?.lastDays==`number`&&Number.isFinite(e.lastDays)&&e.lastDays>0&&t.set(`last_days`,String(Math.floor(e.lastDays))),e?.scenario?.trim()&&t.set(`scenario`,e.scenario.trim()),Tv(t,`limit`,e?.limit),Ev(t,`offset`,e?.offset),Sv(`/api/runs${t.size>0?`?${t.toString()}`:``}`)},getLatestPassRatesByConfigIds:e=>Sv(`/api/runs/latest-pass-rates`,{method:`POST`,body:JSON.stringify(e)}).then(e=>e.byConfigId),listMarkdownReports:e=>{let t=new URLSearchParams;return Tv(t,`limit`,e?.limit),Ev(t,`offset`,e?.offset),Sv(`/api/markdown-reports${t.size>0?`?${t.toString()}`:``}`)},listToolAnalysisServers:()=>Sv(`/api/tool-analysis-results/servers`).then(e=>e.data),getMarkdownReport:e=>Sv(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),getMarkdownReportById:e=>Sv(`/api/markdown-reports/${encodeURIComponent(e)}`),deleteMarkdownReport:e=>Sv(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:`DELETE`}).then(()=>void 0),getRun:e=>Sv(`/api/runs/${e}`),deleteRun:e=>Sv(`/api/runs/${e}`,{method:`DELETE`}),updateRunNote:(e,t)=>Sv(`/api/runs/${encodeURIComponent(e)}/note`,{method:`PATCH`,body:JSON.stringify({runNote:t??``})}).then(()=>void 0),getRunTrace:e=>Sv(`/api/runs/${e}/trace`),applyResultAssistantReport:e=>Sv(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:`POST`,body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:(e,t)=>Sv(`/api/result-assistant/sessions`,{method:`POST`,body:JSON.stringify(e),signal:t}),getResultAssistantSession:e=>Sv(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t,n)=>Sv(`/api/result-assistant/sessions/${e}/messages`,{method:`POST`,body:JSON.stringify({message:t}),signal:n}),approveResultAssistantToolCall:(e,t,n)=>Sv(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:`POST`,body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>Sv(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:`POST`,body:JSON.stringify({})}),closeResultAssistantSession:e=>Sv(`/api/result-assistant/sessions/${e}`,{method:`DELETE`}).then(()=>void 0),subscribeResultAssistantSessionEvents:(e,t)=>wv(`/api/result-assistant/sessions/${e}/events`,t),getLibraries:()=>Sv(`/api/libraries`),saveLibraries:e=>Sv(`/api/libraries`,{method:`PUT`,body:JSON.stringify(e)}),startRun:e=>Sv(`/api/runs`,{method:`POST`,body:JSON.stringify(e)}),runScenarioPreview:e=>Sv(`/api/runs/preview`,{method:`POST`,body:JSON.stringify(e)}),listProviderModels:e=>Sv(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:(e,t)=>Sv(`/api/scenario-assistant/sessions`,{method:`POST`,body:JSON.stringify(e),signal:t}),getScenarioAssistantSession:e=>Sv(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t,n)=>Sv(`/api/scenario-assistant/sessions/${e}/messages`,{method:`POST`,body:JSON.stringify({message:t}),signal:n}),approveScenarioAssistantToolCall:(e,t)=>Sv(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:`POST`,body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>Sv(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:`POST`,body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>Sv(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:`POST`,body:JSON.stringify({})}),closeScenarioAssistantSession:e=>Sv(`/api/scenario-assistant/sessions/${e}`,{method:`DELETE`}),subscribeScenarioAssistantSessionEvents:(e,t)=>wv(`/api/scenario-assistant/sessions/${e}/events`,t),discoverToolsForAnalysis:e=>Sv(`/api/tool-analysis/discover-tools`,{method:`POST`,body:JSON.stringify(e)}),startToolAnalysis:e=>Sv(`/api/tool-analysis/jobs`,{method:`POST`,body:JSON.stringify(e)}),getToolAnalysisResult:e=>Sv(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>Sv(`/api/tool-analysis/jobs/${e}/stop`,{method:`POST`}),subscribeToolAnalysisJob:(e,t)=>{let n=new EventSource(`${bv}/api/tool-analysis/jobs/${e}/events`),r=!1,i=()=>{r||(r=!0,n.close())},a=e=>{if(!r&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);t(n),(n.type===`completed`||n.type===`error`)&&i()}catch{}};return n.addEventListener(`started`,a),n.addEventListener(`log`,a),n.addEventListener(`completed`,a),n.addEventListener(`error`,a),n.onerror=()=>{r||(t({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`}}),i())},()=>i()},listToolAnalysisResults:e=>{let t=new URLSearchParams;return Tv(t,`limit`,e?.limit),Ev(t,`offset`,e?.offset),e?.server?.trim()&&t.set(`server`,e.server.trim()),Sv(`/api/tool-analysis-results${t.size>0?`?${t.toString()}`:``}`)},getToolAnalysisSavedResult:e=>Sv(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>Sv(`/api/tool-analysis-results/${e}`,{method:`DELETE`}).then(()=>void 0),createOAuthDebuggerSession:e=>Sv(`/api/oauth-debugger/sessions`,{method:`POST`,body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>Sv(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>Sv(`/api/oauth-debugger/sessions/${e}/start`,{method:`POST`,body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{let n=new EventSource(`${bv}/api/oauth-debugger/sessions/${e}/events`),r=!1,i=()=>{r||(r=!0,n.close())},a=e=>{if(!r&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);t(n),(n.type===`completed`||n.type===`error`||n.type===`stopped`)&&i()}catch{}};return[`started`,`step_started`,`step_completed`,`step_failed`,`http_request`,`http_response`,`validation`,`log`,`waiting_for_user`,`waiting_for_browser_callback`,`completed`,`error`,`stopped`].forEach(e=>n.addEventListener(e,a)),n.onerror=()=>{r||(t({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`}}),i())},()=>i()},submitOAuthDebuggerManualCallback:(e,t)=>Sv(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:`POST`,body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>Sv(`/api/oauth-debugger/sessions/${e}/stop`,{method:`POST`,body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t===`json`?Sv(`/api/oauth-debugger/sessions/${e}/export?format=json`):Cv(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),createOAuthRuntimeSession:e=>Sv(`/api/oauth-runtime/sessions`,{method:`POST`,body:JSON.stringify(e)}),getOAuthRuntimeSession:e=>Sv(`/api/oauth-runtime/sessions/${e}`),getOAuthRuntimeSessionToken:e=>Sv(`/api/oauth-runtime/sessions/${e}/token`),submitOAuthRuntimeCallback:(e,t)=>Sv(`/api/oauth-runtime/sessions/${e}/callback`,{method:`POST`,body:JSON.stringify(t)}),cancelOAuthRuntimeSession:e=>Sv(`/api/oauth-runtime/sessions/${e}/cancel`,{method:`POST`,body:JSON.stringify({})}),ensureOAuthServers:e=>Sv(`/api/oauth-runtime/servers/ensure`,{method:`POST`,body:JSON.stringify(e)}),stopRun:e=>Sv(`/api/runs/jobs/${e}/stop`,{method:`POST`}),stopEvaluationRun:e=>Sv(`/api/runs/evaluations/${encodeURIComponent(e)}/stop`,{method:`POST`}),stopScenario:(e,t,n)=>Sv(`/api/runs/jobs/${encodeURIComponent(e)}/scenarios/${encodeURIComponent(t)}/agents/${encodeURIComponent(n)}/stop`,{method:`POST`}),removeEvaluationRun:e=>Sv(`/api/runs/queue/evaluations/${encodeURIComponent(e)}`,{method:`DELETE`}),openRover:e=>Sv(`/api/rover/open`,{method:`POST`,body:JSON.stringify({jobId:e})}),resumeRover:e=>Sv(`/api/rover/jobs/${encodeURIComponent(e)}/resume`,{method:`POST`}),getRoverStatus:()=>Sv(`/api/rover/status`),getRunQueue:()=>Sv(`/api/runs/queue`),subscribeRunQueue:e=>{if(typeof SharedWorker>`u`){let t=new EventSource(`${bv}/api/runs/queue/events`),n=!1;return t.onopen=()=>{n||e({type:`connected`,ts:new Date().toISOString(),payload:{message:`SSE connected`}})},t.addEventListener(`queue_event`,t=>{if(!n)try{e(JSON.parse(t.data))}catch{}}),t.onerror=()=>{n||(e({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`,reconnecting:t.readyState!==2}}),t.readyState===2&&(t.onerror=null,n=!0))},()=>{n||(n=!0,t.close())}}let t=new SharedWorker(new URL(`/assets/sse-queue-worker-Iwmqd2oW.js`,``+import.meta.url),{type:`module`}),n=!1;return t.onerror=()=>{n||e({type:`error`,ts:new Date().toISOString(),payload:{message:`Queue worker failed to load`}})},t.port.onmessage=r=>{n||typeof r.data==`object`&&r.data&&(r.data.type===`ping`?t.port.postMessage({type:`pong`}):e(r.data))},t.port.start(),t.port.postMessage({type:`init`,baseUrl:bv}),()=>{n||(n=!0,t.port.postMessage({type:`close`}),t.port.onmessage=null,t.port.close())}},removeQueuedRun:e=>Sv(`/api/runs/queue/${e}`,{method:`DELETE`}).then(()=>void 0),resumeQueue:()=>Sv(`/api/runs/queue/resume`,{method:`POST`}),subscribeRunJob:(e,t)=>{let n=new EventSource(`${bv}/api/runs/jobs/${e}/events`),r=!1,i=()=>{r||(r=!0,n.close())},a=e=>{if(!r&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);t(n),(n.type===`completed`||n.type===`error`)&&i()}catch{}};return n.addEventListener(`queued`,a),n.addEventListener(`started`,a),n.addEventListener(`log`,a),n.addEventListener(`completed`,a),n.addEventListener(`error`,a),n.addEventListener(`oauth_required`,a),n.onerror=()=>{r||(t({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`}}),i())},()=>{i()}}};function Dv(e){if(e.sourcePath){let t=e.sourcePath.split(`/`);return t[t.length-1].replace(/\.(yaml|yml)$/i,``)}return e.name||`config-${Date.now()}`}function Ov(e){return e||`config-${Date.now()}`}var kv={async health(){return G.health()},async listConfigs(){return(await G.listConfigs()).map(nv)},async createConfig(e){return nv(await G.createConfig(Dv(e),iv(e)))},async updateConfig(e){return nv(await G.updateConfig(e.id,iv(e),Ov(e.name)))},async deleteConfig(e){await G.deleteConfig(e)},async listResults(e){let t=0,n=[];for(;;){let r=await G.listRuns({...e,limit:100,offset:t});if(n.push(...r.data),!r.has_more||r.next_offset===null)break;t=r.next_offset}let r=n.map(async e=>{let[{runId:t,results:n},r]=await Promise.all([G.getRun(e.runId),G.getRunTrace(e.runId)]);return _v(n,r.records,t)});return Promise.all(r)},async listRunSummaries(e){let t=Math.max(1,Math.min(100,e?.limit??100)),n=Math.max(0,e?.offset??0),r=[];for(;;){let i=await G.listRuns({...e,limit:t,offset:n});if(r.push(...i.data),!i.has_more||i.next_offset===null)break;n=i.next_offset}return r},async listRunSummariesPage(e){return G.listRuns(e)},async getLatestPassRatesByConfigIds(e){return G.getLatestPassRatesByConfigIds(e)},async getResult(e){try{let[{runId:t,results:n},r]=await Promise.all([G.getRun(e),G.getRunTrace(e)]);return _v(n,r.records,t)}catch{return}},async deleteResult(e){await G.deleteRun(e)},async updateRunNote(e,t){await G.updateRunNote(e,t)},async listMarkdownReports(e){if(e?.limit!==void 0||e?.offset!==void 0)return(await G.listMarkdownReports(e)).data;let t=[],n=0;for(;;){let e=await G.listMarkdownReports({limit:100,offset:n});if(t.push(...e.data),!e.has_more||e.next_offset===null)break;n=e.next_offset}return t},async listMarkdownReportsPage(e){return G.listMarkdownReports(e)},async getMarkdownReport(e){return G.getMarkdownReport(e)},async getMarkdownReportById(e){return G.getMarkdownReportById(e)},async deleteMarkdownReport(e){await G.deleteMarkdownReport(e)},async startRun(e){let t=await G.startRun(e);return typeof window<`u`&&window.dispatchEvent(new Event(`mcplab:run-queue-changed`)),t},async runScenarioPreview(e){let t=await G.runScenarioPreview(e),n=t.scenario.run;if(!n)throw Error(`Preview run did not return a run result`);return{runId:t.runId,scenarioId:t.scenario.scenarioId,agentName:t.scenario.agent,run:vv(n,t.scenario.traceRecord)}},async stopRun(e){await G.stopRun(e)},async stopScenario(e,t,n){return G.stopScenario(e,t,n)},async stopEvaluationRun(e){await G.stopEvaluationRun(e)},async removeEvaluationRun(e){await G.removeEvaluationRun(e)},async openRover(e){return G.openRover(e)},async resumeRover(e){return G.resumeRover(e)},async getRoverStatus(){return G.getRoverStatus()},async getRunQueue(){return G.getRunQueue()},subscribeRunQueue(e){return G.subscribeRunQueue(e)},async removeQueuedRun(e){await G.removeQueuedRun(e)},async resumeQueue(){return G.resumeQueue()},subscribeRunJob(e,t){return G.subscribeRunJob(e,t)},async applyResultAssistantReport(e){return G.applyResultAssistantReport(e)},async createResultAssistantSession(e,t){return G.createResultAssistantSession(e,t)},async getResultAssistantSession(e){return G.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t,n){return G.sendResultAssistantMessage(e,t,n)},async approveResultAssistantToolCall(e,t,n){return G.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return G.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await G.closeResultAssistantSession(e)},subscribeResultAssistantSessionEvents(e,t){return G.subscribeResultAssistantSessionEvents(e,t)},async getLibraries(){return rv(await G.getLibraries())},async saveLibraries(e){await G.saveLibraries(av(e))},async listProviderModels(e){return G.listProviderModels(e)},async getWorkspaceSettings(){return G.getSettings()},async updateWorkspaceSettings(e){return G.updateSettings(e)},async createScenarioAssistantSession(e,t){return G.createScenarioAssistantSession(e,t)},async getScenarioAssistantSession(e){return G.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t,n){return G.sendScenarioAssistantMessage(e,t,n)},async approveScenarioAssistantToolCall(e,t){return G.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return G.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return G.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await G.closeScenarioAssistantSession(e)},subscribeScenarioAssistantSessionEvents(e,t){return G.subscribeScenarioAssistantSessionEvents(e,t)},async discoverToolsForAnalysis(e){return G.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return G.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return G.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return G.getToolAnalysisResult(e)},async stopToolAnalysis(e){return G.stopToolAnalysis(e)},async listToolAnalysisResults(e){if(e?.limit!==void 0||e?.offset!==void 0)return(await G.listToolAnalysisResults(e)).data;let t=[],n=0;for(;;){let e=await G.listToolAnalysisResults({limit:100,offset:n});if(t.push(...e.data),!e.has_more||e.next_offset===null)break;n=e.next_offset}return t},async listToolAnalysisResultsPage(e){return G.listToolAnalysisResults(e)},async listToolAnalysisServers(){return G.listToolAnalysisServers()},async getToolAnalysisSavedResult(e){return G.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await G.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return G.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return G.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return G.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return G.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return G.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return G.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return G.exportOAuthDebuggerSession(e,t)},async createOAuthRuntimeSession(e){return G.createOAuthRuntimeSession(e)},async getOAuthRuntimeSession(e){return G.getOAuthRuntimeSession(e)},async getOAuthRuntimeSessionToken(e){return G.getOAuthRuntimeSessionToken(e)},async submitOAuthRuntimeCallback(e,t){return G.submitOAuthRuntimeCallback(e,t)},async cancelOAuthRuntimeSession(e){return G.cancelOAuthRuntimeSession(e)},async ensureOAuthServers(e){return G.ensureOAuthServers(e)}},Av=(0,_.createContext)(null);function jv({children:e}){let t=`workspace`,[n,r]=(0,_.useState)(`checking`),[i,a]=(0,_.useState)(null);(0,_.useEffect)(()=>{r(`checking`),G.health().then(e=>{r(`connected`),a(typeof e?.version==`string`?e.version:null)}).catch(()=>{r(`disconnected`),a(null)})},[t]);let o=(0,_.useMemo)(()=>kv,[]);return(0,I.jsx)(Av.Provider,{value:{mode:t,connection:n,version:i,source:o},children:e})}function Mv(){let e=(0,_.useContext)(Av);if(!e)throw Error(`useDataSource must be used within DataSourceProvider`);return e}var Nv=5,Pv=2e3;function Fv(e){return e.filter(e=>e.status===`blocked_auth`&&e.blockedReason===`oauth_required`).length}function Iv(e){let t=e?.active??null;return{active:t,active_jobs:Array.isArray(e?.active_jobs)?e.active_jobs:t?[t]:[],admitting_jobs:Array.isArray(e?.admitting_jobs)?e.admitting_jobs:[],queued:Array.isArray(e?.queued)?e.queued:[]}}function Lv(){let{source:e}=Mv(),[t,n]=(0,_.useState)({active:null,active_jobs:[],admitting_jobs:[],queued:[]}),[r,i]=(0,_.useState)(`connecting`),[a,o]=(0,_.useState)(0),[s,c]=(0,_.useState)(0),l=(0,_.useRef)(`connecting`),u=(0,_.useRef)(0),d=(0,_.useRef)(new Set);return(0,_.useEffect)(()=>{let t=!1,r=0,a=null,s=null,c=0,f=r=>{let i=u.current;e.getRunQueue().then(e=>{if(t||r!==c||i!==u.current)return;let a=Iv(e);d.current=new Set([...a.active_jobs,...a.admitting_jobs].map(e=>e.jobId)),n(a)}).catch(()=>{})},p=()=>{a!==null&&(window.clearTimeout(a),a=null)},m=()=>{if(t)return;p();let h=++c;i(`connecting`),l.current=`connecting`,s?.(),s=e.subscribeRunQueue(e=>{let t=e.payload.event;if(e.type===`connected`)r=0,i(`connected`),l.current=`connected`;else if(e.type===`queue_event`&&t){u.current+=1;let e=Iv(t),r=new Set([...e.active_jobs,...e.admitting_jobs,...e.queued].map(e=>e.jobId)),a=[...d.current].filter(e=>!r.has(e)).length;a>0&&o(e=>e+a),d.current=new Set([...e.active_jobs,...e.admitting_jobs].map(e=>e.jobId)),i(`connected`),l.current=`connected`,n(e)}else if(e.type===`error`){if(s?.(),s=null,r>=Nv){i(`disconnected`),l.current=`disconnected`;return}r+=1,i(`connecting`),l.current=`connecting`;let e=Pv*2**(r-1);a=window.setTimeout(()=>{m()},e)}}),f(h)};m();let h=()=>f(c);window.addEventListener(`mcplab:run-queue-changed`,h);let g=()=>{l.current!==`connected`&&m()};return window.addEventListener(`focus`,g),()=>{t=!0,s?.(),p(),window.removeEventListener(`focus`,g),window.removeEventListener(`mcplab:run-queue-changed`,h)}},[e,s]),(0,_.useMemo)(()=>{let e=t.active_jobs.length>0||t.admitting_jobs.length>0,n=t.active_jobs.length+t.admitting_jobs.length,i=t.queued.length,o=Fv(t.queued);return{isRunning:e,runningCount:n,completionVersion:a,queuedCount:i,oauthBlockedCount:o,streamStatus:r,reconnectStream:()=>{c(e=>e+1)}}},[t,r])}var Rv=(e,t)=>{if(e===`/`)return[{label:`Dashboard`}];let n=[{label:`Dashboard`,to:`/`}];if($u(`/mcp-evaluations/:id/edit`,e))return n.push({label:`MCP Evaluations`,to:`/mcp-evaluations`},{label:`MCP Evaluation`,to:e.replace(/\/edit$/,``)},{label:`Edit`}),n;if($u(`/mcp-evaluations/:id`,e))return n.push({label:`MCP Evaluations`,to:`/mcp-evaluations`},{label:`MCP Evaluation`}),n;if($u(`/mcp-evaluations`,e))return n.push({label:`MCP Evaluations`}),n;if($u(`/settings/mcp`,e))return n.push({label:`Settings`,to:`/settings`},{label:`MCP Connection`}),n;if($u(`/settings`,e))return n.push({label:`Settings`}),n;if($u(`/tool-analysis`,e))return n.push({label:`Analyze MCP Tools`}),n;if($u(`/tool-analysis-results/:id`,e)){let t=$u(`/tool-analysis-results/:id`,e);return n.push({label:`Tool Analysis Results`,to:`/tool-analysis-results`},{label:t?.params.id??`Report`}),n}if($u(`/tool-analysis-results`,e))return n.push({label:`Tool Analysis Results`}),n;if($u(`/markdown-reports/view`,e))return n.push({label:`Markdown Reports`,to:`/markdown-reports`},{label:`View Report`}),n;if($u(`/markdown-reports`,e))return n.push({label:`Markdown Reports`}),n;if($u(`/oauth-debugger`,e))return n.push({label:`OAuth Debugger`}),n;if($u(`/results/:id`,e))return n.push({label:`Evaluation Results`,to:`/results`},{label:`Result`}),n;if($u(`/results`,e))return n.push({label:`Evaluation Results`}),n;if($u(`/run`,e))return n.push({label:`Run Evaluation`}),n;if($u(`/libraries/servers/:serverId`,e)){let t=$u(`/libraries/servers/:serverId`,e),r=t?.params.serverId?decodeURIComponent(t.params.serverId):`Server`;return n.push({label:`Libraries`,to:`/libraries/servers`},{label:`MCP servers`,to:`/libraries/servers`},{label:r===`new`?`New Server`:r}),n}if($u(`/libraries/servers`,e))return n.push({label:`Libraries`,to:`/libraries/servers`},{label:`MCP servers`}),n;if($u(`/libraries/agents/:agentName`,e)){let t=$u(`/libraries/agents/:agentName`,e),r=t?.params.agentName?decodeURIComponent(t.params.agentName):`Agent`;return n.push({label:`Libraries`,to:`/libraries/agents`},{label:`Agents`,to:`/libraries/agents`},{label:r===`new`?`New Agent`:r}),n}if($u(`/libraries/agents`,e))return n.push({label:`Libraries`,to:`/libraries/agents`},{label:`Agents`}),n;if($u(`/libraries/test-cases/:testCaseId`,e)){let t=$u(`/libraries/test-cases/:testCaseId`,e),r=t?.params.testCaseId?decodeURIComponent(t.params.testCaseId):`Test Case`;return n.push({label:`Libraries`,to:`/libraries/test-cases`},{label:`Test Cases`,to:`/libraries/test-cases`},{label:r}),n}if($u(`/libraries/test-cases`,e))return n.push({label:`Libraries`,to:`/libraries/test-cases`},{label:`Test Cases`}),n;if($u(`/compare/results`,e))return n.push({label:`Compare Evaluations`,to:`/compare`},{label:`Full Result Compare`}),n;if($u(`/compare`,e)){let e=new URLSearchParams(t).get(`mode`)===`within-run`?`Agents`:`Runs`;return n.push({label:`Compare Evaluations`,to:`/compare`},{label:e}),n}return n};function zv(){let e=Vd(),t=new URLSearchParams(e.search).get(`embed`)===`1`,n=Rv(e.pathname,e.search),{version:r}=Mv(),{isRunning:i,runningCount:a,queuedCount:o,oauthBlockedCount:s,streamStatus:c,reconnectStream:l}=Lv(),u=o+a;return t?(0,I.jsx)(`main`,{className:`min-h-screen overflow-auto bg-background p-4`,children:(0,I.jsx)(vf,{})}):(0,I.jsx)(kg,{children:(0,I.jsxs)(`div`,{className:`flex min-h-screen w-full`,children:[(0,I.jsx)(r_,{version:r}),(0,I.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,I.jsxs)(`header`,{className:`flex h-12 items-center gap-2 border-b bg-card px-4`,children:[(0,I.jsx)(jg,{}),(0,I.jsx)(a_,{children:(0,I.jsx)(o_,{children:n.map((e,t)=>{let r=t===n.length-1;return(0,I.jsxs)(_.Fragment,{children:[(0,I.jsx)(s_,{children:e.to&&!r?(0,I.jsx)(c_,{asChild:!0,children:(0,I.jsx)(cp,{to:e.to,children:e.label})}):(0,I.jsx)(l_,{children:e.label})}),!r&&(0,I.jsx)(u_,{})]},`${e.label}-${t}`)})})}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(i||o>0||s>0)&&(0,I.jsxs)(cp,{to:`/run`,className:`inline-flex items-center gap-2 rounded-full border px-2.5 py-1 hover:bg-muted/50 transition-colors`,title:`Open Run Evaluation queue`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Run Queue`}),(0,I.jsx)(`span`,{className:`inline-flex min-w-5 items-center justify-center rounded-full px-1.5 py-0.5 text-xs font-semibold ${s>0?`bg-yellow-500/20 text-yellow-800 dark:text-yellow-300`:`bg-muted text-foreground`}`,children:u}),i&&(0,I.jsx)(i_,{}),s>0&&(0,I.jsx)(`span`,{className:`text-xs text-yellow-700 dark:text-yellow-400`,children:`OAuth wait`})]}),(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-2 rounded-full border px-2.5 py-1 disabled:opacity-70`,onClick:()=>{c===`disconnected`&&l()},disabled:c===`connecting`,title:c===`disconnected`?`Retry queue connection`:c===`connecting`?`Connecting to queue stream...`:`Queue stream connected`,children:[(0,I.jsx)(`span`,{className:`h-2 w-2 rounded-full ${c===`connected`?`bg-emerald-500`:c===`connecting`?`bg-amber-400`:`bg-rose-500`}`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-xs ${c===`connected`?`text-emerald-700`:c===`connecting`?`text-muted-foreground`:`text-destructive`}`,children:c})]})]})]}),(0,I.jsx)(`main`,{className:`flex-1 overflow-auto p-6`,children:(0,I.jsx)(vf,{})})]})]})})}var Bv=(0,_.createContext)(null);function Vv({children:e}){let{source:t}=Mv(),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),o=(0,_.useCallback)(async()=>{a(!0);try{let e=await t.listConfigs();r(e)}finally{a(!1)}},[t]);(0,_.useEffect)(()=>{o()},[o]);let s=(0,_.useCallback)(e=>n.find(t=>t.id===e),[n]),c=(0,_.useCallback)(async e=>{let n=await t.createConfig(e);return r(e=>[...e,n]),n},[t]),l=(0,_.useCallback)(async(e,n)=>{let i=await t.updateConfig({...n,id:e});return r(t=>t.map(t=>t.id===e?i:t)),i},[t]),u=(0,_.useCallback)(async e=>{await t.deleteConfig(e),r(t=>t.filter(t=>t.id!==e))},[t]),d=(0,_.useCallback)(async e=>{let i=n.find(t=>t.id===e);if(!i)throw Error(`Config not found`);let a={...structuredClone(i),id:`cfg-${Date.now()}`,name:`${i.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},o=await t.createConfig(a);return r(e=>[...e,o]),o},[n,t]);return(0,I.jsx)(Bv.Provider,{value:{configs:n,loading:i,getConfig:s,addConfig:c,updateConfig:l,deleteConfig:u,cloneConfig:d,reload:o},children:e})}function Hv(){let e=(0,_.useContext)(Bv);if(!e)throw Error(`useConfigs must be used within ConfigProvider`);return e}var Uv=(0,_.createContext)(null);function Wv({children:e}){let{source:t}=Mv(),[n,r]=(0,_.useState)({servers:[],agents:[],scenarios:[],browserProviders:{}}),[i,a]=(0,_.useState)(!0),o=(0,_.useCallback)(async()=>{a(!0);try{let e=await t.getLibraries();r(e)}finally{a(!1)}},[t]);(0,_.useEffect)(()=>{o()},[t]),(0,_.useEffect)(()=>{let e=()=>{o()};return window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[t]);let s=(0,_.useCallback)(async e=>{r(e),await t.saveLibraries(e)},[t]),c=(0,_.useMemo)(()=>({...n,loading:i,setServers:async e=>s({...n,servers:e}),setAgents:async e=>s({...n,agents:e}),setScenarios:async e=>s({...n,scenarios:e}),reload:o}),[n,i,o,s]);return(0,I.jsx)(Uv.Provider,{value:c,children:e})}function Gv(){let e=(0,_.useContext)(Uv);if(!e)throw Error(`useLibraries must be used within LibraryProvider`);return e}var K=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`rounded-lg border bg-card text-card-foreground shadow-xs`,e),...t}));K.displayName=`Card`;var Kv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`flex flex-col space-y-1.5 p-6`,e),...t}));Kv.displayName=`CardHeader`;var qv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`h3`,{ref:n,className:U(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));qv.displayName=`CardTitle`;var Jv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`p`,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));Jv.displayName=`CardDescription`;var q=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`p-6 pt-0`,e),...t}));q.displayName=`CardContent`;var Yv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`flex items-center p-6 pt-0`,e),...t}));Yv.displayName=`CardFooter`;var Xv=_.forwardRef(({className:e,containerClassName:t,...n},r)=>(0,I.jsx)(`div`,{className:U(`relative w-full overflow-auto`,t),children:(0,I.jsx)(`table`,{ref:r,className:U(`w-full caption-bottom text-sm`,e),...n})}));Xv.displayName=`Table`;var Zv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`thead`,{ref:n,className:U(`[&_tr]:border-b`,e),...t}));Zv.displayName=`TableHeader`;var Qv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`tbody`,{ref:n,className:U(`[&_tr:last-child]:border-0`,e),...t}));Qv.displayName=`TableBody`;var $v=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`tfoot`,{ref:n,className:U(`border-t bg-muted/50 font-medium last:[&>tr]:border-b-0`,e),...t}));$v.displayName=`TableFooter`;var ey=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`tr`,{ref:n,className:U(`border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50`,e),...t}));ey.displayName=`TableRow`;var ty=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`th`,{ref:n,className:U(`h-12 px-4 text-left align-middle font-medium text-muted-foreground has-[[role=checkbox]]:pr-0`,e),...t}));ty.displayName=`TableHead`;var J=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`td`,{ref:n,className:U(`p-4 align-middle has-[[role=checkbox]]:pr-0`,e),...t}));J.displayName=`TableCell`;var ny=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`caption`,{ref:n,className:U(`mt-4 text-sm text-muted-foreground`,e),...t}));ny.displayName=`TableCaption`;function ry({title:e,value:t,subtitle:n,icon:r,trend:i,compact:a=!1}){return(0,I.jsx)(K,{className:a?`h-fit self-start`:void 0,children:(0,I.jsx)(q,{className:a?`p-2`:`p-4`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,I.jsxs)(`div`,{className:a?`space-y-0.5`:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:e}),(0,I.jsx)(`p`,{className:a?`text-lg font-bold`:`text-2xl font-bold`,children:t}),n&&(0,I.jsxs)(`p`,{className:`text-xs ${i===`up`?`text-success`:i===`down`?`text-destructive`:`text-muted-foreground`}`,children:[i===`up`&&`↑ `,i===`down`&&`↓ `,n]})]}),(0,I.jsx)(`div`,{className:a?`rounded-lg bg-primary/10 p-0.5`:`rounded-lg bg-primary/10 p-2`,children:(0,I.jsx)(r,{className:`h-4 w-4 text-primary`})})]})})})}var iy=Wt(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}}),Y=_.forwardRef(({className:e,variant:t,asChild:n,...r},i)=>(0,I.jsx)(n?Tp:`div`,{ref:i,className:U(iy({variant:t}),e),...r}));Y.displayName=`Badge`;function ay({rate:e,className:t}){let n=e===null?null:Math.round(e*100);return n===null?(0,I.jsx)(Y,{variant:`secondary`,className:`font-mono text-xs text-muted-foreground ${t??``}`,title:`Nothing evaluated`,children:`–`}):(0,I.jsxs)(Y,{variant:n>=80?`default`:n>=50?`secondary`:`destructive`,className:`font-mono text-xs ${n>=80?`bg-success/15 text-success hover:bg-success/20 border-0`:n>=50?`bg-warning/15 text-warning hover:bg-warning/20 border-0`:`bg-destructive/15 text-destructive hover:bg-destructive/20 border-0`} ${t??``}`,children:[n,`%`]})}var oy=o(((e,t)=>{t.exports=Array.isArray})),sy=o(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),cy=o(((e,t)=>{var n=sy(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),ly=o(((e,t)=>{t.exports=cy().Symbol})),uy=o(((e,t)=>{var n=ly(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),dy=o(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),fy=o(((e,t)=>{var n=ly(),r=uy(),i=dy(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),py=o(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),my=o(((e,t)=>{var n=fy(),r=py(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),hy=o(((e,t)=>{var n=oy(),r=my(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),gy=o(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),_y=o(((e,t)=>{var n=fy(),r=gy(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),vy=o(((e,t)=>{t.exports=cy()[`__core-js_shared__`]})),yy=o(((e,t)=>{var n=vy(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),by=o(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),xy=o(((e,t)=>{var n=_y(),r=yy(),i=gy(),a=by(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Sy=o(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),Cy=o(((e,t)=>{var n=xy(),r=Sy();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),wy=o(((e,t)=>{t.exports=Cy()(Object,`create`)})),Ty=o(((e,t)=>{var n=wy();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Ey=o(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),Dy=o(((e,t)=>{var n=wy(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Oy=o(((e,t)=>{var n=wy(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),ky=o(((e,t)=>{var n=wy(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),Ay=o(((e,t)=>{var n=Ty(),r=Ey(),i=Dy(),a=Oy(),o=ky();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),jy=o(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),My=o(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),Ny=o(((e,t)=>{var n=My();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Py=o(((e,t)=>{var n=Ny(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Fy=o(((e,t)=>{var n=Ny();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Iy=o(((e,t)=>{var n=Ny();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Ly=o(((e,t)=>{var n=Ny();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Ry=o(((e,t)=>{var n=jy(),r=Py(),i=Fy(),a=Iy(),o=Ly();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),zy=o(((e,t)=>{t.exports=Cy()(cy(),`Map`)})),By=o(((e,t)=>{var n=Ay(),r=Ry(),i=zy();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Vy=o(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Hy=o(((e,t)=>{var n=Vy();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Uy=o(((e,t)=>{var n=Hy();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),Wy=o(((e,t)=>{var n=Hy();function r(e){return n(this,e).get(e)}t.exports=r})),Gy=o(((e,t)=>{var n=Hy();function r(e){return n(this,e).has(e)}t.exports=r})),Ky=o(((e,t)=>{var n=Hy();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),qy=o(((e,t)=>{var n=By(),r=Uy(),i=Wy(),a=Gy(),o=Ky();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Jy=o(((e,t)=>{var n=qy(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),Yy=o(((e,t)=>{var n=Jy(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),Xy=o(((e,t)=>{var n=Yy(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),Zy=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),Qy=o(((e,t)=>{var n=ly(),r=Zy(),i=oy(),a=my(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),$y=o(((e,t)=>{var n=Qy();function r(e){return e==null?``:n(e)}t.exports=r})),eb=o(((e,t)=>{var n=oy(),r=hy(),i=Xy(),a=$y();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),tb=o(((e,t)=>{var n=my(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),nb=o(((e,t)=>{var n=eb(),r=tb();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),rb=o(((e,t)=>{var n=nb();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),ib=o(((e,t)=>{function n(e){return e==null}t.exports=n})),ab=o(((e,t)=>{var n=fy(),r=oy(),i=py(),a=`[object String]`;function o(e){return typeof e==`string`||!r(e)&&i(e)&&n(e)==a}t.exports=o})),ob=o((e=>{var t=Symbol.for(`react.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.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.server_context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.suspense_list`),f=Symbol.for(`react.memo`),p=Symbol.for(`react.lazy`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case u:case d:return e;default:switch(e&&=e.$$typeof,e){case c:case s:case l:case p:case f:case o:return e;default:return m}}case n:return m}}}e.isFragment=function(e){return m(e)===r}})),sb=o(((e,t)=>{t.exports=ob()})),cb=o(((e,t)=>{var n=fy(),r=py(),i=`[object Number]`;function a(e){return typeof e==`number`||r(e)&&n(e)==i}t.exports=a})),lb=o(((e,t)=>{var n=cb();function r(e){return n(e)&&e!=+e}t.exports=r})),ub=l(ab()),db=l(lb()),fb=l(rb()),pb=l(cb()),mb=l(ib()),hb=function(e){return e===0?0:e>0?1:-1},gb=function(e){return(0,ub.default)(e)&&e.indexOf(`%`)===e.length-1},X=function(e){return(0,pb.default)(e)&&!(0,db.default)(e)},_b=function(e){return(0,mb.default)(e)},vb=function(e){return X(e)||(0,ub.default)(e)},yb=0,bb=function(e){var t=++yb;return`${e||``}${t}`},xb=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!X(e)&&!(0,ub.default)(e))return n;var i;if(gb(e)){var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return(0,db.default)(i)&&(i=n),r&&i>t&&(i=t),i},Sb=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},Cb=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[e[r]])n[e[r]]=!0;else return!0;return!1},wb=function(e,t){return X(e)&&X(t)?function(n){return e+n*(t-e)}:function(){return t}};function Tb(e,t,n){return!e||!e.length?null:e.find(function(e){return e&&(typeof t==`function`?t(e):(0,fb.default)(e,t))===n})}var Eb=function(e,t){return X(e)&&X(t)?e-t:(0,ub.default)(e)&&(0,ub.default)(t)?e.localeCompare(t):e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():String(e).localeCompare(String(t))};function Db(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}var Ob=l(gy());function kb(e){"@babel/helpers - typeof";return kb=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},kb(e)}var Ab=[`viewBox`,`children`],jb=`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`),Mb=[`points`,`pathLength`],Nb={svg:Ab,polygon:Mb,polyline:Mb},Pb=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`),Fb=function(e,t){if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,_.isValidElement)(e)&&(n=e.props),!(0,Ob.default)(n))return null;var r={};return Object.keys(n).forEach(function(e){Pb.includes(e)&&(r[e]=t||function(t){return n[e](n,t)})}),r},Ib=function(e,t,n){return function(r){return e(t,n,r),null}},Lb=function(e,t,n){if(!(0,Ob.default)(e)||kb(e)!==`object`)return null;var r=null;return Object.keys(e).forEach(function(i){var a=e[i];Pb.includes(i)&&typeof a==`function`&&(r||={},r[i]=Ib(a,t,n))}),r},Rb=l(_y()),zb=sb(),Bb=[`children`],Vb=[`children`];function Hb(e,t){if(e==null)return{};var n=Ub(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ub(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Wb(e){"@babel/helpers - typeof";return Wb=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Wb(e)}var Gb={click:`onClick`,mousedown:`onMouseDown`,mouseup:`onMouseUp`,mouseover:`onMouseOver`,mousemove:`onMouseMove`,mouseout:`onMouseOut`,mouseenter:`onMouseEnter`,mouseleave:`onMouseLeave`,touchcancel:`onTouchCancel`,touchend:`onTouchEnd`,touchmove:`onTouchMove`,touchstart:`onTouchStart`,contextmenu:`onContextMenu`,dblclick:`onDoubleClick`},Kb=function(e){return typeof e==`string`?e:e?e.displayName||e.name||`Component`:``},qb=null,Jb=null,Yb=function e(t){if(t===qb&&Array.isArray(Jb))return Jb;var n=[];return _.Children.forEach(t,function(t){(0,mb.default)(t)||((0,zb.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),Jb=n,qb=t,n};function Xb(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return Kb(e)}):[Kb(t)],Yb(e).forEach(function(e){var t=(0,fb.default)(e,`type.displayName`)||(0,fb.default)(e,`type.name`);r.indexOf(t)!==-1&&n.push(e)}),n}function Zb(e,t){var n=Xb(e,t);return n&&n[0]}var Qb=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!(!X(n)||n<=0||!X(r)||r<=0)},$b=`a.altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColormatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-url.foreignObject.g.glyph.glyphRef.hkern.image.line.lineGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tref.tspan.use.view.vkern`.split(`.`),ex=function(e){return e&&e.type&&(0,ub.default)(e.type)&&$b.indexOf(e.type)>=0},tx=function(e){return e&&Wb(e)===`object`&&`clipDot`in e},nx=function(e,t,n,r){var i=Nb?.[r]??[];return t.startsWith(`data-`)||!(0,Rb.default)(e)&&(r&&i.includes(t)||jb.includes(t))||n&&Pb.includes(t)},rx=function(e,t,n){if(!e||typeof e==`function`||typeof e==`boolean`)return null;var r=e;if((0,_.isValidElement)(e)&&(r=e.props),!(0,Ob.default)(r))return null;var i={};return Object.keys(r).forEach(function(e){nx(r?.[e],e,t,n)&&(i[e]=r[e])}),i},ix=function e(t,n){if(t===n)return!0;var r=_.Children.count(t);if(r!==_.Children.count(n))return!1;if(r===0)return!0;if(r===1)return ax(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],o=n[i];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!ax(a,o))return!1}return!0},ax=function(e,t){if((0,mb.default)(e)&&(0,mb.default)(t))return!0;if(!(0,mb.default)(e)&&!(0,mb.default)(t)){var n=e.props||{},r=n.children,i=Hb(n,Bb),a=t.props||{},o=a.children,s=Hb(a,Vb);return r&&o?Db(i,s)&&ix(r,o):!r&&!o&&Db(i,s)}return!1},ox=function(e,t){var n=[],r={};return Yb(e).forEach(function(e,i){if(ex(e))n.push(e);else if(e){var a=Kb(e.type),o=t[a]||{},s=o.handler,c=o.once;if(s&&(!c||!r[a])){var l=s(e,a,i);n.push(l),r[a]=!0}}}),n},sx=function(e){var t=e&&e.type;return t&&Gb[t]?Gb[t]:null},mee=function(e,t){return Yb(t).indexOf(e)},cx=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function lx(){return lx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lx.apply(this,arguments)}function ux(e,t){if(e==null)return{};var n=dx(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dx(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function fx(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,c=e.desc,l=ux(e,cx),u=i||{width:n,height:r,x:0,y:0},d=Vt(`recharts-surface`,a);return _.createElement(`svg`,lx({},rx(l,!0,`svg`),{className:d,width:n,height:r,style:o,viewBox:`${u.x} ${u.y} ${u.width} ${u.height}`}),_.createElement(`title`,null,s),_.createElement(`desc`,null,c),t)}var px=[`children`,`className`];function mx(){return mx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mx.apply(this,arguments)}function hx(e,t){if(e==null)return{};var n=gx(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gx(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var _x=_.forwardRef(function(e,t){var n=e.children,r=e.className,i=hx(e,px),a=Vt(`recharts-layer`,r);return _.createElement(`g`,mx({className:a},rx(i,!0),{ref:t}),n)}),vx=o(((e,t)=>{function n(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=n})),yx=o(((e,t)=>{var n=vx();function r(e,t,r){var i=e.length;return r=r===void 0?i:r,!t&&r>=i?e:n(e,t,r)}t.exports=r})),bx=o(((e,t)=>{var n=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function r(e){return n.test(e)}t.exports=r})),xx=o(((e,t)=>{function n(e){return e.split(``)}t.exports=n})),Sx=o(((e,t)=>{var n=`\\ud800-\\udfff`,r=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,i=`\\ufe0e\\ufe0f`,a=`[`+n+`]`,o=`[`+r+`]`,s=`\\ud83c[\\udffb-\\udfff]`,c=`(?:`+o+`|`+s+`)`,l=`[^`+n+`]`,u=`(?:\\ud83c[\\udde6-\\uddff]){2}`,d=`[\\ud800-\\udbff][\\udc00-\\udfff]`,f=`\\u200d`,p=c+`?`,m=`[`+i+`]?`,h=`(?:`+f+`(?:`+[l,u,d].join(`|`)+`)`+m+p+`)*`,g=m+p+h,_=`(?:`+[l+o+`?`,o,u,d,a].join(`|`)+`)`,v=RegExp(s+`(?=`+s+`)|`+_+g,`g`);function y(e){return e.match(v)||[]}t.exports=y})),Cx=o(((e,t)=>{var n=xx(),r=bx(),i=Sx();function a(e){return r(e)?i(e):n(e)}t.exports=a})),wx=o(((e,t)=>{var n=yx(),r=bx(),i=Cx(),a=$y();function o(e){return function(t){t=a(t);var o=r(t)?i(t):void 0,s=o?o[0]:t.charAt(0),c=o?n(o,1).join(``):t.slice(1);return s[e]()+c}}t.exports=o})),Tx=o(((e,t)=>{t.exports=wx()(`toUpperCase`)}));function Ex(e){return function(){return e}}var Dx=Math.cos,Ox=Math.sin,kx=Math.sqrt,Ax=Math.PI;Ax/2;var jx=2*Ax,Mx=Math.PI,Nx=2*Mx,Px=1e-6,Fx=Nx-Px;function Ix(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Lx(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Ix;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var Rx=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?Ix:Lx(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Px){if(!(Math.abs(u*s-c*l)>Px)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Mx-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Px&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Px||Math.abs(this._y1-l)>Px)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Nx+Nx),d>Fx?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Px&&this._append`A${n},${n},0,${+(d>=Mx)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};Rx.prototype;function zx(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Rx(t)}Array.prototype.slice;function Bx(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Vx(e){this._context=e}Vx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function Hx(e){return new Vx(e)}function Ux(e){return e[0]}function Wx(e){return e[1]}function Gx(e,t){var n=Ex(!0),r=null,i=Hx,a=null,o=zx(s);e=typeof e==`function`?e:e===void 0?Ux:Ex(e),t=typeof t==`function`?t:t===void 0?Wx:Ex(t);function s(s){var c,l=(s=Bx(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:Ex(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:Ex(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:Ex(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function Kx(e,t,n){var r=null,i=Ex(!0),a=null,o=Hx,s=null,c=zx(l);e=typeof e==`function`?e:e===void 0?Ux:Ex(+e),t=typeof t==`function`?t:Ex(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Wx:Ex(+n);function l(l){var u,d,f,p=(l=Bx(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h){if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Gx().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:Ex(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:Ex(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:Ex(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:Ex(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:Ex(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:Ex(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:Ex(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var qx=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function Jx(e){return new qx(e,!0)}function Yx(e){return new qx(e,!1)}var Xx={draw(e,t){let n=kx(t/Ax);e.moveTo(n,0),e.arc(0,0,n,0,jx)}},Zx={draw(e,t){let n=kx(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Qx=kx(1/3),$x=Qx*2,eS={draw(e,t){let n=kx(t/$x),r=n*Qx;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},tS={draw(e,t){let n=kx(t),r=-n/2;e.rect(r,r,n,n)}},nS=.8908130915292852,rS=Ox(Ax/10)/Ox(7*Ax/10),iS=Ox(jx/10)*rS,aS=-Dx(jx/10)*rS,oS={draw(e,t){let n=kx(t*nS),r=iS*n,i=aS*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=jx*t/5,o=Dx(a),s=Ox(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},sS=kx(3),cS={draw(e,t){let n=-kx(t/(sS*3));e.moveTo(0,n*2),e.lineTo(-sS*n,-n),e.lineTo(sS*n,-n),e.closePath()}},lS=-.5,uS=kx(3)/2,dS=1/kx(12),fS=(dS/2+1)*3,pS={draw(e,t){let n=kx(t/fS),r=n/2,i=n*dS,a=r,o=n*dS+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(lS*r-uS*i,uS*r+lS*i),e.lineTo(lS*a-uS*o,uS*a+lS*o),e.lineTo(lS*s-uS*c,uS*s+lS*c),e.lineTo(lS*r+uS*i,lS*i-uS*r),e.lineTo(lS*a+uS*o,lS*o-uS*a),e.lineTo(lS*s+uS*c,lS*c-uS*s),e.closePath()}};function mS(e,t){let n=null,r=zx(i);e=typeof e==`function`?e:Ex(e||Xx),t=typeof t==`function`?t:Ex(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:Ex(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:Ex(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function hS(){}function gS(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function _S(e){this._context=e}_S.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:gS(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:gS(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function vS(e){return new _S(e)}function yS(e){this._context=e}yS.prototype={areaStart:hS,areaEnd:hS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:gS(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function bS(e){return new yS(e)}function xS(e){this._context=e}xS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:gS(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function SS(e){return new xS(e)}function CS(e){this._context=e}CS.prototype={areaStart:hS,areaEnd:hS,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function wS(e){return new CS(e)}function TS(e){return e<0?-1:1}function ES(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(TS(a)+TS(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function DS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function OS(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function kS(e){this._context=e}kS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:OS(this,this._t0,DS(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,OS(this,DS(this,n=ES(this,e,t)),n);break;default:OS(this,this._t0,n=ES(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function AS(e){this._context=new jS(e)}(AS.prototype=Object.create(kS.prototype)).point=function(e,t){kS.prototype.point.call(this,t,e)};function jS(e){this._context=e}jS.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function MS(e){return new kS(e)}function NS(e){return new AS(e)}function PS(e){this._context=e}PS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=FS(e),i=FS(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function FS(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function IS(e){return new PS(e)}function LS(e,t){this._context=e,this._t=t}LS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function RS(e){return new LS(e,.5)}function zS(e){return new LS(e,0)}function BS(e){return new LS(e,1)}function VS(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function HS(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function US(e,t){return e[t]}function WS(e){let t=[];return t.key=e,t}function GS(){var e=Ex([]),t=HS,n=VS,r=US;function i(i){var a=Array.from(e.apply(this,arguments),WS),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=Bx(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:Ex(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:Ex(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?HS:typeof e==`function`?e:Ex(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??VS,i):n},i}function KS(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}VS(e,t)}}function qS(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}VS(e,t)}}function JS(e,t){if((o=e.length)>0&&(a=(i=e[t[0]]).length)>0){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,VS(e,t)}}var YS=l(Tx());function XS(e){"@babel/helpers - typeof";return XS=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},XS(e)}var ZS=[`type`,`size`,`sizeType`];function QS(){return QS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QS.apply(this,arguments)}function $S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$S(Object(n),!0).forEach(function(t){tC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tC(e,t,n){return t=nC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nC(e){var t=rC(e,`string`);return XS(t)==`symbol`?t:t+``}function rC(e,t){if(XS(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(XS(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function iC(e,t){if(e==null)return{};var n=aC(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aC(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var oC={symbolCircle:Xx,symbolCross:Zx,symbolDiamond:eS,symbolSquare:tS,symbolStar:oS,symbolTriangle:cS,symbolWye:pS},sC=Math.PI/180,cC=function(e){return oC[`symbol${(0,YS.default)(e)}`]||Xx},lC=function(e,t,n){if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*sC;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},uC=function(e,t){oC[`symbol${(0,YS.default)(e)}`]=t},dC=function(e){var t=e.type,n=t===void 0?`circle`:t,r=e.size,i=r===void 0?64:r,a=e.sizeType,o=a===void 0?`area`:a,s=eC(eC({},iC(e,ZS)),{},{type:n,size:i,sizeType:o}),c=function(){var e=cC(n);return mS().type(e).size(lC(i,o,n))()},l=s.className,u=s.cx,d=s.cy,f=rx(s,!0);return u===+u&&d===+d&&i===+i?_.createElement(`path`,QS({},f,{className:Vt(`recharts-symbols`,l),transform:`translate(${u}, ${d})`,d:c()})):null};dC.registerSymbol=uC;function fC(e){"@babel/helpers - typeof";return fC=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},fC(e)}function pC(){return pC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pC.apply(this,arguments)}function mC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mC(Object(n),!0).forEach(function(t){EC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gC(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function _C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,DC(r.key),r)}}function vC(e,t,n){return t&&_C(e.prototype,t),n&&_C(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yC(e,t,n){return t=CC(t),bC(e,SC()?Reflect.construct(t,n||[],CC(e).constructor):t.apply(e,n))}function bC(e,t){if(t&&(fC(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return xC(e)}function xC(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function SC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SC=function(){return!!e})()}function CC(e){return CC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},CC(e)}function wC(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&TC(e,t)}function TC(e,t){return TC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},TC(e,t)}function EC(e,t,n){return t=DC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DC(e){var t=OC(e,`string`);return fC(t)==`symbol`?t:t+``}function OC(e,t){if(fC(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(fC(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var kC=32,AC=function(e){function t(){return gC(this,t),yC(this,t,arguments)}return wC(t,e),vC(t,[{key:`renderIcon`,value:function(e){var t=this.props.inactiveColor,n=kC/2,r=kC/6,i=kC/3,a=e.inactive?t:e.color;if(e.type===`plainline`)return _.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:a,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:n,x2:kC,y2:n,className:`recharts-legend-icon`});if(e.type===`line`)return _.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:a,d:`M0,${n}h${i}
60
+ A${r},${r},0,1,1,${2*i},${n}
61
+ H${kC}M${2*i},${n}
62
+ A${r},${r},0,1,1,${i},${n}`,className:`recharts-legend-icon`});if(e.type===`rect`)return _.createElement(`path`,{stroke:`none`,fill:a,d:`M0,${kC/8}h${kC}v${kC*3/4}h${-kC}z`,className:`recharts-legend-icon`});if(_.isValidElement(e.legendIcon)){var o=hC({},e);return delete o.legendIcon,_.cloneElement(e.legendIcon,o)}return _.createElement(dC,{fill:a,cx:n,cy:n,size:kC,sizeType:`diameter`,type:e.type})}},{key:`renderItems`,value:function(){var e=this,t=this.props,n=t.payload,r=t.iconSize,i=t.layout,a=t.formatter,o=t.inactiveColor,s={x:0,y:0,width:kC,height:kC},c={display:i===`horizontal`?`inline-block`:`block`,marginRight:10},l={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return n.map(function(t,n){var i=t.formatter||a,u=Vt(EC(EC({"recharts-legend-item":!0},`legend-item-${n}`,!0),`inactive`,t.inactive));if(t.type===`none`)return null;var d=(0,Rb.default)(t.value)?null:t.value;(0,Rb.default)(t.value);var f=t.inactive?o:t.color;return _.createElement(`li`,pC({className:u,style:c,key:`legend-item-${n}`},Lb(e.props,t,n)),_.createElement(fx,{width:r,height:r,viewBox:s,style:l},e.renderIcon(t)),_.createElement(`span`,{className:`recharts-legend-item-text`,style:{color:f}},i?i(d,t,n):d))})}},{key:`render`,value:function(){var e=this.props,t=e.payload,n=e.layout,r=e.align;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:n===`horizontal`?r:`left`};return _.createElement(`ul`,{className:`recharts-default-legend`,style:i},this.renderItems())}}])}(_.PureComponent);EC(AC,`displayName`,`Legend`),EC(AC,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`middle`,inactiveColor:`#ccc`});var jC=o(((e,t)=>{var n=Ry();function r(){this.__data__=new n,this.size=0}t.exports=r})),MC=o(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),NC=o(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),hee=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),gee=o(((e,t)=>{var n=Ry(),r=zy(),i=qy(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),PC=o(((e,t)=>{var n=Ry(),r=jC(),i=MC(),a=NC(),o=hee(),s=gee();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),_ee=o(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),vee=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),FC=o(((e,t)=>{var n=qy(),r=_ee(),i=vee();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),IC=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),LC=o(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),RC=o(((e,t)=>{var n=FC(),r=IC(),i=LC(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),yee=o(((e,t)=>{t.exports=cy().Uint8Array})),bee=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),zC=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),xee=o(((e,t)=>{var n=ly(),r=yee(),i=My(),a=RC(),o=bee(),s=zC(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),BC=o(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),See=o(((e,t)=>{var n=BC(),r=oy();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),Cee=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),wee=o(((e,t)=>{function n(){return[]}t.exports=n})),Tee=o(((e,t)=>{var n=Cee(),r=wee(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),Eee=o(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),Dee=o(((e,t)=>{var n=fy(),r=py(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),VC=o(((e,t)=>{var n=Dee(),r=py(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),Oee=o(((e,t)=>{function n(){return!1}t.exports=n})),HC=o(((e,t)=>{var n=cy(),r=Oee(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),UC=o(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r})),WC=o(((e,t)=>{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),kee=o(((e,t)=>{var n=fy(),r=WC(),i=py(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),GC=o(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),Aee=o(((e,t)=>{var n=sy(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),KC=o(((e,t)=>{var n=kee(),r=GC(),i=Aee(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),jee=o(((e,t)=>{var n=Eee(),r=VC(),i=oy(),a=HC(),o=UC(),s=KC(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),Mee=o(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),qC=o(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),Nee=o(((e,t)=>{t.exports=qC()(Object.keys,Object)})),Pee=o(((e,t)=>{var n=Mee(),r=Nee(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),JC=o(((e,t)=>{var n=_y(),r=WC();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),YC=o(((e,t)=>{var n=jee(),r=Pee(),i=JC();function a(e){return i(e)?n(e):r(e)}t.exports=a})),XC=o(((e,t)=>{var n=See(),r=Tee(),i=YC();function a(e){return n(e,i,r)}t.exports=a})),ZC=o(((e,t)=>{var n=XC(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),QC=o(((e,t)=>{t.exports=Cy()(cy(),`DataView`)})),$C=o(((e,t)=>{t.exports=Cy()(cy(),`Promise`)})),ew=o(((e,t)=>{t.exports=Cy()(cy(),`Set`)})),tw=o(((e,t)=>{t.exports=Cy()(cy(),`WeakMap`)})),nw=o(((e,t)=>{var n=QC(),r=zy(),i=$C(),a=ew(),o=tw(),s=fy(),c=by(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),rw=o(((e,t)=>{var n=PC(),r=RC(),i=xee(),a=ZC(),o=nw(),s=oy(),c=HC(),l=KC(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),iw=o(((e,t)=>{var n=rw(),r=py();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),aw=o(((e,t)=>{var n=PC(),r=iw(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),ow=o(((e,t)=>{var n=gy();function r(e){return e===e&&!n(e)}t.exports=r})),sw=o(((e,t)=>{var n=ow(),r=YC();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),cw=o(((e,t)=>{function n(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),lw=o(((e,t)=>{var n=aw(),r=sw(),i=cw();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),uw=o(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),dw=o(((e,t)=>{var n=eb(),r=VC(),i=oy(),a=UC(),o=WC(),s=tb();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),fw=o(((e,t)=>{var n=uw(),r=dw();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),pw=o(((e,t)=>{var n=iw(),r=rb(),i=fw(),a=hy(),o=ow(),s=cw(),c=tb(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),mw=o(((e,t)=>{function n(e){return e}t.exports=n})),hw=o(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),Fee=o(((e,t)=>{var n=nb();function r(e){return function(t){return n(t,e)}}t.exports=r})),gw=o(((e,t)=>{var n=hw(),r=Fee(),i=hy(),a=tb();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),_w=o(((e,t)=>{var n=lw(),r=pw(),i=mw(),a=oy(),o=gw();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),vw=o(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),yw=o(((e,t)=>{function n(e){return e!==e}t.exports=n})),bw=o(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),xw=o(((e,t)=>{var n=vw(),r=yw(),i=bw();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),Sw=o(((e,t)=>{var n=xw();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),Cw=o(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),ww=o(((e,t)=>{function n(){}t.exports=n})),Tw=o(((e,t)=>{var n=ew(),r=ww(),i=zC();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),Ew=o(((e,t)=>{var n=FC(),r=Sw(),i=Cw(),a=LC(),o=Tw(),s=zC(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),Dw=l(o(((e,t)=>{var n=_w(),r=Ew();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))());function Ow(e,t,n){return t===!0?(0,Dw.default)(e,n):(0,Rb.default)(t)?(0,Dw.default)(e,t):e}function kw(e){"@babel/helpers - typeof";return kw=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},kw(e)}var Aw=[`ref`];function jw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jw(Object(n),!0).forEach(function(t){Uw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Nw(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Pw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Ww(r.key),r)}}function Fw(e,t,n){return t&&Pw(e.prototype,t),n&&Pw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Iw(e,t,n){return t=Bw(t),Lw(e,zw()?Reflect.construct(t,n||[],Bw(e).constructor):t.apply(e,n))}function Lw(e,t){if(t&&(kw(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Rw(e)}function Rw(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function zw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zw=function(){return!!e})()}function Bw(e){return Bw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bw(e)}function Vw(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hw(e,t)}function Hw(e,t){return Hw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hw(e,t)}function Uw(e,t,n){return t=Ww(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ww(e){var t=Gw(e,`string`);return kw(t)==`symbol`?t:t+``}function Gw(e,t){if(kw(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(kw(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Kw(e,t){if(e==null)return{};var n=qw(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qw(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jw(e){return e.value}function Yw(e,t){if(_.isValidElement(e))return _.cloneElement(e,t);if(typeof e==`function`)return _.createElement(e,t);t.ref;var n=Kw(t,Aw);return _.createElement(AC,n)}var Xw=1,Zw=function(e){function t(){var e;Nw(this,t);var n=[...arguments];return e=Iw(this,t,[].concat(n)),Uw(e,`lastBoundingBox`,{width:-1,height:-1}),e}return Vw(t,e),Fw(t,[{key:`componentDidMount`,value:function(){this.updateBBox()}},{key:`componentDidUpdate`,value:function(){this.updateBBox()}},{key:`getBBox`,value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();return e.height=this.wrapperNode.offsetHeight,e.width=this.wrapperNode.offsetWidth,e}return null}},{key:`updateBBox`,value:function(){var e=this.props.onBBoxUpdate,t=this.getBBox();t?(Math.abs(t.width-this.lastBoundingBox.width)>Xw||Math.abs(t.height-this.lastBoundingBox.height)>Xw)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:`getBBoxSnapshot`,value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Mw({},this.lastBoundingBox):{width:0,height:0}}},{key:`getDefaultPosition`,value:function(e){var t=this.props,n=t.layout,r=t.align,i=t.verticalAlign,a=t.margin,o=t.chartWidth,s=t.chartHeight,c,l;if(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null)){if(r===`center`&&n===`vertical`){var u=this.getBBoxSnapshot();c={left:((o||0)-u.width)/2}}else c=r===`right`?{right:a&&a.right||0}:{left:a&&a.left||0}}if(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null)){if(i===`middle`){var d=this.getBBoxSnapshot();l={top:((s||0)-d.height)/2}}else l=i===`bottom`?{bottom:a&&a.bottom||0}:{top:a&&a.top||0}}return Mw(Mw({},c),l)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.content,r=t.width,i=t.height,a=t.wrapperStyle,o=t.payloadUniqBy,s=t.payload,c=Mw(Mw({position:`absolute`,width:r||`auto`,height:i||`auto`},this.getDefaultPosition(a)),a);return _.createElement(`div`,{className:`recharts-legend-wrapper`,style:c,ref:function(t){e.wrapperNode=t}},Yw(n,Mw(Mw({},this.props),{},{payload:Ow(s,o,Jw)})))}}],[{key:`getWithHeight`,value:function(e,t){var n=Mw(Mw({},this.defaultProps),e.props).layout;return n===`vertical`&&X(e.props.height)?{height:e.props.height}:n===`horizontal`?{width:e.props.width||t}:null}}])}(_.PureComponent);Uw(Zw,`displayName`,`Legend`),Uw(Zw,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`bottom`});var Qw=o(((e,t)=>{var n=ly(),r=VC(),i=oy(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),$w=o(((e,t)=>{var n=BC(),r=Qw();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),eT=o(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),tT=o(((e,t)=>{t.exports=eT()()})),nT=o(((e,t)=>{var n=tT(),r=YC();function i(e,t){return e&&n(e,t,r)}t.exports=i})),rT=o(((e,t)=>{var n=JC();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),iT=o(((e,t)=>{var n=nT();t.exports=rT()(n)})),aT=o(((e,t)=>{var n=iT(),r=JC();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),oT=o(((e,t)=>{function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=n})),sT=o(((e,t)=>{var n=my();function r(e,t){if(e!==t){var r=e!==void 0,i=e===null,a=e===e,o=n(e),s=t!==void 0,c=t===null,l=t===t,u=n(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}t.exports=r})),cT=o(((e,t)=>{var n=sT();function r(e,t,r){for(var i=-1,a=e.criteria,o=t.criteria,s=a.length,c=r.length;++i<s;){var l=n(a[i],o[i]);if(l)return i>=c?l:l*(r[i]==`desc`?-1:1)}return e.index-t.index}t.exports=r})),lT=o(((e,t)=>{var n=Zy(),r=nb(),i=_w(),a=aT(),o=oT(),s=GC(),c=cT(),l=mw(),u=oy();function d(e,t,d){t=t.length?n(t,function(e){return u(e)?function(t){return r(t,e.length===1?e[0]:e)}:e}):[l];var f=-1;return t=n(t,s(i)),o(a(e,function(e,r,i){return{criteria:n(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,d)})}t.exports=d})),uT=o(((e,t)=>{function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=n})),dT=o(((e,t)=>{var n=uT(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o<s;)c[o]=a[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=a[o];return l[t]=i(c),n(e,this,l)}}t.exports=i})),fT=o(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),pT=o(((e,t)=>{var n=Cy();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),mT=o(((e,t)=>{var n=fT(),r=pT(),i=mw();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),hT=o(((e,t)=>{var n=Date.now;function r(e){var t=0,r=0;return function(){var i=n(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=r})),Iee=o(((e,t)=>{var n=mT();t.exports=hT()(n)})),Lee=o(((e,t)=>{var n=mw(),r=dT(),i=Iee();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),gT=o(((e,t)=>{var n=My(),r=JC(),i=UC(),a=gy();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),_T=l(o(((e,t)=>{var n=$w(),r=lT(),i=Lee(),a=gT();t.exports=i(function(e,t){if(e==null)return[];var i=t.length;return i>1&&a(e,t[0],t[1])?t=[]:i>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])})}))());function vT(e){"@babel/helpers - typeof";return vT=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},vT(e)}function yT(){return yT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yT.apply(this,arguments)}function bT(e,t){return TT(e)||wT(e,t)||ST(e,t)||xT()}function xT(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
63
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ST(e,t){if(e){if(typeof e==`string`)return CT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CT(e,t)}}function CT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wT(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function TT(e){if(Array.isArray(e))return e}function ET(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ET(Object(n),!0).forEach(function(t){OT(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ET(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function OT(e,t,n){return t=kT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kT(e){var t=AT(e,`string`);return vT(t)==`symbol`?t:t+``}function AT(e,t){if(vT(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(vT(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function jT(e){return Array.isArray(e)&&vb(e[0])&&vb(e[1])?e.join(` ~ `):e}var MT=function(e){var t=e.separator,n=t===void 0?` : `:t,r=e.contentStyle,i=r===void 0?{}:r,a=e.itemStyle,o=a===void 0?{}:a,s=e.labelStyle,c=s===void 0?{}:s,l=e.payload,u=e.formatter,d=e.itemSorter,f=e.wrapperClassName,p=e.labelClassName,m=e.label,h=e.labelFormatter,g=e.accessibilityLayer,v=g!==void 0&&g,y=function(){if(l&&l.length){var e={padding:0,margin:0},t=(d?(0,_T.default)(l,d):l).map(function(e,t){if(e.type===`none`)return null;var r=DT({display:`block`,paddingTop:4,paddingBottom:4,color:e.color||`#000`},o),i=e.formatter||u||jT,a=e.value,s=e.name,c=a,d=s;if(i&&c!=null&&d!=null){var f=i(a,s,e,t,l);if(Array.isArray(f)){var p=bT(f,2);c=p[0],d=p[1]}else c=f}return _.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:r},vb(d)?_.createElement(`span`,{className:`recharts-tooltip-item-name`},d):null,vb(d)?_.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,_.createElement(`span`,{className:`recharts-tooltip-item-value`},c),_.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return _.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},b=DT({margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},i),x=DT({margin:0},c),S=!(0,mb.default)(m),C=S?m:``,w=Vt(`recharts-default-tooltip`,f),T=Vt(`recharts-tooltip-label`,p);S&&h&&l!=null&&(C=h(m,l));var E=v?{role:`status`,"aria-live":`assertive`}:{};return _.createElement(`div`,yT({className:w,style:b},E),_.createElement(`p`,{className:T,style:x},_.isValidElement(C)?C:`${C}`),y())};function NT(e){"@babel/helpers - typeof";return NT=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},NT(e)}function PT(e,t,n){return t=FT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FT(e){var t=IT(e,`string`);return NT(t)==`symbol`?t:t+``}function IT(e,t){if(NT(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(NT(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var LT=`recharts-tooltip-wrapper`,RT={visibility:`hidden`};function zT(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Vt(LT,PT(PT(PT(PT({},`${LT}-right`,X(n)&&t&&X(t.x)&&n>=t.x),`${LT}-left`,X(n)&&t&&X(t.x)&&n<t.x),`${LT}-bottom`,X(r)&&t&&X(t.y)&&r>=t.y),`${LT}-top`,X(r)&&t&&X(t.y)&&r<t.y))}function BT(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,a=e.position,o=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,l=e.viewBoxDimension;if(a&&X(a[r]))return a[r];var u=n[r]-s-i,d=n[r]+i;return t[r]?o[r]?u:d:o[r]?u<c[r]?Math.max(d,c[r]):Math.max(u,c[r]):d+s>c[r]+l?Math.max(u,c[r]):Math.max(d,c[r])}function VT(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function HT(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,c=e.viewBox,l,u,d;return o.height>0&&o.width>0&&n?(u=BT({allowEscapeViewBox:t,coordinate:n,key:`x`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=BT({allowEscapeViewBox:t,coordinate:n,key:`y`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),l=VT({translateX:u,translateY:d,useTranslate3d:s})):l=RT,{cssProperties:l,cssClasses:zT({translateX:u,translateY:d,coordinate:n})}}function UT(e){"@babel/helpers - typeof";return UT=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},UT(e)}function WT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function GT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WT(Object(n),!0).forEach(function(t){nE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WT(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KT(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function qT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,rE(r.key),r)}}function JT(e,t,n){return t&&qT(e.prototype,t),n&&qT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function YT(e,t,n){return t=$T(t),XT(e,QT()?Reflect.construct(t,n||[],$T(e).constructor):t.apply(e,n))}function XT(e,t){if(t&&(UT(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return ZT(e)}function ZT(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function QT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QT=function(){return!!e})()}function $T(e){return $T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$T(e)}function eE(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tE(e,t)}function tE(e,t){return tE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tE(e,t)}function nE(e,t,n){return t=rE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rE(e){var t=iE(e,`string`);return UT(t)==`symbol`?t:t+``}function iE(e,t){if(UT(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(UT(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var aE=1,oE=function(e){function t(){var e;KT(this,t);var n=[...arguments];return e=YT(this,t,[].concat(n)),nE(e,`state`,{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),nE(e,`handleKeyDown`,function(t){t.key===`Escape`&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:e.props.coordinate?.x??0,y:e.props.coordinate?.y??0}})}),e}return eE(t,e),JT(t,[{key:`updateBBox`,value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.state.lastBoundingBox.width)>aE||Math.abs(e.height-this.state.lastBoundingBox.height)>aE)&&this.setState({lastBoundingBox:{width:e.width,height:e.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:`componentDidMount`,value:function(){document.addEventListener(`keydown`,this.handleKeyDown),this.updateBBox()}},{key:`componentWillUnmount`,value:function(){document.removeEventListener(`keydown`,this.handleKeyDown)}},{key:`componentDidUpdate`,value:function(){this.props.active&&this.updateBBox(),this.state.dismissed&&(this.props.coordinate?.x!==this.state.dismissedAtCoordinate.x||this.props.coordinate?.y!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.children,s=t.coordinate,c=t.hasPayload,l=t.isAnimationActive,u=t.offset,d=t.position,f=t.reverseDirection,p=t.useTranslate3d,m=t.viewBox,h=t.wrapperStyle,g=HT({allowEscapeViewBox:r,coordinate:s,offsetTopLeft:u,position:d,reverseDirection:f,tooltipBox:this.state.lastBoundingBox,useTranslate3d:p,viewBox:m}),v=g.cssClasses,y=g.cssProperties,b=GT(GT({transition:l&&n?`transform ${i}ms ${a}`:void 0},y),{},{pointerEvents:`none`,visibility:!this.state.dismissed&&n&&c?`visible`:`hidden`,position:`absolute`,top:0,left:0},h);return _.createElement(`div`,{tabIndex:-1,className:v,style:b,ref:function(t){e.wrapperNode=t}},o)}}])}(_.PureComponent),sE={isSsr:function(){return!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)}(),get:function(e){return sE[e]},set:function(e,t){if(typeof e==`string`)sE[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){sE[t]=e[t]})}}};function cE(e){"@babel/helpers - typeof";return cE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},cE(e)}function lE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lE(Object(n),!0).forEach(function(t){xE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dE(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function fE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,SE(r.key),r)}}function pE(e,t,n){return t&&fE(e.prototype,t),n&&fE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mE(e,t,n){return t=vE(t),hE(e,_E()?Reflect.construct(t,n||[],vE(e).constructor):t.apply(e,n))}function hE(e,t){if(t&&(cE(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return gE(e)}function gE(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function _E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_E=function(){return!!e})()}function vE(e){return vE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vE(e)}function yE(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bE(e,t)}function bE(e,t){return bE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bE(e,t)}function xE(e,t,n){return t=SE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SE(e){var t=CE(e,`string`);return cE(t)==`symbol`?t:t+``}function CE(e,t){if(cE(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(cE(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wE(e){return e.dataKey}function TE(e,t){return _.isValidElement(e)?_.cloneElement(e,t):typeof e==`function`?_.createElement(e,t):_.createElement(MT,t)}var EE=function(e){function t(){return dE(this,t),mE(this,t,arguments)}return yE(t,e),pE(t,[{key:`render`,value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.content,s=t.coordinate,c=t.filterNull,l=t.isAnimationActive,u=t.offset,d=t.payload,f=t.payloadUniqBy,p=t.position,m=t.reverseDirection,h=t.useTranslate3d,g=t.viewBox,v=t.wrapperStyle,y=d??[];c&&y.length&&(y=Ow(d.filter(function(t){return t.value!=null&&(t.hide!==!0||e.props.includeHidden)}),f,wE));var b=y.length>0;return _.createElement(oE,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:l,active:n,coordinate:s,hasPayload:b,offset:u,position:p,reverseDirection:m,useTranslate3d:h,viewBox:g,wrapperStyle:v},TE(o,uE(uE({},this.props),{},{payload:y})))}}])}(_.PureComponent);xE(EE,`displayName`,`Tooltip`),xE(EE,`defaultProps`,{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!sE.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:` : `,trigger:`hover`,useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var DE=o(((e,t)=>{var n=cy();t.exports=function(){return n.Date.now()}})),OE=o(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),kE=o(((e,t)=>{var n=OE(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),AE=o(((e,t)=>{var n=kE(),r=gy(),i=my(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),jE=o(((e,t)=>{var n=gy(),r=DE(),i=AE(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c})),ME=l(o(((e,t)=>{var n=jE(),r=gy(),i=`Expected a function`;function a(e,t,a){var o=!0,s=!0;if(typeof e!=`function`)throw TypeError(i);return r(a)&&(o=`leading`in a?!!a.leading:o,s=`trailing`in a?!!a.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}t.exports=a}))());function NE(e){"@babel/helpers - typeof";return NE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},NE(e)}function PE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?PE(Object(n),!0).forEach(function(t){IE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function IE(e,t,n){return t=LE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LE(e){var t=RE(e,`string`);return NE(t)==`symbol`?t:t+``}function RE(e,t){if(NE(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(NE(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function zE(e,t){return WE(e)||UE(e,t)||VE(e,t)||BE()}function BE(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
64
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VE(e,t){if(e){if(typeof e==`string`)return HE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HE(e,t)}}function HE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function UE(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function WE(e){if(Array.isArray(e))return e}var GE=(0,_.forwardRef)(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?`100%`:a,s=e.height,c=s===void 0?`100%`:s,l=e.minWidth,u=l===void 0?0:l,d=e.minHeight,f=e.maxHeight,p=e.children,m=e.debounce,h=m===void 0?0:m,g=e.id,v=e.className,y=e.onResize,b=e.style,x=b===void 0?{}:b,S=(0,_.useRef)(null),C=(0,_.useRef)();C.current=y,(0,_.useImperativeHandle)(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn(`The usage of ref.current.current is deprecated and will no longer be supported.`),S.current},configurable:!0})});var w=zE((0,_.useState)({containerWidth:i.width,containerHeight:i.height}),2),T=w[0],E=w[1],D=(0,_.useCallback)(function(e,t){E(function(n){var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,_.useEffect)(function(){var e=function(e){var t,n=e[0].contentRect,r=n.width,i=n.height;D(r,i),(t=C.current)==null||t.call(C,r,i)};h>0&&(e=(0,ME.default)(e,h,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=S.current.getBoundingClientRect(),r=n.width,i=n.height;return D(r,i),t.observe(S.current),function(){t.disconnect()}},[D,h]);var O=(0,_.useMemo)(function(){var e=T.containerWidth,t=T.containerHeight;if(e<0||t<0)return null;gb(o)||gb(c);var r=gb(o)?e:o,i=gb(c)?t:c;n&&n>0&&(r?i=r/n:i&&(r=i*n),f&&i>f&&(i=f));var a=!Array.isArray(p)&&Kb(p.type).endsWith(`Chart`);return _.Children.map(p,function(e){return _.isValidElement(e)?(0,_.cloneElement)(e,FE({width:r,height:i},a?{style:FE({height:`100%`,width:`100%`,maxHeight:i,maxWidth:r},e.props.style)}:{})):e})},[n,p,c,f,d,u,T,o]);return _.createElement(`div`,{id:g?`${g}`:void 0,className:Vt(`recharts-responsive-container`,v),style:FE(FE({},x),{},{width:o,height:c,minWidth:u,minHeight:d,maxHeight:f}),ref:S},O)}),KE=function(e){return null};KE.displayName=`Cell`;function qE(e){"@babel/helpers - typeof";return qE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},qE(e)}function JE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function YE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?JE(Object(n),!0).forEach(function(t){XE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function XE(e,t,n){return t=ZE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZE(e){var t=QE(e,`string`);return qE(t)==`symbol`?t:t+``}function QE(e,t){if(qE(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(qE(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var $E={widthCache:{},cacheCount:0},eD=2e3,tD={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},nD=`recharts_measurement_span`;function rD(e){var t=YE({},e);return Object.keys(t).forEach(function(e){t[e]||delete t[e]}),t}var iD=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||sE.isSsr)return{width:0,height:0};var n=rD(t),r=JSON.stringify({text:e,copyStyle:n});if($E.widthCache[r])return $E.widthCache[r];try{var i=document.getElementById(nD);i||(i=document.createElement(`span`),i.setAttribute(`id`,nD),i.setAttribute(`aria-hidden`,`true`),document.body.appendChild(i));var a=YE(YE({},tD),n);Object.assign(i.style,a),i.textContent=`${e}`;var o=i.getBoundingClientRect(),s={width:o.width,height:o.height};return $E.widthCache[r]=s,++$E.cacheCount>eD&&($E.cacheCount=0,$E.widthCache={}),s}catch{return{width:0,height:0}}},aD=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function oD(e){"@babel/helpers - typeof";return oD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},oD(e)}function sD(e,t){return fD(e)||dD(e,t)||lD(e,t)||cD()}function cD(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
65
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lD(e,t){if(e){if(typeof e==`string`)return uD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uD(e,t)}}function uD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dD(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function fD(e){if(Array.isArray(e))return e}function pD(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function mD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,gD(r.key),r)}}function hD(e,t,n){return t&&mD(e.prototype,t),n&&mD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gD(e){var t=_D(e,`string`);return oD(t)==`symbol`?t:t+``}function _D(e,t){if(oD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(oD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var vD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,yD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,bD=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,xD=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,SD={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},CD=Object.keys(SD),wD=`NaN`;function TD(e,t){return e*SD[t]}var ED=function(){function e(t,n){pD(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=``),n!==``&&!bD.test(n)&&(this.num=NaN,this.unit=``),CD.includes(n)&&(this.num=TD(t,n),this.unit=`px`)}return hD(e,[{key:`add`,value:function(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}},{key:`subtract`,value:function(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}},{key:`multiply`,value:function(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}},{key:`divide`,value:function(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}},{key:`toString`,value:function(){return`${this.num}${this.unit}`}},{key:`isNaN`,value:function(){return Number.isNaN(this.num)}}],[{key:`parse`,value:function(t){var n=sD(xD.exec(t)??[],3),r=n[1],i=n[2];return new e(parseFloat(r),i??``)}}])}();function DD(e){if(e.includes(wD))return wD;for(var t=e;t.includes(`*`)||t.includes(`/`);){var n=sD(vD.exec(t)??[],4),r=n[1],i=n[2],a=n[3],o=ED.parse(r??``),s=ED.parse(a??``),c=i===`*`?o.multiply(s):o.divide(s);if(c.isNaN())return wD;t=t.replace(vD,c.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var l=sD(yD.exec(t)??[],4),u=l[1],d=l[2],f=l[3],p=ED.parse(u??``),m=ED.parse(f??``),h=d===`+`?p.add(m):p.subtract(m);if(h.isNaN())return wD;t=t.replace(yD,h.toString())}return t}var OD=/\(([^()]*)\)/;function kD(e){for(var t=e;t.includes(`(`);){var n=sD(OD.exec(t),2)[1];t=t.replace(OD,DD(n))}return t}function AD(e){var t=e.replace(/\s+/g,``);return t=kD(t),t=DD(t),t}function jD(e){try{return AD(e)}catch{return wD}}function MD(e){var t=jD(e.slice(5,-1));return t===wD?``:t}var ND=[`x`,`y`,`lineHeight`,`capHeight`,`scaleToFit`,`textAnchor`,`verticalAnchor`,`fill`],PD=[`dx`,`dy`,`angle`,`className`,`breakAll`];function FD(){return FD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FD.apply(this,arguments)}function ID(e,t){if(e==null)return{};var n=LD(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function LD(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function RD(e,t){return UD(e)||HD(e,t)||BD(e,t)||zD()}function zD(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
66
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BD(e,t){if(e){if(typeof e==`string`)return VD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VD(e,t)}}function VD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function HD(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function UD(e){if(Array.isArray(e))return e}var WD=/[ \f\n\r\t\v\u2028\u2029]+/,GD=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return(0,mb.default)(t)||(i=n?t.toString().split(``):t.toString().split(WD)),{wordsWithComputedWidth:i.map(function(e){return{word:e,width:iD(e,r).width}}),spaceWidth:n?0:iD(`\xA0`,r).width}}catch{return null}},KD=function(e,t,n,r,i){var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=X(a),u=o,d=function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).reduce(function(e,t){var a=t.word,o=t.width,s=e[e.length-1];if(s&&(r==null||i||s.width+o+n<Number(r)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[])},f=d(t),p=function(e){return e.reduce(function(e,t){return e.width>t.width?e:t})};if(!l)return f;for(var m=`…`,h=function(e){var t=GD({breakAll:c,style:s,children:u.slice(0,e)+m}).wordsWithComputedWidth,n=d(t);return[n.length>a||p(n).width>Number(r),n]},g=0,_=u.length-1,v=0,y;g<=_&&v<=u.length-1;){var b=Math.floor((g+_)/2),x=RD(h(b-1),2),S=x[0],C=x[1],w=RD(h(b),1)[0];if(!S&&!w&&(g=b+1),S&&w&&(_=b-1),!S&&w){y=C;break}v++}return y||f},qD=function(e){return[{words:(0,mb.default)(e)?[]:e.toString().split(WD)}]},JD=function(e){var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!sE.isSsr){var s,c,l=GD({breakAll:a,children:r,style:i});if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return qD(r);return KD({breakAll:a,children:r,maxLines:o,style:i},s,c,t,n)}return qD(r)},YD=`#808080`,XD=function(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.lineHeight,o=a===void 0?`1em`:a,s=e.capHeight,c=s===void 0?`0.71em`:s,l=e.scaleToFit,u=l!==void 0&&l,d=e.textAnchor,f=d===void 0?`start`:d,p=e.verticalAnchor,m=p===void 0?`end`:p,h=e.fill,g=h===void 0?YD:h,v=ID(e,ND),y=(0,_.useMemo)(function(){return JD({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:u,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,u,v.style,v.width]),b=v.dx,x=v.dy,S=v.angle,C=v.className,w=v.breakAll,T=ID(v,PD);if(!vb(n)||!vb(i))return null;var E=n+(X(b)?b:0),D=i+(X(x)?x:0),O;switch(m){case`start`:O=MD(`calc(${c})`);break;case`middle`:O=MD(`calc(${(y.length-1)/2} * -${o} + (${c} / 2))`);break;default:O=MD(`calc(${y.length-1} * -${o})`)}var k=[];if(u){var A=y[0].width,j=v.width;k.push(`scale(${(X(j)?j/A:1)/A})`)}return S&&k.push(`rotate(${S}, ${E}, ${D})`),k.length&&(T.transform=k.join(` `)),_.createElement(`text`,FD({},rx(T,!0),{x:E,y:D,className:Vt(`recharts-text`,C),textAnchor:f,fill:g.includes(`url`)?YD:g}),y.map(function(e,t){var n=e.words.join(w?``:` `);return _.createElement(`tspan`,{x:E,dy:t===0?O:o,key:`${n}-${t}`},n)}))};function ZD(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function QD(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function $D(e){let t,n,r;e.length===2?(t=e===ZD||e===QD?e:eO,n=e,r=e):(t=ZD,n=(t,n)=>ZD(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function eO(){return 0}function tO(e){return e===null?NaN:+e}function*nO(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var rO=$D(ZD),iO=rO.right;rO.left,$D(tO).center;var aO=class extends Map{constructor(e,t=lO){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(oO(this,e))}has(e){return super.has(oO(this,e))}set(e,t){return super.set(sO(this,e),t)}delete(e){return super.delete(cO(this,e))}};function oO({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function sO({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function cO({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function lO(e){return typeof e==`object`&&e?e.valueOf():e}function uO(e=ZD){if(e===ZD)return dO;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function dO(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}var fO=Math.sqrt(50),pO=Math.sqrt(10),mO=Math.sqrt(2);function hO(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=fO?10:a>=pO?5:a>=mO?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?hO(e,t,n*2):[s,c,l]}function gO(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?hO(t,e,n):hO(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r){if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o}else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function _O(e,t,n){return t=+t,e=+e,n=+n,hO(e,t,n)[2]}function vO(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?_O(t,e,n):_O(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function yO(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function bO(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function xO(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?dO:uO(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));xO(e,t,u,d,i)}let a=e[t],o=n,s=r;for(SO(e,n,t),i(e[r],a)>0&&SO(e,n,r);o<s;){for(SO(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?SO(e,n,s):(++s,SO(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function SO(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function CO(e,t,n){if(e=Float64Array.from(nO(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return bO(e);if(t>=1)return yO(e);var r,i=(r-1)*t,a=Math.floor(i),o=yO(xO(e,a).subarray(0,a+1));return o+(bO(e.subarray(a+1))-o)*(i-a)}}function wO(e,t,n=tO){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function TO(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function EO(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function DO(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t)}return this}var OO=Symbol(`implicit`);function kO(){var e=new aO,t=[],n=[],r=OO;function i(i){let a=e.get(i);if(a===void 0){if(r!==OO)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new aO;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return kO(t,n).unknown(r)},EO.apply(i,arguments),i}function AO(){var e=kO().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=TO(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return AO(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},EO.apply(d(),arguments)}function jO(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return jO(t())},e}function MO(){return jO(AO.apply(null,arguments).paddingInner(1))}function NO(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function PO(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function FO(){}var IO=.7,LO=1/IO,RO=`\\s*([+-]?\\d+)\\s*`,zO=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,BO=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,VO=/^#([0-9a-f]{3,8})$/,HO=RegExp(`^rgb\\(${RO},${RO},${RO}\\)$`),UO=RegExp(`^rgb\\(${BO},${BO},${BO}\\)$`),WO=RegExp(`^rgba\\(${RO},${RO},${RO},${zO}\\)$`),GO=RegExp(`^rgba\\(${BO},${BO},${BO},${zO}\\)$`),KO=RegExp(`^hsl\\(${zO},${BO},${BO}\\)$`),qO=RegExp(`^hsla\\(${zO},${BO},${BO},${zO}\\)$`),JO={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};NO(FO,$O,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:YO,formatHex:YO,formatHex8:XO,formatHsl:ZO,formatRgb:QO,toString:QO});function YO(){return this.rgb().formatHex()}function XO(){return this.rgb().formatHex8()}function ZO(){return fk(this).formatHsl()}function QO(){return this.rgb().formatRgb()}function $O(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=VO.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ek(t):n===3?new ik(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?tk(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?tk(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=HO.exec(e))?new ik(t[1],t[2],t[3],1):(t=UO.exec(e))?new ik(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=WO.exec(e))?tk(t[1],t[2],t[3],t[4]):(t=GO.exec(e))?tk(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=KO.exec(e))?dk(t[1],t[2]/100,t[3]/100,1):(t=qO.exec(e))?dk(t[1],t[2]/100,t[3]/100,t[4]):JO.hasOwnProperty(e)?ek(JO[e]):e===`transparent`?new ik(NaN,NaN,NaN,0):null}function ek(e){return new ik(e>>16&255,e>>8&255,e&255,1)}function tk(e,t,n,r){return r<=0&&(e=t=n=NaN),new ik(e,t,n,r)}function nk(e){return e instanceof FO||(e=$O(e)),e?(e=e.rgb(),new ik(e.r,e.g,e.b,e.opacity)):new ik}function rk(e,t,n,r){return arguments.length===1?nk(e):new ik(e,t,n,r??1)}function ik(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}NO(ik,rk,PO(FO,{brighter(e){return e=e==null?LO:LO**+e,new ik(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?IO:IO**+e,new ik(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ik(lk(this.r),lk(this.g),lk(this.b),ck(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ak,formatHex:ak,formatHex8:ok,formatRgb:sk,toString:sk}));function ak(){return`#${uk(this.r)}${uk(this.g)}${uk(this.b)}`}function ok(){return`#${uk(this.r)}${uk(this.g)}${uk(this.b)}${uk((isNaN(this.opacity)?1:this.opacity)*255)}`}function sk(){let e=ck(this.opacity);return`${e===1?`rgb(`:`rgba(`}${lk(this.r)}, ${lk(this.g)}, ${lk(this.b)}${e===1?`)`:`, ${e})`}`}function ck(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function lk(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function uk(e){return e=lk(e),(e<16?`0`:``)+e.toString(16)}function dk(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new mk(e,t,n,r)}function fk(e){if(e instanceof mk)return new mk(e.h,e.s,e.l,e.opacity);if(e instanceof FO||(e=$O(e)),!e)return new mk;if(e instanceof mk)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new mk(o,s,c,e.opacity)}function pk(e,t,n,r){return arguments.length===1?fk(e):new mk(e,t,n,r??1)}function mk(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}NO(mk,pk,PO(FO,{brighter(e){return e=e==null?LO:LO**+e,new mk(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?IO:IO**+e,new mk(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ik(_k(e>=240?e-240:e+120,i,r),_k(e,i,r),_k(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new mk(hk(this.h),gk(this.s),gk(this.l),ck(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=ck(this.opacity);return`${e===1?`hsl(`:`hsla(`}${hk(this.h)}, ${gk(this.s)*100}%, ${gk(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function hk(e){return e=(e||0)%360,e<0?e+360:e}function gk(e){return Math.max(0,Math.min(1,e||0))}function _k(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var vk=e=>()=>e;function yk(e,t){return function(n){return e+n*t}}function bk(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function xk(e){return(e=+e)==1?Sk:function(t,n){return n-t?bk(t,n,e):vk(isNaN(t)?n:t)}}function Sk(e,t){var n=t-e;return n?yk(e,n):vk(isNaN(e)?t:e)}var Ck=(function e(t){var n=xk(t);function r(e,t){var r=n((e=rk(e)).r,(t=rk(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Sk(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function wk(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Tk(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ek(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=Fk(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Dk(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ok(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function kk(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Fk(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Ak=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jk=new RegExp(Ak.source,`g`);function Mk(e){return function(){return e}}function Nk(e){return function(t){return e(t)+``}}function Pk(e,t){var n=Ak.lastIndex=jk.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Ak.exec(e))&&(i=jk.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Ok(r,i)})),n=jk.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Nk(c[0].x):Mk(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Fk(e,t){var n=typeof t,r;return t==null||n===`boolean`?vk(t):(n===`number`?Ok:n===`string`?(r=$O(t))?(t=r,Ck):Pk:t instanceof $O?Ck:t instanceof Date?Dk:Tk(t)?wk:Array.isArray(t)?Ek:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?kk:Ok)(e,t)}function Ik(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Lk(e,t){t===void 0&&(t=e,e=Fk);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function Rk(e){return function(){return e}}function zk(e){return+e}var Bk=[0,1];function Vk(e){return e}function Hk(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Rk(isNaN(t)?NaN:.5)}function Uk(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Wk(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Hk(i,r),a=n(o,a)):(r=Hk(r,i),a=n(a,o)),function(e){return a(r(e))}}function Gk(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Hk(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=iO(e,t,1,r)-1;return a[n](i[n](t))}}function Kk(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function qk(){var e=Bk,t=Bk,n=Fk,r,i,a,o=Vk,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==Vk&&(o=Uk(e[0],e[n-1])),s=n>2?Gk:Wk,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),Ok))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,zk),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=Ik,u()},d.clamp=function(e){return arguments.length?(o=e?!0:Vk,u()):o!==Vk},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function Jk(){return qk()(Vk,Vk)}function Yk(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function Xk(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Zk(e){return e=Xk(Math.abs(e)),e?e[1]:NaN}function Qk(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function $k(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var eA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tA(e){if(!(t=eA.exec(e)))throw Error(`invalid format: `+e);var t;return new nA({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}tA.prototype=nA.prototype;function nA(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}nA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function rA(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var iA;function aA(e,t){var n=Xk(e,t);if(!n)return iA=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(iA=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+Xk(e,Math.max(0,t+a-1))[0]}function oA(e,t){var n=Xk(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var sA={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Yk,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>oA(e*100,t),r:oA,s:aA,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cA(e){return e}var lA=Array.prototype.map,uA=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function dA(e){var t=e.grouping===void 0||e.thousands===void 0?cA:Qk(lA.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?cA:$k(lA.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=tA(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):sA[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=sA[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=rA(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&iA!==void 0?uA[8+iA/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(Zk(t)/3)))*3,r=10**-n,i=l((e=tA(e),e.type=`f`,e),{suffix:uA[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var fA,pA,mA;hA({thousands:`,`,grouping:[3],currency:[`$`,``]});function hA(e){return fA=dA(e),pA=fA.format,mA=fA.formatPrefix,fA}function gA(e){return Math.max(0,-Zk(Math.abs(e)))}function _A(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Zk(t)/3)))*3-Zk(Math.abs(e)))}function vA(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Zk(t)-Zk(e))+1}function yA(e,t,n,r){var i=vO(e,t,n),a;switch(r=tA(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=_A(i,o))&&(r.precision=a),mA(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=vA(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=gA(i))&&(r.precision=a-(r.type===`%`)*2)}return pA(r)}function bA(e){var t=e.domain;return e.ticks=function(e){var n=t();return gO(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return yA(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=_O(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function xA(){var e=Jk();return e.copy=function(){return Kk(e,xA())},EO.apply(e,arguments),bA(e)}function SA(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,zk),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return SA(e).unknown(t)},e=arguments.length?Array.from(e,zk):[0,1],bA(n)}function CA(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function wA(e){return Math.log(e)}function TA(e){return Math.exp(e)}function EA(e){return-Math.log(-e)}function DA(e){return-Math.exp(-e)}function OA(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function kA(e){return e===10?OA:e===Math.E?Math.exp:t=>e**+t}function AA(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function jA(e){return(t,n)=>-e(-t,n)}function MA(e){let t=e(wA,TA),n=t.domain,r=10,i,a;function o(){return i=AA(r),a=kA(r),n()[0]<0?(i=jA(i),a=jA(a),e(EA,DA)):e(wA,TA),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=gO(o,s,p))}else m=gO(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=tA(n)).precision==null&&(n.trim=!0),n=pA(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(CA(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function NA(){let e=MA(qk()).domain([1,10]);return e.copy=()=>Kk(e,NA()).base(e.base()),EO.apply(e,arguments),e}function PA(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function FA(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function IA(e){var t=1,n=e(PA(t),FA(t));return n.constant=function(n){return arguments.length?e(PA(t=+n),FA(t)):t},bA(n)}function LA(){var e=IA(qk());return e.copy=function(){return Kk(e,LA()).constant(e.constant())},EO.apply(e,arguments)}function RA(e){return function(t){return t<0?-((-t)**+e):t**+e}}function zA(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function BA(e){return e<0?-e*e:e*e}function VA(e){var t=e(Vk,Vk),n=1;function r(){return n===1?e(Vk,Vk):n===.5?e(zA,BA):e(RA(n),RA(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},bA(t)}function HA(){var e=VA(qk());return e.copy=function(){return Kk(e,HA()).exponent(e.exponent())},EO.apply(e,arguments),e}function UA(){return HA.apply(null,arguments).exponent(.5)}function WA(e){return Math.sign(e)*e*e}function GA(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function KA(){var e=Jk(),t=[0,1],n=!1,r;function i(t){var i=GA(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(WA(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,zk)).map(WA)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return KA(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},EO.apply(i,arguments),bA(i)}function qA(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=wO(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[iO(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(ZD),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return qA().domain(e).range(t).unknown(r)},EO.apply(a,arguments)}function JA(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[iO(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return JA().domain([e,t]).range(i).unknown(a)},EO.apply(bA(o),arguments)}function YA(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[iO(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return YA().domain(e).range(t).unknown(n)},EO.apply(i,arguments)}var XA=new Date,ZA=new Date;function QA(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>QA(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(XA.setTime(+t),ZA.setTime(+r),e(XA),e(ZA),Math.floor(n(XA,ZA))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var $A=QA(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);$A.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?QA(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):$A),$A.range;var ej=1e3,tj=ej*60,nj=tj*60,rj=nj*24,ij=rj*7,aj=rj*30,oj=rj*365,sj=QA(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ej)},(e,t)=>(t-e)/ej,e=>e.getUTCSeconds());sj.range;var cj=QA(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ej)},(e,t)=>{e.setTime(+e+t*tj)},(e,t)=>(t-e)/tj,e=>e.getMinutes());cj.range;var lj=QA(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*tj)},(e,t)=>(t-e)/tj,e=>e.getUTCMinutes());lj.range;var uj=QA(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ej-e.getMinutes()*tj)},(e,t)=>{e.setTime(+e+t*nj)},(e,t)=>(t-e)/nj,e=>e.getHours());uj.range;var dj=QA(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*nj)},(e,t)=>(t-e)/nj,e=>e.getUTCHours());dj.range;var fj=QA(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*tj)/rj,e=>e.getDate()-1);fj.range;var pj=QA(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/rj,e=>e.getUTCDate()-1);pj.range;var mj=QA(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/rj,e=>Math.floor(e/rj));mj.range;function hj(e){return QA(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*tj)/ij)}var gj=hj(0),_j=hj(1),vj=hj(2),yj=hj(3),bj=hj(4),xj=hj(5),Sj=hj(6);gj.range,_j.range,vj.range,yj.range,bj.range,xj.range,Sj.range;function Cj(e){return QA(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/ij)}var wj=Cj(0),Tj=Cj(1),Ej=Cj(2),Dj=Cj(3),Oj=Cj(4),kj=Cj(5),Aj=Cj(6);wj.range,Tj.range,Ej.range,Dj.range,Oj.range,kj.range,Aj.range;var jj=QA(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());jj.range;var Mj=QA(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Mj.range;var Nj=QA(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Nj.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:QA(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Nj.range;var Pj=QA(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Pj.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:QA(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Pj.range;function Fj(e,t,n,r,i,a){let o=[[sj,1,ej],[sj,5,5*ej],[sj,15,15*ej],[sj,30,30*ej],[a,1,tj],[a,5,5*tj],[a,15,15*tj],[a,30,30*tj],[i,1,nj],[i,3,3*nj],[i,6,6*nj],[i,12,12*nj],[r,1,rj],[r,2,2*rj],[n,1,ij],[t,1,aj],[t,3,3*aj],[e,1,oj]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=$D(([,,e])=>e).right(o,i);if(a===o.length)return e.every(vO(t/oj,n/oj,r));if(a===0)return $A.every(Math.max(vO(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[Ij,Lj]=Fj(Pj,Mj,wj,mj,dj,lj),[Rj,zj]=Fj(Nj,jj,gj,fj,uj,cj);function Bj(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Vj(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Hj(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Uj(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=Xj(i),u=Zj(i),d=Xj(a),f=Zj(a),p=Xj(o),m=Zj(o),h=Xj(s),g=Zj(s),_=Xj(c),v=Zj(c),y={a:N,A:P,b:F,B:I,c:null,d:vM,e:vM,f:CM,g:PM,G:IM,H:yM,I:bM,j:xM,L:SM,m:wM,M:TM,p:ee,q:L,Q:aN,s:oN,S:EM,u:DM,U:OM,V:AM,w:jM,W:MM,x:null,X:null,y:NM,Y:FM,Z:LM,"%":iN},b={a:R,A:z,b:te,B:ne,c:null,d:RM,e:RM,f:UM,g:eN,G:nN,H:zM,I:BM,j:VM,L:HM,m:WM,M:GM,p:re,q:ie,Q:aN,s:oN,S:KM,u:qM,U:JM,V:XM,w:ZM,W:QM,x:null,X:null,y:$M,Y:tN,Z:rN,"%":iN},x={a:E,A:D,b:O,B:k,c:A,d:cM,e:cM,f:mM,g:iM,G:rM,H:uM,I:uM,j:lM,L:pM,m:sM,M:dM,p:T,q:oM,Q:gM,s:_M,S:fM,u:$j,U:eM,V:tM,w:Qj,W:nM,x:j,X:M,y:iM,Y:rM,Z:aM,"%":hM};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=Wj[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=Hj(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=Vj(Hj(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?Tj.ceil(a):Tj(a),a=pj.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=Bj(Hj(r.y,0,1)),o=a.getDay(),a=o>4||o===0?_j.ceil(a):_j(a),a=fj.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Vj(Hj(r.y,0,1)).getUTCDay():Bj(Hj(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Vj(r)):Bj(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in Wj?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function P(e){return a[e.getDay()]}function F(e){return c[e.getMonth()]}function I(e){return s[e.getMonth()]}function ee(e){return i[+(e.getHours()>=12)]}function L(e){return 1+~~(e.getMonth()/3)}function R(e){return o[e.getUTCDay()]}function z(e){return a[e.getUTCDay()]}function te(e){return c[e.getUTCMonth()]}function ne(e){return s[e.getUTCMonth()]}function re(e){return i[+(e.getUTCHours()>=12)]}function ie(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var Wj={"-":``,_:` `,0:`0`},Gj=/^\s*\d+/,Kj=/^%/,qj=/[\\^$*+?|[\]().{}]/g;function Jj(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function Yj(e){return e.replace(qj,`\\$&`)}function Xj(e){return RegExp(`^(?:`+e.map(Yj).join(`|`)+`)`,`i`)}function Zj(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Qj(e,t,n){var r=Gj.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function $j(e,t,n){var r=Gj.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function eM(e,t,n){var r=Gj.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function tM(e,t,n){var r=Gj.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function nM(e,t,n){var r=Gj.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function rM(e,t,n){var r=Gj.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function iM(e,t,n){var r=Gj.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function aM(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function oM(e,t,n){var r=Gj.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function sM(e,t,n){var r=Gj.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function cM(e,t,n){var r=Gj.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function lM(e,t,n){var r=Gj.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function uM(e,t,n){var r=Gj.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function dM(e,t,n){var r=Gj.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function fM(e,t,n){var r=Gj.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function pM(e,t,n){var r=Gj.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function mM(e,t,n){var r=Gj.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function hM(e,t,n){var r=Kj.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function gM(e,t,n){var r=Gj.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function _M(e,t,n){var r=Gj.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function vM(e,t){return Jj(e.getDate(),t,2)}function yM(e,t){return Jj(e.getHours(),t,2)}function bM(e,t){return Jj(e.getHours()%12||12,t,2)}function xM(e,t){return Jj(1+fj.count(Nj(e),e),t,3)}function SM(e,t){return Jj(e.getMilliseconds(),t,3)}function CM(e,t){return SM(e,t)+`000`}function wM(e,t){return Jj(e.getMonth()+1,t,2)}function TM(e,t){return Jj(e.getMinutes(),t,2)}function EM(e,t){return Jj(e.getSeconds(),t,2)}function DM(e){var t=e.getDay();return t===0?7:t}function OM(e,t){return Jj(gj.count(Nj(e)-1,e),t,2)}function kM(e){var t=e.getDay();return t>=4||t===0?bj(e):bj.ceil(e)}function AM(e,t){return e=kM(e),Jj(bj.count(Nj(e),e)+(Nj(e).getDay()===4),t,2)}function jM(e){return e.getDay()}function MM(e,t){return Jj(_j.count(Nj(e)-1,e),t,2)}function NM(e,t){return Jj(e.getFullYear()%100,t,2)}function PM(e,t){return e=kM(e),Jj(e.getFullYear()%100,t,2)}function FM(e,t){return Jj(e.getFullYear()%1e4,t,4)}function IM(e,t){var n=e.getDay();return e=n>=4||n===0?bj(e):bj.ceil(e),Jj(e.getFullYear()%1e4,t,4)}function LM(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+Jj(t/60|0,`0`,2)+Jj(t%60,`0`,2)}function RM(e,t){return Jj(e.getUTCDate(),t,2)}function zM(e,t){return Jj(e.getUTCHours(),t,2)}function BM(e,t){return Jj(e.getUTCHours()%12||12,t,2)}function VM(e,t){return Jj(1+pj.count(Pj(e),e),t,3)}function HM(e,t){return Jj(e.getUTCMilliseconds(),t,3)}function UM(e,t){return HM(e,t)+`000`}function WM(e,t){return Jj(e.getUTCMonth()+1,t,2)}function GM(e,t){return Jj(e.getUTCMinutes(),t,2)}function KM(e,t){return Jj(e.getUTCSeconds(),t,2)}function qM(e){var t=e.getUTCDay();return t===0?7:t}function JM(e,t){return Jj(wj.count(Pj(e)-1,e),t,2)}function YM(e){var t=e.getUTCDay();return t>=4||t===0?Oj(e):Oj.ceil(e)}function XM(e,t){return e=YM(e),Jj(Oj.count(Pj(e),e)+(Pj(e).getUTCDay()===4),t,2)}function ZM(e){return e.getUTCDay()}function QM(e,t){return Jj(Tj.count(Pj(e)-1,e),t,2)}function $M(e,t){return Jj(e.getUTCFullYear()%100,t,2)}function eN(e,t){return e=YM(e),Jj(e.getUTCFullYear()%100,t,2)}function tN(e,t){return Jj(e.getUTCFullYear()%1e4,t,4)}function nN(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Oj(e):Oj.ceil(e),Jj(e.getUTCFullYear()%1e4,t,4)}function rN(){return`+0000`}function iN(){return`%`}function aN(e){return+e}function oN(e){return Math.floor(e/1e3)}var sN,cN,lN;uN({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function uN(e){return sN=Uj(e),cN=sN.format,sN.parse,lN=sN.utcFormat,sN.utcParse,sN}function dN(e){return new Date(e)}function fN(e){return e instanceof Date?+e:+new Date(+e)}function pN(e,t,n,r,i,a,o,s,c,l){var u=Jk(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,fN)):f().map(dN)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(CA(n,e)):u},u.copy=function(){return Kk(u,pN(e,t,n,r,i,a,o,s,c,l))},u}function mN(){return EO.apply(pN(Rj,zj,Nj,jj,gj,fj,uj,cj,sj,cN).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function hN(){return EO.apply(pN(Ij,Lj,Pj,Mj,wj,pj,dj,lj,sj,lN).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function gN(){var e=0,t=1,n,r,i,a,o=Vk,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(Fk),l.rangeRound=u(Ik),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function _N(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function vN(){var e=bA(gN()(Vk));return e.copy=function(){return _N(e,vN())},DO.apply(e,arguments)}function yN(){var e=MA(gN()).domain([1,10]);return e.copy=function(){return _N(e,yN()).base(e.base())},DO.apply(e,arguments)}function bN(){var e=IA(gN());return e.copy=function(){return _N(e,bN()).constant(e.constant())},DO.apply(e,arguments)}function xN(){var e=VA(gN());return e.copy=function(){return _N(e,xN()).exponent(e.exponent())},DO.apply(e,arguments)}function SN(){return xN.apply(null,arguments).exponent(.5)}function CN(){var e=[],t=Vk;function n(n){if(n!=null&&!isNaN(n=+n))return t((iO(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(ZD),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>CO(e,r/t))},n.copy=function(){return CN(t).domain(e)},DO.apply(n,arguments)}function wN(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=Vk,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=Lk(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(Fk),p.rangeRound=m(Ik),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function TN(){var e=bA(wN()(Vk));return e.copy=function(){return _N(e,TN())},DO.apply(e,arguments)}function EN(){var e=MA(wN()).domain([.1,1,10]);return e.copy=function(){return _N(e,EN()).base(e.base())},DO.apply(e,arguments)}function DN(){var e=IA(wN());return e.copy=function(){return _N(e,DN()).constant(e.constant())},DO.apply(e,arguments)}function ON(){var e=VA(wN());return e.copy=function(){return _N(e,ON()).exponent(e.exponent())},DO.apply(e,arguments)}function kN(){return ON.apply(null,arguments).exponent(.5)}var AN=s({scaleBand:()=>AO,scaleDiverging:()=>TN,scaleDivergingLog:()=>EN,scaleDivergingPow:()=>ON,scaleDivergingSqrt:()=>kN,scaleDivergingSymlog:()=>DN,scaleIdentity:()=>SA,scaleImplicit:()=>OO,scaleLinear:()=>xA,scaleLog:()=>NA,scaleOrdinal:()=>kO,scalePoint:()=>MO,scalePow:()=>HA,scaleQuantile:()=>qA,scaleQuantize:()=>JA,scaleRadial:()=>KA,scaleSequential:()=>vN,scaleSequentialLog:()=>yN,scaleSequentialPow:()=>xN,scaleSequentialQuantile:()=>CN,scaleSequentialSqrt:()=>SN,scaleSequentialSymlog:()=>bN,scaleSqrt:()=>UA,scaleSymlog:()=>LA,scaleThreshold:()=>YA,scaleTime:()=>mN,scaleUtc:()=>hN,tickFormat:()=>yA}),jN=o(((e,t)=>{var n=my();function r(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===void 0?s===s&&!n(s):r(s,c)))var c=s,l=o}return l}t.exports=r})),MN=o(((e,t)=>{function n(e,t){return e>t}t.exports=n})),NN=o(((e,t)=>{var n=jN(),r=MN(),i=mw();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),PN=o(((e,t)=>{function n(e,t){return e<t}t.exports=n})),FN=o(((e,t)=>{var n=jN(),r=PN(),i=mw();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),IN=o(((e,t)=>{var n=Zy(),r=_w(),i=aT(),a=oy();function o(e,t){return(a(e)?n:i)(e,r(t,3))}t.exports=o})),LN=o(((e,t)=>{var n=$w(),r=IN();function i(e,t){return n(r(e,t),1)}t.exports=i})),RN=o(((e,t)=>{var n=iw();function r(e,t){return n(e,t)}t.exports=r})),zN=o(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i)t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;else{if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0){if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i)}if((i=e[r=`LN10`])!==void 0){if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i)}return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}));function BN(e){return WN(e)||UN(e)||HN(e)||VN()}function VN(){throw TypeError(`Invalid attempt to spread non-iterable instance.
67
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HN(e,t){if(e){if(typeof e==`string`)return GN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GN(e,t)}}function UN(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function WN(e){if(Array.isArray(e))return GN(e)}function GN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var KN=function(e){return e},qN={"@@functional/placeholder":!0},JN=function(e){return e===qN},YN=function(e){return function t(){return arguments.length===0||arguments.length===1&&JN(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},XN=function e(t,n){return t===1?n:YN(function(){var r=[...arguments],i=r.filter(function(e){return e!==qN}).length;return i>=t?n.apply(void 0,r):e(t-i,YN(function(){var e=[...arguments],t=r.map(function(t){return JN(t)?e.shift():t});return n.apply(void 0,BN(t).concat(e))}))})},ZN=function(e){return XN(e.length,e)},QN=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},$N=ZN(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),eP=function(){var e=[...arguments];if(!e.length)return KN;var t=e.reverse(),n=t[0],r=t.slice(1);return function(){return r.reduce(function(e,t){return t(e)},n.apply(void 0,arguments))}},tP=function(e){return Array.isArray(e)?e.reverse():e.split(``).reverse.join(``)},nP=function(e){var t=null,n=null;return function(){var r=[...arguments];return t&&r.every(function(e,n){return e===t[n]})||(t=r,n=e.apply(void 0,r)),n}},rP=l(zN());function iP(e){return e===0?1:Math.floor(new rP.default(e).abs().log(10).toNumber())+1}function aP(e,t,n){for(var r=new rP.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var oP={rangeStep:aP,getDigitCount:iP,interpolateNumber:ZN(function(e,t,n){var r=+e;return r+n*(+t-r)}),uninterpolateNumber:ZN(function(e,t,n){var r=t-+e;return r||=1/0,(n-e)/r}),uninterpolateTruncation:ZN(function(e,t,n){var r=t-+e;return r||=1/0,Math.max(0,Math.min(1,(n-e)/r))})};function sP(e){return uP(e)||lP(e)||pP(e)||cP()}function cP(){throw TypeError(`Invalid attempt to spread non-iterable instance.
68
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lP(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function uP(e){if(Array.isArray(e))return mP(e)}function dP(e,t){return gP(e)||hP(e,t)||pP(e,t)||fP()}function fP(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
69
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pP(e,t){if(e){if(typeof e==`string`)return mP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mP(e,t)}}function mP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hP(e,t){if(typeof Symbol<`u`&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function gP(e){if(Array.isArray(e))return e}function _P(e){var t=dP(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function vP(e,t,n){if(e.lte(0))return new rP.default(0);var r=oP.getDigitCount(e.toNumber()),i=new rP.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new rP.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?s:new rP.default(Math.ceil(s))}function yP(e,t,n){var r=1,i=new rP.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new rP.default(10).pow(oP.getDigitCount(e)-1),i=new rP.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new rP.default(Math.floor(e)))}else e===0?i=new rP.default(Math.floor((t-1)/2)):n||(i=new rP.default(Math.floor(e)));var o=Math.floor((t-1)/2);return eP($N(function(e){return i.add(new rP.default(e-o).mul(r)).toNumber()}),QN)(0,t)}function bP(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new rP.default(0),tickMin:new rP.default(0),tickMax:new rP.default(0)};var a=vP(new rP.default(t).sub(e).div(n-1),r,i),o;e<=0&&t>=0?o=new rP.default(0):(o=new rP.default(e).add(t).div(2),o=o.sub(new rP.default(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new rP.default(t).sub(o).div(a).toNumber()),l=s+c+1;return l>n?bP(e,t,n,r,i+1):(l<n&&(c=t>0?c+(n-l):c,s=t>0?s:s+(n-l)),{step:a,tickMin:o.sub(new rP.default(s).mul(a)),tickMax:o.add(new rP.default(c).mul(a))})}function xP(e){var t=dP(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=dP(_P([n,r]),2),c=s[0],l=s[1];if(c===-1/0||l===1/0){var u=l===1/0?[c].concat(sP(QN(0,i-1).map(function(){return 1/0}))):[].concat(sP(QN(0,i-1).map(function(){return-1/0})),[l]);return n>r?tP(u):u}if(c===l)return yP(c,i,a);var d=bP(c,l,o,a),f=d.step,p=d.tickMin,m=d.tickMax,h=oP.rangeStep(p,m.add(new rP.default(.1).mul(f)),f);return n>r?tP(h):h}function SP(e,t){var n=dP(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=dP(_P([r,i]),2),s=o[0],c=o[1];if(s===-1/0||c===1/0)return[r,i];if(s===c)return[s];var l=Math.max(t,2),u=vP(new rP.default(c).sub(s).div(l-1),a,0),d=[].concat(sP(oP.rangeStep(new rP.default(s),new rP.default(c).sub(new rP.default(.99).mul(u)),u)),[c]);return r>i?tP(d):d}var CP=nP(xP),wP=nP(SP),TP=`Invariant failed`;function EP(e,t){if(!e)throw Error(TP)}var DP=[`offset`,`layout`,`width`,`dataKey`,`data`,`dataPointFormatter`,`xAxis`,`yAxis`];function OP(e){"@babel/helpers - typeof";return OP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},OP(e)}function kP(){return kP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kP.apply(this,arguments)}function AP(e,t){return FP(e)||PP(e,t)||MP(e,t)||jP()}function jP(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
70
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MP(e,t){if(e){if(typeof e==`string`)return NP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NP(e,t)}}function NP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function PP(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function FP(e){if(Array.isArray(e))return e}function IP(e,t){if(e==null)return{};var n=LP(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function LP(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function RP(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function zP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,YP(r.key),r)}}function BP(e,t,n){return t&&zP(e.prototype,t),n&&zP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function VP(e,t,n){return t=GP(t),HP(e,WP()?Reflect.construct(t,n||[],GP(e).constructor):t.apply(e,n))}function HP(e,t){if(t&&(OP(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return UP(e)}function UP(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function WP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WP=function(){return!!e})()}function GP(e){return GP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},GP(e)}function KP(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qP(e,t)}function qP(e,t){return qP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qP(e,t)}function JP(e,t,n){return t=YP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YP(e){var t=XP(e,`string`);return OP(t)==`symbol`?t:t+``}function XP(e,t){if(OP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(OP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ZP=function(e){function t(){return RP(this,t),VP(this,t,arguments)}return KP(t,e),BP(t,[{key:`render`,value:function(){var e=this.props,t=e.offset,n=e.layout,r=e.width,i=e.dataKey,a=e.data,o=e.dataPointFormatter,s=e.xAxis,c=e.yAxis,l=rx(IP(e,DP),!1);this.props.direction===`x`&&s.type!==`number`&&EP(!1);var u=a.map(function(e){var a=o(e,i),u=a.x,d=a.y,f=a.value,p=a.errorVal;if(!p)return null;var m=[],h,g;if(Array.isArray(p)){var v=AP(p,2);h=v[0],g=v[1]}else h=g=p;if(n===`vertical`){var y=s.scale,b=d+t,x=b+r,S=b-r,C=y(f-h),w=y(f+g);m.push({x1:w,y1:x,x2:w,y2:S}),m.push({x1:C,y1:b,x2:w,y2:b}),m.push({x1:C,y1:x,x2:C,y2:S})}else if(n===`horizontal`){var T=c.scale,E=u+t,D=E-r,O=E+r,k=T(f-h),A=T(f+g);m.push({x1:D,y1:A,x2:O,y2:A}),m.push({x1:E,y1:k,x2:E,y2:A}),m.push({x1:D,y1:k,x2:O,y2:k})}return _.createElement(_x,kP({className:`recharts-errorBar`,key:`bar-${m.map(function(e){return`${e.x1}-${e.x2}-${e.y1}-${e.y2}`})}`},l),m.map(function(e){return _.createElement(`line`,kP({},e,{key:`line-${e.x1}-${e.x2}-${e.y1}-${e.y2}`}))}))});return _.createElement(_x,{className:`recharts-errorBars`},u)}}])}(_.Component);JP(ZP,`defaultProps`,{stroke:`black`,strokeWidth:1.5,width:5,offset:0,layout:`horizontal`}),JP(ZP,`displayName`,`ErrorBar`);function QP(e){"@babel/helpers - typeof";return QP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QP(e)}function $P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$P(Object(n),!0).forEach(function(t){tF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tF(e,t,n){return t=nF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nF(e){var t=rF(e,`string`);return QP(t)==`symbol`?t:t+``}function rF(e,t){if(QP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var iF=function(e){var t=e.children,n=e.formattedGraphicalItems,r=e.legendWidth,i=e.legendContent,a=Zb(t,Zw);if(!a)return null;var o=Zw.defaultProps,s=o===void 0?{}:eF(eF({},o),a.props),c=a.props&&a.props.payload?a.props&&a.props.payload:i===`children`?(n||[]).reduce(function(e,t){var n=t.item,r=t.props,i=r.sectors||r.data||[];return e.concat(i.map(function(e){return{type:a.props.iconType||n.props.legendType,value:e.name,color:e.fill,payload:e}}))},[]):(n||[]).map(function(e){var t=e.item,n=t.type.defaultProps,r=n===void 0?{}:eF(eF({},n),t.props),i=r.dataKey,a=r.name,o=r.legendType;return{inactive:r.hide,dataKey:i,type:s.iconType||o||`square`,color:wF(t),value:a||i,payload:r}});return eF(eF(eF({},s),Zw.getWithHeight(a,r)),{},{payload:c,item:a})},aF=l(NN()),oF=l(FN()),sF=l(LN()),cF=l(RN());function lF(e){"@babel/helpers - typeof";return lF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},lF(e)}function uF(e){return mF(e)||pF(e)||fF(e)||dF()}function dF(){throw TypeError(`Invalid attempt to spread non-iterable instance.
71
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fF(e,t){if(e){if(typeof e==`string`)return hF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hF(e,t)}}function pF(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function mF(e){if(Array.isArray(e))return hF(e)}function hF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _F(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gF(Object(n),!0).forEach(function(t){vF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vF(e,t,n){return t=yF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yF(e){var t=bF(e,`string`);return lF(t)==`symbol`?t:t+``}function bF(e,t){if(lF(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(lF(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xF(e,t,n){return(0,mb.default)(e)||(0,mb.default)(t)?n:vb(t)?(0,fb.default)(e,t,n):(0,Rb.default)(t)?t(e):n}function SF(e,t,n,r){var i=(0,sF.default)(e,function(e){return xF(e,t)});if(n===`number`){var a=i.filter(function(e){return X(e)||parseFloat(e)});return a.length?[(0,oF.default)(a),(0,aF.default)(a)]:[1/0,-1/0]}return(r?i.filter(function(e){return!(0,mb.default)(e)}):i).map(function(e){return vb(e)||e instanceof Date?e:``})}var CF=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=-1,a=t?.length??0;if(a<=1)return 0;if(r&&r.axisType===`angleAxis`&&Math.abs(Math.abs(r.range[1]-r.range[0])-360)<=1e-6)for(var o=r.range,s=0;s<a;s++){var c=s>0?n[s-1].coordinate:n[a-1].coordinate,l=n[s].coordinate,u=s>=a-1?n[0].coordinate:n[s+1].coordinate,d=void 0;if(hb(l-c)!==hb(u-l)){var f=[];if(hb(u-l)===hb(o[1]-o[0])){d=u;var p=l+o[1]-o[0];f[0]=Math.min(p,(p+c)/2),f[1]=Math.max(p,(p+c)/2)}else{d=c;var m=u+o[1]-o[0];f[0]=Math.min(l,(m+l)/2),f[1]=Math.max(l,(m+l)/2)}var h=[Math.min(l,(d+l)/2),Math.max(l,(d+l)/2)];if(e>h[0]&&e<=h[1]||e>=f[0]&&e<=f[1]){i=n[s].index;break}}else{var g=Math.min(c,u),_=Math.max(c,u);if(e>(g+l)/2&&e<=(_+l)/2){i=n[s].index;break}}}else for(var v=0;v<a;v++)if(v===0&&e<=(t[v].coordinate+t[v+1].coordinate)/2||v>0&&v<a-1&&e>(t[v].coordinate+t[v-1].coordinate)/2&&e<=(t[v].coordinate+t[v+1].coordinate)/2||v===a-1&&e>(t[v].coordinate+t[v-1].coordinate)/2){i=t[v].index;break}return i},wF=function(e){var t,n=e.type.displayName,r=(t=e.type)!=null&&t.defaultProps?_F(_F({},e.type.defaultProps),e.props):e.props,i=r.stroke,a=r.fill,o;switch(n){case`Line`:o=i;break;case`Area`:case`Radar`:o=i&&i!==`none`?i:a;break;default:o=a}return o},TF=function(e){var t=e.barSize,n=e.totalSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var a={},o=Object.keys(i),s=0,c=o.length;s<c;s++)for(var l=i[o[s]].stackGroups,u=Object.keys(l),d=0,f=u.length;d<f;d++){var p=l[u[d]],m=p.items,h=p.cateAxisId,g=m.filter(function(e){return Kb(e.type).indexOf(`Bar`)>=0});if(g&&g.length){var _=g[0].type.defaultProps,v=_===void 0?g[0].props:_F(_F({},_),g[0].props),y=v.barSize,b=v[h];a[b]||(a[b]=[]);var x=(0,mb.default)(y)?t:y;a[b].push({item:g[0],stackList:g.slice(1),barSize:(0,mb.default)(x)?void 0:xb(x,n,0)})}}return a},EF=function(e){var t=e.barGap,n=e.barCategoryGap,r=e.bandSize,i=e.sizeList,a=i===void 0?[]:i,o=e.maxBarSize,s=a.length;if(s<1)return null;var c=xb(t,r,0,!0),l,u=[];if(a[0].barSize===+a[0].barSize){var d=!1,f=r/s,p=a.reduce(function(e,t){return e+t.barSize||0},0);p+=(s-1)*c,p>=r&&(p-=(s-1)*c,c=0),p>=r&&f>0&&(d=!0,f*=.9,p=s*f);var m={offset:((r-p)/2|0)-c,size:0};l=a.reduce(function(e,t){var n={item:t.item,position:{offset:m.offset+m.size+c,size:d?f:t.barSize}},r=[].concat(uF(e),[n]);return m=r[r.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:m})}),r},u)}else{var h=xb(n,r,0,!0);r-2*h-(s-1)*c<=0&&(c=0);var g=(r-2*h-(s-1)*c)/s;g>1&&(g>>=0);var _=o===+o?Math.min(g,o):g;l=a.reduce(function(e,t,n){var r=[].concat(uF(e),[{item:t.item,position:{offset:h+(g+c)*n+(g-_)/2,size:_}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:r[r.length-1].position})}),r},u)}return l},DF=function(e,t,n,r){var i=n.children,a=n.width,o=n.margin,s=iF({children:i,legendWidth:a-(o.left||0)-(o.right||0)});if(s){var c=r||{},l=c.width,u=c.height,d=s.align,f=s.verticalAlign,p=s.layout;if((p===`vertical`||p===`horizontal`&&f===`middle`)&&d!==`center`&&X(e[d]))return _F(_F({},e),{},vF({},d,e[d]+(l||0)));if((p===`horizontal`||p===`vertical`&&d===`center`)&&f!==`middle`&&X(e[f]))return _F(_F({},e),{},vF({},f,e[f]+(u||0)))}return e},OF=function(e,t,n){return(0,mb.default)(t)?!0:e===`horizontal`?t===`yAxis`:e===`vertical`||n===`x`?t===`xAxis`:n!==`y`||t===`yAxis`},kF=function(e,t,n,r,i){var a=t.props.children,o=Xb(a,ZP).filter(function(e){return OF(r,i,e.props.direction)});if(o&&o.length){var s=o.map(function(e){return e.props.dataKey});return e.reduce(function(e,t){var r=xF(t,n);if((0,mb.default)(r))return e;var i=Array.isArray(r)?[(0,oF.default)(r),(0,aF.default)(r)]:[r,r],a=s.reduce(function(e,n){var r=xF(t,n,0),a=i[0]-Math.abs(Array.isArray(r)?r[0]:r),o=i[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(a,e[0]),Math.max(o,e[1])]},[1/0,-1/0]);return[Math.min(a[0],e[0]),Math.max(a[1],e[1])]},[1/0,-1/0])}return null},AF=function(e,t,n,r,i){var a=t.map(function(t){return kF(e,t,n,i,r)}).filter(function(e){return!(0,mb.default)(e)});return a&&a.length?a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]):null},jF=function(e,t,n,r,i){var a=t.map(function(t){var a=t.props.dataKey;return n===`number`&&a&&kF(e,t,a,r)||SF(e,a,n,i)});if(n===`number`)return a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]);var o={};return a.reduce(function(e,t){for(var n=0,r=t.length;n<r;n++)o[t[n]]||(o[t[n]]=!0,e.push(t[n]));return e},[])},MF=function(e,t){return e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`},NF=function(e,t,n){if(!e)return null;var r=e.scale,i=e.duplicateDomain,a=e.type,o=e.range,s=e.realScaleType===`scaleBand`?r.bandwidth()/2:2,c=(t||n)&&a===`category`&&r.bandwidth?r.bandwidth()/s:0;return c=e.axisType===`angleAxis`&&o?.length>=2?hb(o[0]-o[1])*2*c:c,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map(function(e){return{coordinate:r(i?i.indexOf(e):e)+c,value:e,offset:c}}).filter(function(e){return!(0,db.default)(e.coordinate)}):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(e,t){return{coordinate:r(e)+c,value:e,index:t,offset:c}}):r.ticks&&!n?r.ticks(e.tickCount).map(function(e){return{coordinate:r(e)+c,value:e,offset:c}}):r.domain().map(function(e,t){return{coordinate:r(e)+c,value:i?i[e]:e,index:t,offset:c}})},PF=new WeakMap,FF=function(e,t){if(typeof t!=`function`)return e;PF.has(e)||PF.set(e,new WeakMap);var n=PF.get(e);if(n.has(t))return n.get(t);var r=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return n.set(t,r),r},IF=function(e,t,n){var r=e.scale,i=e.type,a=e.layout,o=e.axisType;if(r===`auto`)return a===`radial`&&o===`radiusAxis`?{scale:AO(),realScaleType:`band`}:a===`radial`&&o===`angleAxis`?{scale:xA(),realScaleType:`linear`}:i===`category`&&t&&(t.indexOf(`LineChart`)>=0||t.indexOf(`AreaChart`)>=0||t.indexOf(`ComposedChart`)>=0&&!n)?{scale:MO(),realScaleType:`point`}:i===`category`?{scale:AO(),realScaleType:`band`}:{scale:xA(),realScaleType:`linear`};if((0,ub.default)(r)){var s=`scale${(0,YS.default)(r)}`;return{scale:(AN[s]||MO)(),realScaleType:AN[s]?s:`point`}}return(0,Rb.default)(r)?{scale:r}:{scale:MO(),realScaleType:`point`}},LF=1e-4,RF=function(e){var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,r=e.range(),i=Math.min(r[0],r[1])-LF,a=Math.max(r[0],r[1])+LF,o=e(t[0]),s=e(t[n-1]);(o<i||o>a||s<i||s>a)&&e.domain([t[0],t[n-1]])}},zF=function(e,t){if(!e)return null;for(var n=0,r=e.length;n<r;n++)if(e[n].item===t)return e[n].position;return null},BF=function(e,t){if(!t||t.length!==2||!X(t[0])||!X(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!X(e[0])||e[0]<n)&&(i[0]=n),(!X(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},VF={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,a=0,o=0;o<t;++o){var s=(0,db.default)(e[o][n][1])?e[o][n][0]:e[o][n][1];s>=0?(e[o][n][0]=i,e[o][n][1]=i+s,i=e[o][n][1]):(e[o][n][0]=a,e[o][n][1]=a+s,a=e[o][n][1])}},expand:KS,none:VS,silhouette:qS,wiggle:JS,positive:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,a=0;a<t;++a){var o=(0,db.default)(e[a][n][1])?e[a][n][0]:e[a][n][1];o>=0?(e[a][n][0]=i,e[a][n][1]=i+o,i=e[a][n][1]):(e[a][n][0]=0,e[a][n][1]=0)}}},HF=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),i=VF[n];return GS().keys(r).value(function(e,t){return+xF(e,t,0)}).order(HS).offset(i)(e)},UF=function(e,t,n,r,i,a){if(!e)return null;var o=(a?t.reverse():t).reduce(function(e,t){var i,a=(i=t.type)!=null&&i.defaultProps?_F(_F({},t.type.defaultProps),t.props):t.props,o=a.stackId;if(a.hide)return e;var s=a[n],c=e[s]||{hasStack:!1,stackGroups:{}};if(vb(o)){var l=c.stackGroups[o]||{numericAxisId:n,cateAxisId:r,items:[]};l.items.push(t),c.hasStack=!0,c.stackGroups[o]=l}else c.stackGroups[bb(`_stackId_`)]={numericAxisId:n,cateAxisId:r,items:[t]};return _F(_F({},e),{},vF({},s,c))},{});return Object.keys(o).reduce(function(t,a){var s=o[a];return s.hasStack&&(s.stackGroups=Object.keys(s.stackGroups).reduce(function(t,a){var o=s.stackGroups[a];return _F(_F({},t),{},vF({},a,{numericAxisId:n,cateAxisId:r,items:o.items,stackedData:HF(e,o.items,i)}))},{})),_F(_F({},t),{},vF({},a,s))},{})},WF=function(e,t){var n=t.realScaleType,r=t.type,i=t.tickCount,a=t.originalDomain,o=t.allowDecimals,s=n||t.scale;if(s!==`auto`&&s!==`linear`)return null;if(i&&r===`number`&&a&&(a[0]===`auto`||a[1]===`auto`)){var c=e.domain();if(!c.length)return null;var l=CP(c,i,o);return e.domain([(0,oF.default)(l),(0,aF.default)(l)]),{niceTicks:l}}return i&&r===`number`?{niceTicks:wP(e.domain(),i,o)}:null};function GF(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!(0,mb.default)(i[t.dataKey])){var s=Tb(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=xF(i,(0,mb.default)(o)?t.dataKey:o);return(0,mb.default)(c)?null:t.scale(c)}var KF=function(e){var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,o=e.index;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=xF(a,t.dataKey,t.domain[o]);return(0,mb.default)(s)?null:t.scale(s)-i/2+r},qF=function(e){var t=e.numericAxis,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},JF=function(e,t){var n,r=((n=e.type)!=null&&n.defaultProps?_F(_F({},e.type.defaultProps),e.props):e.props).stackId;if(vb(r)){var i=t[r];if(i){var a=i.items.indexOf(e);return a>=0?i.stackedData[a]:null}}return null},YF=function(e){return e.reduce(function(e,t){return[(0,oF.default)(t.concat([e[0]]).filter(X)),(0,aF.default)(t.concat([e[1]]).filter(X))]},[1/0,-1/0])},XF=function(e,t,n){return Object.keys(e).reduce(function(r,i){var a=e[i].stackedData.reduce(function(e,r){var i=YF(r.slice(t,n+1));return[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(a[0],r[0]),Math.max(a[1],r[1])]},[1/0,-1/0]).map(function(e){return e===1/0||e===-1/0?0:e})},ZF=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,QF=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,$F=function(e,t,n){if((0,Rb.default)(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if(X(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(ZF.test(e[0])){var i=+ZF.exec(e[0])[1];r[0]=t[0]-i}else r[0]=(0,Rb.default)(e[0])?e[0](t[0]):t[0];if(X(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(QF.test(e[1])){var a=+QF.exec(e[1])[1];r[1]=t[1]+a}else r[1]=(0,Rb.default)(e[1])?e[1](t[1]):t[1];return r},eI=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,_T.default)(t,function(e){return e.coordinate}),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c.coordinate||0)-(l.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0},tI=function(e,t,n){return!e||!e.length||(0,cF.default)(e,(0,fb.default)(n,`type.defaultProps.domain`))?t:e},nI=function(e,t){var n=e.type.defaultProps?_F(_F({},e.type.defaultProps),e.props):e.props,r=n.dataKey,i=n.name,a=n.unit,o=n.formatter,s=n.tooltipType,c=n.chartType,l=n.hide;return _F(_F({},rx(e,!1)),{},{dataKey:r,unit:a,formatter:o,name:i||r,color:wF(e),value:xF(t,r),type:s,payload:t,chartType:c,hide:l})};function rI(e){"@babel/helpers - typeof";return rI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},rI(e)}function iI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function aI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?iI(Object(n),!0).forEach(function(t){oI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function oI(e,t,n){return t=sI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sI(e){var t=cI(e,`string`);return rI(t)==`symbol`?t:t+``}function cI(e,t){if(rI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(rI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function lI(e,t){return mI(e)||pI(e,t)||dI(e,t)||uI()}function uI(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
72
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dI(e,t){if(e){if(typeof e==`string`)return fI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fI(e,t)}}function fI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pI(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function mI(e){if(Array.isArray(e))return e}var hI=Math.PI/180,gI=function(e){return e*180/Math.PI},_I=function(e,t,n,r){return{x:e+Math.cos(-hI*r)*n,y:t+Math.sin(-hI*r)*n}},vI=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},yI=function(e,t,n,r,i){var a=e.width,o=e.height,s=e.startAngle,c=e.endAngle,l=xb(e.cx,a,a/2),u=xb(e.cy,o,o/2),d=vI(a,o,n),f=xb(e.innerRadius,d,0),p=xb(e.outerRadius,d,d*.8);return Object.keys(t).reduce(function(e,n){var a=t[n],o=a.domain,d=a.reversed,m;if((0,mb.default)(a.range))r===`angleAxis`?m=[s,c]:r===`radiusAxis`&&(m=[f,p]),d&&(m=[m[1],m[0]]);else{m=a.range;var h=lI(m,2);s=h[0],c=h[1]}var g=IF(a,i),_=g.realScaleType,v=g.scale;v.domain(o).range(m),RF(v);var y=WF(v,aI(aI({},a),{},{realScaleType:_})),b=aI(aI(aI({},a),y),{},{range:m,radius:p,realScaleType:_,scale:v,cx:l,cy:u,innerRadius:f,outerRadius:p,startAngle:s,endAngle:c});return aI(aI({},e),{},oI({},n,b))},{})},bI=function(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},xI=function(e,t){var n=e.x,r=e.y,i=t.cx,a=t.cy,o=bI({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:gI(c),angleInRadian:c}},SI=function(e){var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},CI=function(e,t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},wI=function(e,t){var n=e.x,r=e.y,i=xI({x:n,y:r},t),a=i.radius,o=i.angle,s=t.innerRadius,c=t.outerRadius;if(a<s||a>c)return!1;if(a===0)return!0;var l=SI(t),u=l.startAngle,d=l.endAngle,f=o,p;if(u<=d){for(;f>d;)f-=360;for(;f<u;)f+=360;p=f>=u&&f<=d}else{for(;f>u;)f-=360;for(;f<d;)f+=360;p=f>=d&&f<=u}return p?aI(aI({},t),{},{radius:a,angle:CI(f,t)}):null},TI=function(e){return!(0,_.isValidElement)(e)&&!(0,Rb.default)(e)&&typeof e!=`boolean`?e.className:``};function EI(e){"@babel/helpers - typeof";return EI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},EI(e)}var DI=[`offset`];function OI(e){return MI(e)||jI(e)||AI(e)||kI()}function kI(){throw TypeError(`Invalid attempt to spread non-iterable instance.
73
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AI(e,t){if(e){if(typeof e==`string`)return NI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NI(e,t)}}function jI(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function MI(e){if(Array.isArray(e))return NI(e)}function NI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function PI(e,t){if(e==null)return{};var n=FI(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FI(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function II(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?II(Object(n),!0).forEach(function(t){RI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):II(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function RI(e,t,n){return t=zI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zI(e){var t=BI(e,`string`);return EI(t)==`symbol`?t:t+``}function BI(e,t){if(EI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(EI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function VI(){return VI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VI.apply(this,arguments)}var HI=function(e){var t=e.value,n=e.formatter,r=(0,mb.default)(e.children)?t:e.children;return(0,Rb.default)(n)?n(r):r},UI=function(e,t){return hb(t-e)*Math.min(Math.abs(t-e),360)},WI=function(e,t,n){var r=e.position,i=e.viewBox,a=e.offset,o=e.className,s=i,c=s.cx,l=s.cy,u=s.innerRadius,d=s.outerRadius,f=s.startAngle,p=s.endAngle,m=s.clockWise,h=(u+d)/2,g=UI(f,p),v=g>=0?1:-1,y,b;r===`insideStart`?(y=f+v*a,b=m):r===`insideEnd`?(y=p-v*a,b=!m):r===`end`&&(y=p+v*a,b=m),b=g<=0?b:!b;var x=_I(c,l,h,y),S=_I(c,l,h,y+(b?1:-1)*359),C=`M${x.x},${x.y}
74
+ A${h},${h},0,1,${+!b},
75
+ ${S.x},${S.y}`,w=(0,mb.default)(e.id)?bb(`recharts-radial-line-`):e.id;return _.createElement(`text`,VI({},n,{dominantBaseline:`central`,className:Vt(`recharts-radial-bar-label`,o)}),_.createElement(`defs`,null,_.createElement(`path`,{id:w,d:C})),_.createElement(`textPath`,{xlinkHref:`#${w}`},t))},GI=function(e){var t=e.viewBox,n=e.offset,r=e.position,i=t,a=i.cx,o=i.cy,s=i.innerRadius,c=i.outerRadius,l=(i.startAngle+i.endAngle)/2;if(r===`outside`){var u=_I(a,o,c+n,l),d=u.x;return{x:d,y:u.y,textAnchor:d>=a?`start`:`end`,verticalAnchor:`middle`}}if(r===`center`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`middle`};if(r===`centerTop`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`start`};if(r===`centerBottom`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`end`};var f=_I(a,o,(s+c)/2,l);return{x:f.x,y:f.y,textAnchor:`middle`,verticalAnchor:`middle`}},KI=function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,i=e.position,a=t,o=a.x,s=a.y,c=a.width,l=a.height,u=l>=0?1:-1,d=u*r,f=u>0?`end`:`start`,p=u>0?`start`:`end`,m=c>=0?1:-1,h=m*r,g=m>0?`end`:`start`,_=m>0?`start`:`end`;if(i===`top`)return LI(LI({},{x:o+c/2,y:s-u*r,textAnchor:`middle`,verticalAnchor:f}),n?{height:Math.max(s-n.y,0),width:c}:{});if(i===`bottom`)return LI(LI({},{x:o+c/2,y:s+l+d,textAnchor:`middle`,verticalAnchor:p}),n?{height:Math.max(n.y+n.height-(s+l),0),width:c}:{});if(i===`left`){var v={x:o-h,y:s+l/2,textAnchor:g,verticalAnchor:`middle`};return LI(LI({},v),n?{width:Math.max(v.x-n.x,0),height:l}:{})}if(i===`right`){var y={x:o+c+h,y:s+l/2,textAnchor:_,verticalAnchor:`middle`};return LI(LI({},y),n?{width:Math.max(n.x+n.width-y.x,0),height:l}:{})}var b=n?{width:c,height:l}:{};return i===`insideLeft`?LI({x:o+h,y:s+l/2,textAnchor:_,verticalAnchor:`middle`},b):i===`insideRight`?LI({x:o+c-h,y:s+l/2,textAnchor:g,verticalAnchor:`middle`},b):i===`insideTop`?LI({x:o+c/2,y:s+d,textAnchor:`middle`,verticalAnchor:p},b):i===`insideBottom`?LI({x:o+c/2,y:s+l-d,textAnchor:`middle`,verticalAnchor:f},b):i===`insideTopLeft`?LI({x:o+h,y:s+d,textAnchor:_,verticalAnchor:p},b):i===`insideTopRight`?LI({x:o+c-h,y:s+d,textAnchor:g,verticalAnchor:p},b):i===`insideBottomLeft`?LI({x:o+h,y:s+l-d,textAnchor:_,verticalAnchor:f},b):i===`insideBottomRight`?LI({x:o+c-h,y:s+l-d,textAnchor:g,verticalAnchor:f},b):(0,Ob.default)(i)&&(X(i.x)||gb(i.x))&&(X(i.y)||gb(i.y))?LI({x:o+xb(i.x,c),y:s+xb(i.y,l),textAnchor:`end`,verticalAnchor:`end`},b):LI({x:o+c/2,y:s+l/2,textAnchor:`middle`,verticalAnchor:`middle`},b)},qI=function(e){return`cx`in e&&X(e.cx)};function JI(e){var t=e.offset,n=t===void 0?5:t,r=PI(e,DI),i=LI({offset:n},r),a=i.viewBox,o=i.position,s=i.value,c=i.children,l=i.content,u=i.className,d=u===void 0?``:u,f=i.textBreakAll;if(!a||(0,mb.default)(s)&&(0,mb.default)(c)&&!(0,_.isValidElement)(l)&&!(0,Rb.default)(l))return null;if((0,_.isValidElement)(l))return(0,_.cloneElement)(l,i);var p;if((0,Rb.default)(l)){if(p=(0,_.createElement)(l,i),(0,_.isValidElement)(p))return p}else p=HI(i);var m=qI(a),h=rx(i,!0);if(m&&(o===`insideStart`||o===`insideEnd`||o===`end`))return WI(i,p,h);var g=m?GI(i):KI(i);return _.createElement(XD,VI({className:Vt(`recharts-label`,d)},h,g,{breakAll:f}),p)}JI.displayName=`Label`;var YI=function(e){var t=e.cx,n=e.cy,r=e.angle,i=e.startAngle,a=e.endAngle,o=e.r,s=e.radius,c=e.innerRadius,l=e.outerRadius,u=e.x,d=e.y,f=e.top,p=e.left,m=e.width,h=e.height,g=e.clockWise,_=e.labelViewBox;if(_)return _;if(X(m)&&X(h)){if(X(u)&&X(d))return{x:u,y:d,width:m,height:h};if(X(f)&&X(p))return{x:f,y:p,width:m,height:h}}return X(u)&&X(d)?{x:u,y:d,width:0,height:0}:X(t)&&X(n)?{cx:t,cy:n,startAngle:i||r||0,endAngle:a||r||0,innerRadius:c||0,outerRadius:l||s||o||0,clockWise:g}:e.viewBox?e.viewBox:{}},XI=function(e,t){return e?e===!0?_.createElement(JI,{key:`label-implicit`,viewBox:t}):vb(e)?_.createElement(JI,{key:`label-implicit`,viewBox:t,value:e}):(0,_.isValidElement)(e)?e.type===JI?(0,_.cloneElement)(e,{key:`label-implicit`,viewBox:t}):_.createElement(JI,{key:`label-implicit`,content:e,viewBox:t}):(0,Rb.default)(e)?_.createElement(JI,{key:`label-implicit`,content:e,viewBox:t}):(0,Ob.default)(e)?_.createElement(JI,VI({viewBox:t},e,{key:`label-implicit`})):null:null};JI.parseViewBox=YI,JI.renderCallByParent=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=YI(e),a=Xb(r,JI).map(function(e,n){return(0,_.cloneElement)(e,{viewBox:t||i,key:`label-${n}`})});return n?[XI(e.label,t||i)].concat(OI(a)):a};var ZI=l(o(((e,t)=>{function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}t.exports=n}))());function QI(e){"@babel/helpers - typeof";return QI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QI(e)}var $I=[`valueAccessor`],eL=[`data`,`dataKey`,`clockWise`,`id`,`textBreakAll`];function tL(e){return aL(e)||iL(e)||rL(e)||nL()}function nL(){throw TypeError(`Invalid attempt to spread non-iterable instance.
76
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rL(e,t){if(e){if(typeof e==`string`)return oL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oL(e,t)}}function iL(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function aL(e){if(Array.isArray(e))return oL(e)}function oL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sL(){return sL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sL.apply(this,arguments)}function cL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cL(Object(n),!0).forEach(function(t){uL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uL(e,t,n){return t=dL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dL(e){var t=fL(e,`string`);return QI(t)==`symbol`?t:t+``}function fL(e,t){if(QI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function pL(e,t){if(e==null)return{};var n=mL(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function mL(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var hL=function(e){return Array.isArray(e.value)?(0,ZI.default)(e.value):e.value};function gL(e){var t=e.valueAccessor,n=t===void 0?hL:t,r=pL(e,$I),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,c=r.textBreakAll,l=pL(r,eL);return!i||!i.length?null:_.createElement(_x,{className:`recharts-label-list`},i.map(function(e,t){var r=(0,mb.default)(a)?n(e,t):xF(e&&e.payload,a),i=(0,mb.default)(s)?{}:{id:`${s}-${t}`};return _.createElement(JI,sL({},rx(e,!0),l,i,{parentViewBox:e.parentViewBox,value:r,textBreakAll:c,viewBox:JI.parseViewBox((0,mb.default)(o)?e:lL(lL({},e),{},{clockWise:o})),key:`label-${t}`,index:t}))}))}gL.displayName=`LabelList`;function _L(e,t){return e?e===!0?_.createElement(gL,{key:`labelList-implicit`,data:t}):_.isValidElement(e)||(0,Rb.default)(e)?_.createElement(gL,{key:`labelList-implicit`,data:t,content:e}):(0,Ob.default)(e)?_.createElement(gL,sL({data:t},e,{key:`labelList-implicit`})):null:null}function vL(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=Xb(r,gL).map(function(e,n){return(0,_.cloneElement)(e,{data:t,key:`labelList-${n}`})});return n?[_L(e.label,t)].concat(tL(i)):i}gL.renderCallByParent=vL;function yL(e){"@babel/helpers - typeof";return yL=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},yL(e)}function bL(){return bL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bL.apply(this,arguments)}function xL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xL(Object(n),!0).forEach(function(t){CL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function CL(e,t,n){return t=wL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wL(e){var t=TL(e,`string`);return yL(t)==`symbol`?t:t+``}function TL(e,t){if(yL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(yL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var EL=function(e,t){return hb(t-e)*Math.min(Math.abs(t-e),359.999)},DL=function(e){var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,o=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,l=s*(o?1:-1)+r,u=Math.asin(s/l)/hI,d=c?i:i+a*u,f=_I(t,n,l,d),p=_I(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:_I(t,n,l*Math.cos(u*hI),m),theta:u}},OL=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,s=EL(a,o),c=a+s,l=_I(t,n,i,a),u=_I(t,n,i,c),d=`M ${l.x},${l.y}
77
+ A ${i},${i},0,
78
+ ${+(Math.abs(s)>180)},${+(a>c)},
79
+ ${u.x},${u.y}
80
+ `;if(r>0){var f=_I(t,n,r,a),p=_I(t,n,r,c);d+=`L ${p.x},${p.y}
81
+ A ${r},${r},0,
82
+ ${+(Math.abs(s)>180)},${+(a<=c)},
83
+ ${f.x},${f.y} Z`}else d+=`L ${t},${n} Z`;return d},kL=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,l=e.endAngle,u=hb(l-c),d=DL({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),f=d.circleTangency,p=d.lineTangency,m=d.theta,h=DL({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),g=h.circleTangency,_=h.lineTangency,v=h.theta,y=s?Math.abs(c-l):Math.abs(c-l)-m-v;if(y<0)return o?`M ${p.x},${p.y}
84
+ a${a},${a},0,0,1,${a*2},0
85
+ a${a},${a},0,0,1,${-a*2},0
86
+ `:OL({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var b=`M ${p.x},${p.y}
87
+ A${a},${a},0,0,${+(u<0)},${f.x},${f.y}
88
+ A${i},${i},0,${+(y>180)},${+(u<0)},${g.x},${g.y}
89
+ A${a},${a},0,0,${+(u<0)},${_.x},${_.y}
90
+ `;if(r>0){var x=DL({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),S=x.circleTangency,C=x.lineTangency,w=x.theta,T=DL({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),E=T.circleTangency,D=T.lineTangency,O=T.theta,k=s?Math.abs(c-l):Math.abs(c-l)-w-O;if(k<0&&a===0)return`${b}L${t},${n}Z`;b+=`L${D.x},${D.y}
91
+ A${a},${a},0,0,${+(u<0)},${E.x},${E.y}
92
+ A${r},${r},0,${+(k>180)},${+(u>0)},${S.x},${S.y}
93
+ A${a},${a},0,0,${+(u<0)},${C.x},${C.y}Z`}else b+=`L${t},${n}Z`;return b},AL={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},jL=function(e){var t=SL(SL({},AL),e),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,u=t.endAngle,d=t.className;if(a<i||l===u)return null;var f=Vt(`recharts-sector`,d),p=a-i,m=xb(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?kL({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):OL({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return _.createElement(`path`,bL({},rx(t,!0),{className:f,d:h,role:`img`}))};function ML(e){"@babel/helpers - typeof";return ML=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ML(e)}function NL(){return NL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NL.apply(this,arguments)}function PL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?PL(Object(n),!0).forEach(function(t){IL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function IL(e,t,n){return t=LL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LL(e){var t=RL(e,`string`);return ML(t)==`symbol`?t:t+``}function RL(e,t){if(ML(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ML(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var zL={curveBasisClosed:bS,curveBasisOpen:SS,curveBasis:vS,curveBumpX:Jx,curveBumpY:Yx,curveLinearClosed:wS,curveLinear:Hx,curveMonotoneX:MS,curveMonotoneY:NS,curveNatural:IS,curveStep:RS,curveStepAfter:BS,curveStepBefore:zS},BL=function(e){return e.x===+e.x&&e.y===+e.y},VL=function(e){return e.x},HL=function(e){return e.y},Ree=function(e,t){if((0,Rb.default)(e))return e;var n=`curve${(0,YS.default)(e)}`;return(n===`curveMonotone`||n===`curveBump`)&&t?zL[`${n}${t===`vertical`?`Y`:`X`}`]:zL[n]||Hx},zee=function(e){var t=e.type,n=t===void 0?`linear`:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,o=e.layout,s=e.connectNulls,c=s!==void 0&&s,l=Ree(n,o),u=c?i.filter(function(e){return BL(e)}):i,d;if(Array.isArray(a)){var f=c?a.filter(function(e){return BL(e)}):a,p=u.map(function(e,t){return FL(FL({},e),{},{base:f[t]})});return d=o===`vertical`?Kx().y(HL).x1(VL).x0(function(e){return e.base.x}):Kx().x(VL).y1(HL).y0(function(e){return e.base.y}),d.defined(BL).curve(l),d(p)}return d=o===`vertical`&&X(a)?Kx().y(HL).x1(VL).x0(a):X(a)?Kx().x(VL).y1(HL).y0(a):Gx().x(VL).y(HL),d.defined(BL).curve(l),d(u)},UL=function(e){var t=e.className,n=e.points,r=e.path,i=e.pathRef;if((!n||!n.length)&&!r)return null;var a=n&&n.length?zee(e):r;return _.createElement(`path`,NL({},rx(e,!1),Fb(e),{className:Vt(`recharts-curve`,t),d:a,ref:i}))},Bee=o(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Vee=o(((e,t)=>{var n=Bee();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Hee=o(((e,t)=>{t.exports=Vee()()})),{getOwnPropertyNames:Uee,getOwnPropertySymbols:Wee}=Object,{hasOwnProperty:Gee}=Object.prototype;function WL(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function GL(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function Kee(e){return e?.[Symbol.toStringTag]}function KL(e){return Uee(e).concat(Wee(e))}var qee=Object.hasOwn||((e,t)=>Gee.call(e,t));function qL(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Jee=`__v`,Yee=`__o`,Xee=`_owner`,{getOwnPropertyDescriptor:JL,keys:YL}=Object;function Zee(e,t){return e.byteLength===t.byteLength&&$L(new Uint8Array(e),new Uint8Array(t))}function Qee(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function $ee(e,t){return e.byteLength===t.byteLength&&$L(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function ete(e,t){return qL(e.getTime(),t.getTime())}function tte(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function nte(e,t){return e===t}function XL(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var rte=qL;function ite(e,t,n){let r=YL(e),i=r.length;if(YL(t).length!==i)return!1;for(;i-->0;)if(!eR(e,t,n,r[i]))return!1;return!0}function ZL(e,t,n){let r=KL(e),i=r.length;if(KL(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!eR(e,t,n,a)||(o=JL(e,a),s=JL(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function ate(e,t){return qL(e.valueOf(),t.valueOf())}function ote(e,t){return e.source===t.source&&e.flags===t.flags}function QL(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function $L(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function ste(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function eR(e,t,n,r){return(r===Xee||r===Yee||r===Jee)&&(e.$$typeof||t.$$typeof)?!0:qee(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var cte=`[object ArrayBuffer]`,lte=`[object Arguments]`,ute=`[object Boolean]`,tR=`[object DataView]`,nR=`[object Date]`,rR=`[object Error]`,iR=`[object Map]`,aR=`[object Number]`,oR=`[object Object]`,sR=`[object RegExp]`,cR=`[object Set]`,lR=`[object String]`,uR={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},dR=`[object URL]`,fR=Object.prototype.toString;function pR({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`&&a(h,g,_);let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=fR.call(h);if(b===nR)return r(h,g,_);if(b===sR)return u(h,g,_);if(b===iR)return o(h,g,_);if(b===cR)return d(h,g,_);if(b===oR)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===dR)return p(h,g,_);if(b===rR)return i(h,g,_);if(b===lte)return c(h,g,_);if(uR[b])return f(h,g,_);if(b===cte)return e(h,g,_);if(b===tR)return n(h,g,_);if(b===ute||b===aR||b===lR)return l(h,g,_);if(m){let e=m[b];if(!e){let t=Kee(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function mR({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Zee,areArraysEqual:n?ZL:Qee,areDataViewsEqual:$ee,areDatesEqual:ete,areErrorsEqual:tte,areFunctionsEqual:nte,areMapsEqual:n?WL(XL,ZL):XL,areNumbersEqual:rte,areObjectsEqual:n?ZL:ite,arePrimitiveWrappersEqual:ate,areRegExpsEqual:ote,areSetsEqual:n?WL(QL,ZL):QL,areTypedArraysEqual:n?WL($L,ZL):$L,areUrlsEqual:ste,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=GL(r.areArraysEqual),t=GL(r.areMapsEqual),n=GL(r.areObjectsEqual),i=GL(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function hR(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function gR({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var _R=vR();vR({strict:!0}),vR({circular:!0}),vR({circular:!0,strict:!0}),vR({createInternalComparator:()=>qL}),vR({strict:!0,createInternalComparator:()=>qL}),vR({circular:!0,createInternalComparator:()=>qL}),vR({circular:!0,createInternalComparator:()=>qL,strict:!0});function vR(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=pR(mR(e));return gR({circular:t,comparator:a,createState:r,equals:n?n(a):hR(a),strict:i})}function yR(e){typeof requestAnimationFrame<`u`&&requestAnimationFrame(e)}function bR(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1;requestAnimationFrame(function r(i){n<0&&(n=i),i-n>t?(e(i),n=-1):yR(r)})}function xR(e){"@babel/helpers - typeof";return xR=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},xR(e)}function SR(e){return DR(e)||ER(e)||wR(e)||CR()}function CR(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
94
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wR(e,t){if(e){if(typeof e==`string`)return TR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TR(e,t)}}function TR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ER(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function DR(e){if(Array.isArray(e))return e}function OR(){var e={},t=function(){return null},n=!1,r=function r(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var a=SR(i),o=a[0],s=a.slice(1);if(typeof o==`number`){bR(r.bind(null,s),o);return}r(o),bR(r.bind(null,s))}else xR(i)===`object`&&(e=i,t(e)),typeof i==`function`&&i()}};return{stop:function(){n=!0},start:function(e){n=!1,r(e)},subscribe:function(e){return t=e,function(){t=function(){return null}}}}}function kR(e){"@babel/helpers - typeof";return kR=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},kR(e)}function AR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?AR(Object(n),!0).forEach(function(t){MR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function MR(e,t,n){return t=NR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NR(e){var t=PR(e,`string`);return kR(t)===`symbol`?t:String(t)}function PR(e,t){if(kR(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(kR(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var FR=function(e,t){return[Object.keys(e),Object.keys(t)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})})},IR=function(e){return e},LR=function(e){return e.replace(/([A-Z])/g,function(e){return`-${e.toLowerCase()}`})},RR=function(e,t){return Object.keys(t).reduce(function(n,r){return jR(jR({},n),{},MR({},r,e(r,t[r])))},{})},zR=function(e,t,n){return e.map(function(e){return`${LR(e)} ${t}ms ${n}`}).join(`,`)};function BR(e,t){return UR(e)||HR(e,t)||KR(e,t)||VR()}function VR(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
95
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HR(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function UR(e){if(Array.isArray(e))return e}function WR(e){return JR(e)||qR(e)||KR(e)||GR()}function GR(){throw TypeError(`Invalid attempt to spread non-iterable instance.
96
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KR(e,t){if(e){if(typeof e==`string`)return YR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YR(e,t)}}function qR(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function JR(e){if(Array.isArray(e))return YR(e)}function YR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var XR=1e-4,ZR=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},QR=function(e,t){return e.map(function(e,n){return e*t**+n}).reduce(function(e,t){return e+t})},$R=function(e,t){return function(n){return QR(ZR(e,t),n)}},ez=function(e,t){return function(n){var r=ZR(e,t);return QR([].concat(WR(r.map(function(e,t){return e*t}).slice(1)),[0]),n)}},tz=function(){var e=[...arguments],t=e[0],n=e[1],r=e[2],i=e[3];if(e.length===1)switch(e[0]){case`linear`:t=0,n=0,r=1,i=1;break;case`ease`:t=.25,n=.1,r=.25,i=1;break;case`ease-in`:t=.42,n=0,r=1,i=1;break;case`ease-out`:t=.42,n=0,r=.58,i=1;break;case`ease-in-out`:t=0,n=0,r=.58,i=1;break;default:var a=e[0].split(`(`);if(a[0]===`cubic-bezier`&&a[1].split(`)`)[0].split(`,`).length===4){var o=BR(a[1].split(`)`)[0].split(`,`).map(function(e){return parseFloat(e)}),4);t=o[0],n=o[1],r=o[2],i=o[3]}}[t,r,n,i].every(function(e){return typeof e==`number`&&e>=0&&e<=1});var s=$R(t,r),c=$R(n,i),l=ez(t,r),u=function(e){return e>1?1:e<0?0:e},d=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var i=s(n)-t,a=l(n);if(Math.abs(i-t)<XR||a<XR)return c(n);n=u(n-i/a)}return c(n)};return d.isStepper=!1,d},nz=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,n=t===void 0?100:t,r=e.damping,i=r===void 0?8:r,a=e.dt,o=a===void 0?17:a,s=function(e,t,r){var a=r+(-(e-t)*n-r*i)*o/1e3,s=r*o/1e3+e;return Math.abs(s-t)<XR&&Math.abs(a)<XR?[t,0]:[s,a]};return s.isStepper=!0,s.dt=o,s},rz=function(){var e=[...arguments][0];if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return tz(e);case`spring`:return nz();default:if(e.split(`(`)[0]===`cubic-bezier`)return tz(e)}return typeof e==`function`?e:null};function iz(e){"@babel/helpers - typeof";return iz=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},iz(e)}function az(e){return cz(e)||sz(e)||gz(e)||oz()}function oz(){throw TypeError(`Invalid attempt to spread non-iterable instance.
97
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sz(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function cz(e){if(Array.isArray(e))return _z(e)}function lz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lz(Object(n),!0).forEach(function(t){dz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dz(e,t,n){return t=fz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fz(e){var t=pz(e,`string`);return iz(t)===`symbol`?t:String(t)}function pz(e,t){if(iz(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(iz(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function mz(e,t){return yz(e)||vz(e,t)||gz(e,t)||hz()}function hz(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
98
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gz(e,t){if(e){if(typeof e==`string`)return _z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _z(e,t)}}function _z(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vz(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function yz(e){if(Array.isArray(e))return e}var bz=function(e,t,n){return e+(t-e)*n},xz=function(e){return e.from!==e.to},Sz=function e(t,n,r){var i=RR(function(e,n){if(xz(n)){var r=mz(t(n.from,n.to,n.velocity),2),i=r[0],a=r[1];return uz(uz({},n),{},{from:i,velocity:a})}return n},n);return r<1?RR(function(e,t){return xz(t)?uz(uz({},t),{},{velocity:bz(t.velocity,i[e].velocity,r),from:bz(t.from,i[e].from,r)}):t},n):e(t,i,r-1)},Cz=(function(e,t,n,r,i){var a=FR(e,t),o=a.reduce(function(n,r){return uz(uz({},n),{},dz({},r,[e[r],t[r]]))},{}),s=a.reduce(function(n,r){return uz(uz({},n),{},dz({},r,{from:e[r],velocity:0,to:t[r]}))},{}),c=-1,l,u,d=function(){return null},f=function(){return RR(function(e,t){return t.from},s)},p=function(){return!Object.values(s).filter(xz).length};return d=n.isStepper?function(r){l||=r;var a=(r-l)/n.dt;s=Sz(n,s,a),i(uz(uz(uz({},e),t),f(s))),l=r,p()||(c=requestAnimationFrame(d))}:function(a){u||=a;var s=(a-u)/r,l=RR(function(e,t){return bz.apply(void 0,az(t).concat([n(s)]))},o);if(i(uz(uz(uz({},e),t),l)),s<1)c=requestAnimationFrame(d);else{var f=RR(function(e,t){return bz.apply(void 0,az(t).concat([n(1)]))},o);i(uz(uz(uz({},e),t),f))}},function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}}),wz=l(Hee());function Tz(e){"@babel/helpers - typeof";return Tz=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Tz(e)}var Ez=[`children`,`begin`,`duration`,`attributeName`,`easing`,`isActive`,`steps`,`from`,`to`,`canBegin`,`onAnimationEnd`,`shouldReAnimate`,`onAnimationReStart`];function Dz(e,t){if(e==null)return{};var n=Oz(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Oz(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function kz(e){return Nz(e)||Mz(e)||jz(e)||Az()}function Az(){throw TypeError(`Invalid attempt to spread non-iterable instance.
99
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jz(e,t){if(e){if(typeof e==`string`)return Pz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pz(e,t)}}function Mz(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Nz(e){if(Array.isArray(e))return Pz(e)}function Pz(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Fz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Iz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Fz(Object(n),!0).forEach(function(t){Lz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Lz(e,t,n){return t=Vz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rz(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function zz(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Vz(r.key),r)}}function Bz(e,t,n){return t&&zz(e.prototype,t),n&&zz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vz(e){var t=Hz(e,`string`);return Tz(t)===`symbol`?t:String(t)}function Hz(e,t){if(Tz(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Tz(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Uz(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wz(e,t)}function Wz(e,t){return Wz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Wz(e,t)}function Gz(e){var t=Jz();return function(){var n=Yz(e),r;if(t){var i=Yz(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Kz(this,r)}}function Kz(e,t){if(t&&(Tz(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return qz(e)}function qz(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Jz(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Yz(e){return Yz=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yz(e)}var Xz=function(e){Uz(n,e);var t=Gz(n);function n(e,r){var i;Rz(this,n),i=t.call(this,e,r);var a=i.props,o=a.isActive,s=a.attributeName,c=a.from,l=a.to,u=a.steps,d=a.children,f=a.duration;if(i.handleStyleChange=i.handleStyleChange.bind(qz(i)),i.changeStyle=i.changeStyle.bind(qz(i)),!o||f<=0)return i.state={style:{}},typeof d==`function`&&(i.state={style:l}),Kz(i);if(u&&u.length)i.state={style:u[0].style};else if(c){if(typeof d==`function`)return i.state={style:c},Kz(i);i.state={style:s?Lz({},s,c):c}}else i.state={style:{}};return i}return Bz(n,[{key:`componentDidMount`,value:function(){var e=this.props,t=e.isActive,n=e.canBegin;this.mounted=!0,t&&n&&this.runAnimation(this.props)}},{key:`componentDidUpdate`,value:function(e){var t=this.props,n=t.isActive,r=t.canBegin,i=t.attributeName,a=t.shouldReAnimate,o=t.to,s=t.from,c=this.state.style;if(r){if(!n){var l={style:i?Lz({},i,o):o};this.state&&c&&(i&&c[i]!==o||!i&&c!==o)&&this.setState(l)}else if(!(_R(e.to,o)&&e.canBegin&&e.isActive)){var u=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var d=u||a?s:e.to;if(this.state&&c){var f={style:i?Lz({},i,d):d};(i&&c[i]!==d||!i&&c!==d)&&this.setState(f)}this.runAnimation(Iz(Iz({},this.props),{},{from:d,begin:0}))}}}},{key:`componentWillUnmount`,value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&=(this.manager.stop(),null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:`handleStyleChange`,value:function(e){this.changeStyle(e)}},{key:`changeStyle`,value:function(e){this.mounted&&this.setState({style:e})}},{key:`runJSAnimation`,value:function(e){var t=this,n=e.from,r=e.to,i=e.duration,a=e.easing,o=e.begin,s=e.onAnimationEnd,c=e.onAnimationStart,l=Cz(n,r,rz(a),i,this.changeStyle);this.manager.start([c,o,function(){t.stopJSAnimation=l()},i,s])}},{key:`runStepAnimation`,value:function(e){var t=this,n=e.steps,r=e.begin,i=e.onAnimationStart,a=n[0],o=a.style,s=a.duration,c=s===void 0?0:s;return this.manager.start([i].concat(kz(n.reduce(function(e,r,i){if(i===0)return e;var a=r.duration,o=r.easing,s=o===void 0?`ease`:o,c=r.style,l=r.properties,u=r.onAnimationEnd,d=i>0?n[i-1]:r,f=l||Object.keys(c);if(typeof s==`function`||s===`spring`)return[].concat(kz(e),[t.runJSAnimation.bind(t,{from:d.style,to:c,duration:a,easing:s}),a]);var p=zR(f,a,s),m=Iz(Iz(Iz({},d.style),c),{},{transition:p});return[].concat(kz(e),[m,a,u]).filter(IR)},[o,Math.max(c,r)])),[e.onAnimationEnd]))}},{key:`runAnimation`,value:function(e){this.manager||=OR();var t=e.begin,n=e.duration,r=e.attributeName,i=e.to,a=e.easing,o=e.onAnimationStart,s=e.onAnimationEnd,c=e.steps,l=e.children,u=this.manager;if(this.unSubscribe=u.subscribe(this.handleStyleChange),typeof a==`function`||typeof l==`function`||a===`spring`)this.runJSAnimation(e);else if(c.length>1)this.runStepAnimation(e);else{var d=r?Lz({},r,i):i,f=zR(Object.keys(d),n,a);u.start([o,t,Iz(Iz({},d),{},{transition:f}),n,s])}}},{key:`render`,value:function(){var e=this.props,t=e.children;e.begin;var n=e.duration;e.attributeName,e.easing;var r=e.isActive;e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart;var i=Dz(e,Ez),a=_.Children.count(t),o=this.state.style;if(typeof t==`function`)return t(o);if(!r||a===0||n<=0)return t;var s=function(e){var t=e.props,n=t.style,r=n===void 0?{}:n,a=t.className;return(0,_.cloneElement)(e,Iz(Iz({},i),{},{style:Iz(Iz({},r),o),className:a}))};return a===1?s(_.Children.only(t)):_.createElement(`div`,null,_.Children.map(t,function(e){return s(e)}))}}]),n}(_.PureComponent);Xz.displayName=`Animate`,Xz.defaultProps={begin:0,duration:1e3,from:``,to:``,attributeName:``,easing:`ease`,isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},Xz.propTypes={from:wz.default.oneOfType([wz.default.object,wz.default.string]),to:wz.default.oneOfType([wz.default.object,wz.default.string]),attributeName:wz.default.string,duration:wz.default.number,begin:wz.default.number,easing:wz.default.oneOfType([wz.default.string,wz.default.func]),steps:wz.default.arrayOf(wz.default.shape({duration:wz.default.number.isRequired,style:wz.default.object.isRequired,easing:wz.default.oneOfType([wz.default.oneOf([`ease`,`ease-in`,`ease-out`,`ease-in-out`,`linear`]),wz.default.func]),properties:wz.default.arrayOf(`string`),onAnimationEnd:wz.default.func})),children:wz.default.oneOfType([wz.default.node,wz.default.func]),isActive:wz.default.bool,canBegin:wz.default.bool,onAnimationEnd:wz.default.func,shouldReAnimate:wz.default.bool,onAnimationStart:wz.default.func,onAnimationReStart:wz.default.func};var Zz=Xz;function Qz(e){"@babel/helpers - typeof";return Qz=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Qz(e)}function $z(){return $z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$z.apply(this,arguments)}function eB(e,t){return aB(e)||iB(e,t)||nB(e,t)||tB()}function tB(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
100
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nB(e,t){if(e){if(typeof e==`string`)return rB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rB(e,t)}}function rB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iB(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function aB(e){if(Array.isArray(e))return e}function oB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oB(Object(n),!0).forEach(function(t){cB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cB(e,t,n){return t=lB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lB(e){var t=uB(e,`string`);return Qz(t)==`symbol`?t:t+``}function uB(e,t){if(Qz(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Qz(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var dB=function(e,t,n,r,i){var a=Math.min(Math.abs(n)/2,Math.abs(r)/2),o=r>=0?1:-1,s=n>=0?1:-1,c=+(r>=0&&n>=0||r<0&&n<0),l;if(a>0&&i instanceof Array){for(var u=[0,0,0,0],d=0,f=4;d<f;d++)u[d]=i[d]>a?a:i[d];l=`M${e},${t+o*u[0]}`,u[0]>0&&(l+=`A ${u[0]},${u[0]},0,0,${c},${e+s*u[0]},${t}`),l+=`L ${e+n-s*u[1]},${t}`,u[1]>0&&(l+=`A ${u[1]},${u[1]},0,0,${c},
101
+ ${e+n},${t+o*u[1]}`),l+=`L ${e+n},${t+r-o*u[2]}`,u[2]>0&&(l+=`A ${u[2]},${u[2]},0,0,${c},
102
+ ${e+n-s*u[2]},${t+r}`),l+=`L ${e+s*u[3]},${t+r}`,u[3]>0&&(l+=`A ${u[3]},${u[3]},0,0,${c},
103
+ ${e},${t+r-o*u[3]}`),l+=`Z`}else if(a>0&&i===+i&&i>0){var p=Math.min(a,i);l=`M ${e},${t+o*p}
104
+ A ${p},${p},0,0,${c},${e+s*p},${t}
105
+ L ${e+n-s*p},${t}
106
+ A ${p},${p},0,0,${c},${e+n},${t+o*p}
107
+ L ${e+n},${t+r-o*p}
108
+ A ${p},${p},0,0,${c},${e+n-s*p},${t+r}
109
+ L ${e+s*p},${t+r}
110
+ A ${p},${p},0,0,${c},${e},${t+r-o*p} Z`}else l=`M ${e},${t} h ${n} v ${r} h ${-n} Z`;return l},fB=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,i=t.x,a=t.y,o=t.width,s=t.height;if(Math.abs(o)>0&&Math.abs(s)>0){var c=Math.min(i,i+o),l=Math.max(i,i+o),u=Math.min(a,a+s),d=Math.max(a,a+s);return n>=c&&n<=l&&r>=u&&r<=d}return!1},pB={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},mB=function(e){var t=sB(sB({},pB),e),n=(0,_.useRef)(),r=eB((0,_.useState)(-1),2),i=r[0],a=r[1];(0,_.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.width,l=t.height,u=t.radius,d=t.className,f=t.animationEasing,p=t.animationDuration,m=t.animationBegin,h=t.isAnimationActive,g=t.isUpdateAnimationActive;if(o!==+o||s!==+s||c!==+c||l!==+l||c===0||l===0)return null;var v=Vt(`recharts-rectangle`,d);return g?_.createElement(Zz,{canBegin:i>0,from:{width:c,height:l,x:o,y:s},to:{width:c,height:l,x:o,y:s},duration:p,animationEasing:f,isActive:g},function(e){var r=e.width,a=e.height,o=e.x,s=e.y;return _.createElement(Zz,{canBegin:i>0,from:`0px ${i===-1?1:i}px`,to:`${i}px 0px`,attributeName:`strokeDasharray`,begin:m,duration:p,isActive:h,easing:f},_.createElement(`path`,$z({},rx(t,!0),{className:v,d:dB(o,s,r,a,u),ref:n})))}):_.createElement(`path`,$z({},rx(t,!0),{className:v,d:dB(o,s,c,l,u)}))},hB=[`points`,`className`,`baseLinePoints`,`connectNulls`];function gB(){return gB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gB.apply(this,arguments)}function _B(e,t){if(e==null)return{};var n=vB(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vB(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yB(e){return CB(e)||SB(e)||xB(e)||bB()}function bB(){throw TypeError(`Invalid attempt to spread non-iterable instance.
111
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xB(e,t){if(e){if(typeof e==`string`)return wB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wB(e,t)}}function SB(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function CB(e){if(Array.isArray(e))return wB(e)}function wB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var TB=function(e){return e&&e.x===+e.x&&e.y===+e.y},EB=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[[]];return e.forEach(function(e){TB(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),TB(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},DB=function(e,t){var n=EB(e);t&&(n=[n.reduce(function(e,t){return[].concat(yB(e),yB(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return`${e}${n===0?`M`:`L`}${t.x},${t.y}`},``)}).join(``);return n.length===1?`${r}Z`:r},OB=function(e,t,n){var r=DB(e,n);return`${r.slice(-1)===`Z`?r.slice(0,-1):r}L${DB(t.reverse(),n).slice(1)}`},kB=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,i=e.connectNulls,a=_B(e,hB);if(!t||!t.length)return null;var o=Vt(`recharts-polygon`,n);if(r&&r.length){var s=a.stroke&&a.stroke!==`none`,c=OB(t,r,i);return _.createElement(`g`,{className:o},_.createElement(`path`,gB({},rx(a,!0),{fill:c.slice(-1)===`Z`?a.fill:`none`,stroke:`none`,d:c})),s?_.createElement(`path`,gB({},rx(a,!0),{fill:`none`,d:DB(t,i)})):null,s?_.createElement(`path`,gB({},rx(a,!0),{fill:`none`,d:DB(r,i)})):null)}var l=DB(t,i);return _.createElement(`path`,gB({},rx(a,!0),{fill:l.slice(-1)===`Z`?a.fill:`none`,className:o,d:l}))};function AB(){return AB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AB.apply(this,arguments)}var jB=function(e){var t=e.cx,n=e.cy,r=e.r,i=e.className,a=Vt(`recharts-dot`,i);return t===+t&&n===+n&&r===+r?_.createElement(`circle`,AB({},rx(e,!1),Fb(e),{className:a,cx:t,cy:n,r})):null};function MB(e){"@babel/helpers - typeof";return MB=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},MB(e)}var NB=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function PB(){return PB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PB.apply(this,arguments)}function FB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function IB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?FB(Object(n),!0).forEach(function(t){LB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LB(e,t,n){return t=RB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RB(e){var t=zB(e,`string`);return MB(t)==`symbol`?t:t+``}function zB(e,t){if(MB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(MB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function BB(e,t){if(e==null)return{};var n=VB(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VB(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var HB=function(e,t,n,r,i,a){return`M${e},${i}v${r}M${a},${t}h${n}`},UB=function(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,o=a===void 0?0:a,s=e.left,c=s===void 0?0:s,l=e.width,u=l===void 0?0:l,d=e.height,f=d===void 0?0:d,p=e.className,m=BB(e,NB),h=IB({x:n,y:i,top:o,left:c,width:u,height:f},m);return!X(n)||!X(i)||!X(u)||!X(f)||!X(o)||!X(c)?null:_.createElement(`path`,PB({},rx(h,!0),{className:Vt(`recharts-cross`,p),d:HB(n,i,u,f,o,c)}))},WB=o(((e,t)=>{var n=jN(),r=MN(),i=_w();function a(e,t){return e&&e.length?n(e,i(t,2),r):void 0}t.exports=a})),GB=o(((e,t)=>{var n=jN(),r=_w(),i=PN();function a(e,t){return e&&e.length?n(e,r(t,2),i):void 0}t.exports=a})),KB=l(WB()),qB=l(GB()),JB=[`cx`,`cy`,`angle`,`ticks`,`axisLine`],YB=[`ticks`,`tick`,`angle`,`tickFormatter`,`stroke`];function XB(e){"@babel/helpers - typeof";return XB=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},XB(e)}function ZB(){return ZB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ZB.apply(this,arguments)}function QB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $B(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?QB(Object(n),!0).forEach(function(t){fV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eV(e,t){if(e==null)return{};var n=tV(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tV(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function nV(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function rV(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,pV(r.key),r)}}function iV(e,t,n){return t&&rV(e.prototype,t),n&&rV(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function aV(e,t,n){return t=lV(t),oV(e,cV()?Reflect.construct(t,n||[],lV(e).constructor):t.apply(e,n))}function oV(e,t){if(t&&(XB(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return sV(e)}function sV(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function cV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cV=function(){return!!e})()}function lV(e){return lV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lV(e)}function uV(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dV(e,t)}function dV(e,t){return dV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dV(e,t)}function fV(e,t,n){return t=pV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pV(e){var t=mV(e,`string`);return XB(t)==`symbol`?t:t+``}function mV(e,t){if(XB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(XB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var hV=function(e){function t(){return nV(this,t),aV(this,t,arguments)}return uV(t,e),iV(t,[{key:`getTickValueCoord`,value:function(e){var t=e.coordinate,n=this.props,r=n.angle,i=n.cx,a=n.cy;return _I(i,a,t,r)}},{key:`getTickTextAnchor`,value:function(){var e=this.props.orientation,t;switch(e){case`left`:t=`end`;break;case`right`:t=`start`;break;default:t=`middle`}return t}},{key:`getViewBox`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,i=e.ticks,a=(0,KB.default)(i,function(e){return e.coordinate||0});return{cx:t,cy:n,startAngle:r,endAngle:r,innerRadius:(0,qB.default)(i,function(e){return e.coordinate||0}).coordinate||0,outerRadius:a.coordinate||0}}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,i=e.ticks,a=e.axisLine,o=eV(e,JB),s=i.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),c=_I(t,n,s[0],r),l=_I(t,n,s[1],r),u=$B($B($B({},rx(o,!1)),{},{fill:`none`},rx(a,!1)),{},{x1:c.x,y1:c.y,x2:l.x,y2:l.y});return _.createElement(`line`,ZB({className:`recharts-polar-radius-axis-line`},u))}},{key:`renderTicks`,value:function(){var e=this,n=this.props,r=n.ticks,i=n.tick,a=n.angle,o=n.tickFormatter,s=n.stroke,c=eV(n,YB),l=this.getTickTextAnchor(),u=rx(c,!1),d=rx(i,!1),f=r.map(function(n,r){var c=e.getTickValueCoord(n),f=$B($B($B($B({textAnchor:l,transform:`rotate(${90-a}, ${c.x}, ${c.y})`},u),{},{stroke:`none`,fill:s},d),{},{index:r},c),{},{payload:n});return _.createElement(_x,ZB({className:Vt(`recharts-polar-radius-axis-tick`,TI(i)),key:`tick-${n.coordinate}`},Lb(e.props,n,r)),t.renderTickItem(i,f,o?o(n.value,r):n.value))});return _.createElement(_x,{className:`recharts-polar-radius-axis-ticks`},f)}},{key:`render`,value:function(){var e=this.props,t=e.ticks,n=e.axisLine,r=e.tick;return!t||!t.length?null:_.createElement(_x,{className:Vt(`recharts-polar-radius-axis`,this.props.className)},n&&this.renderAxisLine(),r&&this.renderTicks(),JI.renderCallByParent(this.props,this.getViewBox()))}}],[{key:`renderTickItem`,value:function(e,t,n){return _.isValidElement(e)?_.cloneElement(e,t):(0,Rb.default)(e)?e(t):_.createElement(XD,ZB({},t,{className:`recharts-polar-radius-axis-tick-value`}),n)}}])}(_.PureComponent);fV(hV,`displayName`,`PolarRadiusAxis`),fV(hV,`axisType`,`radiusAxis`),fV(hV,`defaultProps`,{type:`number`,radiusAxisId:0,cx:0,cy:0,angle:0,orientation:`right`,stroke:`#ccc`,axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:`auto`,allowDuplicatedCategory:!0});function gV(e){"@babel/helpers - typeof";return gV=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},gV(e)}function _V(){return _V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_V.apply(this,arguments)}function vV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vV(Object(n),!0).forEach(function(t){AV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bV(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function xV(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,jV(r.key),r)}}function SV(e,t,n){return t&&xV(e.prototype,t),n&&xV(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function CV(e,t,n){return t=DV(t),wV(e,EV()?Reflect.construct(t,n||[],DV(e).constructor):t.apply(e,n))}function wV(e,t){if(t&&(gV(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return TV(e)}function TV(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function EV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(EV=function(){return!!e})()}function DV(e){return DV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},DV(e)}function OV(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kV(e,t)}function kV(e,t){return kV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kV(e,t)}function AV(e,t,n){return t=jV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jV(e){var t=MV(e,`string`);return gV(t)==`symbol`?t:t+``}function MV(e,t){if(gV(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(gV(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var NV=Math.PI/180,PV=1e-5,FV=function(e){function t(){return bV(this,t),CV(this,t,arguments)}return OV(t,e),SV(t,[{key:`getTickLineCoord`,value:function(e){var t=this.props,n=t.cx,r=t.cy,i=t.radius,a=t.orientation,o=t.tickSize||8,s=_I(n,r,i,e.coordinate),c=_I(n,r,i+(a===`inner`?-1:1)*o,e.coordinate);return{x1:s.x,y1:s.y,x2:c.x,y2:c.y}}},{key:`getTickTextAnchor`,value:function(e){var t=this.props.orientation,n=Math.cos(-e.coordinate*NV);return n>PV?t===`outer`?`start`:`end`:n<-PV?t===`outer`?`end`:`start`:`middle`}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,i=e.axisLine,a=e.axisLineType,o=yV(yV({},rx(this.props,!1)),{},{fill:`none`},rx(i,!1));if(a===`circle`)return _.createElement(jB,_V({className:`recharts-polar-angle-axis-line`},o,{cx:t,cy:n,r}));var s=this.props.ticks.map(function(e){return _I(t,n,r,e.coordinate)});return _.createElement(kB,_V({className:`recharts-polar-angle-axis-line`},o,{points:s}))}},{key:`renderTicks`,value:function(){var e=this,n=this.props,r=n.ticks,i=n.tick,a=n.tickLine,o=n.tickFormatter,s=n.stroke,c=rx(this.props,!1),l=rx(i,!1),u=yV(yV({},c),{},{fill:`none`},rx(a,!1)),d=r.map(function(n,r){var d=e.getTickLineCoord(n),f=yV(yV(yV({textAnchor:e.getTickTextAnchor(n)},c),{},{stroke:`none`,fill:s},l),{},{index:r,payload:n,x:d.x2,y:d.y2});return _.createElement(_x,_V({className:Vt(`recharts-polar-angle-axis-tick`,TI(i)),key:`tick-${n.coordinate}`},Lb(e.props,n,r)),a&&_.createElement(`line`,_V({className:`recharts-polar-angle-axis-tick-line`},u,d)),i&&t.renderTickItem(i,f,o?o(n.value,r):n.value))});return _.createElement(_x,{className:`recharts-polar-angle-axis-ticks`},d)}},{key:`render`,value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return n<=0||!t||!t.length?null:_.createElement(_x,{className:Vt(`recharts-polar-angle-axis`,this.props.className)},r&&this.renderAxisLine(),this.renderTicks())}}],[{key:`renderTickItem`,value:function(e,t,n){return _.isValidElement(e)?_.cloneElement(e,t):(0,Rb.default)(e)?e(t):_.createElement(XD,_V({},t,{className:`recharts-polar-angle-axis-tick-value`}),n)}}])}(_.PureComponent);AV(FV,`displayName`,`PolarAngleAxis`),AV(FV,`axisType`,`angleAxis`),AV(FV,`defaultProps`,{type:`category`,angleAxisId:0,scale:`auto`,cx:0,cy:0,orientation:`outer`,axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var IV=o(((e,t)=>{t.exports=qC()(Object.getPrototypeOf,Object)})),LV=o(((e,t)=>{var n=fy(),r=IV(),i=py(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),RV=o(((e,t)=>{var n=fy(),r=py(),i=`[object Boolean]`;function a(e){return e===!0||e===!1||r(e)&&n(e)==i}t.exports=a}));function zV(e){"@babel/helpers - typeof";return zV=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},zV(e)}function BV(){return BV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BV.apply(this,arguments)}function VV(e,t){return KV(e)||GV(e,t)||UV(e,t)||HV()}function HV(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
112
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UV(e,t){if(e){if(typeof e==`string`)return WV(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return WV(e,t)}}function WV(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function GV(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function KV(e){if(Array.isArray(e))return e}function qV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qV(Object(n),!0).forEach(function(t){YV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YV(e,t,n){return t=XV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XV(e){var t=ZV(e,`string`);return zV(t)==`symbol`?t:t+``}function ZV(e,t){if(zV(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(zV(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var QV=function(e,t,n,r,i){var a=n-r,o=`M ${e},${t}`;return o+=`L ${e+n},${t}`,o+=`L ${e+n-a/2},${t+i}`,o+=`L ${e+n-a/2-r},${t+i}`,o+=`L ${e},${t} Z`,o},$V={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},eH=function(e){var t=JV(JV({},$V),e),n=(0,_.useRef)(),r=VV((0,_.useState)(-1),2),i=r[0],a=r[1];(0,_.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.upperWidth,l=t.lowerWidth,u=t.height,d=t.className,f=t.animationEasing,p=t.animationDuration,m=t.animationBegin,h=t.isUpdateAnimationActive;if(o!==+o||s!==+s||c!==+c||l!==+l||u!==+u||c===0&&l===0||u===0)return null;var g=Vt(`recharts-trapezoid`,d);return h?_.createElement(Zz,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:u,x:o,y:s},to:{upperWidth:c,lowerWidth:l,height:u,x:o,y:s},duration:p,animationEasing:f,isActive:h},function(e){var r=e.upperWidth,a=e.lowerWidth,o=e.height,s=e.x,c=e.y;return _.createElement(Zz,{canBegin:i>0,from:`0px ${i===-1?1:i}px`,to:`${i}px 0px`,attributeName:`strokeDasharray`,begin:m,duration:p,easing:f},_.createElement(`path`,BV({},rx(t,!0),{className:g,d:QV(s,c,r,a,o),ref:n})))}):_.createElement(`g`,null,_.createElement(`path`,BV({},rx(t,!0),{className:g,d:QV(o,s,c,l,u)})))},tH=l(LV()),nH=l(RV()),rH=[`option`,`shapeType`,`propTransformer`,`activeClassName`,`isActive`];function iH(e){"@babel/helpers - typeof";return iH=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},iH(e)}function aH(e,t){if(e==null)return{};var n=oH(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oH(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function sH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?sH(Object(n),!0).forEach(function(t){lH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lH(e,t,n){return t=uH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uH(e){var t=dH(e,`string`);return iH(t)==`symbol`?t:t+``}function dH(e,t){if(iH(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(iH(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function fH(e,t){return cH(cH({},t),e)}function pH(e,t){return e===`symbols`}function mH(e){var t=e.shapeType,n=e.elementProps;switch(t){case`rectangle`:return _.createElement(mB,n);case`trapezoid`:return _.createElement(eH,n);case`sector`:return _.createElement(jL,n);case`symbols`:if(pH(t,n))return _.createElement(dC,n);break;default:return null}}function hH(e){return(0,_.isValidElement)(e)?e.props:e}function gH(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?fH:r,a=e.activeClassName,o=a===void 0?`recharts-active-shape`:a,s=e.isActive,c=aH(e,rH),l;if((0,_.isValidElement)(t))l=(0,_.cloneElement)(t,cH(cH({},c),hH(t)));else if((0,Rb.default)(t))l=t(c);else if((0,tH.default)(t)&&!(0,nH.default)(t)){var u=i(t,c);l=_.createElement(mH,{shapeType:n,elementProps:u})}else{var d=c;l=_.createElement(mH,{shapeType:n,elementProps:d})}return s?_.createElement(_x,{className:o},l):l}function _H(e,t){return t!=null&&`trapezoids`in e.props}function vH(e,t){return t!=null&&`sectors`in e.props}function yH(e,t){return t!=null&&`points`in e.props}function bH(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)==null?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)==null?void 0:r.y)||e.y===t.y;return i&&a}function xH(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function SH(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function CH(e,t){var n;return _H(e,t)?n=bH:vH(e,t)?n=xH:yH(e,t)&&(n=SH),n}function wH(e,t){var n;return _H(e,t)?n=`trapezoids`:vH(e,t)?n=`sectors`:yH(e,t)&&(n=`points`),n}function TH(e,t){if(_H(e,t)){var n;return(n=t.tooltipPayload)==null||(n=n[0])==null||(n=n.payload)==null?void 0:n.payload}if(vH(e,t)){var r;return(r=t.tooltipPayload)==null||(r=r[0])==null||(r=r.payload)==null?void 0:r.payload}return yH(e,t)?t.payload:{}}function EH(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=wH(n,t),a=TH(n,t),o=r.filter(function(e,r){var o=(0,cF.default)(a,e),s=n.props[i].filter(function(e){return CH(n,t)(e,t)}),c=r===n.props[i].indexOf(s[s.length-1]);return o&&c});return r.indexOf(o[o.length-1])}var DH;function OH(e){"@babel/helpers - typeof";return OH=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},OH(e)}function kH(){return kH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kH.apply(this,arguments)}function AH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?AH(Object(n),!0).forEach(function(t){HH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function MH(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function NH(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,UH(r.key),r)}}function PH(e,t,n){return t&&NH(e.prototype,t),n&&NH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function FH(e,t,n){return t=zH(t),IH(e,RH()?Reflect.construct(t,n||[],zH(e).constructor):t.apply(e,n))}function IH(e,t){if(t&&(OH(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return LH(e)}function LH(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function RH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RH=function(){return!!e})()}function zH(e){return zH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zH(e)}function BH(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&VH(e,t)}function VH(e,t){return VH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},VH(e,t)}function HH(e,t,n){return t=UH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UH(e){var t=WH(e,`string`);return OH(t)==`symbol`?t:t+``}function WH(e,t){if(OH(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(OH(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var GH=function(e){function t(e){var n;return MH(this,t),n=FH(this,t,[e]),HH(n,`pieRef`,null),HH(n,`sectorRefs`,[]),HH(n,`id`,bb(`recharts-pie-`)),HH(n,`handleAnimationEnd`,function(){var e=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),(0,Rb.default)(e)&&e()}),HH(n,`handleAnimationStart`,function(){var e=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),(0,Rb.default)(e)&&e()}),n.state={isAnimationFinished:!e.isAnimationActive,prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,sectorToFocus:0},n}return BH(t,e),PH(t,[{key:`isActiveIndex`,value:function(e){var t=this.props.activeIndex;return Array.isArray(t)?t.indexOf(e)!==-1:e===t}},{key:`hasActiveIndex`,value:function(){var e=this.props.activeIndex;return Array.isArray(e)?e.length!==0:e||e===0}},{key:`renderLabels`,value:function(e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.label,i=n.labelLine,a=n.dataKey,o=n.valueKey,s=rx(this.props,!1),c=rx(r,!1),l=rx(i,!1),u=r&&r.offsetRadius||20,d=e.map(function(e,n){var d=(e.startAngle+e.endAngle)/2,f=_I(e.cx,e.cy,e.outerRadius+u,d),p=jH(jH(jH(jH({},s),e),{},{stroke:`none`},c),{},{index:n,textAnchor:t.getTextAnchor(f.x,e.cx)},f),m=jH(jH(jH(jH({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:n,points:[_I(e.cx,e.cy,e.outerRadius,d),f]}),h=a;return(0,mb.default)(a)&&(0,mb.default)(o)?h=`value`:(0,mb.default)(a)&&(h=o),_.createElement(_x,{key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${n}`},i&&t.renderLabelLineItem(i,m,`line`),t.renderLabelItem(r,p,xF(e,h)))});return _.createElement(_x,{className:`recharts-pie-labels`},d)}},{key:`renderSectorsStatically`,value:function(e){var t=this,n=this.props,r=n.activeShape,i=n.blendStroke,a=n.inactiveShape;return e.map(function(n,o){if(n?.startAngle===0&&n?.endAngle===0&&e.length!==1)return null;var s=t.isActiveIndex(o),c=a&&t.hasActiveIndex()?a:null,l=s?r:c,u=jH(jH({},n),{},{stroke:i?n.fill:n.stroke,tabIndex:-1});return _.createElement(_x,kH({ref:function(e){e&&!t.sectorRefs.includes(e)&&t.sectorRefs.push(e)},tabIndex:-1,className:`recharts-pie-sector`},Lb(t.props,n,o),{key:`sector-${n?.startAngle}-${n?.endAngle}-${n.midAngle}-${o}`}),_.createElement(gH,kH({option:l,isActive:s,shapeType:`sector`},u)))})}},{key:`renderSectorsWithAnimation`,value:function(){var e=this,t=this.props,n=t.sectors,r=t.isAnimationActive,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.animationId,c=this.state,l=c.prevSectors,u=c.prevIsAnimationActive;return _.createElement(Zz,{begin:i,duration:a,isActive:r,easing:o,from:{t:0},to:{t:1},key:`pie-${s}-${u}`,onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(t){var r=t.t,i=[],a=(n&&n[0]).startAngle;return n.forEach(function(e,t){var n=l&&l[t],o=t>0?(0,fb.default)(e,`paddingAngle`,0):0;if(n){var s=wb(n.endAngle-n.startAngle,e.endAngle-e.startAngle),c=jH(jH({},e),{},{startAngle:a+o,endAngle:a+s(r)+o});i.push(c),a=c.endAngle}else{var u=e.endAngle,d=e.startAngle,f=wb(0,u-d)(r),p=jH(jH({},e),{},{startAngle:a+o,endAngle:a+f+o});i.push(p),a=p.endAngle}}),_.createElement(_x,null,e.renderSectorsStatically(i))})}},{key:`attachKeyboardHandlers`,value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case`ArrowLeft`:var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case`ArrowRight`:var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case`Escape`:t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:`renderSectors`,value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!(0,cF.default)(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:`componentDidMount`,value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,i=t.className,a=t.label,o=t.cx,s=t.cy,c=t.innerRadius,l=t.outerRadius,u=t.isAnimationActive,d=this.state.isAnimationFinished;if(n||!r||!r.length||!X(o)||!X(s)||!X(c)||!X(l))return null;var f=Vt(`recharts-pie`,i);return _.createElement(_x,{tabIndex:this.props.rootTabIndex,className:f,ref:function(t){e.pieRef=t}},this.renderSectors(),a&&this.renderLabels(r),JI.renderCallByParent(this.props,null,!1),(!u||d)&&gL.renderCallByParent(this.props,r,!1))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return t.prevIsAnimationActive===e.isAnimationActive?e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors===t.curSectors?null:{curSectors:e.sectors,isAnimationFinished:!0}:{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}}},{key:`getTextAnchor`,value:function(e,t){return e>t?`start`:e<t?`end`:`middle`}},{key:`renderLabelLineItem`,value:function(e,t,n){if(_.isValidElement(e))return _.cloneElement(e,t);if((0,Rb.default)(e))return e(t);var r=Vt(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className);return _.createElement(UL,kH({},t,{key:n,type:`linear`,className:r}))}},{key:`renderLabelItem`,value:function(e,t,n){if(_.isValidElement(e))return _.cloneElement(e,t);var r=n;if((0,Rb.default)(e)&&(r=e(t),_.isValidElement(r)))return r;var i=Vt(`recharts-pie-label-text`,typeof e!=`boolean`&&!(0,Rb.default)(e)?e.className:``);return _.createElement(XD,kH({},t,{alignmentBaseline:`middle`,className:i}),r)}}])}(_.PureComponent);DH=GH,HH(GH,`displayName`,`Pie`),HH(GH,`defaultProps`,{stroke:`#fff`,fill:`#808080`,legendType:`rect`,cx:`50%`,cy:`50%`,startAngle:0,endAngle:360,innerRadius:0,outerRadius:`80%`,paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!sE.isSsr,animationBegin:400,animationDuration:1500,animationEasing:`ease`,nameKey:`name`,blendStroke:!1,rootTabIndex:0}),HH(GH,`parseDeltaAngle`,function(e,t){return hb(t-e)*Math.min(Math.abs(t-e),360)}),HH(GH,`getRealPieData`,function(e){var t=e.data,n=e.children,r=rx(e,!1),i=Xb(n,KE);return t&&t.length?t.map(function(e,t){return jH(jH(jH({payload:e},r),e),i&&i[t]&&i[t].props)}):i&&i.length?i.map(function(e){return jH(jH({},r),e.props)}):[]}),HH(GH,`parseCoordinateOfPie`,function(e,t){var n=t.top,r=t.left,i=t.width,a=t.height,o=vI(i,a);return{cx:r+xb(e.cx,i,i/2),cy:n+xb(e.cy,a,a/2),innerRadius:xb(e.innerRadius,o,0),outerRadius:xb(e.outerRadius,o,o*.8),maxRadius:e.maxRadius||Math.sqrt(i*i+a*a)/2}}),HH(GH,`getComposedData`,function(e){var t=e.item,n=e.offset,r=t.type.defaultProps===void 0?t.props:jH(jH({},t.type.defaultProps),t.props),i=DH.getRealPieData(r);if(!i||!i.length)return null;var a=r.cornerRadius,o=r.startAngle,s=r.endAngle,c=r.paddingAngle,l=r.dataKey,u=r.nameKey,d=r.valueKey,f=r.tooltipType,p=Math.abs(r.minAngle),m=DH.parseCoordinateOfPie(r,n),h=DH.parseDeltaAngle(o,s),g=Math.abs(h),_=l;(0,mb.default)(l)&&(0,mb.default)(d)?_=`value`:(0,mb.default)(l)&&(_=d);var v=i.filter(function(e){return xF(e,_,0)!==0}).length,y=(g>=360?v:v-1)*c,b=g-v*p-y,x=i.reduce(function(e,t){var n=xF(t,_,0);return e+(X(n)?n:0)},0),S;if(x>0){var C;S=i.map(function(e,t){var n=xF(e,_,0),r=xF(e,u,t),i=(X(n)?n:0)/x,s=t?C.endAngle+hb(h)*c*(n===0?0:1):o,l=s+hb(h)*((n===0?0:p)+i*b),d=(s+l)/2,g=(m.innerRadius+m.outerRadius)/2;return C=jH(jH(jH({percent:i,cornerRadius:a,name:r,tooltipPayload:[{name:r,value:n,payload:e,dataKey:_,type:f}],midAngle:d,middleRadius:g,tooltipPosition:_I(m.cx,m.cy,g,d)},e),m),{},{value:xF(e,_),startAngle:s,endAngle:l,payload:e,paddingAngle:hb(h)*c}),C})}return jH(jH({},m),{},{sectors:S,data:i})});var KH=o(((e,t)=>{var n=Math.ceil,r=Math.max;function i(e,t,i,a){for(var o=-1,s=r(n((t-e)/(i||1)),0),c=Array(s);s--;)c[a?s:++o]=e,e+=i;return c}t.exports=i})),qH=o(((e,t)=>{var n=AE(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),JH=o(((e,t)=>{var n=KH(),r=gT(),i=qH();function a(e){return function(t,a,o){return o&&typeof o!=`number`&&r(t,a,o)&&(a=o=void 0),t=i(t),a===void 0?(a=t,t=0):a=i(a),o=o===void 0?t<a?1:-1:i(o),n(t,a,o,e)}}t.exports=a})),YH=o(((e,t)=>{t.exports=JH()()}));function XH(e){"@babel/helpers - typeof";return XH=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},XH(e)}function ZH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ZH(Object(n),!0).forEach(function(t){$H(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $H(e,t,n){return t=eU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eU(e){var t=tU(e,`string`);return XH(t)==`symbol`?t:t+``}function tU(e,t){if(XH(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(XH(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var nU=[`Webkit`,`Moz`,`O`,`ms`],rU=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=nU.reduce(function(e,r){return QH(QH({},e),{},$H({},r+n,t))},{});return r[e]=t,r},iU=l(YH());function aU(e){"@babel/helpers - typeof";return aU=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},aU(e)}function oU(){return oU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oU.apply(this,arguments)}function sU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?sU(Object(n),!0).forEach(function(t){yU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lU(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function uU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,bU(r.key),r)}}function dU(e,t,n){return t&&uU(e.prototype,t),n&&uU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fU(e,t,n){return t=gU(t),pU(e,hU()?Reflect.construct(t,n||[],gU(e).constructor):t.apply(e,n))}function pU(e,t){if(t&&(aU(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return mU(e)}function mU(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function hU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hU=function(){return!!e})()}function gU(e){return gU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gU(e)}function _U(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vU(e,t)}function vU(e,t){return vU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vU(e,t)}function yU(e,t,n){return t=bU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bU(e){var t=xU(e,`string`);return aU(t)==`symbol`?t:t+``}function xU(e,t){if(aU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(aU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var SU=function(e){var t=e.data,n=e.startIndex,r=e.endIndex,i=e.x,a=e.width,o=e.travellerWidth;if(!t||!t.length)return{};var s=t.length,c=MO().domain((0,iU.default)(0,s)).range([i,i+a-o]),l=c.domain().map(function(e){return c(e)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:c(n),endX:c(r),scale:c,scaleValues:l}},CU=function(e){return e.changedTouches&&!!e.changedTouches.length},wU=function(e){function t(e){var n;return lU(this,t),n=fU(this,t,[e]),yU(n,`handleDrag`,function(e){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(e):n.state.isSlideMoving&&n.handleSlideDrag(e)}),yU(n,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&n.handleDrag(e.changedTouches[0])}),yU(n,`handleDragEnd`,function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var e=n.props,t=e.endIndex,r=e.onDragEnd,i=e.startIndex;r?.({endIndex:t,startIndex:i})}),n.detachDragEndListener()}),yU(n,`handleLeaveWrapper`,function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),yU(n,`handleEnterSlideOrTraveller`,function(){n.setState({isTextActive:!0})}),yU(n,`handleLeaveSlideOrTraveller`,function(){n.setState({isTextActive:!1})}),yU(n,`handleSlideDragStart`,function(e){var t=CU(e)?e.changedTouches[0]:e;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:t.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,`startX`),endX:n.handleTravellerDragStart.bind(n,`endX`)},n.state={},n}return _U(t,e),dU(t,[{key:`componentWillUnmount`,value:function(){this.leaveTimer&&=(clearTimeout(this.leaveTimer),null),this.detachDragEndListener()}},{key:`getIndex`,value:function(e){var n=e.startX,r=e.endX,i=this.state.scaleValues,a=this.props,o=a.gap,s=a.data.length-1,c=Math.min(n,r),l=Math.max(n,r),u=t.getIndexInRange(i,c),d=t.getIndexInRange(i,l);return{startIndex:u-u%o,endIndex:d===s?s:d-d%o}}},{key:`getTextOfTick`,value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,i=t.dataKey,a=xF(n[e],i,e);return(0,Rb.default)(r)?r(a,e):a}},{key:`attachDragEndListener`,value:function(){window.addEventListener(`mouseup`,this.handleDragEnd,!0),window.addEventListener(`touchend`,this.handleDragEnd,!0),window.addEventListener(`mousemove`,this.handleDrag,!0)}},{key:`detachDragEndListener`,value:function(){window.removeEventListener(`mouseup`,this.handleDragEnd,!0),window.removeEventListener(`touchend`,this.handleDragEnd,!0),window.removeEventListener(`mousemove`,this.handleDrag,!0)}},{key:`handleSlideDrag`,value:function(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,i=t.endX,a=this.props,o=a.x,s=a.width,c=a.travellerWidth,l=a.startIndex,u=a.endIndex,d=a.onChange,f=e.pageX-n;f>0?f=Math.min(f,o+s-c-i,o+s-c-r):f<0&&(f=Math.max(f,o-r,o-i));var p=this.getIndex({startX:r+f,endX:i+f});(p.startIndex!==l||p.endIndex!==u)&&d&&d(p),this.setState({startX:r+f,endX:i+f,slideMoveStartX:e.pageX})}},{key:`handleTravellerDragStart`,value:function(e,t){var n=CU(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:`handleTravellerMove`,value:function(e){var t=this.state,n=t.brushMoveStartX,r=t.movingTravellerId,i=t.endX,a=t.startX,o=this.state[r],s=this.props,c=s.x,l=s.width,u=s.travellerWidth,d=s.onChange,f=s.gap,p=s.data,m={startX:this.state.startX,endX:this.state.endX},h=e.pageX-n;h>0?h=Math.min(h,c+l-u-o):h<0&&(h=Math.max(h,c-o)),m[r]=o+h;var g=this.getIndex(m),_=g.startIndex,v=g.endIndex,y=function(){var e=p.length-1;return r===`startX`&&(i>a?_%f===0:v%f===0)||i<a&&v===e||r===`endX`&&(i>a?v%f===0:_%f===0)||i>a&&v===e};this.setState(yU(yU({},r,o+h),`brushMoveStartX`,e.pageX),function(){d&&y()&&d(g)})}},{key:`handleTravellerMoveKeyboard`,value:function(e,t){var n=this,r=this.state,i=r.scaleValues,a=r.startX,o=r.endX,s=this.state[t],c=i.indexOf(s);if(c!==-1){var l=c+e;if(!(l===-1||l>=i.length)){var u=i[l];t===`startX`&&u>=o||t===`endX`&&u<=a||this.setState(yU({},t,u),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:`renderBackground`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.fill,o=e.stroke;return _.createElement(`rect`,{stroke:o,fill:a,x:t,y:n,width:r,height:i})}},{key:`renderPanorama`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.data,o=e.children,s=e.padding,c=_.Children.only(o);return c?_.cloneElement(c,{x:t,y:n,width:r,height:i,margin:s,compact:!0,data:a}):null}},{key:`renderTravellerLayer`,value:function(e,n){var r=this,i=this.props,a=i.y,o=i.travellerWidth,s=i.height,c=i.traveller,l=i.ariaLabel,u=i.data,d=i.startIndex,f=i.endIndex,p=Math.max(e,this.props.x),m=cU(cU({},rx(this.props,!1)),{},{x:p,y:a,width:o,height:s}),h=l||`Min value: ${u[d]?.name}, Max value: ${u[f]?.name}`;return _.createElement(_x,{tabIndex:0,role:`slider`,"aria-label":h,"aria-valuenow":e,className:`recharts-brush-traveller`,onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[n],onTouchStart:this.travellerDragStartHandlers[n],onKeyDown:function(e){[`ArrowLeft`,`ArrowRight`].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),r.handleTravellerMoveKeyboard(e.key===`ArrowRight`?1:-1,n))},onFocus:function(){r.setState({isTravellerFocused:!0})},onBlur:function(){r.setState({isTravellerFocused:!1})},style:{cursor:`col-resize`}},t.renderTraveller(c,m))}},{key:`renderSlide`,value:function(e,t){var n=this.props,r=n.y,i=n.height,a=n.stroke,o=n.travellerWidth,s=Math.min(e,t)+o,c=Math.max(Math.abs(t-e)-o,0);return _.createElement(`rect`,{className:`recharts-brush-slide`,onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:`move`},stroke:`none`,fill:a,fillOpacity:.2,x:s,y:r,width:c,height:i})}},{key:`renderText`,value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,r=e.y,i=e.height,a=e.travellerWidth,o=e.stroke,s=this.state,c=s.startX,l=s.endX,u=5,d={pointerEvents:`none`,fill:o};return _.createElement(_x,{className:`recharts-brush-texts`},_.createElement(XD,oU({textAnchor:`end`,verticalAnchor:`middle`,x:Math.min(c,l)-u,y:r+i/2},d),this.getTextOfTick(t)),_.createElement(XD,oU({textAnchor:`start`,verticalAnchor:`middle`,x:Math.max(c,l)+a+u,y:r+i/2},d),this.getTextOfTick(n)))}},{key:`render`,value:function(){var e=this.props,t=e.data,n=e.className,r=e.children,i=e.x,a=e.y,o=e.width,s=e.height,c=e.alwaysShowText,l=this.state,u=l.startX,d=l.endX,f=l.isTextActive,p=l.isSlideMoving,m=l.isTravellerMoving,h=l.isTravellerFocused;if(!t||!t.length||!X(i)||!X(a)||!X(o)||!X(s)||o<=0||s<=0)return null;var g=Vt(`recharts-brush`,n),v=_.Children.count(r)===1,y=rU(`userSelect`,`none`);return _.createElement(_x,{className:g,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:y},this.renderBackground(),v&&this.renderPanorama(),this.renderSlide(u,d),this.renderTravellerLayer(u,`startX`),this.renderTravellerLayer(d,`endX`),(f||p||m||h||c)&&this.renderText())}}],[{key:`renderDefaultTraveller`,value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.stroke,o=Math.floor(n+i/2)-1;return _.createElement(_.Fragment,null,_.createElement(`rect`,{x:t,y:n,width:r,height:i,fill:a,stroke:`none`}),_.createElement(`line`,{x1:t+1,y1:o,x2:t+r-1,y2:o,fill:`none`,stroke:`#fff`}),_.createElement(`line`,{x1:t+1,y1:o+2,x2:t+r-1,y2:o+2,fill:`none`,stroke:`#fff`}))}},{key:`renderTraveller`,value:function(e,n){return _.isValidElement(e)?_.cloneElement(e,n):(0,Rb.default)(e)?e(n):t.renderDefaultTraveller(n)}},{key:`getDerivedStateFromProps`,value:function(e,t){var n=e.data,r=e.width,i=e.x,a=e.travellerWidth,o=e.updateId,s=e.startIndex,c=e.endIndex;if(n!==t.prevData||o!==t.prevUpdateId)return cU({prevData:n,prevTravellerWidth:a,prevUpdateId:o,prevX:i,prevWidth:r},n&&n.length?SU({data:n,width:r,x:i,travellerWidth:a,startIndex:s,endIndex:c}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||i!==t.prevX||a!==t.prevTravellerWidth)){t.scale.range([i,i+r-a]);var l=t.scale.domain().map(function(e){return t.scale(e)});return{prevData:n,prevTravellerWidth:a,prevUpdateId:o,prevX:i,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:l}}return null}},{key:`getIndexInRange`,value:function(e,t){for(var n=e.length,r=0,i=n-1;i-r>1;){var a=Math.floor((r+i)/2);e[a]>t?i=a:r=a}return t>=e[i]?i:r}}])}(_.PureComponent);yU(wU,`displayName`,`Brush`),yU(wU,`defaultProps`,{height:40,travellerWidth:5,gap:1,fill:`#fff`,stroke:`#666`,padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var TU=o(((e,t)=>{var n=iT();function r(e,t){var r;return n(e,function(e,n,i){return r=t(e,n,i),!r}),!!r}t.exports=r})),EU=o(((e,t)=>{var n=IC(),r=_w(),i=TU(),a=oy(),o=gT();function s(e,t,s){var c=a(e)?n:i;return s&&o(e,t,s)&&(t=void 0),c(e,r(t,3))}t.exports=s})),DU=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r=`extendDomain`),r===t},OU=o(((e,t)=>{var n=pT();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),kU=o(((e,t)=>{var n=OU(),r=nT(),i=_w();function a(e,t){var a={};return t=i(t,3),r(e,function(e,r,i){n(a,r,t(e,r,i))}),a}t.exports=a})),AU=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}t.exports=n})),jU=o(((e,t)=>{var n=iT();function r(e,t){var r=!0;return n(e,function(e,n,i){return r=!!t(e,n,i),r}),r}t.exports=r})),MU=o(((e,t)=>{var n=AU(),r=jU(),i=_w(),a=oy(),o=gT();function s(e,t,s){var c=a(e)?n:r;return s&&o(e,t,s)&&(t=void 0),c(e,i(t,3))}t.exports=s})),NU=[`x`,`y`];function PU(e){"@babel/helpers - typeof";return PU=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},PU(e)}function FU(){return FU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FU.apply(this,arguments)}function IU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?IU(Object(n),!0).forEach(function(t){RU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function RU(e,t,n){return t=zU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zU(e){var t=BU(e,`string`);return PU(t)==`symbol`?t:t+``}function BU(e,t){if(PU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(PU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function VU(e,t){if(e==null)return{};var n=HU(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function HU(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function UU(e,t){var n=e.x,r=e.y,i=VU(e,NU),a=`${n}`,o=parseInt(a,10),s=`${r}`,c=parseInt(s,10),l=`${t.height||i.height}`,u=parseInt(l,10),d=`${t.width||i.width}`,f=parseInt(d,10);return LU(LU(LU(LU(LU({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:u,width:f,name:t.name,radius:t.radius})}function WU(e){return _.createElement(gH,FU({shapeType:`rectangle`,propTransformer:UU,activeClassName:`recharts-active-bar`},e))}var GU=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,r){if(typeof e==`number`)return e;var i=X(n)||_b(n);return i?e(n,r):(!i&&EP(!1),t)}},KU=[`value`,`background`],qU;function JU(e){"@babel/helpers - typeof";return JU=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},JU(e)}function YU(e,t){if(e==null)return{};var n=XU(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XU(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ZU(){return ZU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ZU.apply(this,arguments)}function QU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $U(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?QU(Object(n),!0).forEach(function(t){uW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eW(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function tW(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,dW(r.key),r)}}function nW(e,t,n){return t&&tW(e.prototype,t),n&&tW(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rW(e,t,n){return t=sW(t),iW(e,oW()?Reflect.construct(t,n||[],sW(e).constructor):t.apply(e,n))}function iW(e,t){if(t&&(JU(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return aW(e)}function aW(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function oW(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oW=function(){return!!e})()}function sW(e){return sW=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sW(e)}function cW(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lW(e,t)}function lW(e,t){return lW=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lW(e,t)}function uW(e,t,n){return t=dW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dW(e){var t=fW(e,`string`);return JU(t)==`symbol`?t:t+``}function fW(e,t){if(JU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(JU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pW=function(e){function t(){var e;eW(this,t);var n=[...arguments];return e=rW(this,t,[].concat(n)),uW(e,`state`,{isAnimationFinished:!1}),uW(e,`id`,bb(`recharts-bar-`)),uW(e,`handleAnimationEnd`,function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),uW(e,`handleAnimationStart`,function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}return cW(t,e),nW(t,[{key:`renderRectanglesStatically`,value:function(e){var t=this,n=this.props,r=n.shape,i=n.dataKey,a=n.activeIndex,o=n.activeBar,s=rx(this.props,!1);return e&&e.map(function(e,n){var c=n===a,l=c?o:r,u=$U($U($U({},s),e),{},{isActive:c,option:l,index:n,dataKey:i,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return _.createElement(_x,ZU({className:`recharts-bar-rectangle`},Lb(t.props,e,n),{key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${n}`}),_.createElement(WU,u))})}},{key:`renderRectanglesWithAnimation`,value:function(){var e=this,t=this.props,n=t.data,r=t.layout,i=t.isAnimationActive,a=t.animationBegin,o=t.animationDuration,s=t.animationEasing,c=t.animationId,l=this.state.prevData;return _.createElement(Zz,{begin:a,duration:o,isActive:i,easing:s,from:{t:0},to:{t:1},key:`bar-${c}`,onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(t){var i=t.t,a=n.map(function(e,t){var n=l&&l[t];if(n){var a=wb(n.x,e.x),o=wb(n.y,e.y),s=wb(n.width,e.width),c=wb(n.height,e.height);return $U($U({},e),{},{x:a(i),y:o(i),width:s(i),height:c(i)})}if(r===`horizontal`){var u=wb(0,e.height)(i);return $U($U({},e),{},{y:e.y+e.height-u,height:u})}var d=wb(0,e.width)(i);return $U($U({},e),{},{width:d})});return _.createElement(_x,null,e.renderRectanglesStatically(a))})}},{key:`renderRectangles`,value:function(){var e=this.props,t=e.data,n=e.isAnimationActive,r=this.state.prevData;return n&&t&&t.length&&(!r||!(0,cF.default)(r,t))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(t)}},{key:`renderBackground`,value:function(){var e=this,t=this.props,n=t.data,r=t.dataKey,i=t.activeIndex,a=rx(this.props.background,!1);return n.map(function(t,n){t.value;var o=t.background,s=YU(t,KU);if(!o)return null;var c=$U($U($U($U($U({},s),{},{fill:`#eee`},o),a),Lb(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return _.createElement(WU,ZU({key:`background-bar-${n}`,option:e.props.background,isActive:n===i},c))})}},{key:`renderErrorBar`,value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.data,i=n.xAxis,a=n.yAxis,o=n.layout,s=n.children,c=Xb(s,ZP);if(!c)return null;var l=o===`vertical`?r[0].height/2:r[0].width/2,u=function(e,t){var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:xF(e,t)}},d={clipPath:e?`url(#clipPath-${t})`:null};return _.createElement(_x,d,c.map(function(e){return _.cloneElement(e,{key:`error-bar-${t}-${e.props.dataKey}`,data:r,xAxis:i,yAxis:a,layout:o,offset:l,dataPointFormatter:u})}))}},{key:`render`,value:function(){var e=this.props,t=e.hide,n=e.data,r=e.className,i=e.xAxis,a=e.yAxis,o=e.left,s=e.top,c=e.width,l=e.height,u=e.isAnimationActive,d=e.background,f=e.id;if(t||!n||!n.length)return null;var p=this.state.isAnimationFinished,m=Vt(`recharts-bar`,r),h=i&&i.allowDataOverflow,g=a&&a.allowDataOverflow,v=h||g,y=(0,mb.default)(f)?this.id:f;return _.createElement(_x,{className:m},h||g?_.createElement(`defs`,null,_.createElement(`clipPath`,{id:`clipPath-${y}`},_.createElement(`rect`,{x:h?o:o-c/2,y:g?s:s-l/2,width:h?c:c*2,height:g?l:l*2}))):null,_.createElement(_x,{className:`recharts-bar-rectangles`,clipPath:v?`url(#clipPath-${y})`:null},d?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(v,y),(!u||p)&&gL.renderCallByParent(this.props,n))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.animationId===t.prevAnimationId?e.data===t.curData?null:{curData:e.data}:{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}}}])}(_.PureComponent);qU=pW,uW(pW,`displayName`,`Bar`),uW(pW,`defaultProps`,{xAxisId:0,yAxisId:0,legendType:`rect`,minPointSize:0,hide:!1,data:[],layout:`vertical`,activeBar:!1,isAnimationActive:!sE.isSsr,animationBegin:0,animationDuration:400,animationEasing:`ease`}),uW(pW,`getComposedData`,function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,a=e.xAxis,o=e.yAxis,s=e.xAxisTicks,c=e.yAxisTicks,l=e.stackedData,u=e.dataStartIndex,d=e.displayedData,f=e.offset,p=zF(r,n);if(!p)return null;var m=t.layout,h=n.type.defaultProps,g=h===void 0?n.props:$U($U({},h),n.props),_=g.dataKey,v=g.children,y=g.minPointSize,b=m===`horizontal`?o:a,x=l?b.scale.domain():null,S=qF({numericAxis:b}),C=Xb(v,KE);return $U({data:d.map(function(e,t){var r,d,f,h,g,v;l?r=BF(l[u+t],x):(r=xF(e,_),Array.isArray(r)||(r=[S,r]));var b=GU(y,qU.defaultProps.minPointSize)(r[1],t);if(m===`horizontal`){var w=[o.scale(r[0]),o.scale(r[1])],T=w[0],E=w[1];d=KF({axis:a,ticks:s,bandSize:i,offset:p.offset,entry:e,index:t}),f=E??T??void 0,h=p.size;var D=T-E;if(g=Number.isNaN(D)?0:D,v={x:d,y:o.y,width:h,height:o.height},Math.abs(b)>0&&Math.abs(g)<Math.abs(b)){var O=hb(g||b)*(Math.abs(b)-Math.abs(g));f-=O,g+=O}}else{var k=[a.scale(r[0]),a.scale(r[1])],A=k[0],j=k[1];if(d=A,f=KF({axis:o,ticks:c,bandSize:i,offset:p.offset,entry:e,index:t}),h=j-A,g=p.size,v={x:a.x,y:f,width:a.width,height:g},Math.abs(b)>0&&Math.abs(h)<Math.abs(b)){var M=hb(h||b)*(Math.abs(b)-Math.abs(h));h+=M}}return $U($U($U({},e),{},{x:d,y:f,width:h,height:g,value:l?r:r[1],payload:e,background:v},C&&C[t]&&C[t].props),{},{tooltipPayload:[nI(n,e)],tooltipPosition:{x:d+h/2,y:f+g/2}})}),layout:m},f)});var mW=l(kU()),hW=l(MU());function gW(e){"@babel/helpers - typeof";return gW=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},gW(e)}function _W(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function vW(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,CW(r.key),r)}}function yW(e,t,n){return t&&vW(e.prototype,t),n&&vW(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?bW(Object(n),!0).forEach(function(t){SW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function SW(e,t,n){return t=CW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CW(e){var t=wW(e,`string`);return gW(t)==`symbol`?t:t+``}function wW(e,t){if(gW(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(gW(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var TW=function(e,t,n,r,i){var a=e.width,o=e.height,s=e.layout,c=e.children,l=Object.keys(t),u={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:o-n.bottom,bottomMirror:o-n.bottom},d=!!Zb(c,pW);return l.reduce(function(a,o){var c=t[o],l=c.orientation,f=c.domain,p=c.padding,m=p===void 0?{}:p,h=c.mirror,g=c.reversed,_=`${l}${h?`Mirror`:``}`,v,y,b,x,S;if(c.type===`number`&&(c.padding===`gap`||c.padding===`no-gap`)){var C=f[1]-f[0],w=1/0,T=c.categoricalDomain.sort(Eb);if(T.forEach(function(e,t){t>0&&(w=Math.min((e||0)-(T[t-1]||0),w))}),Number.isFinite(w)){var E=w/C,D=c.layout===`vertical`?n.height:n.width;if(c.padding===`gap`&&(v=E*D/2),c.padding===`no-gap`){var O=xb(e.barCategoryGap,E*D),k=E*D/2;v=k-O-(k-O)/D*O}}}y=r===`xAxis`?[n.left+(m.left||0)+(v||0),n.left+n.width-(m.right||0)-(v||0)]:r===`yAxis`?s===`horizontal`?[n.top+n.height-(m.bottom||0),n.top+(m.top||0)]:[n.top+(m.top||0)+(v||0),n.top+n.height-(m.bottom||0)-(v||0)]:c.range,g&&(y=[y[1],y[0]]);var A=IF(c,i,d),j=A.scale,M=A.realScaleType;j.domain(f).range(y),RF(j);var N=WF(j,xW(xW({},c),{},{realScaleType:M}));r===`xAxis`?(S=l===`top`&&!h||l===`bottom`&&h,b=n.left,x=u[_]-S*c.height):r===`yAxis`&&(S=l===`left`&&!h||l===`right`&&h,b=u[_]-S*c.width,x=n.top);var P=xW(xW(xW({},c),N),{},{realScaleType:M,x:b,y:x,scale:j,width:r===`xAxis`?n.width:c.width,height:r===`yAxis`?n.height:c.height});return P.bandSize=eI(P,N),!c.hide&&r===`xAxis`?u[_]+=(S?-1:1)*P.height:c.hide||(u[_]+=(S?-1:1)*P.width),xW(xW({},a),{},SW({},o,P))},{})},EW=function(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return{x:Math.min(n,i),y:Math.min(r,a),width:Math.abs(i-n),height:Math.abs(a-r)}},DW=function(e){var t=e.x1,n=e.y1,r=e.x2,i=e.y2;return EW({x:t,y:n},{x:r,y:i})},OW=function(){function e(t){_W(this,e),this.scale=t}return yW(e,[{key:`domain`,get:function(){return this.scale.domain}},{key:`range`,get:function(){return this.scale.range}},{key:`rangeMin`,get:function(){return this.range()[0]}},{key:`rangeMax`,get:function(){return this.range()[1]}},{key:`bandwidth`,get:function(){return this.scale.bandwidth}},{key:`apply`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.bandAware,r=t.position;if(e!==void 0){if(r)switch(r){case`start`:return this.scale(e);case`middle`:var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i;case`end`:var a=this.bandwidth?this.bandwidth():0;return this.scale(e)+a;default:return this.scale(e)}if(n){var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o}return this.scale(e)}}},{key:`isInRange`,value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}],[{key:`create`,value:function(t){return new e(t)}}])}();SW(OW,`EPS`,1e-4);var kW=function(e){var t=Object.keys(e).reduce(function(t,n){return xW(xW({},t),{},SW({},n,OW.create(e[n])))},{});return xW(xW({},t),{},{apply:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.bandAware,i=n.position;return(0,mW.default)(e,function(e,n){return t[n].apply(e,{bandAware:r,position:i})})},isInRange:function(e){return(0,hW.default)(e,function(e,n){return t[n].isInRange(e)})}})};function AW(e){return(e%180+180)%180}var jW=function(e){var t=e.width,n=e.height,r=AW(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)},MW=o(((e,t)=>{var n=_w(),r=JC(),i=YC();function a(e){return function(t,a,o){var s=Object(t);if(!r(t)){var c=n(a,3);t=i(t),a=function(e){return c(s[e],e,s)}}var l=e(t,a,o);return l>-1?s[c?t[l]:l]:void 0}}t.exports=a})),NW=o(((e,t)=>{var n=qH();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),PW=o(((e,t)=>{var n=vw(),r=_w(),i=NW(),a=Math.max;function o(e,t,o){var s=e==null?0:e.length;if(!s)return-1;var c=o==null?0:i(o);return c<0&&(c=a(s+c,0)),n(e,r(t,3),c)}t.exports=o})),FW=o(((e,t)=>{t.exports=MW()(PW())})),IW=(0,l(Jy()).default)(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return[`l`,e.left,`t`,e.top,`w`,e.width,`h`,e.height].join(``)});FW();var LW=(0,_.createContext)(void 0),RW=(0,_.createContext)(void 0),zW=(0,_.createContext)(void 0),BW=(0,_.createContext)({}),VW=(0,_.createContext)(void 0),HW=(0,_.createContext)(0),UW=(0,_.createContext)(0),WW=function(e){var t=e.state,n=t.xAxisMap,r=t.yAxisMap,i=t.offset,a=e.clipPathId,o=e.children,s=e.width,c=e.height,l=IW(i);return _.createElement(LW.Provider,{value:n},_.createElement(RW.Provider,{value:r},_.createElement(BW.Provider,{value:i},_.createElement(zW.Provider,{value:l},_.createElement(VW.Provider,{value:a},_.createElement(HW.Provider,{value:c},_.createElement(UW.Provider,{value:s},o)))))))},GW=function(){return(0,_.useContext)(VW)},KW=function(e){var t=(0,_.useContext)(LW);t??EP(!1);var n=t[e];return n??EP(!1),n},qW=function(e){var t=(0,_.useContext)(RW);t??EP(!1);var n=t[e];return n??EP(!1),n},JW=function(){return(0,_.useContext)(zW)},YW=function(){return(0,_.useContext)(UW)},XW=function(){return(0,_.useContext)(HW)},ZW=l(EU());function QW(e){"@babel/helpers - typeof";return QW=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QW(e)}function $W(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function eG(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,fG(r.key),r)}}function tG(e,t,n){return t&&eG(e.prototype,t),n&&eG(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nG(e,t,n){return t=oG(t),rG(e,aG()?Reflect.construct(t,n||[],oG(e).constructor):t.apply(e,n))}function rG(e,t){if(t&&(QW(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return iG(e)}function iG(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function aG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aG=function(){return!!e})()}function oG(e){return oG=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oG(e)}function sG(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cG(e,t)}function cG(e,t){return cG=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cG(e,t)}function lG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lG(Object(n),!0).forEach(function(t){dG(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dG(e,t,n){return t=fG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fG(e){var t=pG(e,`string`);return QW(t)==`symbol`?t:t+``}function pG(e,t){if(QW(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QW(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function mG(e,t){return yG(e)||vG(e,t)||gG(e,t)||hG()}function hG(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
113
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gG(e,t){if(e){if(typeof e==`string`)return _G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _G(e,t)}}function _G(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vG(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function yG(e){if(Array.isArray(e))return e}function bG(){return bG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bG.apply(this,arguments)}var xG=function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,Rb.default)(e)?e(t):_.createElement(`line`,bG({},t,{className:`recharts-reference-line-line`}))},SG=function(e,t,n,r,i,a,o,s,c){var l=i.x,u=i.y,d=i.width,f=i.height;if(n){var p=c.y,m=e.y.apply(p,{position:a});if(DU(c,`discard`)&&!e.y.isInRange(m))return null;var h=[{x:l+d,y:m},{x:l,y:m}];return s===`left`?h.reverse():h}if(t){var g=c.x,_=e.x.apply(g,{position:a});if(DU(c,`discard`)&&!e.x.isInRange(_))return null;var v=[{x:_,y:u+f},{x:_,y:u}];return o===`top`?v.reverse():v}if(r){var y=c.segment.map(function(t){return e.apply(t,{position:a})});return DU(c,`discard`)&&(0,ZW.default)(y,function(t){return!e.isInRange(t)})?null:y}return null};function CG(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,s=e.className;e.alwaysShow;var c=GW(),l=KW(i),u=qW(a),d=JW();if(!c||!d)return null;var f=SG(kW({x:l.scale,y:u.scale}),vb(t),vb(n),r&&r.length===2,d,e.position,l.orientation,u.orientation,e);if(!f)return null;var p=mG(f,2),m=p[0],h=m.x,g=m.y,v=p[1],y=v.x,b=v.y,x=uG(uG({clipPath:DU(e,`hidden`)?`url(#${c})`:void 0},rx(e,!0)),{},{x1:h,y1:g,x2:y,y2:b});return _.createElement(_x,{className:Vt(`recharts-reference-line`,s)},xG(o,x),JI.renderCallByParent(e,DW({x1:h,y1:g,x2:y,y2:b})))}var wG=function(e){function t(){return $W(this,t),nG(this,t,arguments)}return sG(t,e),tG(t,[{key:`render`,value:function(){return _.createElement(CG,this.props)}}])}(_.Component);dG(wG,`displayName`,`ReferenceLine`),dG(wG,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,fill:`none`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1,position:`middle`});function TG(){return TG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TG.apply(this,arguments)}function EG(e){"@babel/helpers - typeof";return EG=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},EG(e)}function DG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function OG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?DG(Object(n),!0).forEach(function(t){zG(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kG(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function AG(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,BG(r.key),r)}}function jG(e,t,n){return t&&AG(e.prototype,t),n&&AG(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function MG(e,t,n){return t=IG(t),NG(e,FG()?Reflect.construct(t,n||[],IG(e).constructor):t.apply(e,n))}function NG(e,t){if(t&&(EG(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return PG(e)}function PG(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function FG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FG=function(){return!!e})()}function IG(e){return IG=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},IG(e)}function LG(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&RG(e,t)}function RG(e,t){return RG=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},RG(e,t)}function zG(e,t,n){return t=BG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BG(e){var t=VG(e,`string`);return EG(t)==`symbol`?t:t+``}function VG(e,t){if(EG(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(EG(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var HG=function(e){var t=e.x,n=e.y,r=e.xAxis,i=e.yAxis,a=kW({x:r.scale,y:i.scale}),o=a.apply({x:t,y:n},{bandAware:!0});return DU(e,`discard`)&&!a.isInRange(o)?null:o},UG=function(e){function t(){return kG(this,t),MG(this,t,arguments)}return LG(t,e),jG(t,[{key:`render`,value:function(){var e=this.props,n=e.x,r=e.y,i=e.r;e.alwaysShow;var a=e.clipPathId,o=vb(n),s=vb(r);if(!o||!s)return null;var c=HG(this.props);if(!c)return null;var l=c.x,u=c.y,d=this.props,f=d.shape,p=d.className,m=OG(OG({clipPath:DU(this.props,`hidden`)?`url(#${a})`:void 0},rx(this.props,!0)),{},{cx:l,cy:u});return _.createElement(_x,{className:Vt(`recharts-reference-dot`,p)},t.renderDot(f,m),JI.renderCallByParent(this.props,{x:l-i,y:u-i,width:2*i,height:2*i}))}}])}(_.Component);zG(UG,`displayName`,`ReferenceDot`),zG(UG,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#fff`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1}),zG(UG,`renderDot`,function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,Rb.default)(e)?e(t):_.createElement(jB,TG({},t,{cx:t.cx,cy:t.cy,className:`recharts-reference-dot-dot`}))});function WG(){return WG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WG.apply(this,arguments)}function GG(e){"@babel/helpers - typeof";return GG=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},GG(e)}function KG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?KG(Object(n),!0).forEach(function(t){iK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JG(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function YG(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,aK(r.key),r)}}function XG(e,t,n){return t&&YG(e.prototype,t),n&&YG(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZG(e,t,n){return t=tK(t),QG(e,eK()?Reflect.construct(t,n||[],tK(e).constructor):t.apply(e,n))}function QG(e,t){if(t&&(GG(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return $G(e)}function $G(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function eK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eK=function(){return!!e})()}function tK(e){return tK=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tK(e)}function nK(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rK(e,t)}function rK(e,t){return rK=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rK(e,t)}function iK(e,t,n){return t=aK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aK(e){var t=oK(e,`string`);return GG(t)==`symbol`?t:t+``}function oK(e,t){if(GG(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(GG(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var sK=function(e,t,n,r,i){var a=i.x1,o=i.x2,s=i.y1,c=i.y2,l=i.xAxis,u=i.yAxis;if(!l||!u)return null;var d=kW({x:l.scale,y:u.scale}),f={x:e?d.x.apply(a,{position:`start`}):d.x.rangeMin,y:n?d.y.apply(s,{position:`start`}):d.y.rangeMin},p={x:t?d.x.apply(o,{position:`end`}):d.x.rangeMax,y:r?d.y.apply(c,{position:`end`}):d.y.rangeMax};return DU(i,`discard`)&&(!d.isInRange(f)||!d.isInRange(p))?null:EW(f,p)},cK=function(e){function t(){return JG(this,t),ZG(this,t,arguments)}return nK(t,e),XG(t,[{key:`render`,value:function(){var e=this.props,n=e.x1,r=e.x2,i=e.y1,a=e.y2,o=e.className;e.alwaysShow;var s=e.clipPathId,c=vb(n),l=vb(r),u=vb(i),d=vb(a),f=this.props.shape;if(!c&&!l&&!u&&!d&&!f)return null;var p=sK(c,l,u,d,this.props);if(!p&&!f)return null;var m=DU(this.props,`hidden`)?`url(#${s})`:void 0;return _.createElement(_x,{className:Vt(`recharts-reference-area`,o)},t.renderRect(f,qG(qG({clipPath:m},rx(this.props,!0)),p)),JI.renderCallByParent(this.props,p))}}])}(_.Component);iK(cK,`displayName`,`ReferenceArea`),iK(cK,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#ccc`,fillOpacity:.5,stroke:`none`,strokeWidth:1}),iK(cK,`renderRect`,function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,Rb.default)(e)?e(t):_.createElement(mB,WG({},t,{className:`recharts-reference-area-rect`}))});function lK(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)if(n===void 0||n(e[i])===!0)r.push(e[i]);else return;return r}function uK(e,t,n){return jW({width:e.width+t.width,height:e.height+t.height},n)}function dK(e,t,n){var r=n===`width`,i=e.x,a=e.y,o=e.width,s=e.height;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function fK(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function pK(e,t){return lK(e,t+1)}function mK(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,s=t.end,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:lK(r,l)};var a=c,d,f=function(){return d===void 0&&(d=n(t,a)),d},p=t.coordinate,m=c===0||fK(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function hK(e){"@babel/helpers - typeof";return hK=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},hK(e)}function gK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _K(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gK(Object(n),!0).forEach(function(t){vK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vK(e,t,n){return t=yK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yK(e){var t=bK(e,`string`);return hK(t)==`symbol`?t:t+``}function bK(e,t){if(hK(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(hK(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xK(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,s=t.start,c=t.end,l=function(t){var r=a[t],l,u=function(){return l===void 0&&(l=n(r,t)),l};if(t===o-1){var d=e*(r.coordinate+e*u()/2-c);a[t]=r=_K(_K({},r),{},{tickCoord:d>0?r.coordinate-d*e:r.coordinate})}else a[t]=r=_K(_K({},r),{},{tickCoord:r.coordinate});fK(e,r.tickCoord,u,s,c)&&(c=r.tickCoord-e*(u()/2+i),a[t]=_K(_K({},r),{},{isShow:!0}))},u=o-1;u>=0;u--)l(u);return a}function SK(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,c=t.start,l=t.end;if(a){var u=r[s-1],d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=_K(_K({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),fK(e,u.tickCoord,function(){return d},c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=_K(_K({},u),{},{isShow:!0}))}for(var p=a?s-1:s,m=function(t){var r=o[t],a,s=function(){return a===void 0&&(a=n(r,t)),a};if(t===0){var u=e*(r.coordinate-e*s()/2-c);o[t]=r=_K(_K({},r),{},{tickCoord:u<0?r.coordinate-u*e:r.coordinate})}else o[t]=r=_K(_K({},r),{},{tickCoord:r.coordinate});fK(e,r.tickCoord,s,c,l)&&(c=r.tickCoord+e*(s()/2+i),o[t]=_K(_K({},r),{},{isShow:!0}))},h=0;h<p;h++)m(h);return o}function CK(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,s=e.orientation,c=e.interval,l=e.tickFormatter,u=e.unit,d=e.angle;if(!i||!i.length||!r)return[];if(X(c)||sE.isSsr)return pK(i,typeof c==`number`&&X(c)?c:0);var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?iD(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=function(e,r){var i=(0,Rb.default)(l)?l(e.value,r):e.value;return p===`width`?uK(iD(i,{fontSize:t,letterSpacing:n}),m,d):iD(i,{fontSize:t,letterSpacing:n})[p]},g=i.length>=2?hb(i[1].coordinate-i[0].coordinate):1,_=dK(a,g,p);return c===`equidistantPreserveStart`?mK(g,_,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?SK(g,_,h,i,o,c===`preserveStartEnd`):xK(g,_,h,i,o),f.filter(function(e){return e.isShow}))}var wK=[`viewBox`],TK=[`viewBox`],EK=[`ticks`];function DK(e){"@babel/helpers - typeof";return DK=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},DK(e)}function OK(){return OK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OK.apply(this,arguments)}function kK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kK(Object(n),!0).forEach(function(t){UK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jK(e,t){if(e==null)return{};var n=MK(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function MK(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function NK(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function PK(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,WK(r.key),r)}}function FK(e,t,n){return t&&PK(e.prototype,t),n&&PK(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function IK(e,t,n){return t=BK(t),LK(e,zK()?Reflect.construct(t,n||[],BK(e).constructor):t.apply(e,n))}function LK(e,t){if(t&&(DK(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return RK(e)}function RK(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function zK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zK=function(){return!!e})()}function BK(e){return BK=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},BK(e)}function VK(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&HK(e,t)}function HK(e,t){return HK=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},HK(e,t)}function UK(e,t,n){return t=WK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WK(e){var t=GK(e,`string`);return DK(t)==`symbol`?t:t+``}function GK(e,t){if(DK(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(DK(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var KK=function(e){function t(e){var n;return NK(this,t),n=IK(this,t,[e]),n.state={fontSize:``,letterSpacing:``},n}return VK(t,e),FK(t,[{key:`shouldComponentUpdate`,value:function(e,t){var n=e.viewBox,r=jK(e,wK),i=this.props,a=i.viewBox,o=jK(i,TK);return!Db(n,a)||!Db(r,o)||!Db(t,this.state)}},{key:`componentDidMount`,value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`)[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:`getTickLineCoord`,value:function(e){var t=this.props,n=t.x,r=t.y,i=t.width,a=t.height,o=t.orientation,s=t.tickSize,c=t.mirror,l=t.tickMargin,u,d,f,p,m,h,g=c?-1:1,_=e.tickSize||s,v=X(e.tickCoord)?e.tickCoord:e.coordinate;switch(o){case`top`:u=d=e.coordinate,p=r+ +!c*a,f=p-g*_,h=f-g*l,m=v;break;case`left`:f=p=e.coordinate,d=n+ +!c*i,u=d-g*_,m=u-g*l,h=v;break;case`right`:f=p=e.coordinate,d=n+ +c*i,u=d+g*_,m=u+g*l,h=v;break;default:u=d=e.coordinate,p=r+ +c*a,f=p+g*_,h=f+g*l,m=v}return{line:{x1:u,y1:f,x2:d,y2:p},tick:{x:m,y:h}}}},{key:`getTickTextAnchor`,value:function(){var e=this.props,t=e.orientation,n=e.mirror,r;switch(t){case`left`:r=n?`start`:`end`;break;case`right`:r=n?`end`:`start`;break;default:r=`middle`}return r}},{key:`getTickVerticalAnchor`,value:function(){var e=this.props,t=e.orientation,n=e.mirror,r=`end`;switch(t){case`left`:case`right`:r=`middle`;break;case`top`:r=n?`start`:`end`;break;default:r=n?`end`:`start`}return r}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,o=e.mirror,s=e.axisLine,c=AK(AK(AK({},rx(this.props,!1)),rx(s,!1)),{},{fill:`none`});if(a===`top`||a===`bottom`){var l=+(a===`top`&&!o||a===`bottom`&&o);c=AK(AK({},c),{},{x1:t,y1:n+l*i,x2:t+r,y2:n+l*i})}else{var u=+(a===`left`&&!o||a===`right`&&o);c=AK(AK({},c),{},{x1:t+u*r,y1:n,x2:t+u*r,y2:n+i})}return _.createElement(`line`,OK({},c,{className:Vt(`recharts-cartesian-axis-line`,(0,fb.default)(s,`className`))}))}},{key:`renderTicks`,value:function(e,n,r){var i=this,a=this.props,o=a.tickLine,s=a.stroke,c=a.tick,l=a.tickFormatter,u=a.unit,d=CK(AK(AK({},this.props),{},{ticks:e}),n,r),f=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),m=rx(this.props,!1),h=rx(c,!1),g=AK(AK({},m),{},{fill:`none`},rx(o,!1)),v=d.map(function(e,n){var r=i.getTickLineCoord(e),a=r.line,v=r.tick,y=AK(AK(AK(AK({textAnchor:f,verticalAnchor:p},m),{},{stroke:`none`,fill:s},h),v),{},{index:n,payload:e,visibleTicksCount:d.length,tickFormatter:l});return _.createElement(_x,OK({className:`recharts-cartesian-axis-tick`,key:`tick-${e.value}-${e.coordinate}-${e.tickCoord}`},Lb(i.props,e,n)),o&&_.createElement(`line`,OK({},g,a,{className:Vt(`recharts-cartesian-axis-tick-line`,(0,fb.default)(o,`className`))})),c&&t.renderTickItem(c,y,`${(0,Rb.default)(l)?l(e.value,n):e.value}${u||``}`))});return _.createElement(`g`,{className:`recharts-cartesian-axis-ticks`},v)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.axisLine,r=t.width,i=t.height,a=t.ticksGenerator,o=t.className;if(t.hide)return null;var s=this.props,c=s.ticks,l=jK(s,EK),u=c;return(0,Rb.default)(a)&&(u=c&&c.length>0?a(this.props):a(l)),r<=0||i<=0||!u||!u.length?null:_.createElement(_x,{className:Vt(`recharts-cartesian-axis`,o),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(u,this.state.fontSize,this.state.letterSpacing),JI.renderCallByParent(this.props))}}],[{key:`renderTickItem`,value:function(e,t,n){var r,i=Vt(t.className,`recharts-cartesian-axis-tick-value`);return r=_.isValidElement(e)?_.cloneElement(e,AK(AK({},t),{},{className:i})):(0,Rb.default)(e)?e(AK(AK({},t),{},{className:i})):_.createElement(XD,OK({},t,{className:`recharts-cartesian-axis-tick-value`}),n),r}}])}(_.Component);UK(KK,`displayName`,`CartesianAxis`),UK(KK,`defaultProps`,{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:`bottom`,ticks:[],stroke:`#666`,tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:`preserveEnd`});var qK=[`type`,`layout`,`connectNulls`,`ref`],JK=[`key`];function YK(e){"@babel/helpers - typeof";return YK=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},YK(e)}function XK(e,t){if(e==null)return{};var n=ZK(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ZK(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function QK(){return QK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QK.apply(this,arguments)}function $K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$K(Object(n),!0).forEach(function(t){_q(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$K(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tq(e){return aq(e)||iq(e)||rq(e)||nq()}function nq(){throw TypeError(`Invalid attempt to spread non-iterable instance.
114
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rq(e,t){if(e){if(typeof e==`string`)return oq(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oq(e,t)}}function iq(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function aq(e){if(Array.isArray(e))return oq(e)}function oq(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sq(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function cq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,vq(r.key),r)}}function lq(e,t,n){return t&&cq(e.prototype,t),n&&cq(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function uq(e,t,n){return t=mq(t),dq(e,pq()?Reflect.construct(t,n||[],mq(e).constructor):t.apply(e,n))}function dq(e,t){if(t&&(YK(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return fq(e)}function fq(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function pq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pq=function(){return!!e})()}function mq(e){return mq=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mq(e)}function hq(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gq(e,t)}function gq(e,t){return gq=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gq(e,t)}function _q(e,t,n){return t=vq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vq(e){var t=yq(e,`string`);return YK(t)==`symbol`?t:t+``}function yq(e,t){if(YK(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(YK(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bq=function(e){function t(){var e;sq(this,t);var n=[...arguments];return e=uq(this,t,[].concat(n)),_q(e,`state`,{isAnimationFinished:!0,totalLength:0}),_q(e,`generateSimpleStrokeDasharray`,function(e,t){return`${t}px ${e-t}px`}),_q(e,`getStrokeDasharray`,function(n,r,i){var a=i.reduce(function(e,t){return e+t});if(!a)return e.generateSimpleStrokeDasharray(r,n);for(var o=Math.floor(n/a),s=n%a,c=r-n,l=[],u=0,d=0;u<i.length;d+=i[u],++u)if(d+i[u]>s){l=[].concat(tq(i.slice(0,u)),[s-d]);break}var f=l.length%2==0?[0,c]:[c];return[].concat(tq(t.repeat(i,o)),tq(l),f).map(function(e){return`${e}px`}).join(`, `)}),_q(e,`id`,bb(`recharts-line-`)),_q(e,`pathRef`,function(t){e.mainCurve=t}),_q(e,`handleAnimationEnd`,function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),_q(e,`handleAnimationStart`,function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return hq(t,e),lq(t,[{key:`componentDidMount`,value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:`componentDidUpdate`,value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:`getTotalLength`,value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}},{key:`renderErrorBar`,value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.points,i=n.xAxis,a=n.yAxis,o=n.layout,s=n.children,c=Xb(s,ZP);if(!c)return null;var l=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:xF(e.payload,t)}},u={clipPath:e?`url(#clipPath-${t})`:null};return _.createElement(_x,u,c.map(function(e){return _.cloneElement(e,{key:`bar-${e.props.dataKey}`,data:r,xAxis:i,yAxis:a,layout:o,dataPointFormatter:l})}))}},{key:`renderDots`,value:function(e,n,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,a=i.dot,o=i.points,s=i.dataKey,c=rx(this.props,!1),l=rx(a,!0),u=o.map(function(e,n){var r=eq(eq(eq({key:`dot-${n}`,r:3},c),l),{},{index:n,cx:e.x,cy:e.y,value:e.value,dataKey:s,payload:e.payload,points:o});return t.renderDotItem(a,r)}),d={clipPath:e?`url(#clipPath-${n?``:`dots-`}${r})`:null};return _.createElement(_x,QK({className:`recharts-line-dots`,key:`dots`},d),u)}},{key:`renderCurveStatically`,value:function(e,t,n,r){var i=this.props,a=i.type,o=i.layout,s=i.connectNulls;i.ref;var c=eq(eq(eq({},rx(XK(i,qK),!0)),{},{fill:`none`,className:`recharts-line-curve`,clipPath:t?`url(#clipPath-${n})`:null,points:e},r),{},{type:a,layout:o,connectNulls:s});return _.createElement(UL,QK({},c,{pathRef:this.pathRef}))}},{key:`renderCurveWithAnimation`,value:function(e,t){var n=this,r=this.props,i=r.points,a=r.strokeDasharray,o=r.isAnimationActive,s=r.animationBegin,c=r.animationDuration,l=r.animationEasing,u=r.animationId,d=r.animateNewValues,f=r.width,p=r.height,m=this.state,h=m.prevPoints,g=m.totalLength;return _.createElement(Zz,{begin:s,duration:c,isActive:o,easing:l,from:{t:0},to:{t:1},key:`line-${u}`,onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var o=r.t;if(h){var s=h.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(h[n]){var r=h[n],i=wb(r.x,e.x),a=wb(r.y,e.y);return eq(eq({},e),{},{x:i(o),y:a(o)})}if(d){var c=wb(f*2,e.x),l=wb(p/2,e.y);return eq(eq({},e),{},{x:c(o),y:l(o)})}return eq(eq({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var l=wb(0,g)(o),u;if(a){var m=`${a}`.split(/[,\s]+/gim).map(function(e){return parseFloat(e)});u=n.getStrokeDasharray(l,g,m)}else u=n.generateSimpleStrokeDasharray(g,l);return n.renderCurveStatically(i,e,t,{strokeDasharray:u})})}},{key:`renderCurve`,value:function(e,t){var n=this.props,r=n.points,i=n.isAnimationActive,a=this.state,o=a.prevPoints,s=a.totalLength;return i&&r&&r.length&&(!o&&s>0||!(0,cF.default)(o,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:`render`,value:function(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.xAxis,o=e.yAxis,s=e.top,c=e.left,l=e.width,u=e.height,d=e.isAnimationActive,f=e.id;if(t||!r||!r.length)return null;var p=this.state.isAnimationFinished,m=r.length===1,h=Vt(`recharts-line`,i),g=a&&a.allowDataOverflow,v=o&&o.allowDataOverflow,y=g||v,b=(0,mb.default)(f)?this.id:f,x=rx(n,!1)??{r:3,strokeWidth:2},S=x.r,C=S===void 0?3:S,w=x.strokeWidth,T=w===void 0?2:w,E=(tx(n)?n:{}).clipDot,D=E===void 0||E,O=C*2+T;return _.createElement(_x,{className:h},g||v?_.createElement(`defs`,null,_.createElement(`clipPath`,{id:`clipPath-${b}`},_.createElement(`rect`,{x:g?c:c-l/2,y:v?s:s-u/2,width:g?l:l*2,height:v?u:u*2})),!D&&_.createElement(`clipPath`,{id:`clipPath-dots-${b}`},_.createElement(`rect`,{x:c-O/2,y:s-O/2,width:l+O,height:u+O}))):null,!m&&this.renderCurve(y,b),this.renderErrorBar(y,b),(m||n)&&this.renderDots(y,D,b),(!d||p)&&gL.renderCallByParent(this.props,r))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.animationId===t.prevAnimationId?e.points===t.curPoints?null:{curPoints:e.points}:{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}}},{key:`repeat`,value:function(e,t){for(var n=e.length%2==0?e:[].concat(tq(e),[0]),r=[],i=0;i<t;++i)r=[].concat(tq(r),tq(n));return r}},{key:`renderDotItem`,value:function(e,t){var n;if(_.isValidElement(e))n=_.cloneElement(e,t);else if((0,Rb.default)(e))n=e(t);else{var r=t.key,i=XK(t,JK),a=Vt(`recharts-line-dot`,typeof e==`boolean`?``:e.className);n=_.createElement(jB,QK({key:r},i,{className:a}))}return n}}])}(_.PureComponent);_q(bq,`displayName`,`Line`),_q(bq,`defaultProps`,{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,fill:`#fff`,points:[],isAnimationActive:!sE.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,hide:!1,label:!1}),_q(bq,`getComposedData`,function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,s=e.bandSize,c=e.displayedData,l=e.offset,u=t.layout;return eq({points:c.map(function(e,t){var c=xF(e,o);return u===`horizontal`?{x:GF({axis:n,ticks:i,bandSize:s,entry:e,index:t}),y:(0,mb.default)(c)?null:r.scale(c),value:c,payload:e}:{x:(0,mb.default)(c)?null:n.scale(c),y:GF({axis:r,ticks:a,bandSize:s,entry:e,index:t}),value:c,payload:e}}),layout:u},l)});function xq(e){"@babel/helpers - typeof";return xq=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},xq(e)}function Sq(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Cq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Nq(r.key),r)}}function wq(e,t,n){return t&&Cq(e.prototype,t),n&&Cq(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tq(e,t,n){return t=kq(t),Eq(e,Oq()?Reflect.construct(t,n||[],kq(e).constructor):t.apply(e,n))}function Eq(e,t){if(t&&(xq(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Dq(e)}function Dq(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Oq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Oq=function(){return!!e})()}function kq(e){return kq=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kq(e)}function Aq(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jq(e,t)}function jq(e,t){return jq=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jq(e,t)}function Mq(e,t,n){return t=Nq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nq(e){var t=Pq(e,`string`);return xq(t)==`symbol`?t:t+``}function Pq(e,t){if(xq(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(xq(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Fq(){return Fq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fq.apply(this,arguments)}function Iq(e){var t=e.xAxisId,n=YW(),r=XW(),i=KW(t);return i==null?null:_.createElement(KK,Fq({},i,{className:Vt(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return NF(e,!0)}}))}var Lq=function(e){function t(){return Sq(this,t),Tq(this,t,arguments)}return Aq(t,e),wq(t,[{key:`render`,value:function(){return _.createElement(Iq,this.props)}}])}(_.Component);Mq(Lq,`displayName`,`XAxis`),Mq(Lq,`defaultProps`,{allowDecimals:!0,hide:!1,orientation:`bottom`,width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:`category`,padding:{left:0,right:0},allowDataOverflow:!1,scale:`auto`,reversed:!1,allowDuplicatedCategory:!0});function Rq(e){"@babel/helpers - typeof";return Rq=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Rq(e)}function zq(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Bq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Xq(r.key),r)}}function Vq(e,t,n){return t&&Bq(e.prototype,t),n&&Bq(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hq(e,t,n){return t=Kq(t),Uq(e,Gq()?Reflect.construct(t,n||[],Kq(e).constructor):t.apply(e,n))}function Uq(e,t){if(t&&(Rq(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Wq(e)}function Wq(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Gq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gq=function(){return!!e})()}function Kq(e){return Kq=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Kq(e)}function qq(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jq(e,t)}function Jq(e,t){return Jq=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jq(e,t)}function Yq(e,t,n){return t=Xq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xq(e){var t=Zq(e,`string`);return Rq(t)==`symbol`?t:t+``}function Zq(e,t){if(Rq(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Rq(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Qq(){return Qq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qq.apply(this,arguments)}var $q=function(e){var t=e.yAxisId,n=YW(),r=XW(),i=qW(t);return i==null?null:_.createElement(KK,Qq({},i,{className:Vt(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return NF(e,!0)}}))},eJ=function(e){function t(){return zq(this,t),Hq(this,t,arguments)}return qq(t,e),Vq(t,[{key:`render`,value:function(){return _.createElement($q,this.props)}}])}(_.Component);Yq(eJ,`displayName`,`YAxis`),Yq(eJ,`defaultProps`,{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:`left`,width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:`number`,padding:{top:0,bottom:0},allowDataOverflow:!1,scale:`auto`,reversed:!1});function tJ(e){return aJ(e)||iJ(e)||rJ(e)||nJ()}function nJ(){throw TypeError(`Invalid attempt to spread non-iterable instance.
115
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rJ(e,t){if(e){if(typeof e==`string`)return oJ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oJ(e,t)}}function iJ(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function aJ(e){if(Array.isArray(e))return oJ(e)}function oJ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var sJ=function(e,t,n,r,i){var a=Xb(e,wG),o=Xb(e,UG),s=[].concat(tJ(a),tJ(o)),c=Xb(e,cK),l=`${r}Id`,u=r[0],d=t;if(s.length&&(d=s.reduce(function(e,t){if(t.props[l]===n&&DU(t.props,`extendDomain`)&&X(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),c.length){var f=`${u}1`,p=`${u}2`;d=c.reduce(function(e,t){if(t.props[l]===n&&DU(t.props,`extendDomain`)&&X(t.props[f])&&X(t.props[p])){var r=t.props[f],i=t.props[p];return[Math.min(e[0],r,i),Math.max(e[1],r,i)]}return e},d)}return i&&i.length&&(d=i.reduce(function(e,t){return X(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},cJ=new(l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))())).default,lJ=`recharts.syncMouseEvents`;function uJ(e){"@babel/helpers - typeof";return uJ=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},uJ(e)}function dJ(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function fJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,hJ(r.key),r)}}function pJ(e,t,n){return t&&fJ(e.prototype,t),n&&fJ(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mJ(e,t,n){return t=hJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hJ(e){var t=gJ(e,`string`);return uJ(t)==`symbol`?t:t+``}function gJ(e,t){if(uJ(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(uJ(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var _J=function(){function e(){dJ(this,e),mJ(this,`activeIndex`,0),mJ(this,`coordinateList`,[]),mJ(this,`layout`,`horizontal`)}return pJ(e,[{key:`setDetails`,value:function(e){var t=e.coordinateList,n=t===void 0?null:t,r=e.container,i=r===void 0?null:r,a=e.layout,o=a===void 0?null:a,s=e.offset,c=s===void 0?null:s,l=e.mouseHandlerCallback,u=l===void 0?null:l;this.coordinateList=n??this.coordinateList??[],this.container=i??this.container,this.layout=o??this.layout,this.offset=c??this.offset,this.mouseHandlerCallback=u??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:`focus`,value:function(){this.spoofMouse()}},{key:`keyboardEvent`,value:function(e){if(this.coordinateList.length!==0)switch(e.key){case`ArrowRight`:if(this.layout!==`horizontal`)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case`ArrowLeft`:if(this.layout!==`horizontal`)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:`setIndex`,value:function(e){this.activeIndex=e}},{key:`spoofMouse`,value:function(){if(this.layout===`horizontal`&&this.coordinateList.length!==0){var e=this.container.getBoundingClientRect(),t=e.x,n=e.y,r=e.height,i=this.coordinateList[this.activeIndex].coordinate,a=window?.scrollX||0,o=window?.scrollY||0,s=t+i+a,c=n+this.offset.top+r/2+o;this.mouseHandlerCallback({pageX:s,pageY:c})}}}])}();function vJ(e,t,n){if(n===`number`&&t===!0&&Array.isArray(e)){var r=e?.[0],i=e?.[1];if(r&&i&&X(r)&&X(i))return!0}return!1}function yJ(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function bJ(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[_I(t,n,r,i),_I(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function xJ(e,t,n){var r,i,a,o;if(e===`horizontal`)r=t.x,a=r,i=n.top,o=n.top+n.height;else if(e===`vertical`)i=t.y,o=i,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null){if(e===`centric`){var s=t.cx,c=t.cy,l=t.innerRadius,u=t.outerRadius,d=t.angle,f=_I(s,c,l,d),p=_I(s,c,u,d);r=f.x,i=f.y,a=p.x,o=p.y}else return bJ(t)}return[{x:r,y:i},{x:a,y:o}]}function SJ(e){"@babel/helpers - typeof";return SJ=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},SJ(e)}function CJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?CJ(Object(n),!0).forEach(function(t){TJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TJ(e,t,n){return t=EJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EJ(e){var t=DJ(e,`string`);return SJ(t)==`symbol`?t:t+``}function DJ(e,t){if(SJ(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(SJ(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function OJ(e){var t=e.element,n=e.tooltipEventType,r=e.isActive,i=e.activeCoordinate,a=e.activePayload,o=e.offset,s=e.activeTooltipIndex,c=e.tooltipAxisBandSize,l=e.layout,u=e.chartName,d=t.props.cursor??t.type.defaultProps?.cursor;if(!t||!d||!r||!i||u!==`ScatterChart`&&n!==`axis`)return null;var f,p=UL;if(u===`ScatterChart`)f=i,p=UB;else if(u===`BarChart`)f=yJ(l,i,o,c),p=mB;else if(l===`radial`){var m=bJ(i),h=m.cx,g=m.cy,v=m.radius;f={cx:h,cy:g,startAngle:m.startAngle,endAngle:m.endAngle,innerRadius:v,outerRadius:v},p=jL}else f={points:xJ(l,i,o)},p=UL;var y=wJ(wJ(wJ(wJ({stroke:`#ccc`,pointerEvents:`none`},o),f),rx(d,!1)),{},{payload:a,payloadIndex:s,className:Vt(`recharts-tooltip-cursor`,d.className)});return(0,_.isValidElement)(d)?(0,_.cloneElement)(d,y):(0,_.createElement)(p,y)}var kJ=[`item`],AJ=[`children`,`className`,`width`,`height`,`style`,`compact`,`title`,`desc`];function jJ(e){"@babel/helpers - typeof";return jJ=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},jJ(e)}function MJ(){return MJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MJ.apply(this,arguments)}function NJ(e,t){return IJ(e)||FJ(e,t)||ZJ(e,t)||PJ()}function PJ(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
116
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FJ(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function IJ(e){if(Array.isArray(e))return e}function LJ(e,t){if(e==null)return{};var n=RJ(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function RJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function zJ(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function BJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,rY(r.key),r)}}function VJ(e,t,n){return t&&BJ(e.prototype,t),n&&BJ(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function HJ(e,t,n){return t=KJ(t),UJ(e,GJ()?Reflect.construct(t,n||[],KJ(e).constructor):t.apply(e,n))}function UJ(e,t){if(t&&(jJ(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return WJ(e)}function WJ(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function GJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GJ=function(){return!!e})()}function KJ(e){return KJ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},KJ(e)}function qJ(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&JJ(e,t)}function JJ(e,t){return JJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},JJ(e,t)}function YJ(e){return $J(e)||QJ(e)||ZJ(e)||XJ()}function XJ(){throw TypeError(`Invalid attempt to spread non-iterable instance.
117
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZJ(e,t){if(e){if(typeof e==`string`)return eY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eY(e,t)}}function QJ(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function $J(e){if(Array.isArray(e))return eY(e)}function eY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tY(Object(n),!0).forEach(function(t){nY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nY(e,t,n){return t=rY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rY(e){var t=iY(e,`string`);return jJ(t)==`symbol`?t:t+``}function iY(e,t){if(jJ(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(jJ(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var aY={xAxis:[`bottom`,`top`],yAxis:[`left`,`right`]},oY={width:`100%`,height:`100%`},sY={x:0,y:0};function cY(e){return e}var lY=function(e,t){return t===`horizontal`?e.x:t===`vertical`?e.y:t===`centric`?e.angle:e.radius},uY=function(e,t,n,r){var i=t.find(function(e){return e&&e.index===n});if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.y};if(e===`vertical`)return{x:r.x,y:i.coordinate};if(e===`centric`){var a=i.coordinate,o=r.radius;return Z(Z(Z({},r),_I(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return Z(Z(Z({},r),_I(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return sY},dY=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,i=t.dataEndIndex,a=(n??[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(YJ(e),YJ(n)):e},[]);return a.length>0?a:e&&e.length&&X(r)&&X(i)?e.slice(r,i+1):[]};function fY(e){return e===`number`?[0,`auto`]:void 0}var pY=function(e,t,n,r){var i=e.graphicalItems,a=e.tooltipAxis,o=dY(t,e);return n<0||!i||!i.length||n>=o.length?null:i.reduce(function(i,s){var c=s.props.data??t;c&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(c=c.slice(e.dataStartIndex,e.dataEndIndex+1));var l=a.dataKey&&!a.allowDuplicatedCategory?Tb(c===void 0?o:c,a.dataKey,r):c&&c[n]||o[n];return l?[].concat(YJ(i),[nI(s,l)]):i},[])},mY=function(e,t,n,r){var i=r||{x:e.chartX,y:e.chartY},a=lY(i,n),o=e.orderedTooltipTicks,s=e.tooltipAxis,c=e.tooltipTicks,l=CF(a,o,c,s);if(l>=0&&c){var u=c[l]&&c[l].value;return{activeTooltipIndex:l,activeLabel:u,activePayload:pY(e,t,l,u),activeCoordinate:uY(n,o,l,i)}}return null},hY=function(e,t){var n=t.axes,r=t.graphicalItems,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=e.stackOffset,f=MF(l,i);return n.reduce(function(t,n){var p=n.type.defaultProps===void 0?n.props:Z(Z({},n.type.defaultProps),n.props),m=p.type,h=p.dataKey,g=p.allowDataOverflow,_=p.allowDuplicatedCategory,v=p.scale,y=p.ticks,b=p.includeHidden,x=p[a];if(t[x])return t;var S=dY(e.data,{graphicalItems:r.filter(function(e){return(a in e.props?e.props[a]:e.type.defaultProps?.[a])===x}),dataStartIndex:s,dataEndIndex:c}),C=S.length,w,T,E;vJ(p.domain,g,m)&&(w=$F(p.domain,null,g),f&&(m===`number`||v!==`auto`)&&(E=SF(S,h,`category`)));var D=fY(m);if(!w||w.length===0){var O=p.domain??D;if(h){if(w=SF(S,h,m),m===`category`&&f){var k=Cb(w);_&&k?(T=w,w=(0,iU.default)(0,C)):_||(w=tI(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(YJ(e),[t])},[]))}else if(m===`category`)w=_?w.filter(function(e){return e!==``&&!(0,mb.default)(e)}):tI(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0||t===``||(0,mb.default)(t)?e:[].concat(YJ(e),[t])},[]);else if(m===`number`){var A=AF(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===x&&(b||!n)}),h,i,l);A&&(w=A)}f&&(m===`number`||v!==`auto`)&&(E=SF(S,h,`category`))}else w=f?(0,iU.default)(0,C):o&&o[x]&&o[x].hasStack&&m===`number`?d===`expand`?[0,1]:XF(o[x].stackGroups,s,c):jF(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps.hide;return t===x&&(b||!n)}),m,l,!0);if(m===`number`)w=sJ(u,w,x,i,y),O&&(w=$F(O,w,g));else if(m===`category`&&O){var j=O;w.every(function(e){return j.indexOf(e)>=0})&&(w=j)}}return Z(Z({},t),{},nY({},x,Z(Z({},p),{},{axisType:i,domain:w,categoricalDomain:E,duplicateDomain:T,originalDomain:p.domain??D,isCategorical:f,layout:l})))},{})},gY=function(e,t){var n=t.graphicalItems,r=t.Axis,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=dY(e.data,{graphicalItems:n,dataStartIndex:s,dataEndIndex:c}),f=d.length,p=MF(l,i),m=-1;return n.reduce(function(e,t){var h=(t.type.defaultProps===void 0?t.props:Z(Z({},t.type.defaultProps),t.props))[a],g=fY(`number`);if(!e[h]){m++;var _;return p?_=(0,iU.default)(0,f):o&&o[h]&&o[h].hasStack?(_=XF(o[h].stackGroups,s,c),_=sJ(u,_,h,i)):(_=$F(g,jF(d,n.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===h&&!n}),`number`,l),r.defaultProps.allowDataOverflow),_=sJ(u,_,h,i)),Z(Z({},e),{},nY({},h,Z(Z({axisType:i},r.defaultProps),{},{hide:!0,orientation:(0,fb.default)(aY,`${i}.${m%2}`,null),domain:_,originalDomain:g,isCategorical:p,layout:l})))}return e},{})},_Y=function(e,t){var n=t.axisType,r=n===void 0?`xAxis`:n,i=t.AxisComp,a=t.graphicalItems,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.children,u=`${r}Id`,d=Xb(l,i),f={};return d&&d.length?f=hY(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c}):a&&a.length&&(f=gY(e,{Axis:i,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c})),f},vY=function(e){var t=Sb(e),n=NF(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:(0,_T.default)(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:eI(t,n)}},yY=function(e){var t=e.children,n=e.defaultShowTooltip,r=Zb(t,wU),i=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(i=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},bY=function(e){return!e||!e.length?!1:e.some(function(e){var t=Kb(e&&e.type);return t&&t.indexOf(`Bar`)>=0})},xY=function(e){return e===`horizontal`?{numericAxisName:`yAxis`,cateAxisName:`xAxis`}:e===`vertical`?{numericAxisName:`xAxis`,cateAxisName:`yAxis`}:e===`centric`?{numericAxisName:`radiusAxis`,cateAxisName:`angleAxis`}:{numericAxisName:`angleAxis`,cateAxisName:`radiusAxis`}},SY=function(e,t){var n=e.props,r=e.graphicalItems,i=e.xAxisMap,a=i===void 0?{}:i,o=e.yAxisMap,s=o===void 0?{}:o,c=n.width,l=n.height,u=n.children,d=n.margin||{},f=Zb(u,wU),p=Zb(u,Zw),m=Object.keys(s).reduce(function(e,t){var n=s[t],r=n.orientation;return!n.mirror&&!n.hide?Z(Z({},e),{},nY({},r,e[r]+n.width)):e},{left:d.left||0,right:d.right||0}),h=Z(Z({},Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return!n.mirror&&!n.hide?Z(Z({},e),{},nY({},r,(0,fb.default)(e,`${r}`)+n.height)):e},{top:d.top||0,bottom:d.bottom||0})),m),g=h.bottom;f&&(h.bottom+=f.props.height||wU.defaultProps.height),p&&t&&(h=DF(h,r,n,t));var _=c-h.left-h.right,v=l-h.top-h.bottom;return Z(Z({brushBottom:g},h),{},{width:Math.max(_,0),height:Math.max(v,0)})},CY=function(e,t){if(t===`xAxis`)return e[t].width;if(t===`yAxis`)return e[t].height},wY=function(e){var t=e.chartName,n=e.GraphicalChild,r=e.defaultTooltipEventType,i=r===void 0?`axis`:r,a=e.validateTooltipEventTypes,o=a===void 0?[`axis`]:a,s=e.axisComponents,c=e.legendContent,l=e.formatAxisMap,u=e.defaultProps,d=function(e,t){var n=t.graphicalItems,r=t.stackGroups,i=t.offset,a=t.updateId,o=t.dataStartIndex,c=t.dataEndIndex,l=e.barSize,u=e.layout,d=e.barGap,f=e.barCategoryGap,p=e.maxBarSize,m=xY(u),h=m.numericAxisName,g=m.cateAxisName,_=bY(n),v=[];return n.forEach(function(n,m){var y=dY(e.data,{graphicalItems:[n],dataStartIndex:o,dataEndIndex:c}),b=n.type.defaultProps===void 0?n.props:Z(Z({},n.type.defaultProps),n.props),x=b.dataKey,S=b.maxBarSize,C=b[`${h}Id`],w=b[`${g}Id`],T=s.reduce(function(e,n){var r=t[`${n.axisType}Map`],i=b[`${n.axisType}Id`];!(r&&r[i]||n.axisType===`zAxis`)&&EP(!1);var a=r[i];return Z(Z({},e),{},nY(nY({},n.axisType,a),`${n.axisType}Ticks`,NF(a)))},{}),E=T[g],D=T[`${g}Ticks`],O=r&&r[C]&&r[C].hasStack&&JF(n,r[C].stackGroups),k=Kb(n.type).indexOf(`Bar`)>=0,A=eI(E,D),j=[],M=_&&TF({barSize:l,stackGroups:r,totalSize:CY(T,g)});if(k){var N=(0,mb.default)(S)?p:S,P=eI(E,D,!0)??N??0;j=EF({barGap:d,barCategoryGap:f,bandSize:P===A?A:P,sizeList:M[w],maxBarSize:N}),P!==A&&(j=j.map(function(e){return Z(Z({},e),{},{position:Z(Z({},e.position),{},{offset:e.position.offset-P/2})})}))}var F=n&&n.type&&n.type.getComposedData;F&&v.push({props:Z(Z({},F(Z(Z({},T),{},{displayedData:y,props:e,dataKey:x,item:n,bandSize:A,barPosition:j,offset:i,stackedData:O,layout:u,dataStartIndex:o,dataEndIndex:c}))),{},nY(nY(nY({key:n.key||`item-${m}`},h,T[h]),g,T[g]),`animationId`,a)),childIndex:mee(n,e.children),item:n})}),v},f=function(e,r){var i=e.props,a=e.dataStartIndex,o=e.dataEndIndex,c=e.updateId;if(!Qb({props:i}))return null;var u=i.children,f=i.layout,p=i.stackOffset,m=i.data,h=i.reverseStackOrder,g=xY(f),_=g.numericAxisName,v=g.cateAxisName,y=Xb(u,n),b=UF(m,y,`${_}Id`,`${v}Id`,p,h),x=s.reduce(function(e,t){var n=`${t.axisType}Map`;return Z(Z({},e),{},nY({},n,_Y(i,Z(Z({},t),{},{graphicalItems:y,stackGroups:t.axisType===_&&b,dataStartIndex:a,dataEndIndex:o}))))},{}),S=SY(Z(Z({},x),{},{props:i,graphicalItems:y}),r?.legendBBox);Object.keys(x).forEach(function(e){x[e]=l(i,x[e],S,e.replace(`Map`,``),t)});var C=x[`${v}Map`],w=vY(C);return Z(Z({formattedGraphicalItems:d(i,Z(Z({},x),{},{dataStartIndex:a,dataEndIndex:o,updateId:c,graphicalItems:y,stackGroups:b,offset:S})),graphicalItems:y,offset:S,stackGroups:b},w),x)},p=function(e){function n(e){var r;return zJ(this,n),r=HJ(this,n,[e]),nY(r,`eventEmitterSymbol`,Symbol(`rechartsEventEmitter`)),nY(r,`accessibilityManager`,new _J),nY(r,`handleLegendBBoxUpdate`,function(e){if(e){var t=r.state,n=t.dataStartIndex,i=t.dataEndIndex,a=t.updateId;r.setState(Z({legendBBox:e},f({props:r.props,dataStartIndex:n,dataEndIndex:i,updateId:a},Z(Z({},r.state),{},{legendBBox:e}))))}}),nY(r,`handleReceiveSyncEvent`,function(e,t,n){if(r.props.syncId===e){if(n===r.eventEmitterSymbol&&typeof r.props.syncMethod!=`function`)return;r.applySyncEvent(t)}}),nY(r,`handleBrushChange`,function(e){var t=e.startIndex,n=e.endIndex;if(t!==r.state.dataStartIndex||n!==r.state.dataEndIndex){var i=r.state.updateId;r.setState(function(){return Z({dataStartIndex:t,dataEndIndex:n},f({props:r.props,dataStartIndex:t,dataEndIndex:n,updateId:i},r.state))}),r.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),nY(r,`handleMouseEnter`,function(e){var t=r.getMouseInfo(e);if(t){var n=Z(Z({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseEnter;(0,Rb.default)(i)&&i(n,e)}}),nY(r,`triggeredAfterMouseMove`,function(e){var t=r.getMouseInfo(e),n=t?Z(Z({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseMove;(0,Rb.default)(i)&&i(n,e)}),nY(r,`handleItemMouseEnter`,function(e){r.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),nY(r,`handleItemMouseLeave`,function(){r.setState(function(){return{isTooltipActive:!1}})}),nY(r,`handleMouseMove`,function(e){e.persist(),r.throttleTriggeredAfterMouseMove(e)}),nY(r,`handleMouseLeave`,function(e){r.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};r.setState(t),r.triggerSyncEvent(t);var n=r.props.onMouseLeave;(0,Rb.default)(n)&&n(t,e)}),nY(r,`handleOuterEvent`,function(e){var t=sx(e),n=(0,fb.default)(r.props,`${t}`);t&&(0,Rb.default)(n)&&n((/.*touch.*/i.test(t)?r.getMouseInfo(e.changedTouches[0]):r.getMouseInfo(e))??{},e)}),nY(r,`handleClick`,function(e){var t=r.getMouseInfo(e);if(t){var n=Z(Z({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onClick;(0,Rb.default)(i)&&i(n,e)}}),nY(r,`handleMouseDown`,function(e){var t=r.props.onMouseDown;(0,Rb.default)(t)&&t(r.getMouseInfo(e),e)}),nY(r,`handleMouseUp`,function(e){var t=r.props.onMouseUp;(0,Rb.default)(t)&&t(r.getMouseInfo(e),e)}),nY(r,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),nY(r,`handleTouchStart`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseDown(e.changedTouches[0])}),nY(r,`handleTouchEnd`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseUp(e.changedTouches[0])}),nY(r,`handleDoubleClick`,function(e){var t=r.props.onDoubleClick;(0,Rb.default)(t)&&t(r.getMouseInfo(e),e)}),nY(r,`handleContextMenu`,function(e){var t=r.props.onContextMenu;(0,Rb.default)(t)&&t(r.getMouseInfo(e),e)}),nY(r,`triggerSyncEvent`,function(e){r.props.syncId!==void 0&&cJ.emit(lJ,r.props.syncId,e,r.eventEmitterSymbol)}),nY(r,`applySyncEvent`,function(e){var t=r.props,n=t.layout,i=t.syncMethod,a=r.state.updateId,o=e.dataStartIndex,s=e.dataEndIndex;if(e.dataStartIndex!==void 0||e.dataEndIndex!==void 0)r.setState(Z({dataStartIndex:o,dataEndIndex:s},f({props:r.props,dataStartIndex:o,dataEndIndex:s,updateId:a},r.state)));else if(e.activeTooltipIndex!==void 0){var c=e.chartX,l=e.chartY,u=e.activeTooltipIndex,d=r.state,p=d.offset,m=d.tooltipTicks;if(!p)return;if(typeof i==`function`)u=i(m,e);else if(i===`value`){u=-1;for(var h=0;h<m.length;h++)if(m[h].value===e.activeLabel){u=h;break}}var g=Z(Z({},p),{},{x:p.left,y:p.top}),_=Math.min(c,g.x+g.width),v=Math.min(l,g.y+g.height),y=m[u]&&m[u].value,b=pY(r.state,r.props.data,u),x=m[u]?{x:n===`horizontal`?m[u].coordinate:_,y:n===`horizontal`?v:m[u].coordinate}:sY;r.setState(Z(Z({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else r.setState(e)}),nY(r,`renderCursor`,function(e){var n=r.state,i=n.isTooltipActive,a=n.activeCoordinate,o=n.activePayload,s=n.offset,c=n.activeTooltipIndex,l=n.tooltipAxisBandSize,u=r.getTooltipEventType(),d=e.props.active??i,f=r.props.layout,p=e.key||`_recharts-cursor`;return _.createElement(OJ,{key:p,activeCoordinate:a,activePayload:o,activeTooltipIndex:c,chartName:t,element:e,isActive:d,layout:f,offset:s,tooltipAxisBandSize:l,tooltipEventType:u})}),nY(r,`renderPolarAxis`,function(e,t,n){var i=(0,fb.default)(e,`type.axisType`),a=(0,fb.default)(r.state,`${i}Map`),o=e.type.defaultProps,s=o===void 0?e.props:Z(Z({},o),e.props),c=a&&a[s[`${i}Id`]];return(0,_.cloneElement)(e,Z(Z({},c),{},{className:Vt(i,c.className),key:e.key||`${t}-${n}`,ticks:NF(c,!0)}))}),nY(r,`renderPolarGrid`,function(e){var t=e.props,n=t.radialLines,i=t.polarAngles,a=t.polarRadius,o=r.state,s=o.radiusAxisMap,c=o.angleAxisMap,l=Sb(s),u=Sb(c),d=u.cx,f=u.cy,p=u.innerRadius,m=u.outerRadius;return(0,_.cloneElement)(e,{polarAngles:Array.isArray(i)?i:NF(u,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:NF(l,!0).map(function(e){return e.coordinate}),cx:d,cy:f,innerRadius:p,outerRadius:m,key:e.key||`polar-grid`,radialLines:n})}),nY(r,`renderLegend`,function(){var e=r.state.formattedGraphicalItems,t=r.props,n=t.children,i=t.width,a=t.height,o=r.props.margin||{},s=iF({children:n,formattedGraphicalItems:e,legendWidth:i-(o.left||0)-(o.right||0),legendContent:c});if(!s)return null;var l=s.item,u=LJ(s,kJ);return(0,_.cloneElement)(l,Z(Z({},u),{},{chartWidth:i,chartHeight:a,margin:o,onBBoxUpdate:r.handleLegendBBoxUpdate}))}),nY(r,`renderTooltip`,function(){var e=r.props,t=e.children,n=e.accessibilityLayer,i=Zb(t,EE);if(!i)return null;var a=r.state,o=a.isTooltipActive,s=a.activeCoordinate,c=a.activePayload,l=a.activeLabel,u=a.offset,d=i.props.active??o;return(0,_.cloneElement)(i,{viewBox:Z(Z({},u),{},{x:u.left,y:u.top}),active:d,label:l,payload:d?c:[],coordinate:s,accessibilityLayer:n})}),nY(r,`renderBrush`,function(e){var t=r.props,n=t.margin,i=t.data,a=r.state,o=a.offset,s=a.dataStartIndex,c=a.dataEndIndex,l=a.updateId;return(0,_.cloneElement)(e,{key:e.key||`_recharts-brush`,onChange:FF(r.handleBrushChange,e.props.onChange),data:i,x:X(e.props.x)?e.props.x:o.left,y:X(e.props.y)?e.props.y:o.top+o.height+o.brushBottom-(n.bottom||0),width:X(e.props.width)?e.props.width:o.width,startIndex:s,endIndex:c,updateId:`brush-${l}`})}),nY(r,`renderReferenceElement`,function(e,t,n){if(!e)return null;var i=r.clipPathId,a=r.state,o=a.xAxisMap,s=a.yAxisMap,c=a.offset,l=e.type.defaultProps||{},u=e.props,d=u.xAxisId,f=d===void 0?l.xAxisId:d,p=u.yAxisId,m=p===void 0?l.yAxisId:p;return(0,_.cloneElement)(e,{key:e.key||`${t}-${n}`,xAxis:o[f],yAxis:s[m],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:i})}),nY(r,`renderActivePoints`,function(e){var t=e.item,r=e.activePoint,i=e.basePoint,a=e.childIndex,o=e.isRange,s=[],c=t.props.key,l=t.item.type.defaultProps===void 0?t.item.props:Z(Z({},t.item.type.defaultProps),t.item.props),u=l.activeDot,d=l.dataKey,f=Z(Z({index:a,dataKey:d,cx:r.x,cy:r.y,r:4,fill:wF(t.item),strokeWidth:2,stroke:`#fff`,payload:r.payload,value:r.value},rx(u,!1)),Fb(u));return s.push(n.renderActiveDot(u,f,`${c}-activePoint-${a}`)),i?s.push(n.renderActiveDot(u,Z(Z({},f),{},{cx:i.x,cy:i.y}),`${c}-basePoint-${a}`)):o&&s.push(null),s}),nY(r,`renderGraphicChild`,function(e,t,n){var i=r.filterFormatItem(e,t,n);if(!i)return null;var a=r.getTooltipEventType(),o=r.state,s=o.isTooltipActive,c=o.tooltipAxis,l=o.activeTooltipIndex,u=o.activeLabel,d=r.props.children,f=Zb(d,EE),p=i.props,m=p.points,h=p.isRange,g=p.baseLine,v=i.item.type.defaultProps===void 0?i.item.props:Z(Z({},i.item.type.defaultProps),i.item.props),y=v.activeDot,b=v.hide,x=v.activeBar,S=v.activeShape,C=!!(!b&&s&&f&&(y||x||S)),w={};a!==`axis`&&f&&f.props.trigger===`click`?w={onClick:FF(r.handleItemMouseEnter,e.props.onClick)}:a!==`axis`&&(w={onMouseLeave:FF(r.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:FF(r.handleItemMouseEnter,e.props.onMouseEnter)});var T=(0,_.cloneElement)(e,Z(Z({},i.props),w));function E(e){return typeof c.dataKey==`function`?c.dataKey(e.payload):null}if(C){if(l>=0){var D,O;if(c.dataKey&&!c.allowDuplicatedCategory){var k=typeof c.dataKey==`function`?E:`payload.${c.dataKey.toString()}`;D=Tb(m,k,u),O=h&&g&&Tb(g,k,u)}else D=m?.[l],O=h&&g&&g[l];if(S||x){var A=e.props.activeIndex===void 0?l:e.props.activeIndex;return[(0,_.cloneElement)(e,Z(Z(Z({},i.props),w),{},{activeIndex:A})),null,null]}if(!(0,mb.default)(D))return[T].concat(YJ(r.renderActivePoints({item:i,activePoint:D,basePoint:O,childIndex:l,isRange:h})))}else{var j=(r.getItemByXY(r.state.activeCoordinate)??{graphicalItem:T}).graphicalItem,M=j.item,N=M===void 0?e:M,P=j.childIndex,F=Z(Z(Z({},i.props),w),{},{activeIndex:P});return[(0,_.cloneElement)(N,F),null,null]}}return h?[T,null,null]:[T,null]}),nY(r,`renderCustomized`,function(e,t,n){return(0,_.cloneElement)(e,Z(Z({key:`recharts-customized-${n}`},r.props),r.state))}),nY(r,`renderMap`,{CartesianGrid:{handler:cY,once:!0},ReferenceArea:{handler:r.renderReferenceElement},ReferenceLine:{handler:cY},ReferenceDot:{handler:r.renderReferenceElement},XAxis:{handler:cY},YAxis:{handler:cY},Brush:{handler:r.renderBrush,once:!0},Bar:{handler:r.renderGraphicChild},Line:{handler:r.renderGraphicChild},Area:{handler:r.renderGraphicChild},Radar:{handler:r.renderGraphicChild},RadialBar:{handler:r.renderGraphicChild},Scatter:{handler:r.renderGraphicChild},Pie:{handler:r.renderGraphicChild},Funnel:{handler:r.renderGraphicChild},Tooltip:{handler:r.renderCursor,once:!0},PolarGrid:{handler:r.renderPolarGrid,once:!0},PolarAngleAxis:{handler:r.renderPolarAxis},PolarRadiusAxis:{handler:r.renderPolarAxis},Customized:{handler:r.renderCustomized}}),r.clipPathId=`${e.id??bb(`recharts`)}-clip`,r.throttleTriggeredAfterMouseMove=(0,ME.default)(r.triggeredAfterMouseMove,e.throttleDelay??1e3/60),r.state={},r}return qJ(n,e),VJ(n,[{key:`componentDidMount`,value:function(){this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:this.props.margin.left??0,top:this.props.margin.top??0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:`displayDefaultTooltip`,value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,i=e.layout,a=Zb(t,EE);if(a){var o=a.props.defaultIndex;if(!(typeof o!=`number`||o<0||o>this.state.tooltipTicks.length-1)){var s=this.state.tooltipTicks[o]&&this.state.tooltipTicks[o].value,c=pY(this.state,n,o,s),l=this.state.tooltipTicks[o].coordinate,u=(this.state.offset.top+r)/2,d=i===`horizontal`?{x:l,y:u}:{y:l,x:u},f=this.state.formattedGraphicalItems.find(function(e){return e.item.type.name===`Scatter`});f&&(d=Z(Z({},d),f.props.points[o].tooltipPosition),c=f.props.points[o].tooltipPayload);var p={activeTooltipIndex:o,isTooltipActive:!0,activeLabel:s,activePayload:c,activeCoordinate:d};this.setState(p),this.renderCursor(a),this.accessibilityManager.setIndex(o)}}}},{key:`getSnapshotBeforeUpdate`,value:function(e,t){return this.props.accessibilityLayer&&(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:this.props.margin.left??0,top:this.props.margin.top??0}})),null}},{key:`componentDidUpdate`,value:function(e){ix([Zb(e.children,EE)],[Zb(this.props.children,EE)])||this.displayDefaultTooltip()}},{key:`componentWillUnmount`,value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:`getTooltipEventType`,value:function(){var e=Zb(this.props.children,EE);if(e&&typeof e.props.shared==`boolean`){var t=e.props.shared?`axis`:`item`;return o.indexOf(t)>=0?t:i}return i}},{key:`getMouseInfo`,value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r=aD(n),i={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},a=n.width/t.offsetWidth||1,o=this.inRange(i.chartX,i.chartY,a);if(!o)return null;var s=this.state,c=s.xAxisMap,l=s.yAxisMap,u=this.getTooltipEventType(),d=mY(this.state,this.props.data,this.props.layout,o);if(u!==`axis`&&c&&l){var f=Sb(c).scale,p=Sb(l).scale,m=f&&f.invert?f.invert(i.chartX):null,h=p&&p.invert?p.invert(i.chartY):null;return Z(Z({},i),{},{xValue:m,yValue:h},d)}return d?Z(Z({},i),d):null}},{key:`inRange`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=this.props.layout,i=e/n,a=t/n;if(r===`horizontal`||r===`vertical`){var o=this.state.offset;return i>=o.left&&i<=o.left+o.width&&a>=o.top&&a<=o.top+o.height?{x:i,y:a}:null}var s=this.state,c=s.angleAxisMap,l=s.radiusAxisMap;if(c&&l){var u=Sb(c);return wI({x:i,y:a},u)}return null}},{key:`parseEventsOfWrapper`,value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=Zb(e,EE),r={};return n&&t===`axis`&&(r=n.props.trigger===`click`?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),Z(Z({},Fb(this.props,this.handleOuterEvent)),r)}},{key:`addListener`,value:function(){cJ.on(lJ,this.handleReceiveSyncEvent)}},{key:`removeListener`,value:function(){cJ.removeListener(lJ,this.handleReceiveSyncEvent)}},{key:`filterFormatItem`,value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,i=0,a=r.length;i<a;i++){var o=r[i];if(o.item===e||o.props.key===e.key||t===Kb(o.item.type)&&n===o.childIndex)return o}return null}},{key:`renderClipPath`,value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,r=t.top,i=t.height,a=t.width;return _.createElement(`defs`,null,_.createElement(`clipPath`,{id:e},_.createElement(`rect`,{x:n,y:r,height:i,width:a})))}},{key:`getXScales`,value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=NJ(t,2),r=n[0],i=n[1];return Z(Z({},e),{},nY({},r,i.scale))},{}):null}},{key:`getYScales`,value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=NJ(t,2),r=n[0],i=n[1];return Z(Z({},e),{},nY({},r,i.scale))},{}):null}},{key:`getXScaleByAxisId`,value:function(e){var t;return(t=this.state.xAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getYScaleByAxisId`,value:function(e){var t;return(t=this.state.yAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getItemByXY`,value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var i=0,a=n.length;i<a;i++){var o=n[i],s=o.props,c=o.item,l=c.type.defaultProps===void 0?c.props:Z(Z({},c.type.defaultProps),c.props),u=Kb(c.type);if(u===`Bar`){var d=(s.data||[]).find(function(t){return fB(e,t)});if(d)return{graphicalItem:o,payload:d}}else if(u===`RadialBar`){var f=(s.data||[]).find(function(t){return wI(e,t)});if(f)return{graphicalItem:o,payload:f}}else if(_H(o,r)||vH(o,r)||yH(o,r)){var p=EH({graphicalItem:o,activeTooltipItem:r,itemData:l.data}),m=l.activeIndex===void 0?p:l.activeIndex;return{graphicalItem:Z(Z({},o),{},{childIndex:m}),payload:yH(o,r)?l.data[p]:o.props.data[p]}}}return null}},{key:`render`,value:function(){var e=this;if(!Qb(this))return null;var t=this.props,n=t.children,r=t.className,i=t.width,a=t.height,o=t.style,s=t.compact,c=t.title,l=t.desc,u=rx(LJ(t,AJ),!1);if(s)return _.createElement(WW,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},_.createElement(fx,MJ({},u,{width:i,height:a,title:c,desc:l}),this.renderClipPath(),ox(n,this.renderMap)));this.props.accessibilityLayer&&(u.tabIndex=this.props.tabIndex??0,u.role=this.props.role??`application`,u.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},u.onFocus=function(){e.accessibilityManager.focus()});var d=this.parseEventsOfWrapper();return _.createElement(WW,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},_.createElement(`div`,MJ({className:Vt(`recharts-wrapper`,r),style:Z({position:`relative`,cursor:`default`,width:i,height:a},o)},d,{ref:function(t){e.container=t}}),_.createElement(fx,MJ({},u,{width:i,height:a,title:c,desc:l,style:oY}),this.renderClipPath(),ox(n,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(_.Component);nY(p,`displayName`,t),nY(p,`defaultProps`,Z({layout:`horizontal`,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`},u)),nY(p,`getDerivedStateFromProps`,function(e,t){var n=e.dataKey,r=e.data,i=e.children,a=e.width,o=e.height,s=e.layout,c=e.stackOffset,l=e.margin,u=t.dataStartIndex,d=t.dataEndIndex;if(t.updateId===void 0){var p=yY(e);return Z(Z(Z({},p),{},{updateId:0},f(Z(Z({props:e},p),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(n!==t.prevDataKey||r!==t.prevData||a!==t.prevWidth||o!==t.prevHeight||s!==t.prevLayout||c!==t.prevStackOffset||!Db(l,t.prevMargin)){var m=yY(e),h={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=Z(Z({},mY(t,r,s)),{},{updateId:t.updateId+1}),_=Z(Z(Z({},m),h),g);return Z(Z(Z({},_),f(Z({props:e},_),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(!ix(i,t.prevChildren)){var v=Zb(i,wU),y=v?v.props?.startIndex??u:u,b=v?v.props?.endIndex??d:d,x=y!==u||b!==d,S=!(0,mb.default)(r)&&!x?t.updateId:t.updateId+1;return Z(Z({updateId:S},f(Z(Z({props:e},t),{},{updateId:S,dataStartIndex:y,dataEndIndex:b}),t)),{},{prevChildren:i,dataStartIndex:y,dataEndIndex:b})}return null}),nY(p,`renderActiveDot`,function(e,t,n){var r=(0,_.isValidElement)(e)?(0,_.cloneElement)(e,t):(0,Rb.default)(e)?e(t):_.createElement(jB,t);return _.createElement(_x,{className:`recharts-active-dot`,key:n},r)});var m=(0,_.forwardRef)(function(e,t){return _.createElement(p,MJ({},e,{ref:t}))});return m.displayName=p.displayName,m},TY=wY({chartName:`LineChart`,GraphicalChild:bq,axisComponents:[{axisType:`xAxis`,AxisComp:Lq},{axisType:`yAxis`,AxisComp:eJ}],formatAxisMap:TW}),EY=wY({chartName:`BarChart`,GraphicalChild:pW,defaultTooltipEventType:`axis`,validateTooltipEventTypes:[`axis`,`item`],axisComponents:[{axisType:`xAxis`,AxisComp:Lq},{axisType:`yAxis`,AxisComp:eJ}],formatAxisMap:TW}),DY=wY({chartName:`PieChart`,GraphicalChild:GH,validateTooltipEventTypes:[`item`],defaultTooltipEventType:`item`,legendContent:`children`,axisComponents:[{axisType:`angleAxis`,AxisComp:FV},{axisType:`radiusAxis`,AxisComp:hV}],formatAxisMap:yI,defaultProps:{layout:`centric`,startAngle:0,endAngle:360,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`}});function OY(e){return Array.from(new Map(e.scenarios.map(e=>{let t=String(e.scenarioId??``).trim(),n=String(e.scenarioName??``).trim();return!t&&!n?null:[t||n,n||t]}).filter(e=>!!e)).values())}function kY(e){let t=OY(e),n=e.scenarios.map(e=>e.agentName||e.agentId).filter(Boolean),r=Array.from(new Set(n.length>0?n:e.rerunAgents??[])),i=Array.from(new Set(e.scenarios.map(e=>e.model).filter(e=>!!e))),a=t.slice(0,2).join(`, `),o=t.length>2?` +${t.length-2}`:``,s=i.slice(0,2).join(`, `),c=i.length>2?` +${i.length-2}`:``,l=e.configName?.trim()||``,u=e.configPath?.trim()||``,d=l||u;return{scenarioCount:t.length,agentCount:r.length,scopePreview:d||(a?`${a}${o}`:`n/a`),modelSummary:s?`${s}${c}`:``}}function AY(e){let t=typeof e.toolTokensTotal==`number`?e.toolTokensTotal:null;return{id:e.runId,evaluationRunId:e.evaluationRunId,configId:``,configHash:e.configHash,configPath:e.configPath,configName:e.configName,langsmithTraceUrls:e.langsmithTraceUrls,rerunAgents:e.rerunAgents,rerunScenarioIds:e.rerunScenarioIds,rerunServerOverrideAll:e.rerunServerOverrideAll,rerunScenarioServerOverrides:e.rerunScenarioServerOverrides,timestamp:e.timestamp,runNote:e.runNote,mcpServerVersions:e.mcpServerVersions??{},scenarios:(e.scenarioIds??[]).map((t,n)=>({scenarioId:t,scenarioName:e.scenarioNames?.[n]??t,agentId:e.agentIds?.[n]??``,agentName:e.agentIds?.[n]??``,runs:[],passRate:null,avgToolCalls:0,avgDuration:0})),assistantTokenUsage:null,toolTokenUsage:t===null?null:{inputTokens:null,outputTokens:null,totalTokens:t},overallPassRate:e.passRate,totalScenarios:e.totalScenarios,totalRuns:e.totalRuns,avgToolCalls:e.avgToolCalls,avgLatency:Math.round(e.avgLatencyMs??0),totalDurationMs:typeof e.totalDurationMs==`number`?Math.max(0,e.totalDurationMs):void 0,totalToolDurationMs:typeof e.totalToolDurationMs==`number`?Math.max(0,e.totalToolDurationMs):void 0,outcomes:e.outcomes,executionSource:e.executionSource,executionClient:e.executionClient,checkCounts:e.checkCounts}}var jY=6048e5;function MY(e){return e.length===0?0:e.reduce((e,t)=>e+t,0)/e.length}function NY(e,t=0){let n=Number(e.toFixed(t));return`${n>0?`+`:``}${n.toFixed(t)}`}var PY=()=>{let{configs:e}=Hv(),{source:t}=Mv(),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(`timestamp`),[f,p]=(0,_.useState)(`desc`),m=e=>{u===e?p(e=>e===`asc`?`desc`:`asc`):(d(e),p(`desc`))};(0,_.useEffect)(()=>{let e=!0;r(!0);let n=Date.now(),i=n-2592e6,o=n-jY,c=o-jY,u=new Date(i).toISOString(),d=new Date(o).toISOString(),f=new Date(c).toISOString(),p=new Date(o-1).toISOString(),m=new Date(n).toISOString(),h=async(e,n)=>t.listRunSummaries?(await t.listRunSummaries({since:e,until:n})).map(AY):t.listResults({since:e,until:n});return Promise.all([h(u,m),h(d,m),h(f,p)]).then(([t,n,r])=>{e&&(a(t),s(n),l(r))}).finally(()=>{e&&r(!1)}),()=>{e=!1}},[t]);let h=e.length,g=i.length,v=o.map(e=>e.overallPassRate).filter(e=>e!==null),y=v.length>0?MY(v):null,b=o.length===0?0:Math.round(o.reduce((e,t)=>e+t.avgLatency,0)/o.length),x=c.map(e=>e.overallPassRate).filter(e=>e!==null),S=x.length>0?MY(x):null,C=MY(c.map(e=>e.avgLatency)),w=y===null||S===null?null:(y-S)*100,T=b-C,E=c.length>0,D=w===null?`No prior-week baseline`:`${NY(w,1)}% from last week`,O=E?`${NY(T,0)}ms from last week`:`No prior-week baseline`,k=w===null?`neutral`:w>0?`up`:w<0?`down`:`neutral`,A=E?T<0?`up`:T>0?`down`:`neutral`:`neutral`,j=(0,_.useMemo)(()=>[...i].sort((e,t)=>{let n=0;return u===`timestamp`&&(n=new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()),u===`passRate`&&(n=(e.overallPassRate??-1)-(t.overallPassRate??-1)),u===`latency`&&(n=e.avgLatency-t.avgLatency),u===`scenarios`&&(n=e.totalScenarios-t.totalScenarios),f===`asc`?n:-n}),[i,u,f]),M=j.slice(0,20),N=e=>{let t=e.toolTokenUsage?.totalTokens;return typeof t==`number`?t.toLocaleString():`n/a`},P=[...j].reverse().map(e=>({date:new Date(e.timestamp).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`}),passRate:e.overallPassRate===null?null:Math.round(e.overallPassRate*100),latency:e.avgLatency}));return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Mn,{className:`h-6 w-6`}),`Dashboard`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Overview of your MCP evaluation runs`})]}),(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(W,{asChild:!0,children:(0,I.jsxs)(cp,{to:`/mcp-evaluations/new`,children:[(0,I.jsx)($n,{className:`mr-2 h-4 w-4`}),`New MCP Evaluation`]})}),(0,I.jsx)(W,{variant:`outline`,asChild:!0,children:(0,I.jsxs)(cp,{to:`/run`,children:[(0,I.jsx)(Kn,{className:`mr-2 h-4 w-4`}),`Run Evaluation`]})}),(0,I.jsx)(W,{variant:`outline`,asChild:!0,children:(0,I.jsxs)(cp,{to:`/results`,children:[(0,I.jsx)(tn,{className:`mr-2 h-4 w-4`}),`Browse Results`]})})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,I.jsx)(ry,{title:`MCP Evaluations`,value:h,icon:jn,subtitle:`${h} active`}),(0,I.jsx)(ry,{title:`Total Runs`,value:g,icon:Xt,subtitle:`Last 30 days`}),(0,I.jsx)(ry,{title:`Pass Rate`,value:n?`–`:Bi(y),icon:tn,subtitle:n?`Loading...`:D,trend:n?`neutral`:k}),(0,I.jsx)(ry,{title:`Avg Latency`,value:n?`—`:`${b}ms`,icon:ir,subtitle:n?`Loading...`:O,trend:n?`neutral`:A})]}),(0,I.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-2`,children:[(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsx)(qv,{className:`text-base`,children:`Pass Rate Trend`})}),(0,I.jsx)(q,{children:(0,I.jsx)(GE,{width:`100%`,height:200,children:(0,I.jsxs)(TY,{data:P,children:[(0,I.jsx)(Lq,{dataKey:`date`,tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(eJ,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:e=>`${e}%`}),(0,I.jsx)(EE,{formatter:e=>[`${e}%`,`Pass Rate`]}),(0,I.jsx)(bq,{type:`monotone`,dataKey:`passRate`,stroke:`hsl(38, 92%, 50%)`,strokeWidth:2,dot:{r:3,fill:`hsl(38, 92%, 50%)`}})]})})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsx)(qv,{className:`text-base`,children:`Recent Tool Latency (ms)`})}),(0,I.jsx)(q,{children:(0,I.jsx)(GE,{width:`100%`,height:200,children:(0,I.jsxs)(TY,{data:P,children:[(0,I.jsx)(Lq,{dataKey:`date`,tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(eJ,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(EE,{formatter:e=>[`${e}ms`,`Latency`]}),(0,I.jsx)(bq,{type:`monotone`,dataKey:`latency`,stroke:`hsl(200, 80%, 50%)`,strokeWidth:2,dot:{r:3,fill:`hsl(200, 80%, 50%)`}})]})})})]})]}),(0,I.jsx)(`div`,{className:`grid gap-6`,children:(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsx)(qv,{className:`text-base`,children:`Recent Runs`})}),(0,I.jsxs)(q,{className:`p-0`,children:[(0,I.jsxs)(Xv,{children:[(0,I.jsx)(Zv,{children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{children:`Run ID`}),(0,I.jsx)(ty,{children:`Evaluated`}),(0,I.jsx)(ty,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>m(`timestamp`),children:[`Timestamp`,u===`timestamp`?f===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`})]})}),(0,I.jsx)(ty,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex w-full items-center justify-end gap-1 hover:text-foreground`,onClick:()=>m(`passRate`),children:[`Pass Rate`,u===`passRate`?f===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`})]})}),(0,I.jsx)(ty,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>m(`scenarios`),children:[`Scenarios`,u===`scenarios`?f===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`})]})}),(0,I.jsx)(ty,{className:`text-right`,children:`Avg Tools`}),(0,I.jsx)(ty,{className:`text-right`,children:`Tool Tokens`})]})}),(0,I.jsxs)(Qv,{children:[M.length===0&&(0,I.jsx)(ey,{children:(0,I.jsx)(J,{colSpan:7,className:`py-8 text-center text-sm text-muted-foreground`,children:`No runs in the past 30 days.`})}),M.map(e=>(0,I.jsxs)(ey,{className:`cursor-pointer`,children:[(0,I.jsx)(J,{children:(0,I.jsx)(cp,{to:`/results/${e.id}`,className:`font-mono text-xs text-primary hover:underline`,children:e.id})}),(0,I.jsx)(J,{className:`text-[11px] text-muted-foreground`,children:(()=>{let t=kY(e);return(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{children:[`Evaluated: `,t.scenarioCount,` scenario`,t.scenarioCount===1?``:`s`,` · `,t.agentCount,` agent`,t.agentCount===1?``:`s`,t.modelSummary?` · ${t.modelSummary}`:``]}),(0,I.jsx)(`div`,{className:`font-mono text-xs text-foreground/80`,children:t.scopePreview})]})})()}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.timestamp).toLocaleString()]})}),(0,I.jsx)(J,{className:`text-right`,children:(0,I.jsx)(ay,{rate:e.overallPassRate})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:e.totalScenarios}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:e.avgToolCalls.toFixed(0)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:N(e)})]},e.id))]})]}),j.length>20&&(0,I.jsx)(`div`,{className:`border-t p-4 text-center`,children:(0,I.jsx)(W,{variant:`outline`,asChild:!0,children:(0,I.jsx)(cp,{to:`/results`,children:`Show more`})})})]})]})})]})};function FY({value:e,onValueChange:t,placeholder:n=`Search...`,className:r,inputClassName:i,clearAriaLabel:a=`Clear search`}){return(0,I.jsxs)(`div`,{className:U(`relative`,r),children:[(0,I.jsx)(Pp,{value:e,onChange:e=>t(e.target.value),placeholder:n,className:U(`h-9 w-[240px] pr-8`,i)}),e&&(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 border border-border/60`,onClick:()=>t(``),"aria-label":a,children:(0,I.jsx)(dr,{className:`h-4 w-4`})})]})}var IY=_.createContext(void 0);function LY(e){let t=_.useContext(IY);return e||t||`ltr`}var RY=`rovingFocusGroup.onEntryFocus`,zY={bubbles:!1,cancelable:!0},BY=`RovingFocusGroup`,[VY,HY,UY]=oe(BY),[WY,GY]=L(BY,[UY]),[KY,qY]=WY(BY),JY=_.forwardRef((e,t)=>(0,I.jsx)(VY.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(VY.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(YY,{...e,ref:t})})}));JY.displayName=BY;var YY=_.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=_.useRef(null),p=P(t,f),m=LY(a),[h,g]=Re({prop:o,defaultProp:s??null,onChange:c,caller:BY}),[v,y]=_.useState(!1),b=pe(l),x=HY(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(RY,b),()=>e.removeEventListener(RY,b)},[b]),(0,I.jsx)(KY,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:(0,I.jsx)(V.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:j(e.onMouseDown,()=>{S.current=!0}),onFocus:j(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(RY,zY);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);tX([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:j(e.onBlur,()=>y(!1))})})}),XY=`RovingFocusGroupItem`,ZY=_.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Pa(),l=a||c,u=qY(XY,n),d=u.currentTabStopId===l,f=HY(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return _.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,I.jsx)(VY.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,I.jsx)(V.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:j(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:j(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:j(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=eX(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?nX(n,r+1):n.slice(r+1)}setTimeout(()=>tX(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});ZY.displayName=XY;var QY={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function $Y(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function eX(e,t,n){let r=$Y(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return QY[r]}function tX(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function nX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rX=JY,iX=ZY;function aX(e){let t=oX(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(cX);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function oX(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=uX(n),i=lX(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sX=Symbol(`radix.slottable`);function cX(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===sX}function lX(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 uX(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 dX=[`Enter`,` `],fX=[`ArrowDown`,`PageUp`,`Home`],pX=[`ArrowUp`,`PageDown`,`End`],mX=[...fX,...pX],hX={ltr:[...dX,`ArrowRight`],rtl:[...dX,`ArrowLeft`]},gX={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},_X=`Menu`,[vX,yX,bX]=oe(_X),[xX,SX]=L(_X,[bX,ac,GY]),CX=ac(),wX=GY(),[TX,EX]=xX(_X),[DX,OX]=xX(_X),kX=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=CX(t),[c,l]=_.useState(null),u=_.useRef(!1),d=pe(a),f=LY(i);return _.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,I.jsx)(xc,{...s,children:(0,I.jsx)(TX,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,I.jsx)(DX,{scope:t,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};kX.displayName=_X;var AX=`MenuAnchor`,jX=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=CX(n);return(0,I.jsx)(Sc,{...i,...r,ref:t})});jX.displayName=AX;var MX=`MenuPortal`,[NX,PX]=xX(MX,{forceMount:void 0}),FX=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=EX(MX,t);return(0,I.jsx)(NX,{scope:t,forceMount:n,children:(0,I.jsx)(H,{present:n||a.open,children:(0,I.jsx)(Me,{asChild:!0,container:i,children:r})})})};FX.displayName=MX;var IX=`MenuContent`,[LX,RX]=xX(IX),zX=_.forwardRef((e,t)=>{let n=PX(IX,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=EX(IX,e.__scopeMenu),o=OX(IX,e.__scopeMenu);return(0,I.jsx)(vX.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(H,{present:r||a.open,children:(0,I.jsx)(vX.Slot,{scope:e.__scopeMenu,children:o.modal?(0,I.jsx)(BX,{...i,ref:t}):(0,I.jsx)(VX,{...i,ref:t})})})})}),BX=_.forwardRef((e,t)=>{let n=EX(IX,e.__scopeMenu),r=_.useRef(null),i=P(t,r);return _.useEffect(()=>{let e=r.current;if(e)return _h(e)},[]),(0,I.jsx)(UX,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:j(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),VX=_.forwardRef((e,t)=>{let n=EX(IX,e.__scopeMenu);return(0,I.jsx)(UX,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),HX=aX(`MenuContent.ScrollLock`),UX=_.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=EX(IX,n),v=OX(IX,n),y=CX(n),b=wX(n),x=yX(n),[S,C]=_.useState(null),w=_.useRef(null),T=P(t,w,g.onContentChange),E=_.useRef(0),D=_.useRef(``),O=_.useRef(0),k=_.useRef(null),A=_.useRef(`right`),M=_.useRef(0),N=m?ch:_.Fragment,F=m?{as:HX,allowPinchZoom:!0}:void 0,ee=e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=wZ(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};_.useEffect(()=>()=>window.clearTimeout(E.current),[]),rm();let L=_.useCallback(e=>A.current===k.current?.side&&EZ(e,k.current?.area),[]);return(0,I.jsx)(LX,{scope:n,searchRef:D,onItemEnter:_.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:_.useCallback(e=>{L(e)||(w.current?.focus(),C(null))},[L]),onTriggerLeave:_.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(e=>{k.current=e},[]),children:(0,I.jsx)(N,{...F,children:(0,I.jsx)(qp,{asChild:!0,trapped:i,onMountAutoFocus:j(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,I.jsx)(xe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,I.jsx)(rX,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:j(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,I.jsx)(Cc,{role:`menu`,"aria-orientation":`vertical`,"data-state":yZ(g.open),"data-radix-menu-content":``,dir:v.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:j(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ee(e.key));let i=w.current;if(e.target!==i||!mX.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);pX.includes(e.key)&&a.reverse(),SZ(a)}),onBlur:j(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:j(e.onPointerMove,DZ(e=>{let t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>M.current?`right`:`left`;A.current=t,M.current=e.clientX}}))})})})})})})});zX.displayName=IX;var WX=`MenuGroup`,GX=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(V.div,{role:`group`,...r,ref:t})});GX.displayName=WX;var KX=`MenuLabel`,qX=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(V.div,{...r,ref:t})});qX.displayName=KX;var JX=`MenuItem`,YX=`menu.itemSelect`,XX=_.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=_.useRef(null),o=OX(JX,e.__scopeMenu),s=RX(JX,e.__scopeMenu),c=P(t,a),l=_.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(YX,{bubbles:!0,cancelable:!0});e.addEventListener(YX,e=>r?.(e),{once:!0}),fe(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,I.jsx)(ZX,{...i,ref:c,disabled:n,onClick:j(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:j(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:j(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||dX.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});XX.displayName=JX;var ZX=_.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=RX(JX,n),s=wX(n),c=_.useRef(null),l=P(t,c),[u,d]=_.useState(!1),[f,p]=_.useState(``);return _.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,I.jsx)(vX.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,I.jsx)(iX,{asChild:!0,...s,focusable:!r,children:(0,I.jsx)(V.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:j(e.onPointerMove,DZ(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:j(e.onPointerLeave,DZ(e=>o.onItemLeave(e))),onFocus:j(e.onFocus,()=>d(!0)),onBlur:j(e.onBlur,()=>d(!1))})})})}),QX=`MenuCheckboxItem`,$X=_.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,I.jsx)(sZ,{scope:e.__scopeMenu,checked:n,children:(0,I.jsx)(XX,{role:`menuitemcheckbox`,"aria-checked":bZ(n)?`mixed`:n,...i,ref:t,"data-state":xZ(n),onSelect:j(i.onSelect,()=>r?.(bZ(n)?!0:!n),{checkForDefaultPrevented:!1})})})});$X.displayName=QX;var eZ=`MenuRadioGroup`,[tZ,nZ]=xX(eZ,{value:void 0,onValueChange:()=>{}}),rZ=_.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=pe(r);return(0,I.jsx)(tZ,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,I.jsx)(GX,{...i,ref:t})})});rZ.displayName=eZ;var iZ=`MenuRadioItem`,aZ=_.forwardRef((e,t)=>{let{value:n,...r}=e,i=nZ(iZ,e.__scopeMenu),a=n===i.value;return(0,I.jsx)(sZ,{scope:e.__scopeMenu,checked:a,children:(0,I.jsx)(XX,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":xZ(a),onSelect:j(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});aZ.displayName=iZ;var oZ=`MenuItemIndicator`,[sZ,cZ]=xX(oZ,{checked:!1}),lZ=_.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=cZ(oZ,n);return(0,I.jsx)(H,{present:r||bZ(a.checked)||a.checked===!0,children:(0,I.jsx)(V.span,{...i,ref:t,"data-state":xZ(a.checked)})})});lZ.displayName=oZ;var uZ=`MenuSeparator`,dZ=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(V.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});dZ.displayName=uZ;var fZ=`MenuArrow`,pZ=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=CX(n);return(0,I.jsx)(wc,{...i,...r,ref:t})});pZ.displayName=fZ;var[dte,mZ]=xX(`MenuSub`),hZ=`MenuSubTrigger`,gZ=_.forwardRef((e,t)=>{let n=EX(hZ,e.__scopeMenu),r=OX(hZ,e.__scopeMenu),i=mZ(hZ,e.__scopeMenu),a=RX(hZ,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return _.useEffect(()=>u,[u]),_.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,I.jsx)(jX,{asChild:!0,...l,children:(0,I.jsx)(ZX,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":yZ(n.open),...e,ref:N(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:j(e.onPointerMove,DZ(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:j(e.onPointerLeave,DZ(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:j(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||hX[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});gZ.displayName=hZ;var _Z=`MenuSubContent`,vZ=_.forwardRef((e,t)=>{let n=PX(IX,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=EX(IX,e.__scopeMenu),o=OX(IX,e.__scopeMenu),s=mZ(_Z,e.__scopeMenu),c=_.useRef(null),l=P(t,c);return(0,I.jsx)(vX.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(H,{present:r||a.open,children:(0,I.jsx)(vX.Slot,{scope:e.__scopeMenu,children:(0,I.jsx)(UX,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:j(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:j(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:j(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=gX[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});vZ.displayName=_Z;function yZ(e){return e?`open`:`closed`}function bZ(e){return e===`indeterminate`}function xZ(e){return bZ(e)?`indeterminate`:e?`checked`:`unchecked`}function SZ(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function CZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function wZ(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=CZ(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function TZ(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function EZ(e,t){return t?TZ({x:e.clientX,y:e.clientY},t):!1}function DZ(e){return t=>t.pointerType===`mouse`?e(t):void 0}var OZ=kX,kZ=jX,AZ=FX,jZ=zX,MZ=GX,NZ=qX,PZ=XX,FZ=$X,IZ=rZ,LZ=aZ,RZ=lZ,zZ=dZ,BZ=pZ,VZ=gZ,HZ=vZ,UZ=`DropdownMenu`,[WZ,fte]=L(UZ,[SX]),GZ=SX(),[KZ,qZ]=WZ(UZ),JZ=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=GZ(t),l=_.useRef(null),[u,d]=Re({prop:i,defaultProp:a??!1,onChange:o,caller:UZ});return(0,I.jsx)(KZ,{scope:t,triggerId:Pa(),triggerRef:l,contentId:Pa(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,I.jsx)(OZ,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};JZ.displayName=UZ;var YZ=`DropdownMenuTrigger`,XZ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=qZ(YZ,n),o=GZ(n);return(0,I.jsx)(kZ,{asChild:!0,...o,children:(0,I.jsx)(V.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:N(t,a.triggerRef),onPointerDown:j(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:j(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});XZ.displayName=YZ;var ZZ=`DropdownMenuPortal`,QZ=e=>{let{__scopeDropdownMenu:t,...n}=e,r=GZ(t);return(0,I.jsx)(AZ,{...r,...n})};QZ.displayName=ZZ;var $Z=`DropdownMenuContent`,eQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ($Z,n),a=GZ(n),o=_.useRef(!1);return(0,I.jsx)(jZ,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:j(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:j(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});eQ.displayName=$Z;var tQ=`DropdownMenuGroup`,nQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=GZ(n);return(0,I.jsx)(MZ,{...i,...r,ref:t})});nQ.displayName=tQ;var rQ=`DropdownMenuLabel`,iQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=GZ(n);return(0,I.jsx)(NZ,{...i,...r,ref:t})});iQ.displayName=rQ;var aQ=`DropdownMenuItem`,oQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=GZ(n);return(0,I.jsx)(PZ,{...i,...r,ref:t})});oQ.displayName=aQ;var sQ=`DropdownMenuCheckboxItem`,cQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=GZ(n);return(0,I.jsx)(FZ,{...i,...r,ref:t})});cQ.displayName=sQ;var lQ=`DropdownMenuRadioGroup`,uQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=GZ(n);return(0,I.jsx)(IZ,{...i,...r,ref:t})});uQ.displayName=lQ;var dQ=`DropdownMenuRadioItem`,fQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=GZ(n);return(0,I.jsx)(LZ,{...i,...r,ref:t})});fQ.displayName=dQ;var pQ=`DropdownMenuItemIndicator`,mQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=GZ(n);return(0,I.jsx)(RZ,{...i,...r,ref:t})});mQ.displayName=pQ;var hQ=`DropdownMenuSeparator`,gQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=GZ(n);return(0,I.jsx)(zZ,{...i,...r,ref:t})});gQ.displayName=hQ;var _Q=`DropdownMenuArrow`,vQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=GZ(n);return(0,I.jsx)(BZ,{...i,...r,ref:t})});vQ.displayName=_Q;var yQ=`DropdownMenuSubTrigger`,bQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=GZ(n);return(0,I.jsx)(VZ,{...i,...r,ref:t})});bQ.displayName=yQ;var xQ=`DropdownMenuSubContent`,SQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=GZ(n);return(0,I.jsx)(HZ,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});SQ.displayName=xQ;var CQ=JZ,wQ=XZ,TQ=QZ,EQ=eQ,DQ=iQ,OQ=oQ,kQ=cQ,AQ=fQ,jQ=mQ,MQ=gQ,NQ=bQ,PQ=SQ,FQ=CQ,IQ=wQ,LQ=_.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,I.jsxs)(NQ,{ref:i,className:U(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[state=open]:bg-accent focus:bg-accent`,t&&`pl-8`,e),...r,children:[n,(0,I.jsx)(an,{className:`ml-auto h-4 w-4`})]}));LQ.displayName=NQ.displayName;var RQ=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(PQ,{ref:n,className:U(`z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t}));RQ.displayName=PQ.displayName;var zQ=_.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,I.jsx)(TQ,{children:(0,I.jsx)(EQ,{ref:r,sideOffset:t,className:U(`z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));zQ.displayName=EQ.displayName;var BQ=_.forwardRef(({className:e,inset:t,...n},r)=>(0,I.jsx)(OQ,{ref:r,className:U(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,t&&`pl-8`,e),...n}));BQ.displayName=OQ.displayName;var VQ=_.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,I.jsxs)(kQ,{ref:i,className:U(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,e),checked:n,...r,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,I.jsx)(jQ,{children:(0,I.jsx)(nn,{className:`h-4 w-4`})})}),t]}));VQ.displayName=kQ.displayName;var HQ=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(AQ,{ref:r,className:U(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,e),...n,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,I.jsx)(jQ,{children:(0,I.jsx)(fn,{className:`h-2 w-2 fill-current`})})}),t]}));HQ.displayName=AQ.displayName;var UQ=_.forwardRef(({className:e,inset:t,...n},r)=>(0,I.jsx)(DQ,{ref:r,className:U(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));UQ.displayName=DQ.displayName;var WQ=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(MQ,{ref:n,className:U(`-mx-1 my-1 h-px bg-muted`,e),...t}));WQ.displayName=MQ.displayName;function GQ(e,[t,n]){return Math.min(n,Math.max(t,e))}function KQ(e){let t=qQ(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(YQ);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function qQ(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=ZQ(n),i=XQ(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var JQ=Symbol(`radix.slottable`);function YQ(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===JQ}function XQ(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 ZQ(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 QQ(e){let t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var $Q=[` `,`Enter`,`ArrowUp`,`ArrowDown`],e$=[` `,`Enter`],t$=`Select`,[n$,r$,i$]=oe(t$),[a$,pte]=L(t$,[i$,ac]),o$=ac(),[s$,c$]=a$(t$),[l$,u$]=a$(t$),d$=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=o$(t),[g,v]=_.useState(null),[y,b]=_.useState(null),[x,S]=_.useState(!1),C=LY(l),[w,T]=Re({prop:r,defaultProp:i??!1,onChange:a,caller:t$}),[E,D]=Re({prop:o,defaultProp:s,onChange:c,caller:t$}),O=_.useRef(null),k=!g||m||!!g.closest(`form`),[A,j]=_.useState(new Set),M=Array.from(A).map(e=>e.props.value).join(`;`);return(0,I.jsx)(xc,{...h,children:(0,I.jsxs)(s$,{required:p,scope:t,trigger:g,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:Pa(),value:E,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,children:[(0,I.jsx)(n$.Provider,{scope:t,children:(0,I.jsx)(l$,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(e=>{j(t=>new Set(t).add(e))},[]),onNativeOptionRemove:_.useCallback(e=>{j(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),k?(0,I.jsxs)(o1,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:E,onChange:e=>D(e.target.value),disabled:f,form:m,children:[E===void 0?(0,I.jsx)(`option`,{value:``}):null,Array.from(A)]},M):null]})})};d$.displayName=t$;var f$=`SelectTrigger`,p$=_.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=o$(n),o=c$(f$,n),s=o.disabled||r,c=P(t,o.onTriggerChange),l=r$(n),u=_.useRef(`touch`),[d,f,p]=c1(e=>{let t=l().filter(e=>!e.disabled),n=l1(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(Sc,{asChild:!0,...a,children:(0,I.jsx)(V.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":s1(o.value)?``:void 0,...i,ref:c,onClick:j(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:j(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:j(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&$Q.includes(e.key)&&(m(),e.preventDefault())})})})});p$.displayName=f$;var m$=`SelectValue`,h$=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=c$(m$,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=P(t,c.onValueNodeChange);return Ae(()=>{l(u)},[l,u]),(0,I.jsx)(V.span,{...s,ref:d,style:{pointerEvents:`none`},children:s1(c.value)?(0,I.jsx)(I.Fragment,{children:o}):a})});h$.displayName=m$;var g$=`SelectIcon`,_$=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(V.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});_$.displayName=g$;var v$=`SelectPortal`,y$=e=>(0,I.jsx)(Me,{asChild:!0,...e});y$.displayName=v$;var b$=`SelectContent`,x$=_.forwardRef((e,t)=>{let n=c$(b$,e.__scopeSelect),[r,i]=_.useState();if(Ae(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?A.createPortal((0,I.jsx)(C$,{scope:e.__scopeSelect,children:(0,I.jsx)(n$.Slot,{scope:e.__scopeSelect,children:(0,I.jsx)(`div`,{children:e.children})})}),t):null}return(0,I.jsx)(D$,{...e,ref:t})});x$.displayName=b$;var S$=10,[C$,w$]=a$(b$),T$=`SelectContentImpl`,E$=KQ(`SelectContent.RemoveScroll`),D$=_.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,...v}=e,y=c$(b$,n),[b,x]=_.useState(null),[S,C]=_.useState(null),w=P(t,e=>x(e)),[T,E]=_.useState(null),[D,O]=_.useState(null),k=r$(n),[A,M]=_.useState(!1),N=_.useRef(!1);_.useEffect(()=>{if(b)return _h(b)},[b]),rm();let F=_.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),ee=_.useCallback(()=>F([T,b]),[F,T,b]);_.useEffect(()=>{A&&ee()},[A,ee]);let{onOpenChange:L,triggerPointerDownPosRef:R}=y;_.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(R.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():b.contains(n.target)||L(!1),document.removeEventListener(`pointermove`,t),R.current=null};return R.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,L,R]),_.useEffect(()=>{let e=()=>L(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[L]);let[z,te]=c1(e=>{let t=k().filter(e=>!e.disabled),n=l1(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=_.useCallback((e,t,n)=>{let r=!N.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(N.current=!0))},[y.value]),re=_.useCallback(()=>b?.focus(),[b]),ie=_.useCallback((e,t,n)=>{let r=!N.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),ae=r===`popper`?j$:k$,oe=ae===j$?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,I.jsx)(C$,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ne,selectedItem:T,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:ee,selectedItemText:D,position:r,isPositioned:A,searchRef:z,children:(0,I.jsx)(ch,{as:E$,allowPinchZoom:!0,children:(0,I.jsx)(qp,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:j(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(xe,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,I.jsx)(ae,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...oe,onPlaced:()=>M(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:j(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});D$.displayName=T$;var O$=`SelectItemAlignedPosition`,k$=_.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=c$(b$,n),o=w$(b$,n),[s,c]=_.useState(null),[l,u]=_.useState(null),d=P(t,e=>u(e)),f=r$(n),p=_.useRef(!1),m=_.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=o,b=_.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-S$,d=GQ(a,[S$,Math.max(S$,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-S$,d=GQ(a,[S$,Math.max(S$,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-S$*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),_=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+_+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-S$,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+_+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${S$}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,v,a.dir,r]);Ae(()=>b(),[b]);let[x,S]=_.useState();Ae(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);let C=_.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]);return(0,I.jsx)(M$,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,I.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,I.jsx)(V.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});k$.displayName=O$;var A$=`SelectPopperPosition`,j$=_.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=S$,...a}=e,o=o$(n);return(0,I.jsx)(Cc,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});j$.displayName=A$;var[M$,N$]=a$(b$,{}),P$=`SelectViewport`,F$=_.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=w$(P$,n),o=N$(P$,n),s=P(t,a.onViewportChange),c=_.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(n$.Slot,{scope:n,children:(0,I.jsx)(V.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:j(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-S$*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});F$.displayName=P$;var I$=`SelectGroup`,[L$,R$]=a$(I$),z$=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Pa();return(0,I.jsx)(L$,{scope:n,id:i,children:(0,I.jsx)(V.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});z$.displayName=I$;var B$=`SelectLabel`,V$=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=R$(B$,n);return(0,I.jsx)(V.div,{id:i.id,...r,ref:t})});V$.displayName=B$;var H$=`SelectItem`,[U$,W$]=a$(H$),G$=_.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=c$(H$,n),c=w$(H$,n),l=s.value===r,[u,d]=_.useState(a??``),[f,p]=_.useState(!1),m=P(t,e=>c.itemRefCallback?.(e,r,i)),h=Pa(),g=_.useRef(`touch`),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,I.jsx)(U$,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:_.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(n$.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,I.jsx)(V.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:j(o.onFocus,()=>p(!0)),onBlur:j(o.onBlur,()=>p(!1)),onClick:j(o.onClick,()=>{g.current!==`mouse`&&v()}),onPointerUp:j(o.onPointerUp,()=>{g.current===`mouse`&&v()}),onPointerDown:j(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:j(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:j(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:j(o.onKeyDown,e=>{(c.searchRef?.current===``||e.key!==` `)&&(e$.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})});G$.displayName=H$;var K$=`SelectItemText`,q$=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=c$(K$,n),s=w$(K$,n),c=W$(K$,n),l=u$(K$,n),[u,d]=_.useState(null),f=P(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=_.useMemo(()=>(0,I.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Ae(()=>(h(m),()=>g(m)),[h,g,m]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(V.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?A.createPortal(a.children,o.valueNode):null]})});q$.displayName=K$;var J$=`SelectItemIndicator`,Y$=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return W$(J$,n).isSelected?(0,I.jsx)(V.span,{"aria-hidden":!0,...r,ref:t}):null});Y$.displayName=J$;var X$=`SelectScrollUpButton`,Z$=_.forwardRef((e,t)=>{let n=w$(X$,e.__scopeSelect),r=N$(X$,e.__scopeSelect),[i,a]=_.useState(!1),o=P(t,r.onScrollButtonChange);return Ae(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(e1,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Z$.displayName=X$;var Q$=`SelectScrollDownButton`,$$=_.forwardRef((e,t)=>{let n=w$(Q$,e.__scopeSelect),r=N$(Q$,e.__scopeSelect),[i,a]=_.useState(!1),o=P(t,r.onScrollButtonChange);return Ae(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(e1,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});$$.displayName=Q$;var e1=_.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=w$(`SelectScrollButton`,n),o=_.useRef(null),s=r$(n),c=_.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),Ae(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,I.jsx)(V.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:j(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:j(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:j(i.onPointerLeave,()=>{c()})})}),t1=`SelectSeparator`,n1=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(V.div,{"aria-hidden":!0,...r,ref:t})});n1.displayName=t1;var r1=`SelectArrow`,i1=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=o$(n),a=c$(r1,n),o=w$(r1,n);return a.open&&o.position===`popper`?(0,I.jsx)(wc,{...i,...r,ref:t}):null});i1.displayName=r1;var a1=`SelectBubbleInput`,o1=_.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=_.useRef(null),a=P(r,i),o=QQ(t);return _.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,I.jsx)(V.select,{...n,style:{...Ve,...n.style},ref:a,defaultValue:t})});o1.displayName=a1;function s1(e){return e===``||e===void 0}function c1(e){let t=pe(e),n=_.useRef(``),r=_.useRef(0),i=_.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=_.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function l1(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=u1(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function u1(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var d1=d$,f1=p$,p1=h$,m1=_$,h1=y$,g1=x$,_1=F$,v1=V$,y1=G$,b1=q$,x1=Y$,S1=Z$,C1=$$,w1=n1,T1=d1,E1=p1,D1=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(f1,{ref:r,className:U(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,I.jsx)(m1,{asChild:!0,children:(0,I.jsx)(rn,{className:`h-4 w-4 opacity-50`})})]}));D1.displayName=f1.displayName;var O1=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(S1,{ref:n,className:U(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(on,{className:`h-4 w-4`})}));O1.displayName=S1.displayName;var k1=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(C1,{ref:n,className:U(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(rn,{className:`h-4 w-4`})}));k1.displayName=C1.displayName;var A1=_.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,I.jsx)(h1,{children:(0,I.jsxs)(g1,{ref:i,className:U(`relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,I.jsx)(O1,{}),(0,I.jsx)(_1,{className:U(`p-1`,n===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)`),children:t}),(0,I.jsx)(k1,{})]})}));A1.displayName=g1.displayName;var j1=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(v1,{ref:n,className:U(`py-1.5 pl-8 pr-2 text-sm font-semibold`,e),...t}));j1.displayName=v1.displayName;var Q=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(y1,{ref:r,className:U(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,e),...n,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,I.jsx)(x1,{children:(0,I.jsx)(nn,{className:`h-4 w-4`})})}),(0,I.jsx)(b1,{children:t})]}));Q.displayName=y1.displayName;var M1=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(w1,{ref:n,className:U(`-mx-1 my-1 h-px bg-muted`,e),...t}));M1.displayName=w1.displayName;function N1(e){let t=(e.agentEntries&&e.agentEntries.length>0?e.agentEntries:e.agents.map(e=>({kind:`inline`,agent:e}))).map(e=>e.kind===`inline`?e.agent.id:e.ref).map(e=>e.trim()).filter(Boolean),n=(e.runDefaults?.selectedAgentNames??[]).filter(e=>t.includes(e));return n.length>0?n:t}function P1(e){return e.relativePath?.trim()||e.sourcePath?.trim()||void 0}var F1=e=>e.configName?.trim()||e.name,I1=`(root)`,L1=`__ROOT__`,R1=`mcplab.configurations.collapsedSuites`,z1=e=>e.suitePath&&e.suitePath.trim().length>0?e.suitePath.trim():null,B1=e=>e??I1,V1=e=>e===null?L1:`suite:${e}`,H1=e=>e===L1?null:e.startsWith(`suite:`)?e.slice(6):null,U1=(e,t)=>t===null?e===null:e===null?!1:e===t||e.startsWith(`${t}/`),W1=e=>{for(let t of e){let e=t.scenarioEntries??[];for(let t of e){if(t.kind===`inline`&&t.scenario?.id)return String(t.scenario.id);if(t.kind===`referenced`&&t.ref)return String(t.ref)}let n=t.scenarios??[];for(let e of n)if(e?.id)return String(e.id)}return null},G1=e=>W1([e]),K1=e=>{let t=G1(e);return t?{href:`/results?scenario=${encodeURIComponent(t)}`,tooltipLabel:`Open results filtered by scenario ${t}`}:{href:`/results`,tooltipLabel:`Open results`}},q1=`bg-red-400.bg-red-500.bg-orange-400.bg-orange-500.bg-amber-400.bg-amber-500.bg-yellow-400.bg-yellow-500.bg-lime-400.bg-lime-500.bg-green-400.bg-green-500.bg-emerald-400.bg-emerald-500.bg-teal-400.bg-teal-500.bg-cyan-400.bg-cyan-500.bg-sky-400.bg-sky-500.bg-blue-400.bg-blue-500.bg-indigo-400.bg-indigo-500.bg-violet-400.bg-violet-500.bg-purple-400.bg-purple-500.bg-fuchsia-400.bg-fuchsia-500.bg-pink-400.bg-pink-500.bg-rose-400.bg-rose-500`.split(`.`);function J1(e){return e===null?`bg-slate-400`:q1[e.split(``).reduce((e,t)=>(e+t.charCodeAt(0))%q1.length,0)]??`bg-slate-400`}var Y1=()=>{let{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:i}=Hv(),{source:a}=Mv(),o=Wd(),[s,c]=(0,_.useState)(`name`),[l,u]=(0,_.useState)(`asc`),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(`all`),[h,g]=(0,_.useState)(()=>{try{let e=window.localStorage.getItem(R1);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch(e){return console.warn(`Failed to restore collapsed suites from localStorage`,e),new Set}}),[v,y]=(0,_.useState)(new Set),[b,x]=(0,_.useState)(new Set),[S,C]=(0,_.useState)(new Set),[w,T]=(0,_.useState)({}),E=d.trim().toLowerCase(),D=e=>{s===e?u(e=>e===`asc`?`desc`:`asc`):(c(e),u(e===`updatedAt`?`desc`:`asc`))};(0,_.useEffect)(()=>{i();let e=()=>{i()};return window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[i]),(0,_.useEffect)(()=>{let t=!1;return(async()=>{try{if(a.getLatestPassRatesByConfigIds){let n=await a.getLatestPassRatesByConfigIds({lastDays:365,configs:e.map(e=>({id:e.id,sourcePath:e.sourcePath,relativePath:e.relativePath,configHash:e.configHash}))});t||T(n);return}T({})}catch{t||T({})}})(),()=>{t=!0}},[e,a]);let k=async(e,n)=>{await t(e),O({title:`Deleted`,description:`"${n}" has been removed.`})},A=async e=>{let t=await n(e);O({title:`Cloned`,description:`Created "${F1(t)}".`}),o(`/mcp-evaluations/${t.id}`)},j=e=>e.agentEntries?.length??e.agents?.length??0,M=e=>e.scenarioEntries?.length??e.scenarios?.length??0,N=(0,_.useMemo)(()=>{let t=new Set;for(let n of e){let e=z1(n);if(t.add(e),!e)continue;let r=e.split(`/`).filter(Boolean);for(let e=1;e<r.length;e+=1)t.add(r.slice(0,e).join(`/`))}return Array.from(t).sort((e,t)=>B1(e).localeCompare(B1(t)))},[e]),P=(0,_.useMemo)(()=>e.filter(e=>{let t=z1(e),n=p===`all`?void 0:H1(p),r=B1(t);return n!==void 0&&!U1(t,n)?!1:E.length===0||[F1(e),e.id,e.description??``,e.loadError??``,r,e.relativePath??``].join(` `).toLowerCase().includes(E)}),[e,E,p]),F=(0,_.useMemo)(()=>[...P].sort((e,t)=>{let n=0;return s===`name`&&(n=F1(e).localeCompare(F1(t))),s===`scenarios`&&(n=M(e)-M(t)),s===`agents`&&(n=j(e)-j(t)),s===`updatedAt`&&(n=new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()),l===`asc`?n:-n}),[P,s,l]),ee=e=>s===e?l===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`}),L=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},R=async(t,n,r)=>{if(b.has(t))return;let i=e.find(e=>e.id===t),o=i?N1(i):[];x(e=>new Set(e).add(t));try{await a.startRun({configPath:n,runsPerScenario:1,...o.length>0?{agents:o}:{}}),y(e=>new Set(e).add(t)),window.setTimeout(()=>{y(e=>{let n=new Set(e);return n.delete(t),n})},2e3),O({title:`Queued`,description:`"${r}" added to run queue.`})}catch(e){O({title:`Could not queue evaluation`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{x(e=>{let n=new Set(e);return n.delete(t),n})}};(0,_.useEffect)(()=>{try{window.localStorage.setItem(R1,JSON.stringify(Array.from(h)))}catch(e){console.warn(`Failed to persist collapsed suites to localStorage (quota/private mode?)`,e)}},[h]);let z=async(e,t,n)=>{if(!S.has(e)){C(t=>new Set(t).add(e));try{let e=n.filter(e=>typeof e.sourcePath==`string`&&e.sourcePath.trim().length>0);if(e.length===0){O({title:`No runnable evaluations`,description:`Suite "${t}" has no evaluation files with a source path.`,variant:`destructive`});return}let r=await Promise.allSettled(e.map(e=>{let t=N1(e);return a.startRun({configPath:String(e.sourcePath),runsPerScenario:1,...t.length>0?{agents:t}:{}})})),i=r.filter(e=>e.status===`fulfilled`).length,o=r.length-i,s=r.find(e=>e.status===`rejected`),c=s?s.reason instanceof Error?s.reason.message:String(s.reason):void 0;O({title:o===0?`Suite queued`:`Suite queued with errors`,description:o===0?`Queued ${i} evaluation${i===1?``:`s`} for suite "${t}".`:`Queued ${i}/${e.length} evaluations for suite "${t}" (${o} failed${c?`: ${c}`:``}).`,variant:o===0?`default`:`destructive`})}catch(e){O({title:`Could not queue suite`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{C(t=>{let n=new Set(t);return n.delete(e),n})}}},te=(0,_.useMemo)(()=>{let e=new Map;for(let t of F){let n=z1(t),r=e.get(n);r?r.push(t):e.set(n,[t])}return Array.from(e.entries()).sort((e,t)=>B1(e[0]).localeCompare(B1(t[0])))},[F]);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Tn,{className:`h-6 w-6`}),`MCP Evaluations`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Manage your MCP evaluation suites`})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(FY,{value:d,onValueChange:f,placeholder:`Search evaluations...`}),(0,I.jsxs)(T1,{value:p,onValueChange:m,children:[(0,I.jsx)(D1,{className:`h-9 w-[200px]`,children:(0,I.jsx)(E1,{placeholder:`All suites`})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`all`,children:`All suites`}),N.map(e=>(0,I.jsx)(Q,{value:V1(e),children:B1(e)},V1(e)))]})]}),(0,I.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>void i(),children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),(0,I.jsxs)(W,{variant:`outline`,size:`sm`,children:[(0,I.jsx)(sr,{className:`mr-2 h-4 w-4`}),`Import YAML`]}),(0,I.jsx)(W,{size:`sm`,asChild:!0,children:(0,I.jsxs)(cp,{to:`/mcp-evaluations/new`,children:[(0,I.jsx)(qn,{className:`mr-2 h-4 w-4`}),`Create New`]})})]})]}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(Xv,{children:[(0,I.jsx)(Zv,{children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`name`),children:[`Name`,ee(`name`)]})}),(0,I.jsx)(ty,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`scenarios`),children:[`Scenarios`,ee(`scenarios`)]})}),(0,I.jsx)(ty,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`agents`),children:[`Agents`,ee(`agents`)]})}),(0,I.jsx)(ty,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`updatedAt`),children:[`Last Updated`,ee(`updatedAt`)]})}),(0,I.jsx)(ty,{className:`text-right`,children:`Last Run`}),(0,I.jsx)(ty,{className:`w-[220px] text-right`})]})}),(0,I.jsxs)(Qv,{children:[te.map(([e,t])=>{let n=B1(e),r=V1(e),i=h.has(r),a=S.has(r);return(0,I.jsxs)(_.Fragment,{children:[(0,I.jsx)(ey,{className:`bg-muted/40 hover:bg-muted/40`,children:(0,I.jsx)(J,{colSpan:6,className:`py-2`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 items-center gap-2 text-xs leading-none hover:text-foreground`,onClick:()=>L(r),"aria-expanded":!i,"aria-label":`${i?`Expand`:`Collapse`} suite ${n}`,children:[(0,I.jsx)(an,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${i?``:`rotate-90`}`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`h-2 w-2 rounded-full ${J1(e)}`,"aria-hidden":`true`}),e===null?(0,I.jsx)(kn,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}):(0,I.jsx)(En,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`font-medium`,children:n}),(0,I.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,t.length,`)`]})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-xs`,disabled:a,onClick:()=>void z(r,n,t),children:[(0,I.jsx)(Kn,{className:`mr-1 h-3.5 w-3.5`}),a?`Queueing...`:`Run Suite`]})]})})},`suite-${r}`),!i&&t.map(e=>{let t=K1(e),n=P1(e);return(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(cp,{to:`/mcp-evaluations/${e.id}`,className:`font-medium text-sm hover:text-primary`,children:F1(e)}),e.loadError&&(0,I.jsxs)(Y,{variant:`destructive`,className:`ml-2 align-middle text-[10px]`,children:[(0,I.jsx)(or,{className:`mr-1 h-3 w-3`}),`Broken`]}),n&&(0,I.jsx)(`div`,{className:`mt-0.5`,children:(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground font-mono`,children:n})}),e.loadError&&(0,I.jsx)(`p`,{className:`text-xs text-destructive mt-0.5 break-all`,children:e.loadError})]})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:M(e)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:j(e)}),(0,I.jsx)(J,{className:`text-right text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.updatedAt).toLocaleDateString()]})}),(0,I.jsx)(J,{className:`text-right`,children:Object.hasOwn(w,e.id)?(0,I.jsx)(`div`,{className:`inline-flex justify-end`,children:(0,I.jsx)(ay,{rate:w[e.id]})}):``}),(0,I.jsx)(J,{className:`w-[220px] whitespace-nowrap`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(FQ,{children:[(0,I.jsx)(IQ,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:(0,I.jsx)(vn,{className:`h-4 w-4`})})}),(0,I.jsxs)(zQ,{align:`end`,children:[(0,I.jsxs)(BQ,{onClick:()=>o(`/mcp-evaluations/${e.id}`),children:[(0,I.jsx)(Gn,{className:`mr-2 h-3.5 w-3.5`}),`Edit`]}),(0,I.jsxs)(BQ,{onClick:()=>void A(e.id),children:[(0,I.jsx)(hn,{className:`mr-2 h-3.5 w-3.5`}),`Clone`]}),(0,I.jsxs)(BQ,{className:`text-destructive`,onClick:()=>void k(e.id,F1(e)),children:[(0,I.jsx)(ar,{className:`mr-2 h-3.5 w-3.5`}),`Delete`]})]})]}),(0,I.jsx)(fl,{children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(W,{size:`icon`,variant:`outline`,className:`h-8 w-8`,asChild:!0,"aria-label":t.tooltipLabel,children:(0,I.jsxs)(cp,{to:t.href,children:[(0,I.jsx)(tn,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{className:`sr-only`,children:t.tooltipLabel})]})})}),(0,I.jsx)(hl,{children:t.tooltipLabel})]})}),(0,I.jsx)(fl,{children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-8 px-2 text-xs ${v.has(e.id)?`border-green-600 bg-green-600 text-white hover:bg-green-700 hover:text-white`:``}`,disabled:b.has(e.id)||!e.sourcePath,onClick:()=>e.sourcePath&&void R(e.id,e.sourcePath,F1(e)),"aria-label":`Queue ${F1(e)}`,children:v.has(e.id)?`Queued`:b.has(e.id)?`Queueing...`:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Fn,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Queue evaluation`})]})})}),(0,I.jsx)(hl,{children:`Queue evaluation run`})]})}),(0,I.jsx)(W,{size:`sm`,variant:`outline`,asChild:!0,children:(0,I.jsxs)(cp,{to:`/run?configId=${encodeURIComponent(e.id)}`,children:[(0,I.jsx)(Kn,{className:`h-3.5 w-3.5`}),`Run`]})})]})})]},e.id)})]},`suite-group-${r}`)}),!r&&e.length===0&&(0,I.jsx)(ey,{children:(0,I.jsx)(J,{colSpan:6,className:`text-center py-12 text-muted-foreground`,children:`No MCP evaluations yet. Create your first one to get started.`})}),!r&&e.length>0&&F.length===0&&(0,I.jsx)(ey,{children:(0,I.jsx)(J,{colSpan:6,className:`text-center py-12 text-muted-foreground`,children:`No MCP evaluations match this filter.`})}),r&&(0,I.jsx)(ey,{children:(0,I.jsx)(J,{colSpan:6,className:`text-center py-12 text-muted-foreground`,children:`Loading MCP evaluations...`})})]})]})})})]})},X1=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=wp(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Z1=`Label`,Q1=_.forwardRef((e,t)=>(0,I.jsx)(X1.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Q1.displayName=Z1;var $1=Q1,e0=Wt(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),$=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)($1,{ref:n,className:U(e0(),e),...t}));$.displayName=$1.displayName;var t0=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`textarea`,{className:U(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));t0.displayName=`Textarea`;var n0=`Tabs`,[r0,mte]=L(n0,[GY]),i0=GY(),[a0,o0]=r0(n0),s0=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=LY(s),[d,f]=Re({prop:r,onChange:i,defaultProp:a??``,caller:n0});return(0,I.jsx)(a0,{scope:n,baseId:Pa(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,I.jsx)(V.div,{dir:u,"data-orientation":o,...l,ref:t})})});s0.displayName=n0;var c0=`TabsList`,l0=_.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=o0(c0,n),o=i0(n);return(0,I.jsx)(rX,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,I.jsx)(V.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});l0.displayName=c0;var u0=`TabsTrigger`,d0=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=o0(u0,n),s=i0(n),c=m0(o.baseId,r),l=h0(o.baseId,r),u=r===o.value;return(0,I.jsx)(iX,{asChild:!0,...s,focusable:!i,active:u,children:(0,I.jsx)(V.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:j(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:j(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:j(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});d0.displayName=u0;var f0=`TabsContent`,p0=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=o0(f0,n),c=m0(s.baseId,r),l=h0(s.baseId,r),u=r===s.value,d=_.useRef(u);return _.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,I.jsx)(H,{present:i||u,children:({present:n})=>(0,I.jsx)(V.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});p0.displayName=f0;function m0(e,t){return`${e}-trigger-${t}`}function h0(e,t){return`${e}-content-${t}`}var g0=s0,_0=l0,v0=d0,y0=p0,b0=g0,x0=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(_0,{ref:n,className:U(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,e),...t}));x0.displayName=_0.displayName;var S0=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(v0,{ref:n,className:U(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-xs focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,e),...t}));S0.displayName=v0.displayName;var C0=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(y0,{ref:n,className:U(`mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));C0.displayName=y0.displayName;var w0={openai:`OpenAI`,anthropic:`Anthropic`,azure:`Azure OpenAI`,azure_openai:`Azure OpenAI`,google:`Google`};function T0(e){return w0[e]??e}var E0={openai:`bg-emerald-100 text-emerald-800`,anthropic:`bg-orange-100 text-orange-800`,azure:`bg-blue-100 text-blue-800`,azure_openai:`bg-blue-100 text-blue-800`,google:`bg-yellow-100 text-yellow-800`,custom:`bg-gray-100 text-gray-800`};function D0({provider:e}){return(0,I.jsx)(`span`,{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${E0[e]??E0.custom}`,children:T0(e)})}var O0=`Checkbox`,[k0,hte]=L(O0),[A0,j0]=k0(O0);function M0(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Re({prop:n,defaultProp:i??!1,onChange:c,caller:O0}),[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useRef(!1),b=!m||!!o||!!m.closest(`form`),x={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,required:l,defaultChecked:!V0(i)&&i,isFormControl:b,bubbleInput:g,setBubbleInput:v};return(0,I.jsx)(A0,{scope:t,...x,children:B0(d)?d(x):r})}var N0=`CheckboxTrigger`,P0=_.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=j0(N0,e),h=P(i,u),g=_.useRef(c);return _.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,I.jsx)(V.button,{type:`button`,role:`checkbox`,"aria-checked":V0(c)?`mixed`:c,"aria-required":l,"data-state":H0(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:j(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:j(n,e=>{d(e=>V0(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});P0.displayName=N0;var F0=_.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,I.jsx)(M0,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(P0,{...d,ref:t,__scopeCheckbox:n}),e&&(0,I.jsx)(z0,{__scopeCheckbox:n})]})})});F0.displayName=O0;var I0=`CheckboxIndicator`,L0=_.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=j0(I0,n);return(0,I.jsx)(H,{present:r||V0(a.checked)||a.checked===!0,children:(0,I.jsx)(V.span,{"data-state":H0(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});L0.displayName=I0;var R0=`CheckboxBubbleInput`,z0=_.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=j0(R0,e),m=P(n,p),h=QQ(a),g=nc(r);_.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=V0(a),n.call(e,!V0(a)&&a),e.dispatchEvent(t)}},[f,h,a,i]);let v=_.useRef(!V0(a)&&a);return(0,I.jsx)(V.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??v.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});z0.displayName=R0;function B0(e){return typeof e==`function`}function V0(e){return e===`indeterminate`}function H0(e){return V0(e)?`indeterminate`:e?`checked`:`unchecked`}var U0=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(F0,{ref:n,className:U(`peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,I.jsx)(L0,{className:U(`flex items-center justify-center text-current`),children:(0,I.jsx)(nn,{className:`h-4 w-4`})})}));U0.displayName=F0.displayName;var W0=`Collapsible`,[G0,gte]=L(W0),[K0,q0]=G0(W0),J0=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Re({prop:r,defaultProp:i??!1,onChange:o,caller:W0});return(0,I.jsx)(K0,{scope:n,disabled:a,contentId:Pa(),open:c,onOpenToggle:_.useCallback(()=>l(e=>!e),[l]),children:(0,I.jsx)(V.div,{"data-state":e2(c),"data-disabled":a?``:void 0,...s,ref:t})})});J0.displayName=W0;var Y0=`CollapsibleTrigger`,X0=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=q0(Y0,n);return(0,I.jsx)(V.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":e2(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:j(e.onClick,i.onOpenToggle)})});X0.displayName=Y0;var Z0=`CollapsibleContent`,Q0=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=q0(Z0,e.__scopeCollapsible);return(0,I.jsx)(H,{present:n||i.open,children:({present:e})=>(0,I.jsx)($0,{...r,ref:t,present:e})})});Q0.displayName=Z0;var $0=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=q0(Z0,n),[s,c]=_.useState(r),l=_.useRef(null),u=P(t,l),d=_.useRef(0),f=d.current,p=_.useRef(0),m=p.current,h=o.open||s,g=_.useRef(h),v=_.useRef(void 0);return _.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),Ae(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,I.jsx)(V.div,{"data-state":e2(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function e2(e){return e?`open`:`closed`}var t2=J0,n2=X0,r2=Q0;function i2(e){return e.length>0?`Tool sequence · ${e.join(` -> `)}`:`Tool sequence`}function a2({text:e,variant:t=`assistant`,className:n}){let r=o2(e);return(0,I.jsx)(`div`,{className:U(`space-y-2`,t===`system`&&`text-xs`,n),children:r.map((e,n)=>(0,I.jsx)(_.Fragment,{children:l2(e,n,t)},`md-${n}`))})}function o2(e){let t=e.replace(/\r\n/g,`
118
+ `).split(`
119
+ `),n=[],r=0,i=e=>e.trim()===``,a=e=>e.trimStart().startsWith("```");for(;r<t.length;){let e=t[r],o=e.trim();if(i(e)){r+=1;continue}if(a(e)){let e=o.replace(/^```/,``).trim()||void 0;r+=1;let i=[];for(;r<t.length&&!a(t[r]);)i.push(t[r]),r+=1;r<t.length&&a(t[r])&&(r+=1),n.push({type:`code`,lang:e,code:i.join(`
120
+ `)});continue}if(/^---+$/.test(o)||/^\*\*\*+$/.test(o)){n.push({type:`hr`}),r+=1;continue}if(o.startsWith(`>`)){let e=[];for(;r<t.length&&t[r].trim().startsWith(`>`);)e.push(t[r].trim().replace(/^>\s?/,``)),r+=1;n.push({type:`blockquote`,text:e.join(`
121
+ `)});continue}let s=o.match(/^(#{1,4})\s+(.+)$/);if(s){n.push({type:`heading`,level:s[1].length,text:s[2].trim()}),r+=1;continue}if(s2(t,r)){let e=c2(t[r]);r+=2;let a=[];for(;r<t.length&&t[r].includes(`|`)&&!i(t[r]);)a.push(c2(t[r])),r+=1;n.push({type:`table`,headers:e,rows:a});continue}let c=o.match(/^\d+\.\s+/),l=o.match(/^[-*+]\s+/);if(c||l){let e=!!c,a=[];for(;r<t.length;){let n=t[r].trim();if(e?/^\d+\.\s+/.test(n):/^[-*+]\s+/.test(n))a.push(n.replace(e?/^\d+\.\s+/:/^[-*+]\s+/,``)),r+=1;else{i(t[r])&&(r+=1);break}}n.push({type:`list`,ordered:e,items:a});continue}let u=[e];for(r+=1;r<t.length;){let e=t[r],n=e.trim();if(i(e)||a(e)||/^---+$/.test(n)||/^#{1,4}\s+/.test(n)||n.startsWith(`>`)||s2(t,r)||/^\d+\.\s+/.test(n)||/^[-*+]\s+/.test(n))break;u.push(e),r+=1}n.push({type:`paragraph`,text:u.join(`
122
+ `)})}return n}function s2(e,t){if(t+1>=e.length)return!1;let n=e[t].trim(),r=e[t+1].trim();return n.includes(`|`)?/^\|?(\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?$/.test(r):!1}function c2(e){return e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim())}function l2(e,t,n){if(e.type===`hr`)return(0,I.jsx)(`hr`,{className:`border-border/60`});if(e.type===`heading`){let n=e.level===1?`text-base font-semibold`:e.level===2?`text-sm font-semibold`:`text-sm font-medium`;return(0,I.jsx)(`h4`,{className:n,children:u2(e.text,`${t}-h`)})}if(e.type===`paragraph`)return(0,I.jsx)(`p`,{className:U(`whitespace-pre-wrap leading-relaxed`,n===`system`&&`leading-normal`),children:u2(e.text,`${t}-p`)});if(e.type===`blockquote`)return(0,I.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground italic`,children:u2(e.text,`${t}-bq`)});if(e.type===`code`)return(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/70`,children:[e.lang&&(0,I.jsx)(`div`,{className:`border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:e.lang}),(0,I.jsx)(`pre`,{className:`max-h-72 overflow-auto p-2 text-xs`,children:(0,I.jsx)(`code`,{children:e.code})})]});if(e.type===`list`){let n=e.ordered?`ol`:`ul`;return(0,I.jsx)(n,{className:U(`space-y-1 pl-5`,e.ordered?`list-decimal`:`list-disc`),children:e.items.map((e,n)=>(0,I.jsx)(`li`,{className:`leading-relaxed`,children:u2(e,`${t}-li-${n}`)},`${t}-li-${n}`))})}return e.type===`table`?(0,I.jsx)(`div`,{className:`overflow-x-auto rounded-md border`,children:(0,I.jsxs)(`table`,{className:`w-full min-w-[480px] border-collapse text-xs`,children:[(0,I.jsx)(`thead`,{className:`bg-muted/40`,children:(0,I.jsx)(`tr`,{children:e.headers.map((e,n)=>(0,I.jsx)(`th`,{className:`border-b px-2 py-1.5 text-left font-semibold align-top`,children:u2(e,`${t}-thc-${n}`)},`${t}-th-${n}`))})}),(0,I.jsx)(`tbody`,{children:e.rows.map((e,n)=>(0,I.jsx)(`tr`,{className:`border-t`,children:e.map((e,r)=>(0,I.jsx)(`td`,{className:`px-2 py-1.5 align-top`,children:u2(e,`${t}-tdc-${n}-${r}`)},`${t}-td-${n}-${r}`))},`${t}-row-${n}`))})]})}):null}function u2(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*|\*[^*\n]+\*|_[^_\n]+_|~~[^~\n]+~~|\[[^\]]+\]\([^)]+\))/g).filter(Boolean).map((e,n)=>{if(e.startsWith("`")&&e.endsWith("`"))return(0,I.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]`,children:e.slice(1,-1)},`${t}-${n}`);if(e.startsWith(`**`)&&e.endsWith(`**`))return(0,I.jsx)(`strong`,{children:e.slice(2,-2)},`${t}-${n}`);if(e.startsWith(`*`)&&e.endsWith(`*`)||e.startsWith(`_`)&&e.endsWith(`_`))return(0,I.jsx)(`em`,{children:e.slice(1,-1)},`${t}-${n}`);if(e.startsWith(`~~`)&&e.endsWith(`~~`))return(0,I.jsx)(`s`,{children:e.slice(2,-2)},`${t}-${n}`);let r=e.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return r?(0,I.jsx)(`a`,{href:r[2],target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,children:r[1]},`${t}-${n}`):(0,I.jsx)(_.Fragment,{children:e},`${t}-${n}`)})}function d2({message:e,className:t,assistantLabel:n,renderActions:r}){let i=e.role;if(i===`tool`){let n=String(e.text??``).trim();return/^(Approved|Denied) tool call\b/i.test(n)?null:(0,I.jsxs)(`div`,{className:U(`rounded-md border border-sky-500/30 bg-sky-500/10 px-3 py-2 text-sm`,t),children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wide text-sky-700`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),`Tool`,(0,I.jsx)(`span`,{className:`font-normal normal-case text-sky-700/80`,children:new Date(e.createdAt).toLocaleTimeString()})]}),(0,I.jsx)(`p`,{className:`whitespace-pre-wrap text-sky-900`,children:e.text})]})}if(i===`system`)return(0,I.jsxs)(`div`,{className:U(`flex items-start gap-2 text-xs`,t),children:[(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700`,children:(0,I.jsx)(Jn,{className:`h-3 w-3`})}),(0,I.jsx)(`div`,{className:`max-w-[92%] rounded-md border border-amber-400/30 bg-amber-50/70 p-3 text-sm`,children:(0,I.jsx)(a2,{text:e.text,variant:`assistant`})})]});let a=i===`user`,o=a?cr:$t;return(0,I.jsxs)(`div`,{className:U(`flex items-start gap-2 text-xs ${a?`justify-end`:`justify-start`}`,t),children:[!a&&(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700`,children:(0,I.jsx)(o,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`relative max-w-[92%]`,children:[(0,I.jsxs)(`div`,{className:`max-w-full wrap-break-word rounded-md border px-3 py-2 text-sm ${a?`border-primary/20 bg-primary/10`:`border-border/80 bg-background shadow-xs`}`,children:[!a&&n&&(0,I.jsx)(`p`,{className:`mb-2 text-[11px] font-semibold text-muted-foreground`,children:n}),a?(0,I.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.text}):(0,I.jsx)(a2,{text:e.text,variant:`assistant`,className:`text-sm`})]}),r]}),a&&(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary`,children:(0,I.jsx)(cr,{className:`h-3 w-3`})})]})}function f2({call:e,loading:t=!1,onApprove:n,onDeny:r,defaultOpen:i,className:a,description:o}){let s=e.status===`pending`,c=e.tool||e.publicToolName||`unknown_tool`;return(0,I.jsxs)(`details`,{open:i??s,className:U(`group overflow-hidden rounded-md border border-border/60 bg-background`,a),children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2`,children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:`Tool call ${c}`}),(0,I.jsx)(`span`,{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${s?`bg-amber-100 text-amber-900`:e.status===`error`?`bg-red-100 text-red-900`:e.status===`denied`?`bg-gray-100 text-gray-700`:`bg-muted text-muted-foreground`}`,children:s?`Needs approval`:e.status===`error`?`Error`:e.status===`denied`?`Denied`:`Approved`})]})}),(0,I.jsx)(rn,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,I.jsxs)(`div`,{className:`space-y-2 border-t border-border/50 px-3 py-2`,children:[o&&(0,I.jsx)(a2,{text:o,variant:`assistant`,className:`text-sm`}),(0,I.jsx)(`pre`,{className:`max-h-40 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre rounded border bg-muted/50 p-2 text-xs`,children:(0,I.jsx)(`code`,{children:JSON.stringify(e.arguments??{},null,2)})}),e.error&&(0,I.jsx)(`p`,{className:`text-xs text-destructive`,children:e.error}),s&&(0,I.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-xs`,disabled:t,onClick:()=>r?.(e.id),children:`Deny`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:t,onClick:()=>n?.(e.id),children:`Approve`})]})]})]})}function p2(){return(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700`,children:(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}),`Thinking...`]})]})}function m2({snippets:e,snippetsLabel:t,onSnippetSelect:n,disabled:r=!1,contentClassName:i=`w-[360px]`}){return(0,I.jsxs)(FQ,{children:[(0,I.jsx)(IQ,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 shrink-0 gap-1 px-1.5 text-[11px] font-normal text-muted-foreground/80 hover:text-muted-foreground`,disabled:r,children:[(0,I.jsx)(qn,{className:`h-3 w-3`}),`Snippets`,(0,I.jsx)(rn,{className:`h-3 w-3`})]})}),(0,I.jsxs)(zQ,{align:`start`,className:i,children:[(0,I.jsx)(UQ,{children:t}),(0,I.jsx)(WQ,{}),e.map(e=>(0,I.jsx)(BQ,{className:`items-start whitespace-normal px-2 py-2`,onSelect:()=>n(e.prompt),children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium leading-tight`,children:e.label}),(0,I.jsx)(`div`,{className:`text-[11px] leading-snug text-muted-foreground`,children:e.description})]})},e.label))]})]})}function h2({input:e,onInputChange:t,onSend:n,onCancel:r,inputPlaceholder:i,snippets:a,snippetsLabel:o,onSnippetSelect:s,loading:c=!1,disabled:l=!1,inputRef:u,snippetContentClassName:d}){let f=l||c;return(0,I.jsxs)(`div`,{className:`rounded-xl border bg-background p-2 shadow-xs`,children:[(0,I.jsx)(t0,{ref:u,value:e,onChange:e=>t(e.target.value),placeholder:i,disabled:l,rows:1,className:`min-h-10 max-h-40 resize-none border-0 bg-transparent px-2 py-1 text-sm shadow-none focus-visible:ring-0 focus-visible:ring-offset-0`,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),f||n())}}),(0,I.jsxs)(`div`,{className:`mt-1 flex items-center justify-between gap-2 px-1 pt-1`,children:[(0,I.jsx)(m2,{snippets:a,snippetsLabel:o,onSnippetSelect:s,disabled:f,contentClassName:d}),c&&r?(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`relative h-8 w-8 shrink-0 overflow-hidden rounded-full`,onClick:r,"aria-label":`Cancel assistant message`,title:`Cancel assistant message`,children:[(0,I.jsx)(`span`,{className:`pointer-events-none absolute inset-[2px] rounded-full border border-primary/20 border-t-primary/70 motion-reduce:animate-none animate-[spin_2.2s_linear_infinite]`}),(0,I.jsx)(`span`,{className:`pointer-events-none absolute inset-[4px] rounded-full border border-primary/10 motion-reduce:animate-none animate-pulse`}),(0,I.jsx)(rr,{className:`relative z-10 h-4 w-4`})]}):c?(0,I.jsx)(W,{type:`button`,size:`icon`,className:`h-8 w-8 shrink-0 rounded-full`,disabled:!0,"aria-label":`Assistant is loading`,title:`Assistant is loading`,children:(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`})}):(0,I.jsx)(W,{type:`button`,size:`icon`,className:`h-8 w-8 shrink-0 rounded-full pr-0.5`,onClick:n,disabled:f||!e.trim(),"aria-label":`Send assistant message`,title:`Send assistant message`,children:(0,I.jsx)(Qn,{className:`h-4 w-4`})})]})]})}var g2=ig,_2=og,v2=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(sg,{ref:n,className:U(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));v2.displayName=sg.displayName;var y2=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(_2,{children:[(0,I.jsx)(v2,{}),(0,I.jsxs)(cg,{ref:r,className:U(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,I.jsxs)(dg,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none`,children:[(0,I.jsx)(dr,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));y2.displayName=cg.displayName;var b2=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});b2.displayName=`DialogHeader`;var x2=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(lg,{ref:n,className:U(`text-lg font-semibold leading-none tracking-tight`,e),...t}));x2.displayName=lg.displayName;var S2=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(ug,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));S2.displayName=ug.displayName;function C2(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var w2=`ScrollArea`,[T2,_te]=L(w2),[E2,D2]=T2(w2),O2=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=_.useState(null),[l,u]=_.useState(null),[d,f]=_.useState(null),[p,m]=_.useState(null),[h,g]=_.useState(null),[v,y]=_.useState(0),[b,x]=_.useState(0),[S,C]=_.useState(!1),[w,T]=_.useState(!1),E=P(t,e=>c(e)),D=LY(i);return(0,I.jsx)(E2,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,I.jsx)(V.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":v+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})});O2.displayName=w2;var k2=`ScrollAreaViewport`,A2=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=D2(k2,n),s=P(t,_.useRef(null),o.onViewportChange);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,I.jsx)(V.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,I.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});A2.displayName=k2;var j2=`ScrollAreaScrollbar`,M2=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=D2(j2,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return _.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,I.jsx)(N2,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,I.jsx)(P2,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,I.jsx)(F2,{...r,ref:t,forceMount:n}):i.type===`always`?(0,I.jsx)(I2,{...r,ref:t}):null});M2.displayName=j2;var N2=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=D2(j2,e.__scopeScrollArea),[a,o]=_.useState(!1);return _.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,I.jsx)(H,{present:n||a,children:(0,I.jsx)(F2,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),P2=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=D2(j2,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=n4(()=>c(`SCROLL_END`),100),[s,c]=C2(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return _.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),_.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,I.jsx)(H,{present:n||s!==`hidden`,children:(0,I.jsx)(I2,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:j(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:j(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),F2=_.forwardRef((e,t)=>{let n=D2(j2,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=_.useState(!1),s=e.orientation===`horizontal`,c=n4(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return r4(n.viewport,c),r4(n.content,c),(0,I.jsx)(H,{present:r||a,children:(0,I.jsx)(I2,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),I2=_.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=D2(j2,e.__scopeScrollArea),a=_.useRef(null),o=_.useRef(0),[s,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Y2(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return Z2(e,o.current,s,t)}return n===`horizontal`?(0,I.jsx)(L2,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Q2(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,I.jsx)(R2,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Q2(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),L2=_.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=D2(j2,e.__scopeScrollArea),[o,s]=_.useState(),c=_.useRef(null),l=P(t,c,a.onScrollbarXChange);return _.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,I.jsx)(V2,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":X2(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),e4(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:J2(o.paddingLeft),paddingEnd:J2(o.paddingRight)}})}})}),R2=_.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=D2(j2,e.__scopeScrollArea),[o,s]=_.useState(),c=_.useRef(null),l=P(t,c,a.onScrollbarYChange);return _.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,I.jsx)(V2,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":X2(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),e4(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:J2(o.paddingTop),paddingEnd:J2(o.paddingBottom)}})}})}),[z2,B2]=T2(j2),V2=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=D2(j2,n),[m,h]=_.useState(null),g=P(t,e=>h(e)),v=_.useRef(null),y=_.useRef(``),b=p.viewport,x=r.content-r.viewport,S=pe(u),C=pe(c),w=n4(d,10);function T(e){if(v.current){let t=e.clientX-v.current.left,n=e.clientY-v.current.top;l({x:t,y:n})}}return _.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&S(e,x)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,m,x,S]),_.useEffect(C,[r,C]),r4(m,w),r4(p.content,w),(0,I.jsx)(z2,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:pe(a),onThumbPointerUp:pe(o),onThumbPositionChange:C,onThumbPointerDown:pe(s),children:(0,I.jsx)(V.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:j(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),v.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:j(e.onPointerMove,T),onPointerUp:j(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=``),v.current=null})})})}),H2=`ScrollAreaThumb`,U2=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=B2(H2,e.__scopeScrollArea);return(0,I.jsx)(H,{present:n||i.hasThumb,children:(0,I.jsx)(W2,{ref:t,...r})})}),W2=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=D2(H2,n),o=B2(H2,n),{onThumbPositionChange:s}=o,c=P(t,e=>o.onThumbChange(e)),l=_.useRef(void 0),u=n4(()=>{l.current&&=(l.current(),void 0)},100);return _.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{if(u(),!l.current){let t=t4(e,s);l.current=t,s()}};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,I.jsx)(V.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:j(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:j(e.onPointerUp,o.onThumbPointerUp)})});U2.displayName=H2;var G2=`ScrollAreaCorner`,K2=_.forwardRef((e,t)=>{let n=D2(G2,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,I.jsx)(q2,{...e,ref:t}):null});K2.displayName=G2;var q2=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=D2(G2,n),[a,o]=_.useState(0),[s,c]=_.useState(0),l=!!(a&&s);return r4(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),r4(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,I.jsx)(V.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function J2(e){return e?parseInt(e,10):0}function Y2(e,t){let n=e/t;return isNaN(n)?0:n}function X2(e){let t=Y2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Z2(e,t,n,r=`ltr`){let i=X2(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return $2([c,l],d)(e)}function Q2(e,t,n=`ltr`){let r=X2(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=GQ(e,n===`ltr`?[0,o]:[o*-1,0]);return $2([0,o],[0,s])(c)}function $2(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function e4(e,t){return e>0&&e<t}var t4=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function n4(e,t){let n=pe(e),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function r4(e,t){let n=pe(t);Ae(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var i4=O2,a4=A2,o4=K2,s4=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(i4,{ref:r,className:U(`relative overflow-hidden`,e),...n,children:[(0,I.jsx)(a4,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,I.jsx)(c4,{}),(0,I.jsx)(o4,{})]}));s4.displayName=i4.displayName;var c4=_.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,I.jsx)(M2,{ref:r,orientation:t,className:U(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-px`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-px`,e),...n,children:(0,I.jsx)(U2,{className:`relative flex-1 rounded-full bg-border`})}));c4.displayName=M2.displayName;function l4(e){return e instanceof Error&&e.name===`AbortError`||typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`}function u4(e,t,n){if(e.type===`agent_check`){let n=String(e.label??``).trim();return n?t.find(e=>e.type===`agent_check`&&e.label===n):void 0}if(e.type===`tool_input_contains`||e.type===`tool_input_regex`||e.type===`tool_input_jsonpath`)return t.filter(t=>t.type===e.type&&t.metadata?.tool===e.tool).find(t=>e.type===`tool_input_contains`?H_(e.value)!==void 0&&H_(t.metadata?.value)===H_(e.value):e.type===`tool_input_regex`?H_(e.value)!==void 0&&H_(t.metadata?.pattern)===H_(e.value):t.metadata?.path===e.path&&e.equals===void 0==(t.metadata?.equals===void 0)&&(e.equals===void 0||t.metadata?.equals===e.equals))??t.find(t=>t.type===e.type&&t.label===n(e));let r=n(e);return t.find(t=>t.type===e.type&&t.label===r)}function d4(e){return e===`not_evaluated`?`Not evaluated`:e===`not_executed`?`Not executed`:e===`passed`?`Passed`:`Failed`}function f4({evalRules:e,failureReasons:t,runError:n,checkResults:r}){return n||t.find(e=>e.startsWith(`Scenario error:`))?e.map(e=>({rule:e,status:`not_executed`,failureReason:void 0})):r?.length?e.map(e=>{let t=u4(e,r,p4);return{rule:e,status:t?.status??`not_executed`,failureReason:t?.reason}}):e.map(e=>{let n=h4(e,t);return{rule:e,status:n?`failed`:`passed`,failureReason:n}})}function p4(e){return e.type===`required_tool`?`Required tool · ${e.value}`:e.type===`forbidden_tool`?`Forbidden tool · ${e.value}`:e.type===`tool_sequence`?B_(e.sequence??[]):e.type===`tool_input_contains`?L_({type:`contains`,tool:String(e.tool??``),value:String(e.value??``)}):e.type===`tool_input_regex`?L_({type:`regex`,tool:String(e.tool??``),pattern:String(e.value??``)}):e.type===`tool_input_jsonpath`?L_({type:`jsonpath`,tool:String(e.tool??``),path:String(e.path??``),...e.equals===void 0?{}:{equals:e.equals}}):e.type===`response_contains`?`Text contains · ${e.value}`:e.type===`response_not_contains`?`Text does not contain · ${e.value}`:e.type===`response_starts_with`?`Text starts with · ${e.value}`:e.type===`response_ends_with`?`Text ends with · ${e.value}`:e.type===`response_equals`?`Text equals · ${e.value}`:e.type===`response_regex`?`Text matches regex · ${e.value}`:e.type===`response_jsonpath`?e.equals===void 0?`JSONPath exists · ${e.path}`:`JSONPath equals · ${e.path} == ${String(e.equals)}`:e.type===`response_jsonpath_exists`?`JSONPath exists · ${e.path}`:e.type===`response_jsonpath_not_exists`?`JSONPath not exists · ${e.path}`:e.type===`agent_check`?`Agent check · ${e.label}`:`${e.type} · ${e.value}`}function m4(e){return B_(e).replace(/^Tool sequence · /,``)}function h4(e,t){if(e.type===`tool_input_contains`||e.type===`tool_input_regex`||e.type===`tool_input_jsonpath`){let n=e.type===`tool_input_contains`?{type:`contains`,tool:String(e.tool??``),value:String(e.value??``)}:e.type===`tool_input_regex`?{type:`regex`,tool:String(e.tool??``),pattern:String(e.value??``)}:{type:`jsonpath`,tool:String(e.tool??``),path:String(e.path??``),...e.equals===void 0?{}:{equals:e.equals}},r=[z_(n,`tool_not_used`),z_(n,`input_mismatch`),z_(n,`invalid_regex`),z_(n,`invalid_jsonpath`),z_(n,`serialization`)];return t.find(e=>r.includes(e))}if(e.type===`response_jsonpath_exists`){let n=String(e.path??``).trim();return n?t.find(e=>e.startsWith(`JSONPath assertion failed: ${n}`)||e.startsWith(`JSONPath assertion failed: invalid JSON for path ${n}`)):void 0}let n=H_(e.value);if((e.type===`response_contains`||e.type===`response_not_contains`||e.type===`response_starts_with`||e.type===`response_ends_with`||e.type===`response_equals`||e.type===`response_regex`)&&n===void 0)return;let r=e.type===`required_tool`?`Required tool not used: ${e.value}`:e.type===`forbidden_tool`?`Forbidden tool used: ${e.value}`:e.type===`tool_sequence`?`Tool sequence order was not satisfied: ${(e.sequence??[]).join(` -> `)}`:e.type===`response_contains`?`Contains assertion failed: ${n}`:e.type===`response_not_contains`?`Not-contains assertion failed: ${n}`:e.type===`response_starts_with`?`Starts-with assertion failed: ${n}`:e.type===`response_ends_with`?`Ends-with assertion failed: ${n}`:e.type===`response_equals`?`Equals assertion failed: ${n}`:e.type===`response_regex`?`Regex assertion failed: ${n}`:e.type===`response_jsonpath`?e.equals===void 0?`JSONPath assertion failed: ${e.path}`:`JSONPath equals assertion failed: ${e.path}`:e.type===`response_jsonpath_not_exists`?`JSONPath not-exists assertion failed: ${e.path}`:e.type===`agent_check`?String(e.label??``):``;if(!r)return;let i=t.find(e=>e===r);if(i)return i;if(e.type===`response_regex`){let e=n??``;return e?t.find(t=>t.startsWith(`Regex assertion failed:`)&&t.includes(e)):void 0}return e.type===`response_jsonpath`||e.type===`response_jsonpath_not_exists`?t.find(t=>t.includes(e.path??``)):e.type===`tool_sequence`?t.find(t=>t.startsWith(`Tool sequence order was not satisfied: ${m4(e.sequence??[])}`)||t.startsWith(`Required tool in sequence not used:`)):t.find(e=>e.startsWith(r))}async function g4(e){let{sessionId:t,source:n,serverName:r,onLaunchUrl:i,timeoutMs:a=3e5}=e,o=Date.now()+a,s=!1;for(;Date.now()<o;){let{session:e}=await n.getOAuthRuntimeSession(t),a=e.authorizeLaunchUrl||e.authorizationUrl||``;if(a&&i&&i(a),e.status===`completed`&&e.hasAccessToken){s=!0;break}if(e.status===`error`||e.status===`stopped`)throw Error(`OAuth login failed for '${r}' (${e.status}). ${e.lastError||``}`.trim());await new Promise(e=>setTimeout(e,1500))}if(!s)throw Error(`OAuth login timed out for '${r}'. Authorization was not completed within 5 minutes.`)}var _4=250;async function v4(e){let{serverNames:t,source:n,onServerAuthStart:r,onServerStatus:i,timeoutMs:a=3e5}=e,o=Array.from(new Set(t.filter(Boolean)));if(o.length===0)return;let s=Date.now()+a,c=new Set,l=new Map;for(;Date.now()<s;){let e=await n.ensureOAuthServers({serverNames:o});for(let t of e.servers){let e=`${t.status}:${t.debugState??``}:${t.runtimeSessionId??``}`;l.get(t.serverName)!==e&&(l.set(t.serverName,e),i?.({serverName:t.serverName,status:t.status,debugState:t.debugState,tokenExpiresAt:t.tokenExpiresAt,tokenExpiresInSeconds:t.tokenExpiresInSeconds,message:t.message}))}let t=e.servers.filter(e=>e.status===`auth_required`);if(t.length===0&&e.allReady)return;for(let e of t){let t=e.runtimeSessionId;if(!t)throw Error(e.message||`OAuth login required for '${e.serverName}'.`);c.has(t)||(c.add(t),r?.(e.serverName));let i=(()=>{let e=!1;return t=>{if(e||!t)return;e=!0;let n=t.startsWith(`http`)?t:`${window.location.origin}${t}`;window.open(n,`_blank`,`noopener,noreferrer`)}})();i(e.authorizeLaunchUrl||e.authorizationUrl||``),await g4({sessionId:t,source:n,serverName:e.serverName,onLaunchUrl:i,timeoutMs:Math.max(1e4,s-Date.now())})}await new Promise(e=>{window.setTimeout(e,_4)})}throw Error(`OAuth login timed out before all required servers were authorized.`)}var y4=[{label:`Suggest Checks`,description:`Propose stronger evaluation checks for this scenario.`,prompt:`Review the current checks in this scenario and suggest stronger alternatives. For each suggestion, explain what failure mode it catches that the existing checks miss. Prioritize checks that are deterministic, not sensitive to minor phrasing changes, and that would reliably catch regressions.`},{label:`Suggest Value Capture Rules`,description:`Recommend extract/value capture rules for key outputs.`,prompt:`Analyze the expected tool calls and outputs in this scenario and suggest value capture rules that extract the most meaningful structured data. For each rule, explain which field to capture, why it matters for evaluation, and what a good vs. bad captured value looks like.`},{label:`Generate Structured Updates`,description:`Return apply-ready Checks and Value Capture suggestions.`,prompt:[`Propose concrete scenario updates and include structured suggestions that can be applied directly.`,`Return ONLY valid JSON envelope and no markdown.`,`Required shape:`,`{"type":"assistant_message","text":"short rationale","suggestions":{"evalRules":{"replacement":[...]}, "extractRules":{"replacement":[...]}}}`,`If tool usage is clear, include at least one required_tool check.`,`For argument validation, use tool_input_contains with tool and value, tool_input_regex with tool and value, or tool_input_jsonpath with tool and path plus optional equals.`,`Prefer deterministic checks and concise capture patterns.`].join(`
123
+ `)},{label:`Improve Prompt Determinism`,description:`Reduce ambiguity and improve reproducibility.`,prompt:`Identify parts of this scenario's prompt or context that are ambiguous, open-ended, or likely to produce different results across runs. Suggest specific rewrites that make the expected behavior more deterministic — without changing the intent of what is being tested.`},{label:`Generate Scenario Draft`,description:`Create a draft scenario from the current context.`,prompt:`Based on the current tool configuration and context, generate a complete scenario draft. Include a clear prompt, realistic expected tool calls with arguments, meaningful checks that validate the core behavior, and at least one value capture rule. Explain your choices so I can adjust them.`}];function b4(e){if(Array.isArray(e.sequence))return e.sequence.map(e=>e.trim()).filter(Boolean);let t=typeof e.value==`string`?e.value.trim():``;return!t||t.toLowerCase()===`tool sequence`?[]:t.split(/\s*(?:->|,|\n)\s*/).map(e=>e.trim()).filter(Boolean)}function x4(e){let t=[],n=0;for(let r of e)if(r.type===`tool_sequence`){let e=b4(r);e.length>0?t.push({type:`tool_sequence`,sequence:e}):n+=1}else t.push(r);return{rules:t,skippedToolSequences:n}}function S4(e){if(e.type===`tool_sequence`){let t=b4(e);return t.length>0?`Tool sequence · ${t.join(` -> `)}`:`Tool sequence · No tool steps`}return p4(e)}function C4({open:e,onOpenChange:t,configId:n,configPath:r,scenario:i,agents:a,servers:o,defaultAssistantAgentName:s,initialUserMessage:c,onApplyPatch:l}){let{source:u}=Mv(),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(new Set),w=(0,_.useRef)(null),T=(0,_.useRef)(null),E=(0,_.useRef)(null),D=(0,_.useRef)(null),k=(0,_.useRef)(0),[A,j]=(0,_.useState)(!1),M=(0,_.useRef)(!1),N=s||a[0]?.id||``,P=(0,_.useCallback)(()=>{let e=D.current;e&&e.controller.abort()},[]);(0,_.useEffect)(()=>{if(!e||!N||d)return;let t=!1;return y(!0),(async()=>{await v4({serverNames:Array.from(new Set(i.serverIds.filter(e=>o.find(t=>t.id===e)?.authType===`oauth2`))),source:u});let e=await u.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:i.id,selectedAssistantAgentName:N,context:{scenario:{id:i.id,name:i.name,prompt:i.prompt,serverNames:i.serverIds,evalRules:i.evalRules,extractRules:i.extractRules},availableServers:o.map(e=>({name:e.name||e.id,url:e.url})),availableAgents:a.map(e=>({name:e.name||e.id,provider:e.provider,model:e.model}))}});t||(f(e.sessionId),ee(e.session),y(!1))})().catch(e=>{t||O({title:`Could not start Scenario Assistant`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}).finally(()=>{t||y(!1)}),()=>{t=!0}},[e,u,d,n,r,i,a,o,N]);let F=()=>{P(),f(null),m(null),g(``),C(new Set),E.current=null},ee=(0,_.useCallback)(e=>{m(t=>t&&t.messages.length>e.messages.length?t:e)},[]),L=(0,_.useCallback)(()=>{let e=D.current;e&&(P(),g(e.prompt),y(!1),x(!1))},[P]),R=e=>{F(),u.closeScenarioAssistantSession(e).catch(()=>{})};(0,_.useEffect)(()=>{e||d&&(M.current||A||R(d))},[e,d,u,A]),(0,_.useEffect)(()=>()=>{P(),d&&u.closeScenarioAssistantSession(d).catch(()=>{})},[P,d,u]),(0,_.useEffect)(()=>{if(!e)return;A&&j(!1),M.current&&=!1;let t=window.setTimeout(()=>{w.current?.scrollIntoView({behavior:`smooth`,block:`end`})},0);return()=>window.clearTimeout(t)},[e,v,p?.messages.length,p?.pendingToolCalls.length,p?.warnings.length]),(0,_.useEffect)(()=>{let e=T.current;if(!e)return;e.style.height=`0px`;let t=Math.min(e.scrollHeight,160);e.style.height=`${Math.max(40,t)}px`},[h,e]);let z=a.length>0&&i.serverIds.length>0&&!!N,te=async e=>{if(!d)return;let t=e.trim();if(!t)return;let n=++k.current,r=new AbortController,i=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,a={id:i,role:`user`,text:t,createdAt:new Date().toISOString()};D.current={id:n,controller:r,prompt:t},x(!0),m(e=>e&&{...e,messages:[...e.messages,a]}),g(``),y(!0);try{let e=await u.sendScenarioAssistantMessage(d,t,r.signal);if(r.signal.aborted||D.current?.id!==n)return;ee(e.session)}catch(e){if(l4(e)||r.signal.aborted||D.current?.id!==n)return;m(e=>e&&{...e,messages:e.messages.filter(e=>e.id!==i)}),g(e=>e.trim()?e:t),O({title:`Scenario Assistant error`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{D.current?.id===n&&(D.current=null,y(!1),x(!1))}},ne=e=>{g(e),requestAnimationFrame(()=>T.current?.focus())};(0,_.useEffect)(()=>{if(!e||!d||!p||!z||D.current)return;let t=String(c??``).trim();t&&E.current!==t&&(E.current=t,te(t))},[e,d,p,z,c]),(0,_.useEffect)(()=>{if(e&&d&&p)return u.subscribeScenarioAssistantSessionEvents(d,e=>{ee(e.payload.session)})},[e,d,u,ee]);let re=async e=>{if(d){y(!0);try{let t=await u.approveScenarioAssistantToolCall(d,e);ee(t.session)}catch(e){O({title:`Tool call failed`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{y(!1)}}},ie=async e=>{if(d){y(!0);try{let t=await u.denyScenarioAssistantToolCall(d,e);ee(t.session)}catch(e){O({title:`Could not deny tool call`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{y(!1)}}},ae=async()=>{if(d){y(!0);try{let e=await u.approveAllScenarioAssistantToolCalls(d);ee(e.session)}catch(e){O({title:`Could not approve all tool calls`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{y(!1)}}},oe=(e,t,n,r,a=`replace`)=>{if(t){if(n===`prompt`&&t.prompt&&l({prompt:t.prompt.replacement}),n===`evalRules`&&t.evalRules){let e=x4(r??t.evalRules.replacement);l({evalRules:a===`append`?[...i.evalRules,...e.rules]:e.rules}),e.skippedToolSequences>0&&O({title:`Skipped invalid tool sequence`,description:`The assistant suggested a sequence check without any tool steps.`,variant:`destructive`})}if(n===`extractRules`&&t.extractRules&&l({extractRules:t.extractRules.replacement}),e){let t=`${e}:${n}`;C(e=>new Set([...e,t]))}O({title:`Applied suggestion`,description:`Updated ${{prompt:`Prompt`,evalRules:`Checks`,extractRules:`Value Capture Rules`}[n]}`})}},se=(e,t,n,r)=>{if(t?.extractRules){if(l({extractRules:r===`append`?[...i.extractRules,...n]:n}),e){let t=`${e}:extractRules`;C(e=>new Set([...e,t]))}O({title:`Applied suggestion`,description:`Updated Value Capture Rules`})}},ce=()=>{let e=document.activeElement;e instanceof HTMLElement&&e.blur()};return(0,I.jsxs)(I.Fragment,{children:[!e&&d&&(0,I.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2 rounded-md border bg-background px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Scenario Assistant (session active)`}),(0,I.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[`Resume conversation for `,(0,I.jsx)(`span`,{className:`font-mono`,children:i.id}),p?` · ${p.messages.length} messages`:``]})]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>t(!0),children:[(0,I.jsx)(tr,{className:`mr-1.5 h-3.5 w-3.5`}),`Resume`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-8 px-2 text-muted-foreground`,onClick:()=>{ce(),M.current=!1,j(!1),d&&R(d)},"aria-label":`Discard assistant session`,title:`Discard assistant session`,children:(0,I.jsx)(dr,{className:`h-4 w-4`})})]})]}),(0,I.jsx)(g2,{open:e,onOpenChange:e=>{e||(ce(),j(!1),M.current=!1),t(e)},children:(0,I.jsxs)(y2,{className:`max-w-6xl h-[85vh] flex flex-col`,children:[d&&(0,I.jsxs)(`button`,{type:`button`,className:`absolute right-12 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2`,onClick:()=>{ce(),M.current=!0,j(!0),t(!1)},"aria-label":`Minimize assistant`,title:`Minimize assistant`,children:[(0,I.jsx)(Rn,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Minimize`})]}),(0,I.jsx)(b2,{className:`pr-20`,children:(0,I.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(x2,{className:`flex items-center gap-2`,children:[(0,I.jsx)(tr,{className:`h-4 w-4`}),`Scenario Assistant`]}),(0,I.jsx)(S2,{children:`LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval.`})]})})}),z?(0,I.jsxs)(`div`,{className:`min-h-0 flex flex-1 flex-col gap-3`,children:[(0,I.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-1`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`MCP Context`}),(0,I.jsxs)(`div`,{className:`h-8 rounded-md border px-2 text-xs flex items-center gap-2`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),p?`Loaded ${p.toolsLoaded} tools`:`Preparing...`]})]})}),(0,I.jsx)(s4,{className:`min-h-0 flex-1 rounded-md border p-3`,children:(0,I.jsxs)(`div`,{className:`space-y-3`,children:[p?.warnings?.map((e,t)=>(0,I.jsx)(`div`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900`,children:e},`${e}-${t}`)),p?.messages.map(e=>(0,I.jsxs)(_.Fragment,{children:[(()=>{let t=e.pendingToolCallIds??(e.pendingToolCallId?[e.pendingToolCallId]:[]),n=t.map(e=>(p?.pendingToolCalls??[]).find(t=>t.id===e)).filter(e=>!!e),r=t.map(e=>p.pendingToolCalls.find(t=>t.id===e)??p.pendingToolCalls.find(t=>t.id===e)).filter(Boolean);if(!(e.role===`assistant`&&t.length>0))return(0,I.jsx)(`div`,{className:`space-y-2`,children:(0,I.jsx)(D4,{message:e})});let i=n.length,a=r.length-i;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700`,children:(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`w-full max-w-[92%] space-y-2`,children:[r.length>1&&i>0&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border border-amber-200 bg-amber-50/50 px-3 py-1.5`,children:[(0,I.jsxs)(`span`,{className:`text-xs text-amber-900`,children:[a,` of `,r.length,` tool calls resolved`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:i===0,onClick:()=>void ae(),children:[`Approve All (`,i,`)`]})]}),r.map((t,n)=>(0,I.jsx)(f2,{call:t,loading:v,description:n===0?e.text:void 0,onApprove:e=>void re(e),onDeny:e=>void ie(e)},t.id))]})]})})(),e.suggestions&&(0,I.jsxs)(`div`,{className:`ml-0 space-y-3 rounded-md border border-dashed bg-muted/10 p-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,I.jsx)(tr,{className:`h-3.5 w-3.5`}),`Structured Suggestions`]}),e.suggestions.prompt&&(0,I.jsx)(w4,{title:`Prompt`,rationale:e.suggestions.prompt.rationale,preview:e.suggestions.prompt.replacement,applied:S.has(`${e.id}:prompt`),onApply:()=>oe(e.id,e.suggestions,`prompt`)}),e.suggestions.evalRules&&(0,I.jsx)(T4,{rationale:e.suggestions.evalRules.rationale,rules:e.suggestions.evalRules.replacement,applied:S.has(`${e.id}:evalRules`),onApply:t=>oe(e.id,e.suggestions,`evalRules`,t,`append`),onReplace:t=>oe(e.id,e.suggestions,`evalRules`,t,`replace`)}),e.suggestions.extractRules&&(0,I.jsx)(E4,{rationale:e.suggestions.extractRules.rationale,rules:e.suggestions.extractRules.replacement,applied:S.has(`${e.id}:extractRules`),onApply:t=>se(e.id,e.suggestions,t,`append`),onReplace:t=>se(e.id,e.suggestions,t,`replace`)}),(()=>{let t=e.suggestions?.notes,n=Array.isArray(t)?t:typeof t==`string`?[t]:[];return n.length===0?null:(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,children:[(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:`Notes`}),(0,I.jsx)(`ul`,{className:`space-y-1 text-xs text-muted-foreground list-disc pl-4`,children:n.map((t,n)=>(0,I.jsx)(`li`,{children:t},`${e.id}-note-${n}`))})]})})()]})]},e.id)),(p?.pendingToolCalls??[]).filter(e=>!(p?.messages??[]).some(t=>t.pendingToolCallId===e.id||t.pendingToolCallIds?.includes(e.id))).map(e=>(0,I.jsx)(f2,{call:e,loading:v,onApprove:e=>void re(e),onDeny:e=>void ie(e)},e.id)),!p&&v&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}),`Starting assistant session...`]}),p&&v&&(0,I.jsx)(p2,{}),(0,I.jsx)(`div`,{ref:w})]})}),(0,I.jsx)(h2,{input:h,onInputChange:g,onSend:()=>void te(h),onCancel:d&&b?L:void 0,inputPlaceholder:`Get assistance with creating or refining this scenario ...`,snippets:y4,snippetsLabel:`Scenario Assistant Snippets`,onSnippetSelect:ne,loading:v,disabled:!d,inputRef:T,snippetContentClassName:`w-[320px]`})]}):(0,I.jsx)(`div`,{className:`rounded-md border p-3 text-sm text-muted-foreground`,children:`Scenario Assistant requires a configured assistant agent and at least one selected server on the scenario.`})]})})]})}function w4({title:e,rationale:t,preview:n,applied:r=!1,onApply:i}){return(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3 ${r?`border-emerald-300 bg-emerald-50/40`:``}`,children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:e})}),t&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}),(0,I.jsx)(`pre`,{className:`max-h-56 overflow-auto rounded bg-muted p-2 text-xs whitespace-pre-wrap`,children:n}),(0,I.jsx)(`div`,{className:`flex justify-end`,children:(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,variant:r?`secondary`:`default`,onClick:i,disabled:r,children:r?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(ln,{className:`mr-1.5 h-3.5 w-3.5`}),`Applied`]}):`Apply`})})]})}function T4({rationale:e,rules:t,applied:n=!1,onApply:r,onReplace:i}){let[a,o]=(0,_.useState)(()=>new Set(t.map((e,t)=>t))),s=a.size,c=t.filter((e,t)=>a.has(t)),l=s===t.length,u=(e,t)=>{o(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})};return(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3 ${n?`border-emerald-300 bg-emerald-50/40`:``}`,children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:`Checks`})}),e&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsxs)(`div`,{className:`space-y-2 rounded bg-muted/60 p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[(0,I.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[s,` of `,t.length,` selected`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-6 px-2 text-[11px]`,disabled:n||t.length===0,onClick:()=>o(l?new Set:new Set(t.map((e,t)=>t))),children:l?`Unselect all`:`Select all`})]}),t.map((e,t)=>{let r=S4(e),i=`scenario-assistant-check-${t}-${e.type}`;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 rounded bg-background p-2`,children:[(0,I.jsx)(U0,{id:i,checked:a.has(t),disabled:n,onCheckedChange:e=>u(t,e===!0),"aria-label":`Select ${r}`}),(0,I.jsxs)(`label`,{htmlFor:i,className:`min-w-0 flex-1 cursor-pointer space-y-1`,children:[(0,I.jsx)(`span`,{className:`block text-xs font-medium`,children:r}),(0,I.jsx)(`code`,{className:`block wrap-break-word rounded bg-muted px-1.5 py-1 text-[11px] text-muted-foreground`,children:JSON.stringify(e)})]})]},`${e.type}-${t}`)})]}),(0,I.jsx)(`div`,{className:`flex justify-end gap-2`,children:n?(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`secondary`,disabled:!0,children:[(0,I.jsx)(ln,{className:`mr-1.5 h-3.5 w-3.5`}),`Applied`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,variant:`outline`,onClick:()=>i(c),disabled:s===0,children:`Replace all`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,onClick:()=>r(c),disabled:s===0,children:`Add selected`})]})})]})}function E4({rationale:e,rules:t,applied:n=!1,onApply:r,onReplace:i}){let[a,o]=(0,_.useState)(()=>new Set(t.map((e,t)=>t))),s=a.size,c=t.filter((e,t)=>a.has(t)),l=s===t.length,u=(e,t)=>{o(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})};return(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3 ${n?`border-emerald-300 bg-emerald-50/40`:``}`,children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:`Value Capture Rules`})}),e&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsxs)(`div`,{className:`space-y-2 rounded bg-muted/60 p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[(0,I.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[s,` of `,t.length,` selected`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-6 px-2 text-[11px]`,disabled:n||t.length===0,onClick:()=>o(l?new Set:new Set(t.map((e,t)=>t))),children:l?`Unselect all`:`Select all`})]}),t.map((e,t)=>{let r=`${e.name} · ${e.pattern}`,i=`scenario-assistant-extract-${t}-${e.name}`;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 rounded bg-background p-2`,children:[(0,I.jsx)(U0,{id:i,checked:a.has(t),disabled:n,onCheckedChange:e=>u(t,e===!0),"aria-label":`Select ${r}`}),(0,I.jsxs)(`label`,{htmlFor:i,className:`min-w-0 flex-1 cursor-pointer space-y-1`,children:[(0,I.jsx)(`span`,{className:`block text-xs font-medium`,children:r}),(0,I.jsx)(`code`,{className:`block wrap-break-word rounded bg-muted px-1.5 py-1 text-[11px] text-muted-foreground`,children:JSON.stringify(e)})]})]},`${e.name}-${t}`)})]}),(0,I.jsx)(`div`,{className:`flex justify-end gap-2`,children:n?(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`secondary`,disabled:!0,children:[(0,I.jsx)(ln,{className:`mr-1.5 h-3.5 w-3.5`}),`Applied`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,variant:`outline`,onClick:()=>i(c),disabled:s===0,children:`Replace all`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,onClick:()=>r(c),disabled:s===0,children:`Add selected`})]})})]})}function D4({message:e}){let t=async e=>{try{await navigator.clipboard.writeText(e),O({title:`Copied`})}catch(e){O({title:`Could not copy`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},n=e.role===`user`||e.role===`assistant`,r=e.role===`user`;return(0,I.jsx)(d2,{message:e,assistantLabel:e.role===`assistant`?`Assistant`:void 0,renderActions:n?(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute bottom-1 h-6 w-6 text-muted-foreground ${r?`-left-8`:`-right-8`}`,onClick:()=>void t(e.text),"aria-label":`Copy message`,title:`Copy message`,children:(0,I.jsx)(hn,{className:`h-3.5 w-3.5`})}):void 0})}function O4(e){return typeof e==`number`?e.toLocaleString():`n/a`}function k4(e,t){let n=t?.nonPositiveLabel??`0s`;if(!Number.isFinite(e)||e<=0)return n;let r=Math.floor(e),i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60;return i>0?`${i}h ${a}m ${o}s`:a>0?`${a}m ${o}s`:`${o}s`}function A4({run:e,fallbackUserPrompt:t}){let[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(!1);return(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(t2,{open:n,onOpenChange:r,children:(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-card p-2`,children:[(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,className:`mb-2 flex w-full items-center justify-between gap-2 text-left`,children:(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${n?`rotate-180`:``}`}),(0,I.jsx)($t,{className:`h-3.5 w-3.5`}),`Final answer`]})})}),(0,I.jsx)(r2,{children:(0,I.jsx)(F4,{text:e.finalAnswer||`No final answer captured.`,maxLength:1200,className:`text-xs text-foreground`})})]})}),(0,I.jsx)(t2,{open:i,onOpenChange:a,children:(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-card p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${i?`rotate-180`:``}`}),(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Conversation trace`})]})}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:[e.toolCalls.length,` tool calls`]})]}),(0,I.jsx)(r2,{children:(0,I.jsx)(`div`,{className:`space-y-2 rounded-md border bg-muted/20 p-2`,children:e.conversation.length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No conversation trace captured.`}):e.conversation.map(e=>(0,I.jsx)(j4,{item:e,fallbackUserPrompt:t},e.id))})})]})})]})}function j4({item:e,fallbackUserPrompt:t}){if(e.kind===`tool_call`){let t=M4(e,`input`);return(0,I.jsx)(P4,{variant:`call`,title:`Tool call · ${e.toolName||`unknown`}${t}`,text:e.text})}if(e.kind===`tool_result`){let t=M4(e,`output`),n=e.ok?(0,I.jsx)(ln,{className:`h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300`}):(0,I.jsx)(dn,{className:`h-3.5 w-3.5 text-rose-700 dark:text-rose-300`});return(0,I.jsx)(P4,{variant:e.ok?`result_ok`:`result_error`,title:`Tool result · ${e.toolName||`unknown`} · ${e.ok?`ok`:`error`}${typeof e.durationMs==`number`?` · ${e.durationMs}ms`:``}${t}`,text:e.text,icon:n})}let n=e.kind===`user_prompt`,r=N4(e.text,e.kind),i=t?N4(t,`user_prompt`):``,a=n&&!r&&i?i:r,o=n?`User prompt`:e.kind===`assistant_final`?`Agent final`:`Agent`,s=n?cr:$t;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 text-xs ${n?`justify-end`:`justify-start`}`,children:[!n&&(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`,children:(0,I.jsx)(s,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`max-w-[90%] rounded-md p-2 ${n?`bg-primary/10`:`bg-muted/50`}`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?`text-right`:``}`,children:o}),n?(0,I.jsx)(F4,{text:a,maxLength:280,className:`text-xs`}):(0,I.jsx)(F4,{text:a,maxLength:500,className:`text-xs`})]}),n&&(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary`,children:(0,I.jsx)(s,{className:`h-3 w-3`})})]})}function M4(e,t){let n=t===`input`?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n==`number`?` · estimated ${O4(n)} tokens`:``}function N4(e,t){let n=String(e??``).replace(/^\s+/,``);return t===`user_prompt`?n.replace(/^user:\s*/i,``):t===`assistant_final`||t===`assistant_thought`?n.replace(/^assistant:\s*/i,``):n}function P4({variant:e,title:t,text:n,icon:r}){let[i,a]=(0,_.useState)(!1);return(0,I.jsx)(t2,{open:i,onOpenChange:a,children:(0,I.jsxs)(`div`,{className:`rounded-md border p-2 text-xs ${{call:`border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300`,result_ok:`border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`,result_error:`border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-300`}[e]}`,children:[(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-[11px]`,children:[r??(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{children:t})]}),(0,I.jsx)(`span`,{className:`text-[11px] font-semibold`,children:i?`Hide content`:`Show content`})]})}),(0,I.jsx)(r2,{children:(0,I.jsx)(`p`,{className:`mt-2 font-mono whitespace-pre-wrap text-foreground`,children:n})})]})})}function F4({text:e,maxLength:t,className:n}){let[r,i]=(0,_.useState)(!1),a=e.length>t,o=r||!a?e:`${e.slice(0,t)}...`;return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(a2,{text:o,className:n}),a&&(0,I.jsx)(`button`,{type:`button`,className:`mt-1 text-[11px] font-medium text-primary hover:underline`,onClick:()=>i(e=>!e),children:r?`Show less`:`Show all`})]})}var I4=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`],L4=[`application/pdf`,`text/plain`,`text/markdown`,`text/csv`];function R4(e){return I4.includes(e)||L4.includes(e)}function z4({value:e,onValueChange:t,className:n,hideToolSequence:r=!1}){return(0,I.jsxs)(T1,{value:e,onValueChange:e=>t(e),children:[(0,I.jsx)(D1,{className:n,children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`required_tool`,children:`Required Tool`}),(0,I.jsx)(Q,{value:`forbidden_tool`,children:`Forbidden Tool`}),!r&&(0,I.jsx)(Q,{value:`tool_sequence`,children:`Tool Sequence`}),(0,I.jsx)(Q,{value:`agent_check`,children:`Judge Agent`}),(0,I.jsx)(Q,{value:`response_contains`,children:`Text contains`}),(0,I.jsx)(Q,{value:`response_not_contains`,children:`Text does not contain`}),(0,I.jsx)(Q,{value:`response_starts_with`,children:`Text starts with`}),(0,I.jsx)(Q,{value:`response_ends_with`,children:`Text ends with`}),(0,I.jsx)(Q,{value:`response_equals`,children:`Text equals`}),(0,I.jsx)(Q,{value:`response_regex`,children:`Text matches regex`}),(0,I.jsx)(Q,{value:`tool_input_contains`,children:`Tool input contains`}),(0,I.jsx)(Q,{value:`tool_input_regex`,children:`Tool input regex`}),(0,I.jsx)(Q,{value:`tool_input_jsonpath`,children:`Tool input JSONPath`}),(0,I.jsx)(Q,{value:`response_jsonpath`,children:`JSONPath (optional equals)`}),(0,I.jsx)(Q,{value:`response_jsonpath_exists`,children:`JSONPath exists`}),(0,I.jsx)(Q,{value:`response_jsonpath_not_exists`,children:`JSONPath not exists`})]})]})}var B4=()=>({id:`scn-${Date.now()}`,name:``,serverIds:[],prompt:``,evalRules:[],extractRules:[]});function V4(e){return i2(e).replace(/^Tool sequence · /,``)}function H4(e){return e.startsWith(`tool_input_`)}function U4(e){let t=e.trim();if(t)return t===`true`?!0:t===`false`?!1:Number.isNaN(Number(t))?t:Number(t)}function W4({scenarios:e,scenarioOrigins:t,scenarioOverrides:n,agents:r,servers:i,configId:a,configPath:o,defaultAssistantAgentName:s,assistantInitialPromptByScenarioId:c,assistantAutoOpenNonceByScenarioId:l,testCaseReturnToPath:u,onChange:d,readOnly:f,allowAdd:p=!f,allowStructureEdits:m=!f}){let h=(t,n)=>{d(e.map((e,r)=>r===t?{...e,...n}:e))},g=t=>d(e.filter((e,n)=>n!==t)),_=()=>d([...e,B4()]),v=(t,n)=>{let r=t+n;if(r<0||r>=e.length)return;let i=[...e],[a]=i.splice(t,1);i.splice(r,0,a),d(i)};return(0,I.jsxs)(`div`,{className:f?`space-y-2`:`space-y-4`,children:[!f&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Scenarios`}),p&&m&&(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:_,children:[(0,I.jsx)(qn,{className:`mr-1.5 h-3.5 w-3.5`}),`Add Scenario`]})]}),e.map((d,p)=>(0,I.jsx)(G4,{scenario:d,scenarioOrigin:t?.[p],hasMcpServerOverride:n?.[p],index:p,total:e.length,agents:r,servers:i,configId:a,configPath:o,defaultAssistantAgentName:s,assistantInitialPrompt:c?.[d.id],assistantAutoOpenNonce:l?.[d.id],testCaseReturnToPath:u,onUpdate:e=>h(p,e),onMoveUp:()=>v(p,-1),onMoveDown:()=>v(p,1),onRemove:()=>g(p),readOnly:f,allowStructureEdits:m},d.id)),e.length===0&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-6`,children:`No scenarios configured. Add one to get started.`})]})}function G4({scenario:e,scenarioOrigin:t,hasMcpServerOverride:n,index:r,total:i,agents:a,servers:o,configId:s,configPath:c,defaultAssistantAgentName:l,assistantInitialPrompt:u,assistantAutoOpenNonce:d,testCaseReturnToPath:f,onUpdate:p,onMoveUp:m,onMoveDown:h,onRemove:g,readOnly:v,allowStructureEdits:y}){let{source:b}=Mv(),[x,S]=(0,_.useState)(`required_tool`),[C,w]=(0,_.useState)(``),[T,E]=(0,_.useState)(``),[D,k]=(0,_.useState)(``),[A,j]=(0,_.useState)(``),[M,N]=(0,_.useState)(``),[P,F]=(0,_.useState)(``),[ee,L]=(0,_.useState)(``),[R,z]=(0,_.useState)([]),[te,ne]=(0,_.useState)(!1),[re,ie]=(0,_.useState)(null),[ae,oe]=(0,_.useState)(null),[se,ce]=(0,_.useState)(!1),[B,le]=(0,_.useState)(null),[ue,de]=(0,_.useState)(``),[V,fe]=(0,_.useState)(null),[pe,me]=(0,_.useState)(!1),[he,ge]=(0,_.useState)(null),[_e,ve]=(0,_.useState)(``),[ye,be]=(0,_.useState)(``),[xe,Se]=(0,_.useState)(!1),[Ce,we]=(0,_.useState)(l||a[0]?.id||``),[Te,Ee]=(0,_.useState)(!1),[De,Oe]=(0,_.useState)(null),[ke,Ae]=(0,_.useState)(``),je=(0,_.useRef)(null);function Me(t){if(!t)return;let n=Array.from(t),r=Array(n.length).fill(null),i=0,a=0,o=()=>{let t=r.filter(e=>e!==null);t.length>0?(p({attachments:[...e.attachments??[],...t]}),a>0&&O({title:`${a} file${a>1?`s`:``} skipped`,description:`Unsupported file type. Images must be JPEG/PNG/GIF/WebP; documents must be PDF, TXT, MD, or CSV.`,variant:`destructive`})):n.length>0&&O({title:`Could not attach files`,description:a>0?`Unsupported file type. Images must be JPEG/PNG/GIF/WebP; documents must be PDF, TXT, MD, or CSV.`:`Files could not be read.`,variant:`destructive`})};n.forEach((e,t)=>{let s=new FileReader;s.onload=()=>{let c=s.result,l=c.indexOf(`,`),u=l>=0?c.slice(l+1):``;if(u){let n=c.slice(0,l).replace(`data:`,``).replace(`;base64`,``),i=n.startsWith(`image/`);R4(n)?r[t]={type:i?`image`:`document`,media_type:n,data:u,name:e.name}:a++}++i===n.length&&o()},s.onerror=()=>{++i===n.length&&o()},s.readAsDataURL(e)})}function Ne(t){p({attachments:(e.attachments??[]).filter((e,n)=>n!==t)})}let[H,Pe]=(0,_.useState)(null),[Fe,Ie]=(0,_.useState)(!v),Le=e=>{let t=e.target;t&&(t.closest(`button, a, input, select, textarea, [role='button']`)||Ie(e=>!e))},Re=t=>t?e.evalRules.findIndex(e=>e===t):-1,ze=()=>{if(H4(x)){let t=T.trim();if(!t)return;let n;if(x===`tool_input_jsonpath`){let e=D.trim();if(!e)return;let r=U4(A);n={type:x,tool:t,path:e,...r===void 0?{}:{equals:r}}}else{let e=C.trim();if(!e)return;n={type:x,tool:t,value:e}}let r=[...e.evalRules],i=Re(B);i>=0?r[i]=n:r.push(n),p({evalRules:r}),E(``),k(``),w(``),j(``),le(null),S(`required_tool`);return}if(x===`response_jsonpath`||x===`response_jsonpath_exists`||x===`response_jsonpath_not_exists`){let t=D.trim();if(!t)return;if(x===`response_jsonpath`){let n=U4(A);p({evalRules:[...e.evalRules,{type:x,path:t,...n===void 0?{}:{equals:n}}]})}else p({evalRules:[...e.evalRules,{type:x,path:t}]});k(``),j(``);return}if(x===`agent_check`){let t=M.trim(),n=P.trim();if(!t||!n)return;let r=[...e.evalRules],i={type:`agent_check`,label:t,prompt:n},a=Re(ae);a>=0?r[a]=i:r.push(i),p({evalRules:r}),N(``),F(``),oe(null),ce(!1),S(`required_tool`);return}if(x===`tool_sequence`){let e=R.map(e=>e.trim()).filter(e=>typeof e==`string`&&e.length>0);if(e.length===0)return;qe(e);return}if(!C.trim())return;let t=[...e.evalRules],n={type:x,value:C.trim()},r=Re(B);r>=0?t[r]=n:t.push(n),p({evalRules:t}),w(``),de(``),le(null),S(`required_tool`)},Be=()=>{let e=ee.trim();e&&(z(t=>[...t,e]),L(``))},Ve=(e,t)=>{let n=e+t;z(t=>{if(n<0||n>=t.length)return t;let r=[...t],[i]=r.splice(e,1);return r.splice(n,0,i),r})},He=e=>{z(t=>t.filter((t,n)=>n!==e))},Ue=e.evalRules.findIndex(e=>e.type===`tool_sequence`),We=Ue>=0?e.evalRules[Ue]:void 0,Ge=We?.type===`tool_sequence`?We.sequence??[]:[],Ke=Ue>=0,qe=t=>{let n=[...e.evalRules],r=t.length>0?{type:`tool_sequence`,sequence:t}:null,i=Re(re),a=i>=0?i:Ue;a>=0?r?n[a]=r:n.splice(a,1):r&&n.push(r),p({evalRules:n}),ne(!1),z([]),L(``),ie(null),x===`tool_sequence`&&S(`required_tool`)};(0,_.useEffect)(()=>{te&&z(Ge)},[te,Ue,Ge.join(`|`)]),(0,_.useEffect)(()=>{ne(x===`tool_sequence`)},[x]),(0,_.useEffect)(()=>{ce(x===`agent_check`)},[x]),(0,_.useEffect)(()=>{re&&Re(re)<0&&ie(null),ae&&Re(ae)<0&&oe(null),B&&Re(B)<0&&le(null)},[e.evalRules,re,ae,B]),(0,_.useEffect)(()=>{re&&x!==`tool_sequence`&&ie(null),ae&&x!==`agent_check`&&oe(null),B&&B.type!==x&&le(null)},[x,re,ae,B]);let Je=t=>{let n=e.evalRules.filter((e,n)=>n!==t);p({evalRules:n,agentContext:n.some(e=>e.type===`agent_check`)?e.agentContext:void 0})},Ye=[`response_contains`,`response_not_contains`,`response_starts_with`,`response_ends_with`,`response_equals`,`response_regex`,`tool_input_contains`,`tool_input_regex`,`tool_input_jsonpath`],Xe=()=>{_e.trim()&&ye.trim()&&(p({extractRules:[...e.extractRules,{name:_e.trim(),pattern:ye.trim()}]}),ve(``),be(``))},Ze=t=>{p({extractRules:e.extractRules.filter((e,n)=>n!==t)})},Qe=t=>{p({serverIds:e.serverIds.includes(t)?e.serverIds.filter(e=>e!==t):[...e.serverIds,t]})},$e={required_tool:`Required`,forbidden_tool:`Forbidden`,tool_sequence:`Sequence`,tool_input_contains:`Input Contains`,tool_input_regex:`Input Regex`,tool_input_jsonpath:`Input JSONPath`,response_contains:`Contains`,response_not_contains:`Not Contains`,response_starts_with:`Starts With`,response_ends_with:`Ends With`,response_equals:`Equals`,response_regex:`Regex`,response_jsonpath:`JSONPath`,response_jsonpath_exists:`JSONPath Exists`,response_jsonpath_not_exists:`JSONPath Not Exists`,agent_check:`Agent`},et={required_tool:`border-sky-300/60 bg-sky-500/10 text-sky-700`,forbidden_tool:`border-rose-300/60 bg-rose-500/10 text-rose-700`,tool_sequence:`border-teal-300/60 bg-teal-500/10 text-teal-700`,tool_input_contains:`border-blue-300/60 bg-blue-500/10 text-blue-700`,tool_input_regex:`border-blue-300/60 bg-blue-500/10 text-blue-700`,tool_input_jsonpath:`border-blue-300/60 bg-blue-500/10 text-blue-700`,response_contains:`border-violet-300/60 bg-violet-500/10 text-violet-700`,response_not_contains:`border-amber-300/60 bg-amber-500/10 text-amber-700`,response_starts_with:`border-cyan-300/60 bg-cyan-500/10 text-cyan-700`,response_ends_with:`border-indigo-300/60 bg-indigo-500/10 text-indigo-700`,response_equals:`border-lime-300/60 bg-lime-500/10 text-lime-700`,response_regex:`border-fuchsia-300/60 bg-fuchsia-500/10 text-fuchsia-700`,response_jsonpath:`border-emerald-300/60 bg-emerald-500/10 text-emerald-700`,response_jsonpath_exists:`border-green-300/60 bg-green-500/10 text-green-700`,response_jsonpath_not_exists:`border-orange-300/60 bg-orange-500/10 text-orange-700`,agent_check:`border-teal-300/60 bg-teal-500/10 text-teal-700`},tt=x===`required_tool`||x===`forbidden_tool`,nt=H4(x),rt=x===`response_jsonpath`||x===`response_jsonpath_exists`||x===`response_jsonpath_not_exists`,it=x===`tool_sequence`&&te,at=x===`agent_check`&&se,ot=e.serverIds.filter(e=>o.some(t=>t.id===e)),st=a.map(e=>e.id).filter(Boolean),ct=ot.length>0,[lt,ut]=(0,_.useState)(``),[dt,ft]=(0,_.useState)(0);(0,_.useEffect)(()=>{let e=(u??``).trim();e&&lt!==e&&(Se(!0),ut(e))},[u,lt]),(0,_.useEffect)(()=>{d&&d!==dt&&(Se(!0),ft(d))},[d,dt]),(0,_.useEffect)(()=>{fe(null),ge(null),de(``)},[e.serverIds.join(`|`)]),(0,_.useEffect)(()=>{de(``),k(``),j(``),L(``)},[x]),(0,_.useEffect)(()=>{Ce&&st.includes(Ce)||we(l||a[0]?.id||``)},[Ce,l,a,st]);let pt=async()=>{if(Ce){Ee(!0),Oe(null);try{await v4({serverNames:e.serverIds.filter(e=>o.find(t=>t.id===e)?.authType===`oauth2`),source:b});let t=await b.runScenarioPreview({selectedAgentName:Ce,scenario:{id:e.id,name:e.name,prompt:e.prompt,serverNames:e.serverIds,attachments:e.attachments??[],evalRules:e.evalRules,extractRules:e.extractRules}});Pe(t)}catch(e){Oe(e instanceof Error?e.message:String(e))}finally{Ee(!1)}}},mt=()=>{if(!H)return;let t=K4(e.evalRules,H.run.failureReasons,H.run.checkResults),n=t.length?t.map(e=>`${e.status.toUpperCase()} - ${q4(e.rule)}${e.failureReason?` (${e.failureReason})`:``}`).join(`
124
+ `):`No checks configured.`,r=Object.keys(H.run.extractedValues).length>0?Object.entries(H.run.extractedValues).map(([e,t])=>`${e}: ${String(t)}`).join(`
125
+ `):`No extracted values.`,i=H.run.toolCalls.length>0?H.run.toolCalls.map((e,t)=>`${t+1}. ${e.name} (${e.duration}ms)`).join(`
126
+ `):`No tool calls.`,a=[`I ran a prompt preview for scenario '${e.id}' and want you to suggest concrete updates.`,`Run ID: ${H.runId}`,`Agent: ${H.agentName}`,`Outcome: ${H.run.passed?`passed`:`failed`}`,`Duration: ${H.run.duration}ms`,``,`Current check outcomes:`,n,``,`Tool sequence:`,i,``,`Extracted values:`,r,``,`Final answer:`,H.run.finalAnswer||`(empty)`,``,`If the run has a meaningful ordered tool path, suggest a tool_sequence check using the raw tool names in the tool sequence order, even if other tools appear between them.`,`Use agent_check only for semantic or fuzzy validation;`,`Please propose concrete updates to the Prompt, Checks, and/or Value Capture Rules based on this preview.`].join(`
127
+ `);Ae(a),Se(!0)},ht=async()=>{if(ct&&!v){me(!0),ge(null);try{await v4({serverNames:ot.filter(e=>o.find(t=>t.id===e)?.authType===`oauth2`),source:b});let e=new Set;for(let t of ot){let n=await b.discoverToolsForAnalysis({serverNames:[t]});for(let t of n.servers)for(let n of t.tools)e.add(n.name)}fe(Array.from(e).sort((e,t)=>e.localeCompare(t)))}catch(e){ge(e instanceof Error?e.message:`Failed to load tools`)}finally{me(!1)}}};return(0,I.jsx)(t2,{open:Fe,onOpenChange:Ie,children:(0,I.jsxs)(K,{className:v?`rounded-md border shadow-none`:`border-dashed`,children:[(0,I.jsxs)(Kv,{className:`${v?`px-3 py-3`:`pb-3`} flex-row items-center justify-between space-y-0 cursor-pointer`,onClick:Le,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[!v&&(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,children:(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${Fe?`rotate-0`:`-rotate-90`}`})})}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[r+1,`.`]}),(0,I.jsx)(qv,{className:`truncate text-sm font-medium`,children:e.name||`Scenario ${r+1}`}),v&&t===`referenced`&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 px-2 text-xs`,asChild:!0,children:(0,I.jsx)(cp,{to:`/libraries/test-cases/${encodeURIComponent(e.id)}${f?`?returnTo=${encodeURIComponent(f)}`:``}`,children:`Edit test`})})]}),v?(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t&&(0,I.jsx)(Y,{variant:t===`inline`?`secondary`:`outline-solid`,children:t===`referenced`?`Referenced`:`Inline`}),n&&(0,I.jsx)(Y,{variant:`secondary`,children:`Override`}),(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-8 w-8`,"aria-label":Fe?`Collapse scenario details`:`Expand scenario details`,children:(0,I.jsx)(rn,{className:`h-4 w-4 transition-transform ${Fe?`rotate-180`:``}`})})})]}):y&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>Se(!0),title:a.length===0?`Add at least one agent in the config`:e.serverIds.length===0?`Select at least one server for this scenario`:`Open Scenario Assistant`,children:[(0,I.jsx)(tr,{className:`h-3.5 w-3.5 text-amber-500`}),`Ask Assistant`]}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:m,disabled:r===0,"aria-label":`Move scenario up`,children:(0,I.jsx)(on,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:h,disabled:r===i-1,"aria-label":`Move scenario down`,children:(0,I.jsx)(rn,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:g,children:(0,I.jsx)(ar,{className:`h-3.5 w-3.5 text-destructive`})})]})]}),(0,I.jsx)(r2,{children:(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsx)(C4,{open:xe,onOpenChange:e=>{Se(e),e||Ae(``)},configId:s,configPath:c,scenario:e,agents:a,servers:o,defaultAssistantAgentName:l,initialUserMessage:ke||u,onApplyPatch:e=>p({...e.prompt===void 0?{}:{prompt:e.prompt},...e.evalRules===void 0?{}:{evalRules:e.evalRules},...e.extractRules===void 0?{}:{extractRules:e.extractRules}})}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Name`}),(0,I.jsx)(Pp,{value:e.name,onChange:e=>p({name:e.target.value}),disabled:v,placeholder:`e.g. List directory`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Servers`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[o.map(t=>(0,I.jsx)(Y,{variant:e.serverIds.includes(t.id)?`default`:`outline-solid`,className:`cursor-pointer text-xs ${e.serverIds.includes(t.id)?``:`opacity-50`}`,onClick:()=>!v&&Qe(t.id),children:t.name||t.id},t.id)),o.length===0&&(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Add servers above first`})]})]}),(0,I.jsxs)(K,{className:`border bg-card`,children:[(0,I.jsxs)(Kv,{className:`pb-2`,children:[(0,I.jsx)(qv,{className:`text-sm`,children:`Prompt`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The instruction sent to the agent for this scenario. Be explicit about the task, expected output, and constraints.`})]}),(0,I.jsxs)(q,{className:`space-y-3 pt-0`,children:[(0,I.jsx)(t0,{value:e.prompt,onChange:e=>p({prompt:e.target.value}),disabled:v,placeholder:`The prompt to send to the agent...`,rows:4,className:`text-xs`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`input`,{ref:je,type:`file`,accept:[...I4,...L4,`.md`].join(`,`),multiple:!0,className:`hidden`,onChange:e=>Me(e.target.files)}),(e.attachments?.length??0)>0?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[e.attachments?.map((e,t)=>(0,I.jsxs)(`div`,{className:`group relative`,title:`${e.name??`attachment ${t+1}`}`,children:[(0,I.jsx)(`div`,{className:`flex h-16 w-16 items-center justify-center overflow-hidden rounded border bg-muted`,children:e.type===`image`?(0,I.jsx)(`img`,{src:`data:${e.media_type};base64,${e.data}`,alt:e.name??`attachment ${t+1}`,className:`h-full w-full object-cover`}):(0,I.jsx)(wn,{className:`h-6 w-6 text-muted-foreground`})}),e.name&&(0,I.jsx)(`p`,{className:`mt-0.5 max-w-[64px] truncate text-center text-xs text-muted-foreground`,children:e.name}),!v&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>Ne(t),className:`absolute -right-1 -top-1 hidden h-4 w-4 items-center justify-center rounded-full bg-destructive text-destructive-foreground group-hover:flex`,"aria-label":`Remove attachment`,children:(0,I.jsx)(dr,{className:`h-2.5 w-2.5`})})]},t)),!v&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>je.current?.click(),className:`flex h-16 w-16 items-center justify-center self-start rounded border border-dashed text-muted-foreground hover:border-foreground hover:text-foreground`,"aria-label":`Attach file`,title:`Attach file (image or document)`,children:(0,I.jsx)(Wn,{className:`h-4 w-4`})})]}):!v&&(0,I.jsxs)(`button`,{type:`button`,onClick:()=>je.current?.click(),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Wn,{className:`h-3.5 w-3.5`}),`Attach file`]})]})]})]}),!v&&(0,I.jsxs)(K,{className:`border bg-muted/20`,children:[(0,I.jsxs)(Kv,{className:`pb-2`,children:[(0,I.jsx)(qv,{className:`text-sm`,children:`Run Prompt Preview`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Execute the current draft prompt once and inspect final answer, conversation trace, tool calls, and check outcomes.`})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_auto]`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Agent`}),(0,I.jsxs)(T1,{value:Ce,onValueChange:we,children:[(0,I.jsx)(D1,{className:`h-8 text-xs`,children:(0,I.jsx)(E1,{placeholder:`Select agent`})}),(0,I.jsx)(A1,{children:a.map(e=>(0,I.jsx)(Q,{value:e.id,children:e.name||e.id},e.id))})]})]}),(0,I.jsx)(`div`,{className:`flex items-end`,children:(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 gap-1.5 px-2 text-xs`,onClick:()=>void pt(),disabled:Te||!Ce||!e.prompt.trim()||e.serverIds.length===0,children:Te?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(In,{className:`h-3.5 w-3.5 animate-spin`}),`Running...`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Kn,{className:`h-3.5 w-3.5`}),`Run Prompt`]})})})]}),!e.prompt.trim()&&(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Add a prompt to run preview.`}),e.serverIds.length===0&&(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Select at least one server to run preview.`}),De&&(0,I.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:De}),H&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,I.jsx)(Y,{variant:H.run.passed?`default`:`destructive`,children:H.run.passed?`Passed`:`Failed`}),(0,I.jsxs)(Y,{variant:`outline`,children:[H.run.duration,`ms`]}),(0,I.jsxs)(Y,{variant:`outline`,children:[H.run.toolCalls.length,` tool calls`]}),(0,I.jsx)(Y,{variant:`outline`,className:`font-mono`,children:H.agentName}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto h-6 gap-1.5 px-2 text-[11px]`,onClick:mt,children:[(0,I.jsx)(tr,{className:`h-3.5 w-3.5 text-amber-500`}),`Send to Assistant`]})]}),e.evalRules.length===0?(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-2`,children:[(0,I.jsx)(`p`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Check results`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No checks configured for this scenario.`})]}):(()=>{let t=K4(e.evalRules,H.run.failureReasons,H.run.checkResults),n=t.filter(e=>e.status===`passed`),r=t.filter(e=>e.status===`failed`);return(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Checks`}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-success/30 bg-success/10 text-success text-[10px]`,children:[n.length,` passed`]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px] ${r.length>0?`border-destructive/30 bg-destructive/10 text-destructive`:``}`,children:[r.length,` failed`]})]}),(0,I.jsx)(`div`,{className:`space-y-1`,children:t.map((t,n)=>(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${t.status===`failed`?`border-destructive/20 bg-destructive/5`:t.status===`not_executed`?`border-amber-500/20 bg-amber-500/5`:t.status===`not_evaluated`?`border-muted-foreground/20 bg-muted/40`:`border-success/20 bg-success/5`}`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t.status===`failed`?(0,I.jsx)(dn,{className:`h-3.5 w-3.5 shrink-0 text-destructive`}):t.status===`not_executed`?(0,I.jsx)(pn,{className:`h-3.5 w-3.5 shrink-0 text-amber-600`}):t.status===`not_evaluated`?(0,I.jsx)(pn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,I.jsx)(ln,{className:`h-3.5 w-3.5 shrink-0 text-success`}),(0,I.jsx)(`span`,{className:`font-medium`,children:Y4(t.rule)})]}),t.failureReason&&(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-[11px] text-muted-foreground`,children:X4(t.failureReason)})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${t.status===`failed`?`border-destructive/30 text-destructive`:t.status===`not_executed`?`border-amber-500/30 text-amber-600`:t.status===`not_evaluated`?`border-muted-foreground/30 text-muted-foreground`:`border-success/30 text-success`}`,children:d4(t.status)})]},`${e.id}-preview-check-${n}`))})]})})(),H.run.failureReasons.length>0&&(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-wide text-destructive`,children:`Check failures`}),(0,I.jsx)(`ul`,{className:`list-disc space-y-1 pl-4 text-xs text-destructive`,children:H.run.failureReasons.map((e,t)=>(0,I.jsx)(`li`,{children:e},`${H.runId}-failure-${t}`))})]}),Object.keys(H.run.extractedValues).length>0&&(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-2`,children:[(0,I.jsx)(`p`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Extracted values`}),(0,I.jsx)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:Object.entries(H.run.extractedValues).map(([e,t])=>(0,I.jsxs)(`div`,{className:`rounded border bg-muted/20 px-2 py-1 text-xs`,children:[(0,I.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:e}),(0,I.jsx)(`div`,{className:`break-all`,children:String(t)})]},e))})]}),(0,I.jsx)(A4,{run:H.run,fallbackUserPrompt:e.prompt})]})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:[(0,I.jsxs)(K,{className:`border bg-muted/20`,children:[(0,I.jsx)(Kv,{className:`pb-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(qv,{className:`text-sm`,children:`Checks`}),(0,I.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Checks determine pass/fail for the scenario. Add tool checks or text pattern checks for the final answer.`})]}),!v&&(0,I.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs shrink-0`,onClick:()=>Se(!0),title:`Ask for help improving checks`,children:[(0,I.jsx)(tr,{className:`h-3.5 w-3.5 text-amber-500`}),`Ask Assistant`]})})]})}),(0,I.jsx)(q,{className:`space-y-2`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Checks (pass / fail)`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`These determine whether the scenario passes. Add tool checks (required/forbidden) or text pattern checks for the final answer.`}),(0,I.jsx)(`div`,{className:`space-y-1.5`,children:e.evalRules.length===0?(0,I.jsx)(`p`,{className:`rounded-md border border-dashed bg-background/60 px-2 py-2 text-xs text-muted-foreground`,children:`No checks yet. Add tool checks or text pattern checks below.`}):e.evalRules.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs`,children:[(0,I.jsx)(`div`,{className:`min-w-0`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`rounded-full border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${et[e.type]}`,children:$e[e.type]}),e.type===`agent_check`?(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-medium leading-tight`,children:e.label||`Unnamed check`}),e.prompt&&(0,I.jsx)(`div`,{className:`mt-0.5 wrap-break-word text-[11px] leading-snug text-muted-foreground`,children:e.prompt})]}):e.type===`tool_sequence`?(0,I.jsx)(`span`,{className:`font-mono break-all`,children:V4(e.sequence??[])}):H4(e.type)?(0,I.jsx)(`span`,{className:`font-mono break-all`,children:e.type===`tool_input_contains`?`${e.tool} contains ${String(e.value)}`:e.type===`tool_input_regex`?`${e.tool} matches ${String(e.value)}`:`${e.tool} · ${e.path} · ${e.equals===void 0?`exists`:`== ${String(e.equals)}`}`}):(0,I.jsx)(`span`,{className:`font-mono break-all`,children:e.path?e.equals===void 0?e.path:`${e.path} == ${String(e.equals)}`:e.value})]})}),!v&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(e.type===`tool_sequence`||e.type===`agent_check`||Ye.includes(e.type))&&(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`h-6 px-2 text-[11px]`,onClick:()=>{e.type===`tool_sequence`?(S(`tool_sequence`),z(e.sequence??[]),ie(e),ne(!0)):e.type===`agent_check`?(S(`agent_check`),oe(e),N(e.label??``),F(e.prompt??``),ce(!0)):(S(e.type),le(e),w(String(e.value??``)),E(e.tool??``),k(e.path??``),j(e.equals===void 0?``:String(e.equals)))},"aria-label":`Edit check ${t+1}`,children:(0,I.jsx)(nr,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6 shrink-0`,onClick:()=>Je(t),"aria-label":`Remove check ${t+1}`,children:(0,I.jsx)(dr,{className:`h-3.5 w-3.5`})})]})]},t))}),!v&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[at?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,I.jsx)(z4,{value:x,onValueChange:S,className:`h-8 w-58 shrink-0 text-xs`}),(0,I.jsx)(Pp,{value:M,onChange:e=>N(e.target.value),placeholder:`Prompt name`,className:`h-8 text-xs`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:ze,children:ae===null?`Add check`:`Update check`})]}),(0,I.jsx)(t0,{value:P,onChange:e=>F(e.target.value),placeholder:`Judge prompt. Example: Confirm the answer includes a valid earliest and latest timestamp range, and that neither is 'Not available'.`,className:`min-h-[64px] text-xs`})]}):(0,I.jsxs)(`div`,{className:`flex gap-2 items-end`,children:[(0,I.jsx)(z4,{value:x,onValueChange:S,className:`h-8 w-58 shrink-0 text-xs`,hideToolSequence:Ke&&x!==`tool_sequence`}),rt?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Pp,{value:D,onChange:e=>k(e.target.value),placeholder:`JSONPath (e.g. $.status)`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),ze())}),x===`response_jsonpath`&&(0,I.jsx)(Pp,{value:A,onChange:e=>j(e.target.value),placeholder:`Equals (optional)`,className:`h-8 w-48 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),ze())})]}):nt?(0,I.jsxs)(I.Fragment,{children:[V&&V.length>0?(0,I.jsxs)(T1,{value:T,onValueChange:E,children:[(0,I.jsx)(D1,{className:`h-8 text-xs font-mono`,children:(0,I.jsx)(E1,{placeholder:`Select tool`})}),(0,I.jsx)(A1,{children:V.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))})]}):(0,I.jsx)(Pp,{value:T,onChange:e=>E(e.target.value),placeholder:`Tool name`,className:`h-8 text-xs font-mono`}),x===`tool_input_jsonpath`&&(0,I.jsx)(Pp,{value:D,onChange:e=>k(e.target.value),placeholder:`JSONPath (e.g. $.query)`,className:`h-8 text-xs font-mono`}),x===`tool_input_jsonpath`?(0,I.jsx)(Pp,{value:A,onChange:e=>j(e.target.value),placeholder:`Equals (optional)`,className:`h-8 w-40 text-xs font-mono`}):(0,I.jsx)(Pp,{value:C,onChange:e=>w(e.target.value),placeholder:x===`tool_input_regex`?`Regex pattern`:`Text present in input`,className:`h-8 w-40 text-xs font-mono`})]}):it?(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 flex items-end gap-2`,children:[(0,I.jsx)(Pp,{value:ee,onChange:e=>L(e.target.value),placeholder:`Tool name`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),Be())}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:Be,children:`Add step`})]}):(0,I.jsx)(Pp,{value:C,onChange:e=>w(e.target.value),placeholder:`Value`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),ze())}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:ze,children:B===null?`Add`:`Update check`})]}),it&&(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border bg-background px-2 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Sequence steps`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Require these tools in order. Other tools may appear between them.`})]}),!v&&R.length>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 px-2 text-[11px]`,onClick:()=>z([]),children:`Clear`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-[11px]`,onClick:()=>qe(R),children:Ke?`Update sequence`:`Add sequence`})]})]}),R.length===0?(0,I.jsx)(`p`,{className:`rounded-md border border-dashed bg-muted/20 px-2 py-2 text-xs text-muted-foreground`,children:`No ordered tool sequence yet.`}):(0,I.jsx)(`div`,{className:`space-y-1.5`,children:R.map((t,n)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border bg-muted/10 px-2 py-1.5`,children:[(0,I.jsxs)(`span`,{className:`text-xs font-medium`,children:[n+1,`.`]}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 font-mono text-xs break-all`,children:t}),!v&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>Ve(n,-1),disabled:n===0,"aria-label":`Move tool ${n+1} up`,children:(0,I.jsx)(on,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>Ve(n,1),disabled:n===R.length-1,"aria-label":`Move tool ${n+1} down`,children:(0,I.jsx)(rn,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>He(n),"aria-label":`Remove tool ${n+1}`,children:(0,I.jsx)(dr,{className:`h-3.5 w-3.5`})})]})]},`${e.id}-tool-sequence-draft-${n}`))})]}),tt&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)($,{className:`mb-1 block text-[11px] text-muted-foreground`,children:`Pick from selected server tools (optional)`}),(0,I.jsxs)(T1,{value:ue,onValueChange:e=>{de(e),w(e)},disabled:pe||!V||V.length===0,children:[(0,I.jsx)(D1,{className:`h-8 text-xs`,children:(0,I.jsx)(E1,{placeholder:pe?`Loading tools...`:V&&V.length>0?`Select tool to insert in value field`:`Load tools first`})}),(0,I.jsx)(A1,{children:(V??[]).map(e=>(0,I.jsx)(Q,{value:e,children:e},e))})]})]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:ht,disabled:!ct||pe,children:pe?`Loading...`:V?`Refresh tools`:`Load tools`})]}),!ct&&(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Select at least one server in this scenario to load tool names.`}),he&&(0,I.jsxs)(`p`,{className:`text-[11px] text-destructive`,children:[`Could not load tools: `,he]})]})]})]})})]}),(0,I.jsxs)(K,{className:`border bg-muted/10`,children:[(0,I.jsx)(Kv,{className:`pb-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(qv,{className:`text-sm`,children:`Value Capture Rules`}),(0,I.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Formerly “Extract Rules”. These do not fail the run. They capture structured values from the final answer for reporting and comparisons.`})]}),!v&&(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs shrink-0`,onClick:()=>Se(!0),title:`Ask for help improving value capture rules`,children:[(0,I.jsx)(tr,{className:`h-3.5 w-3.5 text-amber-500`}),`Ask Assistant`]})]})}),(0,I.jsx)(q,{className:`space-y-2`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Value Capture Rules`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Use regex patterns to capture values like max concentration, product names, date ranges, or IDs from the final answer text.`}),(0,I.jsx)(`div`,{className:`space-y-1.5`,children:e.extractRules.length===0?(0,I.jsx)(`p`,{className:`w-full rounded-md border border-dashed bg-background/60 px-2 py-2 text-xs text-muted-foreground`,children:`No value capture rules yet. Add one below to capture structured output from the final answer.`}):e.extractRules.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs`,children:[(0,I.jsx)(`div`,{className:`min-w-0`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`rounded-full border border-violet-300/60 bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-violet-700`,children:e.name}),(0,I.jsx)(`span`,{className:`text-[11px] font-semibold text-muted-foreground`,children:`regex:`}),(0,I.jsx)(`code`,{className:`font-mono break-all text-foreground`,children:e.pattern})]})}),!v&&(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6 shrink-0`,onClick:()=>Ze(t),"aria-label":`Remove value capture rule ${t+1}`,children:(0,I.jsx)(dr,{className:`h-3.5 w-3.5`})})]},t))}),!v&&(0,I.jsxs)(`div`,{className:`flex gap-2 items-end`,children:[(0,I.jsx)(Pp,{value:_e,onChange:e=>ve(e.target.value),placeholder:`Field name`,className:`h-8 text-xs w-36`}),(0,I.jsx)(Pp,{value:ye,onChange:e=>be(e.target.value),placeholder:`Regex pattern`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),Xe())}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:Xe,children:`Add`})]})]})})]})]}),e.evalRules.some(e=>e.type===`agent_check`)&&(0,I.jsxs)(K,{className:`border bg-muted/10`,children:[(0,I.jsx)(Kv,{className:`pb-2`,children:(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(qv,{className:`text-sm`,children:`Judge context`}),(0,I.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Extra context is shared across all judge checks in this scenario and sent once in the batched judge request.`})]})}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(U0,{id:`judge-ctx-prompt-${e.id}`,checked:e.agentContext?.include_prompt??!1,disabled:v,className:`mt-0.5`,onCheckedChange:t=>{p({agentContext:{...e.agentContext,include_prompt:t===!0}})}}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{htmlFor:`judge-ctx-prompt-${e.id}`,className:`cursor-pointer text-xs font-medium`,children:`Include prompt`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Sends the scenario prompt so the judge can verify the answer addresses the original question.`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(U0,{id:`judge-ctx-tools-${e.id}`,checked:e.agentContext?.include_tool_sequence??!1,disabled:v,className:`mt-0.5`,onCheckedChange:t=>{p({agentContext:{...e.agentContext,include_tool_sequence:t===!0}})}}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{htmlFor:`judge-ctx-tools-${e.id}`,className:`cursor-pointer text-xs font-medium`,children:`Include tool sequence`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Sends the list of called tool names so the judge can reason about which tools were used.`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(U0,{id:`judge-ctx-inputs-${e.id}`,checked:e.agentContext?.include_tool_inputs??!1,disabled:v,className:`mt-0.5`,onCheckedChange:t=>{p({agentContext:{...e.agentContext,include_tool_inputs:t===!0}})}}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{htmlFor:`judge-ctx-inputs-${e.id}`,className:`cursor-pointer text-xs font-medium`,children:`Include tool inputs`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Sends the called MCP tools and their arguments so the judge can verify how the tools were used.`})]})]})]})]})]})})]})})}function K4(e,t,n){return f4({evalRules:e,failureReasons:t,checkResults:n})}function q4(e){return e.type===`agent_check`?`${e.type}: ${e.label??``} — ${e.prompt??``}`:e.type===`tool_sequence`?`${e.type}: ${V4(e.sequence??[])}`:H4(e.type)?`${e.type}: ${e.tool??``}: ${J4(e)}`:e.path?`${e.type}: ${J4(e)}`:`${e.type}: ${e.value??``}`}function J4(e){return e.path?e.equals===void 0?e.path:`${e.path} == ${String(e.equals)}`:String(e.value??``)}var Y4=p4;function X4(e){let t=String(e??``).trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}function Z4(e){let t=e.name?.trim()||e.id||`Server`,n=e.authValue?.trim()||``,r=e.oauthTokenUrl?.trim()||``;return e.authType===`bearer`&&n.length===0?`${t}: bearer token is required.`:e.authType===`api-key`&&r.length===0&&n.length===0?`${t}: API key value is required.`:null}function Q4(e){return e??0}function $4(e=`llm`){return e===`browser`?{id:`agt-${Date.now()}`,name:``,type:`browser`,provider:`claude`,model:``,maxTokens:0,url:``,newConversationBetweenScenarios:!0}:{id:`agt-${Date.now()}`,name:``,type:`llm`,provider:`openai`,model:`gpt-4o`,temperature:0,maxTokens:4096}}var e3=()=>({id:`cfg-${Date.now()}`,name:``,configName:``,description:``,servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),t3=()=>{let{id:e,tab:t}=Jd(),n=Vd(),r=Wd(),[i,a]=mp(),{getConfig:o,addConfig:s,updateConfig:c,loading:l}=Hv(),{source:u}=Mv(),{servers:d,agents:f,scenarios:p}=Gv(),m=e===`new`,h=!m&&!!e,g=h?o(e):void 0,[v,y]=(0,_.useState)(m||t===`edit`),[b,x]=(0,_.useState)(()=>g?structuredClone(g):e3()),[S,C]=(0,_.useState)(``),[w,T]=(0,_.useState)(``),[E,D]=(0,_.useState)({}),[k,A]=(0,_.useState)({}),[j,M]=(0,_.useState)({}),N=(0,_.useMemo)(()=>{let e=t||i.get(`tab`);return e===`agents`||e===`scenarios`?e:`scenarios`},[t,i]),P=`${n.pathname}${n.search}`;(0,_.useEffect)(()=>{g&&!v&&x(structuredClone(g))},[g,v]),(0,_.useEffect)(()=>{t===`edit`&&!m&&y(!0)},[t,m]);let F=e=>x(t=>({...t,...e})),ee=(0,_.useMemo)(()=>b.serverEntries&&b.serverEntries.length>0?b.serverEntries:(b.servers??[]).map(e=>({kind:`inline`,server:e})),[b.serverEntries,b.servers]),L=(0,_.useMemo)(()=>b.scenarioEntries&&b.scenarioEntries.length>0?b.scenarioEntries:b.scenarios.map(e=>({kind:`inline`,scenario:e})),[b.scenarioEntries,b.scenarios]),R=e=>{F({scenarioEntries:e,scenarios:e.filter(e=>e.kind===`inline`).map(e=>e.scenario)})},z=(0,_.useMemo)(()=>b.agentEntries&&b.agentEntries.length>0?b.agentEntries:b.agents.map(e=>({kind:`inline`,agent:e})),[b.agentEntries,b.agents]),te=e=>{F({agentEntries:e,agents:e.filter(e=>e.kind===`inline`).map(e=>e.agent)})},ne=!v,re=b.runDefaults?.selectedAgentNames??[],ie=async()=>{if(!b.name.trim()){O({title:`Validation Error`,description:`Config ID is required.`,variant:`destructive`});return}let e=ee.map(e=>e.kind===`referenced`?{kind:`referenced`,ref:d.find(t=>t.id===e.ref)?.id||e.ref}:e),t=z.map(e=>e.kind===`referenced`?{kind:`referenced`,ref:f.find(t=>t.id===e.ref)?.id||e.ref}:e),n=L.map(e=>{if(e.kind===`referenced`){let t=p.find(t=>t.id===e.ref),n=(e.mcpServers??[]).map(e=>e.kind===`referenced`?{kind:`referenced`,ref:d.find(t=>t.id===e.ref)?.id||e.ref}:e);return{kind:`referenced`,ref:t?.id||e.ref,...e.mcpServers===void 0?{}:{mcpServers:n}}}return e}),i=e.filter(e=>e.kind===`inline`).map(e=>({server:e.server,error:Z4(e.server)})).find(e=>!!e.error);if(i?.error){O({title:`Validation Error`,description:i.error,variant:`destructive`});return}if(n.filter(e=>e.kind===`inline`).some(e=>!e.scenario.name?.trim())){O({title:`Validation Error`,description:`Inline scenarios must have a name before saving.`,variant:`destructive`});return}let a=new Set(t.map(e=>e.kind===`inline`?e.agent.id:e.ref)),o=(b.runDefaults?.selectedAgentNames??[]).filter(e=>a.has(e)),l={...b,serverEntries:e,servers:e.filter(e=>e.kind===`inline`).map(e=>e.server),agentEntries:t,agents:t.filter(e=>e.kind===`inline`).map(e=>e.agent),scenarioEntries:n,scenarios:n.filter(e=>e.kind===`inline`).map(e=>e.scenario),runDefaults:o.length>0?{...b.runDefaults??{},selectedAgentNames:o}:void 0,updatedAt:new Date().toISOString()};if(m){let e=await s(l);x(e),O({title:`MCP Evaluation Created`,description:`"${Vi(e.configName,Vi(e.name,e.id))}" has been saved.`}),r(`/mcp-evaluations/${e.id}`)}else{let e=await c(b.id,l);x(e),O({title:`MCP Evaluation Updated`,description:`"${Vi(e.configName,Vi(e.name,e.id))}" has been updated.`}),y(!1),r(`/mcp-evaluations/${e.id}`,{replace:!0})}},ae=Vi(b.configName,Vi(b.name,b.id)),oe=m?`New MCP Evaluation`:v?`Editing: ${ae}`:ae,se=m?`/mcp-evaluations/new`:`/mcp-evaluations/${encodeURIComponent(b.id||e||``)}`,ce=!!g?.loadError,B=(0,_.useMemo)(()=>f.map(e=>({id:e.id,ref:e.id,label:Vi(e.name,e.id),model:e.model})).sort((e,t)=>e.label.localeCompare(t.label)),[f]),le=(e,t)=>{let n=t?Array.from(new Set([...re,e])):re.filter(t=>t!==e);F({runDefaults:{...b.runDefaults??{},selectedAgentNames:n}})},ue=e=>{let t=new Set([...z.filter(e=>e.kind===`inline`).map(e=>Vi(e.agent.name,e.agent.id)),...f.map(e=>Vi(e.name,e.id))]),n=`${e}-custom`,r=n,i=2;for(;t.has(r);)r=`${n}-${i}`,i+=1;return r},de=()=>{let e=$4(`llm`);te([{kind:`inline`,agent:e},...z]),D(t=>({...t,[e.id]:!0}))},V=()=>{let e=f.find(e=>e.id===w);if(!e)return;let t=e.id;new Set(z.filter(e=>e.kind===`referenced`).map(e=>e.ref)).has(t)||te([...z,{kind:`referenced`,ref:t}]),T(``)},fe=()=>{let e=new Set(z.filter(e=>e.kind===`referenced`).map(e=>e.ref)),t=f.filter(t=>!e.has(t.id)).map(e=>({kind:`referenced`,ref:e.id}));t.length>0&&te([...z,...t])},pe=()=>{let e=f.find(e=>e.id===w);if(!e)return;let t=Vi(e.name,e.id),n=ue(t),r={...structuredClone(e),id:`agt-${Date.now()}`,name:n};te([...z,{kind:`inline`,agent:r}]),D(e=>({...e,[r.id]:!0})),T(``),O({title:`Imported agent as inline`,description:n})},me=e=>{let t=z[e];if(!t)return;let n=t.kind===`inline`?t.agent.id:t.ref,r=re.filter(e=>e!==n);F({runDefaults:{...b.runDefaults??{},selectedAgentNames:r}}),t.kind===`inline`&&D(e=>{let n={...e};return delete n[t.agent.id],n}),te(z.filter((t,n)=>n!==e))},he=(e,t)=>{let n=e+t;if(n<0||n>=z.length)return;let r=[...z],[i]=r.splice(e,1);r.splice(n,0,i),te(r)},ge=e=>{let t=z[e];if(!t||t.kind!==`referenced`)return;let n=we(t.ref);if(!n){O({title:`Referenced agent not found`,variant:`destructive`});return}let r=Vi(n.name,n.id),i=ue(r),a={...structuredClone(n),id:`agt-${Date.now()}`,name:i},o=[...z];if(o[e]={kind:`inline`,agent:a},te(o),re.includes(t.ref)){let e=re.map(e=>e===t.ref?a.id:e);F({runDefaults:{...b.runDefaults??{},selectedAgentNames:Array.from(new Set(e))}})}D(e=>({...e,[a.id]:!0})),O({title:`Referenced agent converted to inline`,description:i})},_e=()=>{let e=p.find(e=>e.id===S);if(!e)return;let t={...structuredClone(e),id:`scn-${Date.now()}`,serverIds:[...e.serverIds]};R([...L,{kind:`inline`,scenario:t}]),M(e=>({...e,[t.id]:!0})),C(``)},ve=()=>{let e={id:`scn-${Date.now()}`,name:``,serverIds:[],prompt:``,evalRules:[],extractRules:[]};R([{kind:`inline`,scenario:e},...L]),M(t=>({...t,[e.id]:!0}))},ye=()=>{let e=p.find(e=>e.id===S);if(!e)return;let t=e.id;new Set(L.filter(e=>e.kind===`referenced`).map(e=>e.ref)).has(t)||R([...L,{kind:`referenced`,ref:t}]),C(``)},be=e=>{let t=L[e];t?.kind===`inline`&&M(e=>{let n={...e};return delete n[t.scenario.id],n}),R(L.filter((t,n)=>n!==e))},xe=(e,t)=>{let n=e+t;if(n<0||n>=L.length)return;let r=[...L],[i]=r.splice(e,1);r.splice(n,0,i),R(r)},Se=e=>{let t=L[e];if(!t||t.kind!==`referenced`)return;let n=Te(t.ref);if(!n){O({title:`Referenced scenario not found`,variant:`destructive`});return}let r=new Set(L.filter(e=>e.kind===`inline`).map(e=>e.scenario.name?.trim().toLowerCase()).filter(Boolean)),i=`${Vi(n.name,n.id)}-custom`,a=i,o=2;for(;r.has(a.toLowerCase());)a=`${i}-${o}`,o+=1;let s=Date.now(),c={...structuredClone(n),id:`scn-${s}`,name:a,serverIds:t.mcpServers&&t.mcpServers.length>0?t.mcpServers.map(e=>e.kind===`referenced`?e.ref:e.server.id):[...n.serverIds]},l=[...L];l[e]={kind:`inline`,scenario:c},R(l),M(e=>({...e,[c.id]:!0})),O({title:`Referenced scenario converted to inline`,description:a})},Ce=e=>d.find(t=>t.id===e),we=e=>f.find(t=>t.id===e),Te=e=>p.find(t=>t.id===e),Ee=ee.filter(e=>e.kind===`referenced`).map(e=>e.ref),De=Ee.map(Ce).filter(e=>!!e),Oe=z.filter(e=>e.kind===`referenced`).map(e=>e.ref),ke=Oe.map(we).filter(e=>!!e);z.filter(e=>e.kind===`inline`);let Ae=z.flatMap(e=>{if(e.kind===`referenced`){let t=we(e.ref);return t?[{agent:t,origin:`referenced`,ref:e.ref}]:[]}return[{agent:e.agent,origin:`inline`,ref:void 0}]}),je=L.filter(e=>e.kind===`referenced`).map(e=>e.ref),Me=L.flatMap(e=>{if(e.kind===`referenced`){let t=Te(e.ref);if(!t)return[];if(e.mcpServers===void 0)return[{scenario:t,origin:`referenced`,hasMcpServerOverride:!1}];let n=e.mcpServers.flatMap(e=>e.kind===`referenced`?[e.ref]:[e.server.id]);return[{scenario:{...t,serverIds:n},origin:`referenced`,hasMcpServerOverride:!0}]}return[{scenario:e.scenario,origin:`inline`,hasMcpServerOverride:!1}]}),Ne=Array.from(new Map([...f,...b.agents,...ke].map(e=>[e.id,e])).values()),H=Array.from(new Map([...d,...b.servers??[],...De].map(e=>[e.id,e])).values()),Pe=L.filter(e=>e.kind===`referenced`).flatMap(e=>(e.mcpServers??[]).filter(e=>e.kind===`referenced`).map(e=>e.ref)),Fe=Array.from(new Set([...Ee,...Pe].filter(e=>!Ce(e)))),Ie=Oe.filter(e=>!we(e)),Le=je.filter(e=>!Te(e));new Set(Fe);let Re=new Set(Le),ze=z.length,Be=L.length,Ve=[...d],He=(e,t)=>{let n=L[e];if(!n||n.kind!==`referenced`)return;let r=[...L];r[e]={kind:`referenced`,ref:n.ref,mcpServers:t.map(e=>({kind:`referenced`,ref:e}))},R(r)},Ue=e=>{let t=L[e];if(!t||t.kind!==`referenced`)return;let n=[...L];n[e]={kind:`referenced`,ref:t.ref},R(n)};return(0,_.useEffect)(()=>{w&&(f.some(e=>e.id===w)||T(``))},[f,w]),(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(W,{variant:`ghost`,size:`icon`,asChild:!0,className:`h-8 w-8`,children:(0,I.jsx)(cp,{to:`/mcp-evaluations`,children:(0,I.jsx)(Qt,{className:`h-4 w-4`})})}),(0,I.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold truncate`,children:oe}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground flex flex-wrap items-center gap-x-2 gap-y-1`,children:[m?`Create a new MCP evaluation`:l?`Loading configuration...`:g?g.loadError?`MCP evaluation could not be fully loaded`:(0,I.jsxs)(I.Fragment,{children:[`Last updated `,(0,I.jsx)(`span`,{children:new Date(b.updatedAt).toLocaleDateString()})]}):`MCP evaluation not found`,!m&&P1(b)&&(0,I.jsxs)(`span`,{"aria-label":`Evaluation file`,className:`inline-flex min-w-0 items-center gap-1 text-xs font-mono`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsx)(Cn,{className:`h-3 w-3 shrink-0`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`truncate`,children:P1(b)})]})]})]}),(0,I.jsxs)(`div`,{className:`flex gap-2 shrink-0`,children:[h&&!v&&(0,I.jsx)(W,{size:`sm`,onClick:()=>{y(!0),r(`${se}/edit`)},children:`Edit`}),h&&!v&&g&&!ce&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,asChild:!0,children:(0,I.jsxs)(cp,{to:`/run?configId=${encodeURIComponent(g.id)}`,children:[(0,I.jsx)(Kn,{className:`h-3.5 w-3.5`}),`Run Evaluation`]})}),h&&!v&&ce&&(0,I.jsxs)(Y,{variant:`destructive`,className:`py-1 px-3 text-xs`,children:[(0,I.jsx)(or,{className:`mr-1 h-3 w-3`}),`Broken config`]}),v&&(0,I.jsxs)(I.Fragment,{children:[!m&&(0,I.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>{x(structuredClone(g)),y(!1),r(se)},children:`Cancel`}),(0,I.jsxs)(W,{size:`sm`,onClick:()=>void ie(),children:[(0,I.jsx)(Xn,{className:`mr-1.5 h-3.5 w-3.5`}),`Save`]})]})]})]}),ce&&!v&&(0,I.jsx)(K,{className:`border-destructive/40`,children:(0,I.jsxs)(q,{className:`pt-6 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(or,{className:`mt-0.5 h-5 w-5 text-destructive`}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-sm font-semibold`,children:`This configuration is broken`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The file is still present, but it could not be loaded because one or more references or fields are invalid.`})]})]}),(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium mb-1`,children:`File`}),(0,I.jsx)(`p`,{className:`text-xs font-mono break-all`,children:g&&P1(g)})]}),(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 p-3`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium mb-1 text-destructive`,children:`Load Error`}),(0,I.jsx)(`p`,{className:`text-xs break-all text-destructive`,children:g?.loadError})]}),(Fe.length>0||Ie.length>0||Le.length>0)&&(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-background p-3 space-y-1.5`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium`,children:`Broken references`}),Fe.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Servers:`,` `,(0,I.jsx)(`span`,{className:`text-destructive`,children:Fe.join(`, `)})]}),Ie.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Agents: `,(0,I.jsx)(`span`,{className:`text-destructive`,children:Ie.join(`, `)})]}),Le.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Scenarios:`,` `,(0,I.jsx)(`span`,{className:`text-destructive`,children:Le.join(`, `)})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Valid items still render below. Only the missing references are marked as broken.`})]})}),!ce&&(b.loadWarnings?.length??0)>0&&(0,I.jsx)(K,{className:`border-amber-500/30`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-amber-700 dark:text-amber-300`,children:[(0,I.jsx)(or,{className:`h-4 w-4`}),`Migration warnings`]}),b.loadWarnings?.map((e,t)=>(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},`${e}-${t}`))]})}),(0,I.jsxs)(`div`,{className:`flex gap-4`,children:[(0,I.jsx)(Y,{variant:N===`scenarios`?`default`:`outline-solid`,className:`py-1 px-3 text-xs`,children:(0,I.jsxs)(cp,{to:`${se}/scenarios`,className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[(0,I.jsx)(wn,{className:`h-3 w-3`}),Be,` scenario`,Be===1?``:`s`]})}),(0,I.jsx)(Y,{variant:N===`agents`?`default`:`outline-solid`,className:`py-1 px-3 text-xs`,children:(0,I.jsxs)(cp,{to:`${se}/agents`,className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[(0,I.jsx)($t,{className:`h-3 w-3`}),ze,` agent`,ze===1?``:`s`]})})]}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6 space-y-3`,children:(0,I.jsxs)(`div`,{className:`grid gap-4 ${ne||!m?`sm:grid-cols-2`:`sm:grid-cols-3`}`,children:[!ne&&m&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Config ID`}),(0,I.jsx)(Pp,{value:b.name,onChange:e=>F({name:e.target.value}),disabled:ne,placeholder:`e.g. check-weather`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Name`}),(0,I.jsx)(Pp,{value:b.configName||``,onChange:e=>F({configName:e.target.value}),disabled:ne,placeholder:`e.g. Weather checks baseline`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Description`}),(0,I.jsx)(Pp,{value:b.description||``,onChange:e=>F({description:e.target.value}),disabled:ne,placeholder:`Brief description...`})]})]})})}),(0,I.jsxs)(b0,{value:N,onValueChange:t=>{if(t!==`servers`&&t!==`agents`&&t!==`scenarios`)return;let n=new URLSearchParams(i);n.delete(`tab`),a(n,{replace:!0}),r(e&&e!==`new`?`/mcp-evaluations/${encodeURIComponent(e)}/${t}`:`/mcp-evaluations/${e??`new`}/${t}`,{replace:!0})},className:`space-y-4`,children:[(0,I.jsxs)(x0,{children:[(0,I.jsxs)(S0,{value:`scenarios`,className:`gap-1.5`,children:[(0,I.jsx)(wn,{className:`h-3.5 w-3.5`}),`Scenarios`]}),(0,I.jsxs)(S0,{value:`agents`,className:`gap-1.5`,children:[(0,I.jsx)($t,{className:`h-3.5 w-3.5`}),`Agents`]})]}),(0,I.jsxs)(C0,{value:`agents`,children:[!ne&&(0,I.jsx)(K,{className:`mb-4`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_auto]`,children:[(0,I.jsxs)(T1,{value:w,onValueChange:T,children:[(0,I.jsx)(D1,{className:`h-8`,children:(0,I.jsx)(E1,{placeholder:`Select agent from library`})}),(0,I.jsx)(A1,{children:B.map(e=>(0,I.jsx)(Q,{value:e.id,children:e.label},e.id))})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!w,onClick:V,children:`Add Ref`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!w,onClick:pe,children:`Import Inline`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:f.length===0||f.every(e=>z.some(t=>t.kind===`referenced`&&t.ref===e.id)),onClick:fe,children:`Add All Refs`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,onClick:de,children:`Add agent`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[z.map((e,t)=>{let n=e.kind===`referenced`?we(e.ref):null,r=e.kind===`inline`?Vi(e.agent.name,e.agent.id):Vi(n?.name,e.ref),i=e.kind===`inline`?e.agent.model:n?.model||`unknown`,a=e.kind===`inline`?e.agent.id:e.ref,o=e.kind===`referenced`&&!n,s=e.kind===`inline`?e.agent.id:e.ref,c=re.includes(s),l=e.kind===`inline`&&!!E[e.agent.id];return(0,I.jsxs)(`div`,{className:`rounded-md border text-sm`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>he(t,-1),disabled:t===0,"aria-label":`Move agent up`,children:(0,I.jsx)(on,{className:`h-3 w-3`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>he(t,1),disabled:t===z.length-1,"aria-label":`Move agent down`,children:(0,I.jsx)(rn,{className:`h-3 w-3`})})]}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t+1,`.`]}),(0,I.jsx)(`span`,{className:`truncate font-medium`,children:r}),(0,I.jsx)(Y,{variant:e.kind===`inline`?`secondary`:`outline-solid`,children:e.kind===`inline`?`Inline`:`Referenced`}),(0,I.jsx)(Y,{variant:`outline`,className:`font-mono text-[10px]`,children:i}),c&&(0,I.jsx)(Y,{variant:`outline`,className:`text-xs border-emerald-300 text-emerald-700 bg-emerald-50`,children:`Default`}),o&&(0,I.jsx)(Y,{variant:`destructive`,children:`Missing`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsxs)(`label`,{className:`mx-2 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>le(s,e.target.checked)}),(0,I.jsx)(`span`,{children:`Default`})]}),e.kind===`inline`&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>D(t=>({...t,[e.agent.id]:!t[e.agent.id]})),children:l?`Collapse`:`Expand`}),e.kind===`referenced`&&(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>ge(t),disabled:o,children:`Convert to inline`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`ghost`,className:`h-7 w-7 text-destructive hover:text-destructive`,onClick:()=>me(t),"aria-label":`Remove agent entry`,children:(0,I.jsx)(ar,{className:`h-3.5 w-3.5`})})]})]}),e.kind===`inline`&&e.agent.type!==`browser`&&l&&(0,I.jsxs)(`div`,{className:`border-t px-3 py-3 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Name`}),(0,I.jsx)(Pp,{value:e.agent.name,onChange:n=>{let r=[...z];r[t]={kind:`inline`,agent:{...e.agent,name:n.target.value}},te(r)},placeholder:`e.g. GPT-5 Mini custom`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Provider`}),(0,I.jsxs)(T1,{value:e.agent.provider,onValueChange:n=>{let r=e.agent;if(r.type===`browser`)return;let i=[...z];i[t]={kind:`inline`,agent:{...r,provider:n}},te(i)},children:[(0,I.jsx)(D1,{children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`openai`,children:`OpenAI`}),(0,I.jsx)(Q,{value:`anthropic`,children:`Anthropic`}),(0,I.jsx)(Q,{value:`azure`,children:`Azure OpenAI`}),(0,I.jsx)(Q,{value:`google`,children:`Google`}),(0,I.jsx)(Q,{value:`custom`,children:`Custom`})]})]})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Model`}),(0,I.jsx)(Pp,{value:e.agent.model,onChange:n=>{let r=[...z];r[t]={kind:`inline`,agent:{...e.agent,model:n.target.value}},te(r)},className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Max Tokens`}),(0,I.jsx)(Pp,{type:`number`,min:1,max:128e3,value:e.agent.maxTokens,onChange:n=>{let r=[...z];r[t]={kind:`inline`,agent:{...e.agent,maxTokens:parseInt(n.target.value)||0}},te(r)},className:`font-mono text-xs`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Temperature`}),(0,I.jsx)(Pp,{type:`number`,min:0,max:2,step:.01,value:Q4(e.agent.temperature),onChange:n=>{let r=e.agent;if(r.type===`browser`)return;let i=[...z];i[t]={kind:`inline`,agent:{...r,temperature:Number(n.target.value)||0}},te(i)},className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`System Prompt`}),(0,I.jsx)(t0,{value:e.agent.systemPrompt||``,onChange:n=>{let r=e.agent;if(r.type!==`llm`)return;let i=[...z];i[t]={kind:`inline`,agent:{...r,systemPrompt:n.target.value}},te(i)},rows:3,className:`text-xs`})]})]})]},`agent-entry-${t}-${a}`)}),z.length===0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No agents configured yet. Add inline agents or references.`})]}),Ie.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`Missing agent refs: `,Ie.join(`, `)]})]})}),ne?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-4`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[Ae.map((e,t)=>{let n=Vi(e.agent.name,e.agent.id),r=re.includes(e.origin===`inline`?e.agent.id:e.ref||e.agent.id),i=e.ref??e.agent.id,a=!!k[i];return(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t+1,`.`]}),(0,I.jsx)(`div`,{className:`truncate font-medium text-sm`,children:n})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r&&(0,I.jsx)(Y,{variant:`outline`,className:`text-xs border-emerald-300 text-emerald-700 bg-emerald-50`,children:`Default`}),(0,I.jsx)(Y,{variant:e.origin===`inline`?`secondary`:`outline-solid`,children:e.origin===`inline`?`Inline`:`Referenced`}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-8 w-8`,onClick:()=>A(e=>({...e,[i]:!e[i]})),"aria-label":a?`Collapse agent details`:`Expand agent details`,children:(0,I.jsx)(rn,{className:`h-4 w-4 transition-transform ${a?`rotate-180`:``}`})})]})]}),a&&(0,I.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2`,children:[(0,I.jsx)(D0,{provider:e.agent.provider}),(0,I.jsx)(Y,{variant:`outline`,className:`text-xs font-mono`,children:e.agent.model}),(0,I.jsxs)(Y,{variant:`outline`,className:`text-xs font-mono`,children:[`max_tokens: `,e.agent.maxTokens]}),e.agent.type!==`browser`&&(0,I.jsxs)(Y,{variant:`outline`,className:`text-xs font-mono`,children:[`temperature: `,Q4(e.agent.temperature)]})]})]},`agent-view-${t}-${e.ref??e.agent.id}`)}),Ae.length===0&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-6`,children:`No agents configured.`})]})})}):null]}),(0,I.jsxs)(C0,{value:`scenarios`,children:[!ne&&(0,I.jsx)(K,{className:`mb-4`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_auto]`,children:[(0,I.jsxs)(T1,{value:S,onValueChange:C,children:[(0,I.jsx)(D1,{className:`h-8`,children:(0,I.jsx)(E1,{placeholder:`Select scenario from library`})}),(0,I.jsx)(A1,{children:[...p].sort((e,t)=>Vi(e.name,e.id).localeCompare(Vi(t.name,t.id))).map(e=>(0,I.jsx)(Q,{value:e.id,children:Vi(e.name,e.id)},e.id))})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!S,onClick:ye,children:`Add Ref`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!S,onClick:_e,children:`Import Inline`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,onClick:ve,children:`Add scenario`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[L.map((e,t)=>{let n=e.kind===`referenced`?Te(e.ref):null,r=e.kind===`inline`?Vi(e.scenario.name,e.scenario.id):Vi(n?.name,e.ref),i=e.kind===`inline`&&Vi(e.scenario.name).length===0,a=e.kind===`referenced`&&Re.has(e.ref),o=e.kind===`referenced`&&Array.isArray(e.mcpServers),s=e.kind===`inline`&&!!j[e.scenario.id];return(0,I.jsxs)(`div`,{className:`rounded-md border text-sm`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>xe(t,-1),disabled:t===0,"aria-label":`Move scenario up`,children:(0,I.jsx)(on,{className:`h-3 w-3`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>xe(t,1),disabled:t===L.length-1,"aria-label":`Move scenario down`,children:(0,I.jsx)(rn,{className:`h-3 w-3`})})]}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t+1,`.`]}),(0,I.jsx)(`span`,{className:`truncate font-medium`,children:r}),(0,I.jsx)(Y,{variant:e.kind===`inline`?`secondary`:`outline-solid`,children:e.kind===`inline`?`Inline`:`Referenced`}),o&&(0,I.jsx)(Y,{variant:`secondary`,children:`Override`}),i&&(0,I.jsx)(Y,{variant:`destructive`,children:`Name required`}),a&&(0,I.jsx)(Y,{variant:`destructive`,children:`Missing`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.kind===`inline`&&(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-7 w-7`,onClick:()=>M(t=>({...t,[e.scenario.id]:!t[e.scenario.id]})),"aria-label":s?`Collapse scenario details`:`Expand scenario details`,children:(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${s?`rotate-180`:``}`})}),e.kind===`referenced`&&(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>Se(t),disabled:a,children:`Convert to inline`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`ghost`,className:`h-7 w-7 text-destructive hover:text-destructive`,onClick:()=>be(t),"aria-label":`Remove scenario entry`,children:(0,I.jsx)(ar,{className:`h-3.5 w-3.5`})})]})]}),e.kind===`inline`&&s&&(0,I.jsx)(`div`,{className:`border-t px-3 py-3`,children:(0,I.jsx)(W4,{scenarios:[e.scenario],scenarioOrigins:[`inline`],agents:[...b.agents,...ke],servers:H,configId:b.id,configPath:b.sourcePath,defaultAssistantAgentName:b.runDefaults?.selectedAgentNames?.[0],onChange:e=>{let n=e[0];if(!n)return;let r=[...L];r[t]={kind:`inline`,scenario:n},R(r)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})}),e.kind===`referenced`&&!a&&(0,I.jsxs)(`div`,{className:`border-t px-3 py-3 space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Optional MCP server override for this referenced scenario.`}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Ve.map(n=>{let r=(e.mcpServers??[]).some(e=>e.kind===`referenced`&&e.ref===n.id);return(0,I.jsx)(W,{type:`button`,size:`sm`,variant:r?`default`:`outline-solid`,className:`h-7 text-xs ${r?``:`opacity-70`}`,onClick:()=>{let r=(e.mcpServers??[]).filter(e=>e.kind===`referenced`).map(e=>e.ref),i=r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id];He(t,i)},children:Vi(n.name,n.id)},`${e.ref}-override-server-${n.id}`)})}),o&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 text-xs`,onClick:()=>Ue(t),children:`Reset override`})]})]},`scenario-entry-${t}-${e.kind===`inline`?e.scenario.id:e.ref}`)}),L.length===0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No scenarios configured yet. Add inline scenarios or references.`})]}),Le.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`Missing scenario refs: `,Le.join(`, `)]})]})}),ne?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-4`,children:(0,I.jsx)(W4,{scenarios:Me.map(e=>e.scenario),scenarioOrigins:Me.map(e=>e.origin),scenarioOverrides:Me.map(e=>e.hasMcpServerOverride),agents:Ne,servers:H,configId:b.id,configPath:b.sourcePath,defaultAssistantAgentName:b.runDefaults?.selectedAgentNames?.[0],testCaseReturnToPath:P,onChange:()=>{},readOnly:!0})})}):null]})]})]})},n3=Symbol(`radix.slottable`);function r3(e){let t=({children:e})=>(0,I.jsx)(I.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=n3,t}var i3=`AlertDialog`,[a3,vte]=L(i3,[Eh]),o3=Eh(),s3=e=>{let{__scopeAlertDialog:t,...n}=e,r=o3(t);return(0,I.jsx)(ig,{...r,...n,modal:!0})};s3.displayName=i3;var c3=`AlertDialogTrigger`,l3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=o3(n);return(0,I.jsx)(ag,{...i,...r,ref:t})});l3.displayName=c3;var u3=`AlertDialogPortal`,d3=e=>{let{__scopeAlertDialog:t,...n}=e,r=o3(t);return(0,I.jsx)(og,{...r,...n})};d3.displayName=u3;var f3=`AlertDialogOverlay`,p3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=o3(n);return(0,I.jsx)(sg,{...i,...r,ref:t})});p3.displayName=f3;var m3=`AlertDialogContent`,[h3,g3]=a3(m3),_3=r3(`AlertDialogContent`),v3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=o3(n),o=_.useRef(null),s=P(t,o),c=_.useRef(null);return(0,I.jsx)($h,{contentName:m3,titleName:y3,docsSlug:`alert-dialog`,children:(0,I.jsx)(h3,{scope:n,cancelRef:c,children:(0,I.jsxs)(cg,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:j(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,I.jsx)(_3,{children:r}),(0,I.jsx)(D3,{contentRef:o})]})})})});v3.displayName=m3;var y3=`AlertDialogTitle`,b3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=o3(n);return(0,I.jsx)(lg,{...i,...r,ref:t})});b3.displayName=y3;var x3=`AlertDialogDescription`,S3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=o3(n);return(0,I.jsx)(ug,{...i,...r,ref:t})});S3.displayName=x3;var C3=`AlertDialogAction`,w3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=o3(n);return(0,I.jsx)(dg,{...i,...r,ref:t})});w3.displayName=C3;var T3=`AlertDialogCancel`,E3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=g3(T3,n),a=o3(n),o=P(t,i);return(0,I.jsx)(dg,{...a,...r,ref:o})});E3.displayName=T3;var D3=({contentRef:e})=>{let t=`\`${m3}\` requires a description for the component to be accessible for screen reader users.
128
+
129
+ You can add a description to the \`${m3}\` by passing a \`${x3}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
130
+
131
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${m3}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
132
+
133
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return _.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},O3=s3,k3=d3,A3=p3,j3=v3,M3=w3,N3=E3,P3=b3,F3=S3,I3=O3,L3=k3,R3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(A3,{className:U(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));R3.displayName=A3.displayName;var z3=_.forwardRef(({className:e,...t},n)=>(0,I.jsxs)(L3,{children:[(0,I.jsx)(R3,{}),(0,I.jsx)(j3,{ref:n,className:U(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...t})]}));z3.displayName=j3.displayName;var B3=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});B3.displayName=`AlertDialogHeader`;var V3=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});V3.displayName=`AlertDialogFooter`;var H3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(P3,{ref:n,className:U(`text-lg font-semibold`,e),...t}));H3.displayName=P3.displayName;var U3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(F3,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));U3.displayName=F3.displayName;var W3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(M3,{ref:n,className:U(Np(),e),...t}));W3.displayName=M3.displayName;var G3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(N3,{ref:n,className:U(Np({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));G3.displayName=N3.displayName;var K3=()=>{let{servers:e,setServers:t,reload:n,loading:r}=Gv(),i=Wd(),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(``),l=s.trim().toLowerCase(),u=e=>e.name?.trim()||e.id,d=async n=>{let r=`${u(n)}-copy`,i=r,a=1;for(;e.some(e=>(e.name?.trim()||e.id)===i);)i=`${r}-${a}`,a+=1;let o={...structuredClone(n),id:`srv-${Date.now()}`,name:i};await t([...e,o]),O({title:`Server duplicated`,description:`Created ${i}.`})},f=async n=>{await t(e.filter(e=>e.id!==n.id)),O({title:`Server deleted`,description:`${u(n)} was removed.`}),o(null)},p=e=>e.transport===`stdio`?[e.command,...e.args||[]].filter(Boolean).join(` `):e.url||``,m=(0,_.useMemo)(()=>[...l.length===0?e:e.filter(e=>[u(e),e.id,e.transport,p(e),e.authType??``].join(` `).toLowerCase().includes(l))].sort((e,t)=>u(e).localeCompare(u(t),void 0,{sensitivity:`base`})),[e,l]);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,className:`h-6 w-6`}),`MCP Servers`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reusable MCP server definitions shared across configurations.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(FY,{value:s,onValueChange:c,placeholder:`Search MCP servers...`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void n(),disabled:r,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>i(`/libraries/servers/new`),children:[(0,I.jsx)(qn,{className:`mr-2 h-4 w-4`}),`Add Server`]})]})]}),e.length===0?(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No servers configured. Add one to get started.`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,className:`mt-4`,onClick:()=>i(`/libraries/servers/new`),children:[(0,I.jsx)(qn,{className:`mr-2 h-4 w-4`}),`Add Server`]})]}):m.length===0?(0,I.jsx)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center`,children:(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No servers match this filter.`})}):(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(Xv,{children:[(0,I.jsx)(Zv,{children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{children:`Name`}),(0,I.jsx)(ty,{children:`Transport`}),(0,I.jsx)(ty,{children:`Endpoint`}),(0,I.jsx)(ty,{children:`Auth`}),(0,I.jsx)(ty,{className:`text-right`,children:`Actions`})]})}),(0,I.jsx)(Qv,{children:m.map(e=>(0,I.jsxs)(ey,{className:`cursor-pointer hover:bg-muted/50`,onClick:()=>i(`/libraries/servers/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(J,{className:`font-medium`,children:(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,className:`h-4 w-4`}),u(e)]})}),(0,I.jsx)(J,{children:(0,I.jsx)(Y,{variant:`secondary`,className:`font-mono text-xs`,children:e.transport})}),(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:p(e)})}),(0,I.jsx)(J,{children:!e.authType||e.authType===`none`?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`}):(0,I.jsx)(Y,{variant:`outline`,className:`text-xs`,children:e.authType})}),(0,I.jsx)(J,{className:`text-right`,onClick:e=>e.stopPropagation(),children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>o(e),children:[(0,I.jsx)(ar,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void d(e),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>i(`/libraries/servers/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(Gn,{className:`mr-1.5 h-3.5 w-3.5`}),`Edit`]})]})})]},e.id))})]})})}),(0,I.jsx)(I3,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(z3,{children:[(0,I.jsxs)(B3,{children:[(0,I.jsx)(H3,{children:`Delete server?`}),(0,I.jsxs)(U3,{children:[`This will permanently remove`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:a?u(a):``}),` `,`from the library. This action cannot be undone.`]})]}),(0,I.jsxs)(V3,{children:[(0,I.jsx)(G3,{children:`Cancel`}),(0,I.jsx)(W3,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{a&&f(a)},children:`Delete Server`})]})]})})]})};function q3({className:e,disabled:t,...n}){let[r,i]=(0,_.useState)(!1);return(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(Pp,{...n,disabled:t,type:r?`text`:`password`,className:[e,`pr-9`].filter(Boolean).join(` `)}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,disabled:t,"aria-label":r?`Hide value`:`Show value`,"aria-pressed":r,title:r?`Hide value`:`Show value`,className:`absolute right-0 top-0 h-full w-9 rounded-l-none`,onClick:()=>i(e=>!e),children:r?(0,I.jsx)(bn,{className:`h-4 w-4`}):(0,I.jsx)(xn,{className:`h-4 w-4`})})]})}var J3={stdio:`Check that the command is installed and the args are correct`,sse:`Check that the server is running and the URL is reachable`,"streamable-http":`Check that the server is running and the URL is reachable`},Y3=()=>({id:`srv-${Date.now()}`,name:``,transport:`stdio`,authType:`none`}),X3=()=>{let{serverId:e}=Jd(),t=Wd(),{servers:n,setServers:r}=Gv(),{source:i}=Mv(),a=e===`new`,o=e?decodeURIComponent(e):``,s=a?null:n.find(e=>e.id===o||e.name===o),c=e=>e.name?.trim()||e.id,[l,u]=(0,_.useState)(()=>s??Y3()),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)({status:`idle`}),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)([]),[w,T]=(0,_.useState)(!1),E=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=a?`new:${o||`new`}`:`srv:${o}`;E.current!==e&&(a?(u(Y3()),T(!1),E.current=e):s&&(u(s),T(!1),E.current=e))},[a,o,s]);let D=e=>{T(!1),u(t=>({...t,authType:e,...e!==`bearer`&&e!==`api-key`?{authValue:void 0}:{},...e===`api-key`?{apiKeyHeaderName:t.apiKeyHeaderName||`X-API-Key`}:{apiKeyHeaderName:void 0},...e===`oauth2`?{oauthRedirectUrl:t.oauthRedirectUrl||void 0}:{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0,oauthMode:void 0,oauthAuthorizationUrl:void 0,oauthTokenEndpoint:void 0}}))},k=async()=>{if(y(!0),g({status:`loading`}),C([]),l.authType===`oauth2`)try{x(!0),await v4({serverNames:[l.id],source:i,onServerStatus:e=>{let t=new Date().toLocaleTimeString(),n=typeof e.tokenExpiresInSeconds==`number`?` (valid ${k4(e.tokenExpiresInSeconds,{nonPositiveLabel:`expired`})}; until ${new Date(e.tokenExpiresAt||Date.now()).toLocaleTimeString()})`:``;e.status===`auth_required`?C(n=>[...n,`[${t}] OAuth debug: callback required for '${e.serverName}'`]):e.status===`ready`&&(e.debugState===`refreshed`?C(e=>[...e,`[${t}] OAuth debug: token refreshed (no callback)${n}`]):e.debugState===`reused`?C(e=>[...e,`[${t}] OAuth debug: session/token reused${n}`]):C(e=>[...e,`[${t}] OAuth debug: authorized${n}`]))}})}catch(e){g({status:`error`,message:`OAuth login failed: ${e instanceof Error?e.message:String(e)}`,testedAt:new Date().toISOString()}),x(!1);return}finally{x(!1)}try{let e=(await i.discoverToolsForAnalysis({serverNames:[l.id]})).servers[0];e&&e.warnings.length===0?g({status:`success`,toolNames:e.tools.map(e=>e.name),toolCount:e.tools.length,mcpServerVersion:e.mcpServerVersion,mcpServerImplementation:e.mcpServerImplementation,testedAt:new Date().toISOString()}):g({status:`error`,message:e?.warnings[0]??`Connection failed`,testedAt:new Date().toISOString()})}catch(e){g({status:`error`,message:e instanceof Error?e.message:String(e),testedAt:new Date().toISOString()})}},A=async()=>{if(!l.name.trim()){O({title:`Name is required`,variant:`destructive`});return}let e=Z4(l);if(e){O({title:`Validation Error`,description:e,variant:`destructive`});return}let i={...l,authValue:l.authValue?.trim(),apiKeyHeaderName:l.apiKeyHeaderName?.trim()||void 0};m(!0);try{if(a)await r([...n,i]),O({title:`Server created`}),t(`/libraries/servers/${encodeURIComponent(i.id)}`);else{let e=n.map(e=>e.id===s?.id?i:e);await r(e),O({title:`Server saved`}),i.id!==o&&t(`/libraries/servers/${encodeURIComponent(i.id)}`,{replace:!0})}}finally{m(!1)}},j=async()=>{let e=n.filter(e=>e.id!==s?.id);await r(e),O({title:`Server deleted`}),t(`/libraries/servers`)},M=()=>l.transport===`stdio`?[l.command,...l.args||[]].filter(Boolean).join(` `):l.url||``;return!a&&!s?(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(cp,{to:`/libraries/servers`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Servers`]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Server "`,o,`" not found.`]})]}):(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(cp,{to:`/libraries/servers`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Servers`]}),(0,I.jsxs)(`h1`,{className:`flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,className:`h-6 w-6`}),a?`New Server`:c(l)]})]}),!a&&(0,I.jsxs)(W,{type:`button`,onClick:()=>void k(),disabled:h.status===`loading`||b,children:[(0,I.jsx)(lr,{className:`mr-2 h-4 w-4`}),`Test Connection`]})]}),v&&(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{className:`flex-row items-center justify-between space-y-0`,children:[(0,I.jsx)(qv,{className:`text-base`,children:`Connection Test`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>y(!1),className:`rounded-sm opacity-70 hover:opacity-100`,children:(0,I.jsx)(dr,{className:`h-4 w-4`})})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:`Server:`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:c(l)}),(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),(0,I.jsx)(`span`,{children:`Transport:`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:l.transport}),M()&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),(0,I.jsx)(`span`,{children:`Endpoint:`}),(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:M()})]})]}),h.status===`loading`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}),b?`Waiting for OAuth login in browser…`:`Connecting to MCP server…`]}),S.length>0&&(0,I.jsx)(`div`,{className:`space-y-0.5`,children:S.map((e,t)=>(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},t))})]}),h.status===`success`&&(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-emerald-700`,children:[(0,I.jsx)(nn,{className:`h-4 w-4 shrink-0`}),`Connected — discovered `,h.toolCount,` tool`,h.toolCount===1?``:`s`]}),h.toolNames.length>0&&(0,I.jsxs)(`div`,{className:`rounded-md bg-muted p-3`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`First 5 tools:`}),(0,I.jsx)(`ul`,{className:`space-y-0.5`,children:h.toolNames.slice(0,5).map(e=>(0,I.jsx)(`li`,{className:`font-mono text-xs`,children:e},e))})]}),(h.mcpServerImplementation||h.mcpServerVersion)&&(0,I.jsx)(`div`,{className:`rounded-md border bg-muted/40 p-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[h.mcpServerImplementation?.icons?.[0]?.src?(0,I.jsx)(`img`,{src:h.mcpServerImplementation.icons[0].src,alt:h.mcpServerImplementation.title||h.mcpServerImplementation.name,className:`h-7 w-7 rounded-sm border bg-background object-contain`}):null,(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`MCP server`}),(0,I.jsx)(`p`,{className:`truncate text-sm`,children:h.mcpServerImplementation?h.mcpServerImplementation.title||h.mcpServerImplementation.name:`Unknown MCP server`}),h.mcpServerVersion?(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Version:`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:h.mcpServerVersion})]}):null,h.mcpServerImplementation?.description?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h.mcpServerImplementation.description}):null]})]})}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tested at `,new Date(h.testedAt).toLocaleString()]}),S.length>0&&(0,I.jsx)(`div`,{className:`space-y-0.5`,children:S.map((e,t)=>(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},t))})]}),h.status===`error`&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:`✗ Connection failed`}),` — `,h.message]}),J3[l.transport]&&(0,I.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground`,children:[`Hint: `,J3[l.transport]]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tested at `,new Date(h.testedAt).toLocaleString()]})]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{children:(0,I.jsx)(qv,{className:`text-base`,children:`Configuration`})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Name`}),(0,I.jsx)(Pp,{value:l.name,onChange:e=>u(t=>({...t,name:e.target.value})),placeholder:`e.g. Filesystem MCP`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Transport`}),(0,I.jsxs)(T1,{value:l.transport,onValueChange:e=>u(t=>({...t,transport:e})),children:[(0,I.jsx)(D1,{children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`stdio`,children:`stdio`}),(0,I.jsx)(Q,{value:`sse`,children:`SSE`}),(0,I.jsx)(Q,{value:`streamable-http`,children:`Streamable HTTP`})]})]})]})]}),l.transport===`stdio`?(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Command`}),(0,I.jsx)(Pp,{value:l.command||``,onChange:e=>u(t=>({...t,command:e.target.value})),placeholder:`npx`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Args (comma-separated)`}),(0,I.jsx)(Pp,{value:(l.args||[]).join(`, `),onChange:e=>u(t=>({...t,args:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})),placeholder:`-y, @mcp/server`,className:`font-mono text-xs`})]})]}):(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`URL`}),(0,I.jsx)(Pp,{value:l.url||``,onChange:e=>u(t=>({...t,url:e.target.value})),placeholder:`http://localhost:3001/sse`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Auth Type`}),(0,I.jsxs)(T1,{value:l.authType||`none`,onValueChange:e=>D(e),children:[(0,I.jsx)(D1,{children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`none`,children:`None`}),(0,I.jsx)(Q,{value:`bearer`,children:`Bearer Token`}),(0,I.jsx)(Q,{value:`api-key`,children:`API Key`}),(0,I.jsx)(Q,{value:`oauth2`,children:`OAuth 2.0`})]})]})]}),l.authType===`bearer`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Token`}),(0,I.jsx)(Pp,{value:l.authValue||``,onChange:e=>u(t=>({...t,authValue:e.target.value})),placeholder:"${DATABRICKS_TOKEN}",className:`font-mono text-xs`})]})]}),l.authType===`bearer`&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground -mt-1`,children:[`Use `,(0,I.jsx)(`code`,{className:`rounded bg-muted px-1`,children:"${VAR_NAME}"}),` to reference an environment variable, or enter a token directly.`]}),l.authType===`api-key`&&(0,I.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`API Key`}),(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Header Name`}),(0,I.jsx)(Pp,{value:l.apiKeyHeaderName||`X-API-Key`,onChange:e=>u(t=>({...t,apiKeyHeaderName:e.target.value})),placeholder:`X-API-Key`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Value`}),(0,I.jsx)(q3,{value:l.authValue||``,onChange:e=>u(t=>({...t,authValue:e.target.value})),placeholder:"${MY_API_KEY}",className:`font-mono text-xs`})]})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Use `,(0,I.jsx)(`code`,{className:`rounded bg-muted px-1`,children:"${VAR_NAME}"}),` to reference an environment variable, or enter a value directly.`]})]}),l.authType===`oauth2`&&(0,I.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`OAuth 2.0 Flow`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:!l.oauthMode||l.oauthMode===`pre_registered`?`default`:`outline-solid`,size:`sm`,onClick:()=>u(e=>({...e,oauthMode:`pre_registered`})),children:`Pre-registered`}),(0,I.jsx)(W,{type:`button`,variant:l.oauthMode===`dcr`?`default`:`outline-solid`,size:`sm`,onClick:()=>u(e=>({...e,oauthMode:`dcr`,oauthClientId:void 0,oauthClientSecret:void 0})),children:`DCR (Dynamic)`})]}),(!l.oauthMode||l.oauthMode===`pre_registered`)&&(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Client ID`}),(0,I.jsx)(Pp,{value:l.oauthClientId||``,onChange:e=>u(t=>({...t,oauthClientId:e.target.value})),placeholder:`your-client-id`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Client Secret (optional)`}),(0,I.jsx)(q3,{value:l.oauthClientSecret||``,onChange:e=>u(t=>({...t,oauthClientSecret:e.target.value})),placeholder:`••••••••`,className:`font-mono text-xs`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Scope (optional, space-separated)`}),(0,I.jsx)(Pp,{value:l.oauthScope||``,onChange:e=>u(t=>({...t,oauthScope:e.target.value})),placeholder:`openid profile mcp`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>T(e=>!e),children:[(0,I.jsx)(`span`,{children:w?`▾`:`▸`}),`Advanced — manual endpoint overrides`]}),w&&(0,I.jsxs)(`div`,{className:`mt-2 grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Authorization URL`}),(0,I.jsx)(Pp,{value:l.oauthAuthorizationUrl||``,onChange:e=>u(t=>({...t,oauthAuthorizationUrl:e.target.value||void 0})),placeholder:`leave blank to use .well-known discovery`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Token URL`}),(0,I.jsx)(Pp,{value:l.oauthTokenEndpoint||``,onChange:e=>u(t=>({...t,oauthTokenEndpoint:e.target.value||void 0})),placeholder:`leave blank to use .well-known discovery`,className:`font-mono text-xs`})]})]})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between pt-2`,children:[(0,I.jsx)(`div`,{children:!a&&(0,I.jsx)(W,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>f(!0),children:`Delete`})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>t(`/libraries/servers`),children:`Cancel`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void A(),disabled:p,children:[p&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),a?`Create Server`:`Save`]})]})]})]})]}),(0,I.jsx)(I3,{open:d,onOpenChange:f,children:(0,I.jsxs)(z3,{children:[(0,I.jsxs)(B3,{children:[(0,I.jsx)(H3,{children:`Delete server?`}),(0,I.jsxs)(U3,{children:[`This will permanently remove the server `,(0,I.jsx)(`span`,{className:`font-mono`,children:l.name}),`. This action cannot be undone.`]})]}),(0,I.jsxs)(V3,{children:[(0,I.jsx)(G3,{children:`Cancel`}),(0,I.jsx)(W3,{onClick:()=>void j(),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:`Delete`})]})]})})]})},Z3=({defaultType:e=`llm`})=>{let{agents:t,setAgents:n,reload:r,loading:i}=Gv(),a=Wd(),[o]=mp(),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),d=o.get(`type`)===`browser`?`browser`:e,[f,p]=(0,_.useState)(d),m=l.trim().toLowerCase();(0,_.useEffect)(()=>{p(d)},[d]);let h=e=>{let t=e;p(t),a(`/libraries/agents?type=${t}`)},g=(0,_.useMemo)(()=>({llm:t.filter(e=>(e.type??`llm`)===`llm`).length,browser:t.filter(e=>e.type===`browser`).length}),[t]),v=(0,_.useMemo)(()=>t.filter(e=>(e.type??`llm`)===f?m.length===0||[e.name,e.provider,e.model,e.type===`browser`?e.url:void 0].filter(Boolean).join(` `).toLowerCase().includes(m):!1),[t,m,f]),y=async e=>{let r=`${e.name}-copy`,i=r,a=1;for(;t.some(e=>e.name===i);)i=`${r}-${a}`,a+=1;let o={...structuredClone(e),id:`agt-${Date.now()}`,name:i};await n([...t,o]),O({title:`Agent duplicated`,description:`Created ${i}.`})},b=async e=>{await n(t.filter(t=>t.id!==e.id)),O({title:`Agent deleted`,description:`${e.name} was removed.`}),c(null)};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)($t,{className:`h-6 w-6`}),`Agents`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reusable agent profiles shared across configurations.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(FY,{value:l,onValueChange:u,placeholder:`Search agents...`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void r(),disabled:i,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>a(`/libraries/agents/new?type=${f}`),children:[(0,I.jsx)(qn,{className:`mr-2 h-4 w-4`}),`Add Agent`]})]})]}),t.length===0?(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No agents configured. Add one to get started.`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,className:`mt-4`,onClick:()=>a(`/libraries/agents/new?type=${f}`),children:[(0,I.jsx)(qn,{className:`mr-2 h-4 w-4`}),`Add Agent`]})]}):(0,I.jsxs)(b0,{value:f,onValueChange:h,className:`space-y-4`,children:[(0,I.jsxs)(x0,{className:`grid w-full max-w-md grid-cols-2`,"aria-label":`Agent type`,children:[(0,I.jsxs)(S0,{value:`llm`,children:[`LLM (`,g.llm,`)`]}),(0,I.jsxs)(S0,{value:`browser`,children:[`Browser (`,g.browser,`)`]})]}),v.length===0?(0,I.jsx)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center`,children:(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No agents match this filter.`})}):(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(Xv,{children:[(0,I.jsx)(Zv,{children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{children:`Name`}),(0,I.jsx)(ty,{children:`Provider`}),f===`browser`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(ty,{children:`URL`}),(0,I.jsx)(ty,{children:`Conversation`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(ty,{children:`Model`}),(0,I.jsx)(ty,{children:`Max Tokens`}),(0,I.jsx)(ty,{children:`Temperature`})]}),(0,I.jsx)(ty,{className:`text-right`,children:`Actions`})]})}),(0,I.jsx)(Qv,{children:v.map(e=>(0,I.jsxs)(ey,{className:`cursor-pointer hover:bg-muted/50`,onClick:()=>a(`/libraries/agents/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(J,{className:`font-medium`,children:(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2`,title:e.type===`browser`?`Browser agent`:`LLM agent`,children:[e.type===`browser`?(0,I.jsx)(_n,{className:`h-4 w-4 text-sky-600`,"aria-hidden":`true`}):(0,I.jsx)($t,{className:`h-4 w-4 text-muted-foreground`,"aria-hidden":`true`}),e.name]})}),(0,I.jsx)(J,{children:(0,I.jsx)(D0,{provider:e.provider})}),e.type===`browser`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`max-w-xs truncate font-mono text-xs`,title:e.url,children:e.url||`Not configured`})}),(0,I.jsx)(J,{className:`text-xs`,children:e.newConversationBetweenScenarios===!1?`Continue same conversation`:`New conversation per scenario`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:e.model})}),(0,I.jsx)(J,{className:`font-mono text-xs`,children:e.maxTokens}),(0,I.jsx)(J,{className:`font-mono text-xs`,children:Q4(e.temperature).toFixed(2)})]}),(0,I.jsx)(J,{className:`text-right`,onClick:e=>e.stopPropagation(),children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>c(e),children:[(0,I.jsx)(ar,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void y(e),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>a(`/libraries/agents/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(Gn,{className:`mr-1.5 h-3.5 w-3.5`}),`Edit`]})]})})]},e.id))})]})})})]}),(0,I.jsx)(I3,{open:!!s,onOpenChange:e=>!e&&c(null),children:(0,I.jsxs)(z3,{children:[(0,I.jsxs)(B3,{children:[(0,I.jsx)(H3,{children:`Delete agent?`}),(0,I.jsxs)(U3,{children:[`This will permanently remove `,(0,I.jsx)(`span`,{className:`font-mono`,children:s?.name}),` `,`from the library. This action cannot be undone.`]})]}),(0,I.jsxs)(V3,{children:[(0,I.jsx)(G3,{children:`Cancel`}),(0,I.jsx)(W3,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{s&&b(s)},children:`Delete Agent`})]})]})})]})},Q3=[`PageUp`,`PageDown`],$3=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],e6={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},t6=`Slider`,[n6,r6,i6]=oe(t6),[a6,yte]=L(t6,[i6]),[o6,s6]=a6(t6),c6=_.forwardRef((e,t)=>{let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:m,...h}=e,g=_.useRef(new Set),v=_.useRef(0),y=o===`horizontal`?d6:f6,[b=[],x]=Re({prop:u,defaultProp:l,onChange:e=>{[...g.current][v.current]?.focus(),d(e)}}),S=_.useRef(b);function C(e){E(e,E6(b,e))}function w(e){E(e,v.current)}function T(){let e=S.current[v.current];b[v.current]!==e&&f(b)}function E(e,t,{commit:n}={commit:!1}){let o=j6(a),s=GQ(M6(Math.round((e-r)/a)*a+r,o),[r,i]);x((e=[])=>{let r=C6(e,s,t);if(k6(r,c*a)){v.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}return e})}return(0,I.jsx)(o6,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:v,thumbs:g.current,values:b,orientation:o,form:m,children:(0,I.jsx)(n6.Provider,{scope:e.__scopeSlider,children:(0,I.jsx)(n6.Slot,{scope:e.__scopeSlider,children:(0,I.jsx)(y,{"aria-disabled":s,"data-disabled":s?``:void 0,...h,ref:t,onPointerDown:j(h.onPointerDown,()=>{s||(S.current=b)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:C,onSlideMove:s?void 0:w,onSlideEnd:s?void 0:T,onHomeKeyDown:()=>!s&&E(r,0,{commit:!0}),onEndKeyDown:()=>!s&&E(i,b.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!s){let n=Q3.includes(e.key)||e.shiftKey&&$3.includes(e.key)?10:1,r=v.current,i=b[r];E(i+a*n*t,r,{commit:!0})}}})})})})});c6.displayName=t6;var[l6,u6]=a6(t6,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),d6=_.forwardRef((e,t)=>{let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=_.useState(null),p=P(t,e=>f(e)),m=_.useRef(void 0),h=LY(i),g=h===`ltr`,v=g&&!a||!g&&a;function y(e){let t=m.current||d.getBoundingClientRect(),i=A6([0,t.width],v?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return(0,I.jsx)(l6,{scope:e.__scopeSlider,startEdge:v?`left`:`right`,endEdge:v?`right`:`left`,direction:v?1:-1,size:`width`,children:(0,I.jsx)(p6,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=y(e.clientX);o?.(t)},onSlideMove:e=>{let t=y(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=e6[v?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),f6=_.forwardRef((e,t)=>{let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=_.useRef(null),d=P(t,u),f=_.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=A6([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return(0,I.jsx)(l6,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,I.jsx)(p6,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=e6[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),p6=_.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=s6(t6,n);return(0,I.jsx)(V.span,{...l,ref:t,onKeyDown:j(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Q3.concat($3).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:j(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)}),onPointerMove:j(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:j(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),m6=`SliderTrack`,h6=_.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=s6(m6,n);return(0,I.jsx)(V.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});h6.displayName=m6;var g6=`SliderRange`,_6=_.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=s6(g6,n),a=u6(g6,n),o=P(t,_.useRef(null)),s=i.values.length,c=i.values.map(e=>w6(e,i.min,i.max)),l=s>1?Math.min(...c):0,u=100-Math.max(...c);return(0,I.jsx)(V.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:o,style:{...e.style,[a.startEdge]:l+`%`,[a.endEdge]:u+`%`}})});_6.displayName=g6;var v6=`SliderThumb`,y6=_.forwardRef((e,t)=>{let n=r6(e.__scopeSlider),[r,i]=_.useState(null),a=P(t,e=>i(e)),o=_.useMemo(()=>r?n().findIndex(e=>e.ref.current===r):-1,[n,r]);return(0,I.jsx)(b6,{...e,ref:a,index:o})}),b6=_.forwardRef((e,t)=>{let{__scopeSlider:n,index:r,name:i,...a}=e,o=s6(v6,n),s=u6(v6,n),[c,l]=_.useState(null),u=P(t,e=>l(e)),d=!c||o.form||!!c.closest(`form`),f=nc(c),p=o.values[r],m=p===void 0?0:w6(p,o.min,o.max),h=T6(r,o.values.length),g=f?.[s.size],v=g?D6(g,m,s.direction):0;return _.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),(0,I.jsxs)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[s.startEdge]:`calc(${m}% + ${v}px)`},children:[(0,I.jsx)(n6.ItemSlot,{scope:e.__scopeSlider,children:(0,I.jsx)(V.span,{role:`slider`,"aria-label":e[`aria-label`]||h,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,tabIndex:o.disabled?void 0:0,...a,ref:u,style:p===void 0?{display:`none`}:e.style,onFocus:j(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),d&&(0,I.jsx)(S6,{name:i??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),form:o.form,value:p},r)]})});y6.displayName=v6;var x6=`RadioBubbleInput`,S6=_.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{let i=_.useRef(null),a=P(i,r),o=QQ(t);return _.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`input`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,I.jsx)(V.input,{style:{display:`none`},...n,ref:a,defaultValue:t})});S6.displayName=x6;function C6(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function w6(e,t,n){return GQ(100/(n-t)*(e-t),[0,100])}function T6(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function E6(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function D6(e,t,n){let r=e/2;return(r-A6([0,50],[0,r])(t)*n)*n}function O6(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function k6(e,t){if(t>0){let n=O6(e);return Math.min(...n)>=t}return!0}function A6(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function j6(e){return(String(e).split(`.`)[1]||``).length}function M6(e,t){let n=10**t;return Math.round(e*n)/n}var N6=c6,P6=h6,F6=_6,I6=y6,L6=_.forwardRef(({className:e,...t},n)=>(0,I.jsxs)(N6,{ref:n,className:U(`relative flex w-full touch-none select-none items-center`,e),...t,children:[(0,I.jsx)(P6,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,I.jsx)(F6,{className:`absolute h-full bg-primary`})}),(0,I.jsx)(I6,{className:`block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`})]}));L6.displayName=N6.displayName;function R6(e){let t=z6(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(V6);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function z6(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=U6(n),i=H6(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var B6=Symbol(`radix.slottable`);function V6(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===B6}function H6(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 U6(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 W6=`Popover`,[G6,bte]=L(W6,[ac]),K6=ac(),[q6,J6]=G6(W6),Y6=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=K6(t),c=_.useRef(null),[l,u]=_.useState(!1),[d,f]=Re({prop:r,defaultProp:i??!1,onChange:a,caller:W6});return(0,I.jsx)(xc,{...s,children:(0,I.jsx)(q6,{scope:t,contentId:Pa(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:o,children:n})})};Y6.displayName=W6;var X6=`PopoverAnchor`,Z6=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=J6(X6,n),a=K6(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(o(),()=>s()),[o,s]),(0,I.jsx)(Sc,{...a,...r,ref:t})});Z6.displayName=X6;var Q6=`PopoverTrigger`,$6=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=J6(Q6,n),a=K6(n),o=P(t,i.triggerRef),s=(0,I.jsx)(V.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":m8(i.open),...r,ref:o,onClick:j(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,I.jsx)(Sc,{asChild:!0,...a,children:s})});$6.displayName=Q6;var e8=`PopoverPortal`,[t8,n8]=G6(e8,{forceMount:void 0}),r8=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=J6(e8,t);return(0,I.jsx)(t8,{scope:t,forceMount:n,children:(0,I.jsx)(H,{present:n||a.open,children:(0,I.jsx)(Me,{asChild:!0,container:i,children:r})})})};r8.displayName=e8;var i8=`PopoverContent`,a8=_.forwardRef((e,t)=>{let n=n8(i8,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=J6(i8,e.__scopePopover);return(0,I.jsx)(H,{present:r||a.open,children:a.modal?(0,I.jsx)(s8,{...i,ref:t}):(0,I.jsx)(c8,{...i,ref:t})})});a8.displayName=i8;var o8=R6(`PopoverContent.RemoveScroll`),s8=_.forwardRef((e,t)=>{let n=J6(i8,e.__scopePopover),r=_.useRef(null),i=P(t,r),a=_.useRef(!1);return _.useEffect(()=>{let e=r.current;if(e)return _h(e)},[]),(0,I.jsx)(ch,{as:o8,allowPinchZoom:!0,children:(0,I.jsx)(l8,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:j(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),c8=_.forwardRef((e,t)=>{let n=J6(i8,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return(0,I.jsx)(l8,{...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()}})}),l8=_.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=J6(i8,n),p=K6(n);return rm(),(0,I.jsx)(qp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(xe,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,I.jsx)(Cc,{"data-state":m8(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),u8=`PopoverClose`,d8=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=J6(u8,n);return(0,I.jsx)(V.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,()=>i.onOpenChange(!1))})});d8.displayName=u8;var f8=`PopoverArrow`,p8=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=K6(n);return(0,I.jsx)(wc,{...i,...r,ref:t})});p8.displayName=f8;function m8(e){return e?`open`:`closed`}var h8=Y6,g8=$6,_8=r8,v8=a8,y8=h8,b8=g8,x8=_.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,I.jsx)(_8,{children:(0,I.jsx)(v8,{ref:i,align:t,sideOffset:n,className:U(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...r})}));x8.displayName=v8.displayName;var S8=1,C8=.9,w8=.8,T8=.17,E8=.1,D8=.999,O8=.9999,k8=.99,A8=/[\\\/_+.#"@\[\(\{&]/,j8=/[\\\/_+.#"@\[\(\{&]/g,M8=/[\s-]/,N8=/[\s-]/g;function P8(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?S8:k8;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=P8(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=S8:A8.test(e.charAt(l-1))?(d*=w8,p=e.slice(i,l-1).match(j8),p&&i>0&&(d*=D8**+p.length)):M8.test(e.charAt(l-1))?(d*=C8,m=e.slice(i,l-1).match(N8),m&&i>0&&(d*=D8**+m.length)):(d*=T8,i>0&&(d*=D8**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=O8)),(d<E8&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=P8(e,t,n,r,l+1,a+2,o),f*E8>d&&(d=f*E8)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function F8(e){return e.toLowerCase().replace(N8,` `)}function I8(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,P8(e,t,F8(e),F8(t),0,0,{})}var L8=`[cmdk-group=""]`,R8=`[cmdk-group-items=""]`,z8=`[cmdk-group-heading=""]`,B8=`[cmdk-item=""]`,V8=`${B8}:not([aria-disabled="true"])`,H8=`cmdk-item-select`,U8=`data-value`,W8=(e,t,n)=>I8(e,t,n),G8=_.createContext(void 0),K8=()=>_.useContext(G8),q8=_.createContext(void 0),J8=()=>_.useContext(q8),Y8=_.createContext(void 0),X8=_.forwardRef((e,t)=>{let n=u5(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=u5(()=>new Set),i=u5(()=>new Map),a=u5(()=>new Map),o=u5(()=>new Set),s=c5(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,...v}=e,y=Pa(),b=Pa(),x=Pa(),S=_.useRef(null),C=p5();l5(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),l5(()=>{C(6,A)},[]);let w=_.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=_.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??W8;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(R8);t?t.appendChild(e.parentElement===t?e:e.closest(`${R8} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${R8} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${L8}[${U8}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(U8);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(L8)?.querySelector(z8))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${B8}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(V8)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(U8))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(U8))}function F(e){let t=j()?.closest(L8),n;for(;t&&!n;)t=e>0?o5(t,L8):s5(t,L8),n=t?.querySelector(V8);n?w.setState(`value`,n.getAttribute(U8)):P(e)}let I=()=>N(M().length-1),ee=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},L=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return _.createElement(V.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&ee(e);break;case`ArrowDown`:ee(e);break;case`p`:case`k`:g&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(H8);t.dispatchEvent(e)}}}}},_.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:g5},c),h5(e,e=>_.createElement(q8.Provider,{value:w},_.createElement(G8.Provider,{value:T},e))))}),Z8=_.forwardRef((e,t)=>{let n=Pa(),r=_.useRef(null),i=_.useContext(Y8),a=K8(),o=c5(e),s=o.current?.forceMount??i?.forceMount;l5(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=f5(n,r,[e.value,e.children,r],e.keywords),l=J8(),u=d5(e=>e.value&&e.value===c.current),d=d5(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);_.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(H8,f),()=>t.removeEventListener(H8,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:v,keywords:y,...b}=e;return _.createElement(V.div,{ref:N(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Q8=_.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Pa(),s=_.useRef(null),c=_.useRef(null),l=Pa(),u=K8(),d=d5(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));l5(()=>u.group(o),[]),f5(o,s,[e.value,e.heading,c]);let f=_.useMemo(()=>({id:o,forceMount:i}),[i]);return _.createElement(V.div,{ref:N(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&_.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),h5(e,e=>_.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},_.createElement(Y8.Provider,{value:f},e))))}),$8=_.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=_.useRef(null),a=d5(e=>!e.search);return!n&&!a?null:_.createElement(V.div,{ref:N(i,t),...r,"cmdk-separator":``,role:`separator`})}),e5=_.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=J8(),o=d5(e=>e.search),s=d5(e=>e.selectedItemId),c=K8();return _.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),_.createElement(V.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),t5=_.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=_.useRef(null),o=_.useRef(null),s=d5(e=>e.selectedItemId),c=K8();return _.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),_.createElement(V.div,{ref:N(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},h5(e,e=>_.createElement(`div`,{ref:N(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),n5=_.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return _.createElement(ig,{open:n,onOpenChange:r},_.createElement(og,{container:o},_.createElement(sg,{"cmdk-overlay":``,className:i}),_.createElement(cg,{"aria-label":e.label,"cmdk-dialog":``,className:a},_.createElement(X8,{ref:t,...s}))))}),r5=_.forwardRef((e,t)=>d5(e=>e.filtered.count===0)?_.createElement(V.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),i5=_.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return _.createElement(V.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},h5(e,e=>_.createElement(`div`,{"aria-hidden":!0},e)))}),a5=Object.assign(X8,{List:t5,Item:Z8,Input:e5,Group:Q8,Separator:$8,Dialog:n5,Empty:r5,Loading:i5});function o5(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function s5(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function c5(e){let t=_.useRef(e);return l5(()=>{t.current=e}),t}var l5=typeof window>`u`?_.useEffect:_.useLayoutEffect;function u5(e){let t=_.useRef();return t.current===void 0&&(t.current=e()),t}function d5(e){let t=J8(),n=()=>e(t.snapshot());return _.useSyncExternalStore(t.subscribe,n,n)}function f5(e,t,n,r=[]){let i=_.useRef(),a=K8();return l5(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(U8,s),i.current=s}),i}var p5=()=>{let[e,t]=_.useState(),n=u5(()=>new Map);return l5(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function m5(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function h5({asChild:e,children:t},n){return e&&_.isValidElement(t)?_.cloneElement(m5(t),{ref:t.ref},n(t.props.children)):n(t)}var g5={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},_5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(a5,{ref:n,className:U(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));_5.displayName=a5.displayName;var v5=_.forwardRef(({className:e,...t},n)=>(0,I.jsxs)(`div`,{className:`flex items-center border-b px-3`,"data-cmdk-input-wrapper":``,children:[(0,I.jsx)(Zn,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,I.jsx)(a5.Input,{ref:n,className:U(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));v5.displayName=a5.Input.displayName;var y5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(a5.List,{ref:n,className:U(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));y5.displayName=a5.List.displayName;var b5=_.forwardRef((e,t)=>(0,I.jsx)(a5.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));b5.displayName=a5.Empty.displayName;var x5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(a5.Group,{ref:n,className:U(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t}));x5.displayName=a5.Group.displayName;var S5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(a5.Separator,{ref:n,className:U(`-mx-1 h-px bg-border`,e),...t}));S5.displayName=a5.Separator.displayName;var C5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(a5.Item,{ref:n,className:U(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50`,e),...t}));C5.displayName=a5.Item.displayName;function w5(){let{source:e}=Mv(),[t,n]=(0,_.useState)({connected:!1});return(0,_.useEffect)(()=>{let t=!1,r=0,i=()=>{if(typeof e.getRoverStatus!=`function`)return;let i=++r;e.getRoverStatus().then(e=>{!t&&i===r&&n({connected:e.connected,provider:e.provider,pageUrl:e.pageUrl,activeJobId:e.activeJobId})}).catch(()=>{!t&&i===r&&n({connected:!1})})};i();let a=window.setInterval(i,3e3);return()=>{t=!0,window.clearInterval(a)}},[e]),t}var T5={openai:[`gpt-4o`,`gpt-4o-mini`,`gpt-4-turbo`,`o1`,`o1-mini`],anthropic:[`claude-3-5-sonnet-latest`,`claude-3-5-haiku-latest`,`claude-3-opus-latest`],azure:[`gpt-4o`,`gpt-4-turbo`],google:[`gemini-2.0-flash`,`gemini-1.5-pro`],custom:[]},E5={anthropic:"Check that `ANTHROPIC_API_KEY` is set in your environment",openai:"Check that `OPENAI_API_KEY` is set in your environment",azure:`Check that Azure OpenAI env vars are configured in your environment`},D5=()=>{let{agentName:e}=Jd(),[t]=mp(),n=Wd(),{agents:r,setAgents:i,browserProviders:a}=Gv(),{source:o}=Mv(),s=w5(),c=e===`new`,l=e?decodeURIComponent(e):``,u=c?null:r.find(e=>e.id===l)??r.find(e=>e.name===l),d=t.get(`type`)===`browser`?`browser`:`llm`,[f,p]=(0,_.useState)(()=>u??$4(d)),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)({status:`idle`}),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)([]),[T,E]=(0,_.useState)(!1),[D,k]=(0,_.useState)(!1),[A,j]=(0,_.useState)(!1),M=(0,_.useRef)(null),N=Object.values(a).map(e=>({id:e.id,name:e.name}));(0,_.useEffect)(()=>{let e=c?`new:${l||`new`}`:`agt:${l}`;M.current!==e&&(c?(p($4(d)),M.current=e):u&&(p(u),M.current=e))},[c,l,u]);let P=f.provider===`anthropic`||f.provider===`openai`||f.provider===`azure`,F=Array.from(new Set([...T5[f.provider]||[],...C])),ee=F.includes(f.model),L=A||!!f.model&&!ee,R=async()=>{if(S(!0),f.type===`browser`)b({status:`unsupported`}),O({title:`Browser Agent connection is handled by Rover`,description:`Open Rover and connect the configured browser provider.`});else if(f.provider===`google`||f.provider===`custom`)b({status:`unsupported`});else{b({status:`loading`});try{let e=await o.listProviderModels(f.provider);b({status:`success`,items:e.items,source:e.source,kind:e.kind,testedAt:new Date().toISOString()})}catch(e){b({status:`error`,message:e instanceof Error?e.message:String(e),testedAt:new Date().toISOString()})}}},z=async()=>{if(!P)O({title:`Provider discovery not supported`,description:`Model discovery is available for Anthropic, OpenAI, and Azure OpenAI.`});else{E(!0);try{let e=await o.listProviderModels(f.provider);w(e.items),O({title:e.kind===`deployments`?`Deployments loaded`:`Models loaded`,description:`${e.items.length} ${e.kind} from ${e.source}`})}catch(e){O({title:`Could not load provider models`,description:String(e instanceof Error?e.message:e),variant:`destructive`})}finally{E(!1)}}},te=async()=>{if(!f.name.trim())O({title:`Name is required`,variant:`destructive`});else if(f.type===`browser`&&!f.url?.trim())O({title:`Browser agent URL is required`,variant:`destructive`});else{v(!0);try{if(c)await i([...r,f]),O({title:`Agent created`}),n(`/libraries/agents/${encodeURIComponent(f.id)}`);else{let e=r.map(e=>e.id===u?.id?f:e);await i(e),O({title:`Agent saved`}),f.id!==l&&n(`/libraries/agents/${encodeURIComponent(f.id)}`,{replace:!0})}}finally{v(!1)}}},ne=async()=>{let e=r.filter(e=>e.id!==u?.id);await i(e),O({title:`Agent deleted`}),n(`/libraries/agents`)};if(!c&&!u)return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(cp,{to:`/libraries/agents`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Agents`]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Agent "`,l,`" not found.`]})]});let re=s.connected&&s.provider===f.provider;return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(cp,{to:`/libraries/agents`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Agents`]}),(0,I.jsxs)(`h1`,{className:`flex items-center gap-2 text-2xl font-bold`,children:[f.type===`browser`?(0,I.jsx)(_n,{className:`h-6 w-6 text-sky-600`,"aria-hidden":`true`}):(0,I.jsx)($t,{className:`h-6 w-6 text-muted-foreground`,"aria-hidden":`true`}),c?`New Agent`:f.name]})]}),!c&&f.type===`browser`?(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[re&&s.pageUrl?(0,I.jsx)(`a`,{href:s.pageUrl,target:`_blank`,rel:`noreferrer`,className:`max-w-xs rounded-md border px-3 py-2 text-xs text-muted-foreground hover:bg-accent hover:text-foreground`,title:`Open ${s.pageUrl}`,children:(0,I.jsx)(`span`,{className:`block truncate`,children:s.pageUrl})}):null,(0,I.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,I.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full ${re?`bg-emerald-500`:`bg-muted-foreground/40`}`}),(0,I.jsx)(`span`,{children:re?`Rover connected`:`Rover not connected`})]})]}):!c&&(0,I.jsxs)(W,{type:`button`,onClick:()=>void R(),children:[(0,I.jsx)(lr,{className:`mr-2 h-4 w-4`}),`Test Connection`]})]}),x&&(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{className:`flex-row items-center justify-between space-y-0`,children:[(0,I.jsx)(qv,{className:`text-base`,children:`Connection Test`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>S(!1),className:`rounded-sm opacity-70 hover:opacity-100`,children:(0,I.jsx)(dr,{className:`h-4 w-4`})})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:`Provider:`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:f.provider}),(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),(0,I.jsx)(`span`,{children:`Endpoint:`}),(0,I.jsxs)(`code`,{className:`font-mono text-xs`,children:[`/api/providers/models?provider=`,f.provider]})]}),y.status===`loading`&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}),`Testing connection...`]}),y.status===`success`&&(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-emerald-700`,children:[(0,I.jsx)(nn,{className:`h-4 w-4 shrink-0`}),`Connected — discovered `,y.items.length,` `,y.kind,` from`,` `,y.source]}),(0,I.jsxs)(`div`,{className:`rounded-md bg-muted p-3`,children:[(0,I.jsxs)(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:[`First 5 `,y.kind,`:`]}),(0,I.jsx)(`ul`,{className:`space-y-0.5`,children:y.items.slice(0,5).map(e=>(0,I.jsx)(`li`,{className:`font-mono text-xs`,children:e},e))})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tested at `,new Date(y.testedAt).toLocaleString()]})]}),y.status===`error`&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:`✗ Connection failed`}),` — `,y.message]}),E5[f.provider]&&(0,I.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground`,children:[`Hint: `,E5[f.provider]]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tested at `,new Date(y.testedAt).toLocaleString()]})]}),y.status===`unsupported`&&(0,I.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground`,children:[`Connection testing is not supported for the`,` `,(0,I.jsx)(`span`,{className:`font-medium`,children:f.provider}),` provider. Supported providers: Anthropic, OpenAI, Azure OpenAI.`]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{children:(0,I.jsx)(qv,{className:`text-base`,children:`Configuration`})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Name`}),(0,I.jsx)(Pp,{value:f.name,onChange:e=>p(t=>({...t,name:e.target.value})),placeholder:`e.g. GPT-4o`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Agent type`}),(0,I.jsxs)(T1,{value:f.type??`llm`,onValueChange:e=>p(t=>e===`browser`?{id:t.id,name:t.name,type:`browser`,provider:`claude`,model:``,maxTokens:0,url:t.type===`browser`?t.url:``,newConversationBetweenScenarios:t.type!==`browser`||t.newConversationBetweenScenarios}:{id:t.id,name:t.name,type:`llm`,provider:`openai`,model:t.model||`gpt-4o`,maxTokens:t.maxTokens||4096,temperature:t.type===`llm`?t.temperature:0,maxTurns:t.type===`llm`?t.maxTurns:void 0,systemPrompt:t.type===`llm`?t.systemPrompt:void 0}),children:[(0,I.jsx)(D1,{children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`llm`,children:`LLM Agent`}),(0,I.jsx)(Q,{value:`browser`,children:`Browser Agent`})]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Provider`}),(0,I.jsxs)(T1,{value:f.provider,onValueChange:e=>p(t=>t.type===`browser`?{...t,provider:e}:{...t,provider:e,model:T5[e]?.[0]||``}),children:[(0,I.jsx)(D1,{children:(0,I.jsx)(E1,{})}),(0,I.jsx)(A1,{children:f.type===`browser`?N.map(e=>(0,I.jsx)(Q,{value:e.id,children:e.name},e.id)):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Q,{value:`openai`,children:`OpenAI`}),(0,I.jsx)(Q,{value:`anthropic`,children:`Anthropic`}),(0,I.jsx)(Q,{value:`azure`,children:`Azure OpenAI`}),(0,I.jsx)(Q,{value:`google`,children:`Google`}),(0,I.jsx)(Q,{value:`custom`,children:`Custom`})]})})]})]}),f.type===`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{htmlFor:`agent-conversation-behavior`,children:`Conversation behavior`}),(0,I.jsxs)(T1,{value:f.newConversationBetweenScenarios===!1?`same`:`new`,onValueChange:e=>p(t=>t.type===`browser`?{...t,newConversationBetweenScenarios:e!==`same`}:t),children:[(0,I.jsx)(D1,{id:`agent-conversation-behavior`,children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`new`,children:`Start a new conversation between scenarios`}),(0,I.jsx)(Q,{value:`same`,children:`Continue the same conversation`})]})]}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Default for queue runs. It can be overridden when starting an evaluation.`})]})]}),f.type===`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Browser agent URL`}),(0,I.jsx)(Pp,{value:f.url??``,onChange:e=>p(t=>({...t,url:e.target.value})),placeholder:`https://provider.example`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Rover opens this URL when the queued Browser Agent needs attention.`})]}),f.type!==`browser`&&(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:f.provider===`azure`?`Deployment`:`Model`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(y8,{open:D,onOpenChange:k,children:[(0,I.jsx)(b8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":D,"aria-controls":`agent-model-command-list`,className:`h-9 flex-1 justify-between font-mono text-xs`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:f.model||`Select model...`}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(x8,{className:`w-[420px] p-0`,align:`start`,children:(0,I.jsxs)(_5,{children:[(0,I.jsx)(v5,{placeholder:`Search ${f.provider===`azure`?`deployments`:`models`}...`}),(0,I.jsxs)(y5,{id:`agent-model-command-list`,children:[(0,I.jsxs)(b5,{children:[`No `,f.provider===`azure`?`deployments`:`models`,` found.`]}),(0,I.jsxs)(x5,{heading:f.provider===`azure`?`Deployments`:`Models`,children:[F.map(e=>(0,I.jsxs)(C5,{value:e,onSelect:e=>{p(t=>({...t,model:e})),j(!1),k(!1)},children:[(0,I.jsx)(nn,{className:U(`mr-2 h-4 w-4`,f.model===e?`opacity-100`:`opacity-0`)}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:e})]},e)),(0,I.jsx)(C5,{value:`__custom_model_id__`,onSelect:()=>{j(!0),k(!1)},children:(0,I.jsx)(`span`,{className:`font-medium`,children:f.provider===`azure`?`Custom deployment ID...`:`Custom model ID...`})})]})]})]})})]}),P&&(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-9 shrink-0 text-xs`,onClick:()=>void z(),disabled:T,title:f.provider===`azure`?`Fetch Azure OpenAI deployments`:`Fetch ${f.provider} models`,children:[T?(0,I.jsx)(In,{className:`mr-1 h-3 w-3 animate-spin`}):(0,I.jsx)(Yn,{className:`mr-1 h-3 w-3`}),f.provider===`azure`?`Fetch Deployments`:`Fetch Models`]})]}),L&&(0,I.jsx)(Pp,{value:f.model,onChange:e=>p(t=>({...t,model:e.target.value})),placeholder:f.provider===`azure`?`Type deployment name manually`:`Type model name manually`,className:`font-mono text-xs`}),C.length>0&&(0,I.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Loaded `,C.length,` `,f.provider===`azure`?`deployment names`:`models`,` from provider discovery.`]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Max Tokens`}),(0,I.jsx)(Pp,{type:`number`,min:1,max:128e3,value:f.maxTokens,onChange:e=>p(t=>({...t,maxTokens:parseInt(e.target.value)||0})),className:`font-mono text-xs`})]})]}),f.type!==`browser`&&(0,I.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Max Turns`}),(0,I.jsx)(Pp,{type:`number`,min:1,max:50,value:f.maxTurns??``,onChange:e=>{let t=e.target.value.trim();p(e=>({...e,maxTurns:t&&parseInt(t)||void 0}))},placeholder:`30 (default)`,className:`font-mono text-xs`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Maximum number of LLM round-trips (tool calls + final answer) per eval run.`})]})}),f.type!==`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)($,{children:`Temperature`}),(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:Q4(f.temperature).toFixed(2)})]}),(0,I.jsx)(L6,{value:[Q4(f.temperature)],onValueChange:([e])=>p(t=>({...t,temperature:e})),min:0,max:2,step:.01})]}),f.type!==`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`System Prompt`}),(0,I.jsx)(t0,{value:f.systemPrompt||``,onChange:e=>p(t=>({...t,systemPrompt:e.target.value})),placeholder:`Optional system prompt...`,rows:3,className:`text-xs`})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between pt-2`,children:[(0,I.jsx)(`div`,{children:!c&&(0,I.jsx)(W,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>h(!0),children:`Delete`})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>n(`/libraries/agents`),children:`Cancel`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void te(),disabled:g,children:[g&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),c?`Create Agent`:`Save`]})]})]})]})]}),(0,I.jsx)(I3,{open:m,onOpenChange:h,children:(0,I.jsxs)(z3,{children:[(0,I.jsxs)(B3,{children:[(0,I.jsx)(H3,{children:`Delete agent?`}),(0,I.jsxs)(U3,{children:[`This will permanently remove the agent `,(0,I.jsx)(`span`,{className:`font-mono`,children:f.name}),`. This action cannot be undone.`]})]}),(0,I.jsxs)(V3,{children:[(0,I.jsx)(G3,{children:`Cancel`}),(0,I.jsx)(W3,{onClick:()=>void ne(),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:`Delete`})]})]})})]})},O5=`mcplab.resultAssistantScenarioHandoff`,k5=()=>{let{testCaseId:e}=Jd(),[t,n]=mp(),r=Wd(),{source:i}=Mv(),{scenarios:a,setScenarios:o,agents:s,servers:c,reload:l,loading:u}=Gv(),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(`all`),[h,g]=(0,_.useState)(`name`),[v,y]=(0,_.useState)(`asc`),[b,x]=(0,_.useState)(``),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(`idle`),[E,D]=(0,_.useState)(``),[k,A]=(0,_.useState)(``),[j,M]=(0,_.useState)(0),[N,P]=(0,_.useState)(null),F=(0,_.useRef)(null),ee=(0,_.useRef)(!1),L=(0,_.useRef)(!1),R=(0,_.useRef)(null),z=(0,_.useRef)(0),te=(0,_.useRef)(a);te.current=a;let ne=(0,_.useRef)(o);ne.current=o;let re=e?decodeURIComponent(e):void 0,ie=t.get(`returnTo`)?.trim()||``,ae=ie.startsWith(`/`)?ie:``,oe=re?a.findIndex(e=>e.id===re):-1,se=oe>=0?a[oe]:void 0,ce=async e=>{if(!se||oe<0||!e)return;let t=[...a];t[oe]=e,await o(t)},B=async()=>{let e=R.current;if(!e||!se)return;if(ee.current){L.current=!0;return}ee.current=!0,L.current=!1;let t=++z.current;T(`saving`),D(``);try{await ce(e),t===z.current&&T(`saved`)}catch(e){let n=e instanceof Error?e.message:String(e);t===z.current&&(T(`error`),D(n)),O({title:`Could not save scenario`,description:n,variant:`destructive`})}finally{ee.current=!1,L.current&&(L.current=!1,B())}},le=e=>{R.current=e,T(`dirty`),D(``),F.current&&window.clearTimeout(F.current),F.current=window.setTimeout(()=>{F.current=null,B()},700)},ue=async()=>{let e=`scn-${Date.now()}`,t=e,n=1;for(;a.some(e=>e.id===t);)t=`${e}-${n}`,n+=1;let i={id:t,name:``,serverIds:[],prompt:``,evalRules:[],extractRules:[]};await o([...a,i]),r(`/libraries/test-cases/${encodeURIComponent(t)}`),O({title:`Test case created`,description:`Opened ${t} for editing.`})},de=e=>{let t=(e||`scn-${Date.now()}`).trim().replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9_-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``)||`scn-${Date.now()}`,n=t,r=1;for(;a.some(e=>e.id===n);)n=`${t}-${r}`,r+=1;return n},V=async(e,t=!1)=>{let n=de(`${e.id}-copy`),i={...structuredClone(e),id:n,name:e.name?`${e.name} (Copy)`:``};await o([...a,i]),O({title:`Test case duplicated`,description:`Created ${i.id}.`}),t&&r(`/libraries/test-cases/${encodeURIComponent(i.id)}`)},fe=async e=>{F.current&&=(window.clearTimeout(F.current),null);let t=a.filter(t=>t.id!==e.id);await o(t),O({title:`Test case deleted`,description:`${e.id} was removed.`}),se?.id===e.id&&(C(null),R.current=null,T(`idle`),D(``),r(`/libraries/test-cases`))},pe=e=>e.map(e=>c.find(t=>t.id===e)).filter(Boolean).map(e=>e?.name||e?.id).filter(Boolean),me=(0,_.useMemo)(()=>{let e=new Set;for(let t of a)for(let n of pe(t.serverIds))e.add(n);return Array.from(e).sort((e,t)=>e.localeCompare(t))},[a,c]),he=(0,_.useMemo)(()=>{let e=d.trim().toLowerCase(),t=a.filter(t=>{let n=(t.name||``).toLowerCase(),r=t.id.toLowerCase(),i=(t.prompt||``).toLowerCase(),a=pe(t.serverIds);return p!==`all`&&!a.includes(p)?!1:!e||n.includes(e)||r.includes(e)||i.includes(e)||a.some(t=>t.toLowerCase().includes(e))});return t.sort((e,t)=>{let n=pe(e.serverIds),r=pe(t.serverIds),i=0;switch(h){case`id`:i=e.id.localeCompare(t.id);break;case`servers`:i=n.length-r.length;break;case`evalRules`:i=e.evalRules.length-t.evalRules.length;break;case`extractRules`:i=e.extractRules.length-t.extractRules.length;break;default:i=(e.name||e.id).localeCompare(t.name||t.id)}return i===0&&(i=e.id.localeCompare(t.id)),v===`asc`?i:-i}),t},[a,d,p,h,v,c]);(0,_.useEffect)(()=>{let e=!0;return i.getWorkspaceSettings().then(t=>{e&&t&&x(t.scenarioAssistantAgentName??``)}).catch(()=>{e&&x(``)}),()=>{e=!1}},[i]),(0,_.useEffect)(()=>{if(re&&t.get(`assistantHandoff`)===`1`)try{let e=window.sessionStorage.getItem(O5);if(!e)return;let r=JSON.parse(e);if(!r||r.scenarioId!==re||!r.prompt)return;A(String(r.prompt)),M(Date.now()),window.sessionStorage.removeItem(O5);let i=new URLSearchParams(t);i.delete(`assistantHandoff`),n(i,{replace:!0}),O({title:`Suggestion sent to Scenario Assistant`,description:`Review the suggestion and apply changes in the scenario editor.`})}catch{}},[re,t,n]),(0,_.useEffect)(()=>{let e=F.current!==null||ee.current,t=R.current;if(!(se&&t?.id===se.id&&e)){if(t&&t.id!==se?.id&&(F.current!==null||L.current)){F.current!==null&&(window.clearTimeout(F.current),F.current=null),L.current=!1;let e=te.current,n=e.findIndex(e=>e.id===t.id);if(n>=0){let r=[...e];r[n]=t,ne.current(r)}}F.current&&=(window.clearTimeout(F.current),null),ee.current=!1,L.current=!1,se?(C(structuredClone(se)),R.current=structuredClone(se),T(`idle`),D(``)):(C(null),R.current=null,T(`idle`),D(``))}},[se]),(0,_.useEffect)(()=>()=>{F.current&&window.clearTimeout(F.current)},[]);let ge=b||s[0]?.name||``;return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Sn,{className:`h-6 w-6`}),`Manage Test Cases`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reusable test case templates shared across configurations.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[se&&(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>r(`/libraries/test-cases`),children:[(0,I.jsx)(Qt,{className:`mr-2 h-4 w-4`}),`Back to Overview`]}),se&&ae&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,asChild:!0,children:(0,I.jsxs)(cp,{to:ae,children:[(0,I.jsx)(Qt,{className:`mr-2 h-4 w-4`}),`Back to evaluation`]})}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void l(),disabled:u,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),!se&&(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void ue(),children:[(0,I.jsx)(qn,{className:`mr-1.5 h-3.5 w-3.5`}),`Add Test Case`]})]})]}),!se&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`grid gap-3 rounded-md border bg-muted/30 p-3 md:grid-cols-[1.6fr_1fr_1fr_auto]`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Search`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(Zn,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,I.jsx)(Pp,{value:d,onChange:e=>f(e.target.value),placeholder:`Search by name, id, prompt, server...`,className:`h-8 pl-8 text-xs`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Server Filter`}),(0,I.jsxs)(T1,{value:p,onValueChange:m,children:[(0,I.jsx)(D1,{className:`h-8 text-xs`,children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`all`,children:`All servers`}),me.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Sort By`}),(0,I.jsxs)(T1,{value:h,onValueChange:e=>g(e),children:[(0,I.jsx)(D1,{className:`h-8 text-xs`,children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`name`,children:`Name`}),(0,I.jsx)(Q,{value:`id`,children:`ID`}),(0,I.jsx)(Q,{value:`servers`,children:`# Servers`}),(0,I.jsx)(Q,{value:`evalRules`,children:`# Eval Rules`}),(0,I.jsx)(Q,{value:`extractRules`,children:`# Extract Rules`})]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Direction`}),(0,I.jsxs)(T1,{value:v,onValueChange:e=>y(e),children:[(0,I.jsx)(D1,{className:`h-8 w-28 text-xs`,children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`asc`,children:`Ascending`}),(0,I.jsx)(Q,{value:`desc`,children:`Descending`})]})]})]})]}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`space-y-3 pt-6`,children:[(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Showing `,he.length,` of `,a.length,` test case`,a.length===1?``:`s`,`.`]}),re&&!se&&(0,I.jsxs)(`div`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900`,children:[`Test case `,(0,I.jsx)(`code`,{className:`font-mono`,children:re}),` was not found.`]}),a.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No library test cases yet.`}):he.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No test cases match the current filters.`}):(0,I.jsx)(`div`,{className:`grid gap-3`,children:he.map(e=>{let t=re===e.id,n=`/libraries/test-cases/${encodeURIComponent(e.id)}`,r=pe(e.serverIds);return(0,I.jsx)(`div`,{className:`rounded-lg border p-3 ${t?`border-primary bg-primary/5`:``}`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1 min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(cp,{to:n,className:`font-medium truncate hover:underline`,children:e.name||e.id}),(0,I.jsx)(Y,{variant:`outline`,className:`font-mono text-[10px]`,children:e.id}),t&&(0,I.jsx)(Y,{children:`Selected`})]}),(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground flex flex-wrap gap-x-3 gap-y-1`,children:[(0,I.jsxs)(`span`,{children:[r.length,` server`,r.length===1?``:`s`]}),(0,I.jsxs)(`span`,{children:[e.evalRules.length,` eval rule`,e.evalRules.length===1?``:`s`]}),(0,I.jsxs)(`span`,{children:[e.extractRules.length,` extract rule`,e.extractRules.length===1?``:`s`]})]}),r.length>0&&(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map(t=>(0,I.jsx)(Y,{variant:`secondary`,className:`text-[10px]`,children:t},`${e.id}-${t}`))})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>P(e),children:[(0,I.jsx)(ar,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void V(e),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:t?`default`:`outline-solid`,asChild:!0,children:(0,I.jsxs)(cp,{to:n,children:[(0,I.jsx)(Gn,{className:`mr-1.5 h-3.5 w-3.5`}),`Edit`]})})]})]})},e.id)})})]})})]}),se&&S?(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(qv,{className:`text-base`,children:[`Edit Test Case ·`,` `,(0,I.jsx)(`code`,{className:`font-mono text-muted-foreground`,children:se.id})]}),(0,I.jsx)(Y,{variant:`outline`,className:`text-[10px] ${w===`saving`?`border-amber-300 text-amber-700`:w===`saved`?`border-emerald-300 text-emerald-700`:w===`error`?`border-destructive/40 text-destructive`:w===`dirty`?`border-sky-300 text-sky-700`:``}`,children:w===`saving`?`Saving...`:w===`saved`?`Saved`:w===`error`?`Save failed`:w===`dirty`?`Unsaved changes`:`Ready`})]}),w===`error`&&E&&(0,I.jsx)(`div`,{className:`text-[11px] text-destructive`,children:E})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void V(S,!0),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>P(S),children:[(0,I.jsx)(ar,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]})]})]})}),(0,I.jsx)(q,{className:`pt-3`,children:(0,I.jsx)(W4,{scenarios:[S],agents:s,servers:c,defaultAssistantAgentName:ge,assistantInitialPromptByScenarioId:k&&S?.id?{[S.id]:k}:void 0,assistantAutoOpenNonceByScenarioId:S?.id&&j?{[S.id]:j}:void 0,onChange:e=>{let t=e[0];t&&(C(t),le(t))},allowAdd:!1})})]}):null,(0,I.jsx)(I3,{open:!!N,onOpenChange:e=>!e&&P(null),children:(0,I.jsxs)(z3,{children:[(0,I.jsxs)(B3,{children:[(0,I.jsx)(H3,{children:`Delete test case?`}),(0,I.jsxs)(U3,{children:[`This will permanently remove`,` `,(0,I.jsx)(`span`,{className:`font-medium`,children:N?.name||N?.id}),` `,`from the library. This action cannot be undone.`]})]}),(0,I.jsxs)(V3,{children:[(0,I.jsx)(G3,{children:`Cancel`}),(0,I.jsx)(W3,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{N&&(fe(N),P(null))},children:`Delete Test Case`})]})]})})]})},A5=()=>{let{source:e}=Mv(),{agents:t,reload:n,loading:r}=Gv(),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(`1`),m=(0,_.useMemo)(()=>c||t[0]?.name||``,[c,t]),h=(0,_.useCallback)(async()=>{a(!0);try{let t=await e.getWorkspaceSettings();l(t?.scenarioAssistantAgentName??``),d(t?.evaluationJudgeAgentName??``),p(String(t?.defaultQueueWorkers??1))}catch(e){l(``),d(``),p(`1`),O({title:`Could not load settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{a(!1)}},[e]);(0,_.useEffect)(()=>{h()},[h]);let g=async t=>{let n=c;l(t),s(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:t||void 0}),O({title:`Settings updated`,description:t?`Default assistant agent set to ${t}.`:`Default assistant agent cleared (will use first available agent by default).`})}catch(e){l(n),O({title:`Could not save settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{s(!1)}},v=async t=>{let n=f;p(t),s(!0);try{await e.updateWorkspaceSettings({defaultQueueWorkers:Number(t)}),O({title:`Settings updated`,description:`Evaluation workers set to ${t}.`})}catch(e){p(n),O({title:`Could not save settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{s(!1)}},y=async t=>{let n=u;d(t),s(!0);try{await e.updateWorkspaceSettings({evaluationJudgeAgentName:t||void 0}),O({title:`Settings updated`,description:t?`Default evaluation judge set to ${t}.`:`Default evaluation judge cleared.`})}catch(e){d(n),O({title:`Could not save settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{s(!1)}},b=async()=>{await Promise.all([n(),h()])};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)($n,{className:`h-6 w-6`}),`Settings`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Workspace-level MCP Lab settings and defaults.`})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void b(),disabled:r||i,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{className:`pb-3`,children:[(0,I.jsx)(qv,{className:`text-base`,children:`Assistant Defaults`}),(0,I.jsx)(Jv,{children:`Default assistant agent used across assistant flows. If unset, MCP Lab uses the first available agent automatically.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Default Assistant Agent`}),(0,I.jsxs)(T1,{value:m||`__none__`,onValueChange:e=>void g(e===`__none__`?``:e),disabled:o,children:[(0,I.jsx)(D1,{className:`h-9 text-sm`,children:(0,I.jsx)(E1,{placeholder:`Select assistant agent`})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`__none__`,children:`None (use first agent)`}),t.map(e=>(0,I.jsxs)(Q,{value:e.id,children:[e.name||e.id,` · `,e.model]},e.id))]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Applies to the assistant flows that use the workspace default. MCP Evaluation editors can still override the assistant agent from their evaluation context.`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Saved in workspace settings`})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{className:`pb-3`,children:[(0,I.jsx)(qv,{className:`text-base`,children:`Evaluation Judge`}),(0,I.jsx)(Jv,{children:`Default judge agent used by semantic agent checks during scenario evaluation runs.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Default Evaluation Judge`}),(0,I.jsxs)(T1,{value:u||`__none__`,onValueChange:e=>void y(e===`__none__`?``:e),disabled:o,children:[(0,I.jsx)(D1,{className:`h-9 text-sm`,children:(0,I.jsx)(E1,{placeholder:`Select evaluation judge`})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`__none__`,children:`None`}),t.map(e=>(0,I.jsxs)(Q,{value:e.id,children:[e.name||e.id,` · `,e.model]},e.id))]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Used by agent checks that semantically evaluate the final answer. If unset, runs with agent checks will fail before execution.`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Saved in workspace settings`})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{className:`pb-3`,children:[(0,I.jsx)(qv,{className:`text-base`,children:`Evaluation Queue`}),(0,I.jsx)(Jv,{children:`Control how many queued evaluation runs may execute in parallel.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Evaluation workers`}),(0,I.jsxs)(T1,{value:f,onValueChange:e=>void v(e),disabled:o,children:[(0,I.jsx)(D1,{className:`h-9 text-sm`,children:(0,I.jsx)(E1,{placeholder:`Select worker count`})}),(0,I.jsx)(A1,{children:Array.from({length:8},(e,t)=>String(t+1)).map(e=>(0,I.jsx)(Q,{value:e,children:e},e))})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Number of queued evaluation runs that may execute in parallel.`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Saved in workspace settings`})]})]})]})},j5=Wt(`relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground`,{variants:{variant:{default:`bg-background text-foreground`,destructive:`border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive`}},defaultVariants:{variant:`default`}}),M5=_.forwardRef(({className:e,variant:t,...n},r)=>(0,I.jsx)(`div`,{ref:r,role:`alert`,className:U(j5({variant:t}),e),...n}));M5.displayName=`Alert`;var N5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`h5`,{ref:n,className:U(`mb-1 font-medium leading-none tracking-tight`,e),...t}));N5.displayName=`AlertTitle`;var P5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`text-sm [&_p]:leading-relaxed`,e),...t}));P5.displayName=`AlertDescription`;var F5=`http://127.0.0.1:3011/mcp`;function I5(e){return navigator.clipboard.writeText(e)}function L5({text:e,label:t}){let[n,r]=(0,_.useState)(!1),i=async()=>{try{await I5(e),r(!0),O({title:`Copied`,description:`${t} copied to clipboard.`}),window.setTimeout(()=>r(!1),1500)}catch(e){O({title:`Copy failed`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}};return(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void i(),children:[(0,I.jsx)(hn,{className:`mr-2 h-3.5 w-3.5`}),n?`Copied`:`Copy`]})}function R5({label:e,value:t,copyText:n,valueClassName:r=``}){return(0,I.jsx)(`div`,{className:`rounded-lg border bg-muted/20 p-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,I.jsx)(`div`,{className:`mt-1 break-all text-sm font-medium ${r}`,children:t})]}),n&&(0,I.jsx)(L5,{text:n,label:e})]})})}function z5({title:e,description:t,code:n,iconSrc:r}){return(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{className:`pb-3`,children:[(0,I.jsxs)(qv,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(`img`,{src:r,alt:``,"aria-hidden":`true`,className:`h-4 w-4`}),e]}),(0,I.jsx)(Jv,{children:t})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsx)(`pre`,{className:`max-h-80 overflow-auto rounded-lg border bg-muted/30 p-3 text-xs whitespace-pre-wrap break-all`,children:n}),(0,I.jsx)(`div`,{className:`flex justify-end`,children:(0,I.jsx)(L5,{text:n,label:e})})]})]})}var B5=()=>{let{source:e}=Mv(),[t,n]=(0,_.useState)(!0),[r,i]=(0,_.useState)(null),a=(0,_.useCallback)(async()=>{n(!0);try{let t=await e.health();i(t)}catch(e){i(null),O({title:`Could not load MCP connection info`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{n(!1)}},[e]);(0,_.useEffect)(()=>{a()},[a]);let o=r?.mcp?.enabled?r.mcp:null,s=o?.directUrl??F5,c=o?.transport??`streamable-http`,l=(0,_.useMemo)(()=>JSON.stringify({mcpServers:{mcplab:{command:`npx`,args:[`mcp-remote`,s]}}},null,2),[s]),u=(0,_.useMemo)(()=>JSON.stringify({name:`mcplab`,transport:c,url:s},null,2),[s,c]);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Pn,{className:`h-6 w-6`}),`MCP Connection Info`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Copy the local MCPLab MCP server details into Claude Desktop or any MCP-capable client.`})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:t,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]})]}),!o&&(0,I.jsxs)(M5,{children:[(0,I.jsx)(Pn,{className:`h-4 w-4`}),(0,I.jsx)(N5,{children:`MCP server not reported`}),(0,I.jsx)(P5,{children:`The page is showing the default local connection details. Start MCP Lab in dev mode to see the live runtime endpoint and package version.`})]}),(0,I.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-[1.1fr_0.9fr]`,children:[(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{className:`pb-3`,children:[(0,I.jsx)(qv,{className:`text-base`,children:`Connection Details`}),(0,I.jsx)(Jv,{children:`The local server is exposed over streamable HTTP.`})]}),(0,I.jsx)(q,{className:`space-y-3`,children:(0,I.jsxs)(`div`,{className:`grid gap-3`,children:[(0,I.jsx)(R5,{label:`Direct MCP URL`,value:s,copyText:s}),(0,I.jsx)(R5,{label:`Transport`,value:c}),(0,I.jsx)(R5,{label:`Authentication`,value:`none`})]})})]}),(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(z5,{title:`Claude Desktop`,description:`Use mcp-remote to bridge Claude Desktop to the local streamable HTTP MCP server.`,code:l,iconSrc:`/icons/claude-color.svg`}),(0,I.jsx)(z5,{title:`OpenAI / MCP-capable client`,description:`Use this endpoint block in any client or adapter that accepts a single MCP-over-HTTP server.`,code:u,iconSrc:`/icons/openai.svg`})]})]})]})};function V5(e,t=[]){let n=[];function r(t,r){let i=_.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=_.useMemo(()=>o,Object.values(o));return(0,I.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.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=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,H5(i,...t)]}function H5(...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 _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var U5=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=wp(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),W5=`Progress`,G5=100,[K5,xte]=V5(W5),[q5,J5]=K5(W5),Y5=_.forwardRef((e,t)=>{let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=Q5,...o}=e;(i||i===0)&&!t7(i)&&console.error(r7(`${i}`,`Progress`));let s=t7(i)?i:G5;r!==null&&!n7(r,s)&&console.error(i7(`${r}`,`Progress`));let c=n7(r,s)?r:null,l=e7(c)?a(c,s):void 0;return(0,I.jsx)(q5,{scope:n,value:c,max:s,children:(0,I.jsx)(U5.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":e7(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":$5(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});Y5.displayName=W5;var X5=`ProgressIndicator`,Z5=_.forwardRef((e,t)=>{let{__scopeProgress:n,...r}=e,i=J5(X5,n);return(0,I.jsx)(U5.div,{"data-state":$5(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});Z5.displayName=X5;function Q5(e,t){return`${Math.round(e/t*100)}%`}function $5(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}function e7(e){return typeof e==`number`}function t7(e){return e7(e)&&!isNaN(e)&&e>0}function n7(e,t){return e7(e)&&!isNaN(e)&&e<=t&&e>=0}function r7(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${G5}\`.`}function i7(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
134
+ - a positive number
135
+ - less than the value passed to \`max\` (or ${G5} if no \`max\` prop is set)
136
+ - \`null\` or \`undefined\` if the progress is indeterminate.
137
+
138
+ Defaulting to \`null\`.`}var a7=Y5,o7=Z5,s7=_.forwardRef(({className:e,value:t,...n},r)=>(0,I.jsx)(a7,{ref:r,className:U(`relative h-4 w-full overflow-hidden rounded-full bg-secondary`,e),...n,children:(0,I.jsx)(o7,{className:`h-full w-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})}));s7.displayName=a7.displayName;function c7(e){let t=e.toLowerCase();return t.includes(`side-effectful prefix`)||t.includes(`destructive behavior`)||t.includes(`destructivehint`)||t.includes(`non-read-only behavior`)||t.includes(`readonlyhint: false`)||t.includes(`additive behavior`)}function l7(e){try{return JSON.stringify(e,null,2)}catch{return`[schema not serializable]`}}function u7(e){return typeof e.type==`string`?e.type:Array.isArray(e.type)?e.type.join(` | `):e.properties&&typeof e.properties==`object`?`object`:e.items&&typeof e.items==`object`?`array`:`any`}function d7(e,t=new Set){if(!e||typeof e!=`object`||Array.isArray(e))return 0;let n=e;if(t.has(n))return 0;let r=new Set(t);r.add(n);let i=n.properties&&typeof n.properties==`object`&&!Array.isArray(n.properties)?n.properties:void 0,a=i?Object.values(i).reduce((e,t)=>e+d7(t,r),0):0,o=d7(n.items,r),s=[...Array.isArray(n.oneOf)?n.oneOf:[],...Array.isArray(n.anyOf)?n.anyOf:[]].reduce((e,t)=>e+d7(t,r),0);return(i?Object.keys(i).length:0)+a+o+s}function f7({name:e,schema:t,required:n=!1,depth:r=0,seen:i=new Set,expandAll:a=null}){let[o,s]=(0,_.useState)(r===0);if((0,_.useEffect)(()=>{a!==null&&s(a)},[a]),!t||typeof t!=`object`||Array.isArray(t))return(0,I.jsx)(`div`,{className:`text-xs`,children:e});let c=t;if(i.has(c))return(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e,` (circular)`]});let l=new Set(i);l.add(c);let u=c.properties&&typeof c.properties==`object`&&!Array.isArray(c.properties)?c.properties:void 0,d=new Set(Array.isArray(c.required)?c.required.filter(e=>typeof e==`string`):[]),f=c.items&&typeof c.items==`object`?c.items:void 0,p=[...Array.isArray(c.oneOf)?c.oneOf:[],...Array.isArray(c.anyOf)?c.anyOf:[]],m=u&&Object.keys(u).length>0||!!f||p.length>0;return(0,I.jsxs)(`div`,{className:`min-w-0 space-y-1`,style:{marginLeft:r*12},children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 text-xs`,children:[m?(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-center gap-1 text-left font-medium hover:underline`,"aria-label":`${o?`Collapse`:`Expand`} ${e}`,"aria-expanded":o,onClick:()=>s(e=>!e),children:[o?(0,I.jsx)(rn,{className:`h-3 w-3 shrink-0`}):(0,I.jsx)(an,{className:`h-3 w-3 shrink-0`}),(0,I.jsx)(`span`,{className:`wrap-break-word`,children:e})]}):(0,I.jsx)(`span`,{className:`wrap-break-word font-medium`,children:e}),(0,I.jsx)(Y,{variant:`outline`,className:`text-[10px]`,children:u7(c)}),n&&(0,I.jsx)(`span`,{className:`text-[10px] text-rose-600`,children:`required`})]}),typeof c.description==`string`&&(0,I.jsx)(`div`,{className:`max-w-full wrap-break-word text-[11px] text-muted-foreground`,children:c.description}),Array.isArray(c.enum)&&(0,I.jsxs)(`div`,{className:`max-w-full wrap-break-word text-[11px] text-muted-foreground`,children:[`Enum: `,c.enum.map(e=>String(e)).join(`, `)]}),c.default!==void 0&&(0,I.jsxs)(`div`,{className:`max-w-full wrap-break-word text-[11px] text-muted-foreground`,children:[`Default: `,l7(c.default)]}),o&&m&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-2 border-l pl-2`,children:[u&&Object.keys(u).length>0&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Properties`}),Object.entries(u).map(([e,t])=>(0,I.jsx)(f7,{name:e,schema:t,required:d.has(e),depth:r+1,seen:l,expandAll:a},e))]}),f&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Items`}),(0,I.jsx)(f7,{name:`item`,schema:f,depth:r+1,seen:l,expandAll:a})]}),p.length>0&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Variants`}),p.map((e,t)=>(0,I.jsx)(f7,{name:`variant ${t+1}`,schema:e,depth:r+1,seen:l,expandAll:a},t))]})]})]})}function p7({propertyCount:e,onExpandAll:t,onCollapseAll:n}){return(0,I.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1`,children:[(0,I.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[e,` Properties`]}),(0,I.jsx)(`button`,{type:`button`,className:`rounded border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:t,children:`Expand All`}),(0,I.jsx)(`button`,{type:`button`,className:`rounded border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:n,children:`Collapse All`})]})}function m7({title:e,schema:t,explorerControls:n}){let r=e.toLowerCase(),i=async()=>{try{await navigator.clipboard.writeText(l7(t)),O({title:`${e} copied`})}catch(t){O({title:`Could not copy ${e.toLowerCase()}`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}};return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:e}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-1.5`,children:[n,(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex shrink-0 items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`Copy ${r} JSON`,title:`Copy ${r} JSON`,onClick:()=>void i(),children:[(0,I.jsx)(hn,{className:`h-3 w-3`}),`Copy JSON`]})]})]})}function h7({inputSchema:e,outputSchema:t,mode:n,onModeChange:r}){let[i,a]=(0,_.useState)(`explorer`),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(null),u=n??i,d=e=>{r?.(e),n||a(e)};return e===void 0&&t===void 0?null:(0,I.jsxs)(`details`,{className:`group/schema min-w-0 max-w-full overflow-hidden rounded border bg-muted/10 p-2`,onClick:e=>e.stopPropagation(),children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 text-xs font-medium`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Schemas`,e!==void 0&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`input`}),t!==void 0&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`output`})]}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`inline-flex rounded-md border bg-muted p-0.5`,role:`tablist`,"aria-label":`Schema view mode`,children:[`json`,`explorer`].map(e=>(0,I.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":u===e,className:`rounded px-2 py-0.5 text-[11px] font-medium capitalize data-[active=true]:bg-background data-[active=true]:shadow-xs`,"data-active":u===e,onClick:t=>{t.preventDefault(),t.stopPropagation(),d(e)},children:e.toUpperCase()},e))}),(0,I.jsx)(rn,{className:`h-4 w-4 text-muted-foreground transition-transform group-open/schema:rotate-180`})]})]}),(0,I.jsxs)(`div`,{className:`mt-2`,children:[u===`json`&&(0,I.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[e!==void 0&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(m7,{title:`Input schema`,schema:e}),(0,I.jsx)(`pre`,{className:`max-h-52 max-w-full overflow-auto whitespace-pre-wrap wrap-break-word rounded border bg-muted/20 p-2 text-[11px]`,children:l7(e)})]}),t!==void 0&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(m7,{title:`Output schema`,schema:t}),(0,I.jsx)(`pre`,{className:`max-h-52 max-w-full overflow-auto whitespace-pre-wrap wrap-break-word rounded border bg-muted/20 p-2 text-[11px]`,children:l7(t)})]})]}),u===`explorer`&&(0,I.jsxs)(`div`,{className:`mt-2 min-w-0 space-y-2`,children:[e!==void 0&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-2 rounded border bg-muted/10 p-2`,children:[(0,I.jsx)(m7,{title:`Input schema`,schema:e,explorerControls:(0,I.jsx)(p7,{propertyCount:d7(e),onExpandAll:()=>s(!0),onCollapseAll:()=>s(!1)})}),(0,I.jsx)(f7,{name:`root`,schema:e,expandAll:o})]}),t!==void 0&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-2 rounded border bg-muted/10 p-2`,children:[(0,I.jsx)(m7,{title:`Output schema`,schema:t,explorerControls:(0,I.jsx)(p7,{propertyCount:d7(t),onExpandAll:()=>l(!0),onCollapseAll:()=>l(!1)})}),(0,I.jsx)(f7,{name:`root`,schema:t,expandAll:c})]})]})]})]})}function g7(e,t){let n=t??(typeof navigator<`u`?navigator.language:void 0);return e.toLocaleString(n)}function _7(e,t){let n=0,r=!1;for(let i of e){let e=i.tokenEstimate;if(!e)continue;r=!0;let a=new Set(t[i.serverName]??[]);n+=e.tools.filter(e=>a.has(e.name)).reduce((e,t)=>e+t.total,0)}return r?n:void 0}function v7({total:e,title:t=`Estimated tokens for this tool definition and its schemas`,className:n}){return typeof e==`number`?(0,I.jsxs)(Y,{variant:`outline`,className:U(`bg-background font-mono text-xs font-normal`,n),title:t,children:[`~`,g7(e),`tok`]}):null}var y7=[`critical`,`high`,`medium`,`low`,`info`];function b7(e){switch(e){case`critical`:return`border-red-300 bg-red-100 text-red-900`;case`high`:return`border-orange-300 bg-orange-100 text-orange-900`;case`medium`:return`border-amber-300 bg-amber-100 text-amber-900`;case`low`:return`border-sky-300 bg-sky-100 text-sky-900`;default:return`border-slate-300 bg-slate-100 text-slate-800`}}function x7(e){switch(e){case`critical`:return`border-red-300 bg-background text-red-900`;case`high`:return`border-orange-300 bg-background text-orange-900`;case`medium`:return`border-amber-300 bg-background text-amber-900`;case`low`:return`border-sky-300 bg-background text-sky-900`;default:return`border-slate-300 bg-background text-slate-800`}}function S7(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`tool`}async function C7(e,t){let n=typeof t==`string`?t:JSON.stringify(t,null,2);try{await navigator.clipboard.writeText(n),O({title:`${e} copied`})}catch(t){O({title:`Could not copy ${e.toLowerCase()}`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}}function w7({text:e}){return(0,I.jsxs)(`div`,{className:`mt-2 rounded-md border px-2.5 py-2 text-[11px] text-slate-800`,children:[(0,I.jsxs)(`div`,{className:`mb-1 inline-flex items-center gap-1 font-medium text-slate-700`,children:[(0,I.jsx)(Nn,{className:`h-3.5 w-3.5`}),`Suggested improvement`]}),(0,I.jsx)(`p`,{children:e})]})}function T7({label:e,reason:t,variantClassName:n}){return(0,I.jsx)(fl,{delayDuration:0,children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(Y,{variant:`outline`,className:n,children:e})}),(0,I.jsx)(hl,{className:`max-w-sm text-xs`,children:(0,I.jsx)(`p`,{children:t})})]})})}function E7(e){let t=[],n=(e,n)=>{t.push(`#### ${e}`),t.push("```json");try{t.push(JSON.stringify(n,null,2))}catch{t.push(`"[schema not serializable]"`)}t.push("```")};if(t.push(`# MCP Tool Analysis Report`,``),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),e.mcpServerVersions&&Object.keys(e.mcpServerVersions).length>0){let n=Object.entries(e.mcpServerVersions).map(([e,t])=>`${e}: ${t??`unknown`}`).join(`, `);t.push(`- MCP Server Versions: ${n}`)}t.push(`- Modes: ${[e.modes.metadataReview?`metadata review`:null,e.modes.deeperAnalysis?`deeper analysis`:null].filter(Boolean).join(` + `)}`),t.push(``,`## Summary`),t.push(`- Servers analyzed: ${e.summary.serversAnalyzed}`),t.push(`- Tools analyzed: ${e.summary.toolsAnalyzed}`),t.push(`- Tools skipped: ${e.summary.toolsSkipped}`,``);for(let r of e.servers){t.push(`## Server: ${r.serverName}`),r.warnings.length>0&&t.push(...r.warnings.map(e=>`- Warning: ${e}`),``);for(let e of r.tools){if(t.push(`### ${e.publicToolName}`),e.title&&t.push(`- Title: ${e.title}`),t.push(`- Safety: ${e.safetyClassification} (${e.classificationReason})`),e.inputSchema!==void 0&&n(`Input schema`,e.inputSchema),e.outputSchema!==void 0&&n(`Output schema`,e.outputSchema),e.metadataReview?.issues.length){t.push(`#### Metadata issues`);for(let n of e.metadataReview.issues)t.push(` - [${n.severity}] ${n.title}: ${n.detail}`)}if(e.deeperAnalysis){if(!e.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${e.deeperAnalysis.skippedReason??`unknown`})`);else{t.push(`- Deeper analysis sample calls: ${e.deeperAnalysis.sampleCalls.length}`);for(let n of e.deeperAnalysis.sampleCalls){t.push(` - Call ${n.callIndex}: ${n.ok?`ok`:`error`}${n.durationMs?` (${n.durationMs}ms)`:``}`),n.error&&t.push(` - Error: ${n.error}`);for(let e of n.observations)t.push(` - ${e}`)}}}if(e.overallRecommendations.length>0){t.push(`#### Recommendations`);for(let n of e.overallRecommendations)t.push(` - ${n}`)}if(e.metadataReview?.evalReadinessNotes.length){t.push(`#### Agent/Eval readiness notes`);for(let n of e.metadataReview.evalReadinessNotes)t.push(` - ${n}`)}t.push(``)}}return`${t.join(`
139
+ `)}\n`}function D7({report:e,schemaMode:t,onSchemaModeChange:n}){let[r,i]=mp(),[a,o]=(0,_.useState)([...y7]),[s,c]=(0,_.useState)(new Set),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(`explorer`),h=t??p,g=e=>{n?.(e),t||m(e)},v=r.get(`groupBy`)===`severity`?`severity`:`tool`,y=(0,_.useRef)(null),b=l.trim().toLowerCase(),x=(0,_.useMemo)(()=>new Set(a),[a]),S=e=>{o(t=>{let n=t.includes(e)?t.filter(t=>t!==e):[...t,e];return n.length===0?[...y7]:n})},C=e=>{let t=new URLSearchParams(r);e===`severity`?t.set(`groupBy`,`severity`):t.delete(`groupBy`),i(t,{replace:!0})},w=(0,_.useMemo)(()=>{let t={critical:[],high:[],medium:[],low:[],info:[]};for(let n of e.servers)for(let e of n.tools){let r=`tool-${S7(`${n.serverName}-${e.publicToolName}`)}`,i=`${n.serverName}::${e.publicToolName}`,a=e.publicToolName.split(`::`).pop()??e.publicToolName;for(let n of e.metadataReview?.issues??[]){let e=n.severity;t[e].push({key:`${i}-metadata-${n.id}`,toolAnchorId:r,toolLabel:i,toolDisplayName:a,sourceLabel:`Metadata review`,issue:{id:n.id,title:n.title,detail:n.detail,severity:e,suggestion:n.suggestion}})}for(let n of e.deeperAnalysis?.sampleCalls??[])for(let e of n.issues){let o=e.severity;t[o].push({key:`${i}-call-${n.callIndex}-${e.id}`,toolAnchorId:r,toolLabel:i,toolDisplayName:a,sourceLabel:`Sample call ${n.callIndex}`,issue:{id:e.id,title:e.title,detail:e.detail,severity:o,suggestion:e.suggestion}})}}return t},[e.servers]),T=(0,_.useMemo)(()=>Array.from(new Set(e.servers.flatMap(e=>e.tools.map(e=>e.publicToolName)).map(e=>e.split(`::`).pop()??e))).sort((e,t)=>e.localeCompare(t)),[e.servers]),E=e=>b.length===0||(e.toLowerCase().split(`::`).pop()??e.toLowerCase()).includes(b),D=e=>{y.current&&y.current.querySelectorAll(`details`).forEach(t=>{t.open=e})},O=()=>c(new Set(y7)),k=()=>c(new Set),A=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Tools analyzed`}),(0,I.jsx)(`div`,{className:`text-2xl font-semibold`,children:e.summary.toolsAnalyzed})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Tools skipped`}),(0,I.jsx)(`div`,{className:`text-2xl font-semibold`,children:e.summary.toolsSkipped})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Findings`}),(0,I.jsx)(`div`,{className:`text-2xl font-semibold`,children:e.findings.length})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{className:`pb-3`,children:[(0,I.jsx)(qv,{className:`text-base`,children:`Analysis Overview`}),(0,I.jsx)(Jv,{children:`Visual breakdown of findings by severity. Click badges to filter the report.`})]}),(0,I.jsx)(q,{children:(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[y7.filter(t=>e.summary.issueCounts[t]>0).map(t=>{let n=x.has(t);return(0,I.jsx)(`button`,{type:`button`,onClick:()=>S(t),className:`rounded-full`,"aria-pressed":n,children:(0,I.jsxs)(Y,{variant:`outline`,className:`capitalize font-normal ${n?b7(t):x7(t)} ${n?`ring-1 ring-current`:`opacity-70`}`,children:[t,`: `,e.summary.issueCounts[t]]})},t)}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>o([...y7]),className:`h-7 px-2 text-xs`,children:`Reset`})]})})]}),(0,I.jsxs)(`div`,{className:`space-y-0`,children:[(0,I.jsx)(b0,{value:v,onValueChange:e=>{(e===`tool`||e===`severity`)&&C(e)},className:`min-w-0 px-3 pt-1`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-2 border-b`,children:[(0,I.jsxs)(x0,{className:`h-auto justify-start rounded-none bg-transparent p-0`,children:[(0,I.jsx)(S0,{value:`tool`,className:`-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none`,children:`Report by Tool`}),(0,I.jsx)(S0,{value:`severity`,className:`-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none`,children:`By Severity`})]}),(0,I.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`whitespace-nowrap text-xs text-muted-foreground`,children:`Filter tools`}),(0,I.jsxs)(y8,{open:d,onOpenChange:f,children:[(0,I.jsx)(b8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":d,"aria-controls":`tool-filter-command-list`,className:`h-8 w-[320px] max-w-full justify-between text-xs font-normal`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:l||`All tools`}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(x8,{className:`w-[320px] p-0`,align:`end`,children:(0,I.jsxs)(_5,{children:[(0,I.jsx)(v5,{placeholder:`Search tools...`}),(0,I.jsxs)(y5,{id:`tool-filter-command-list`,children:[(0,I.jsx)(b5,{children:`No tools found.`}),(0,I.jsxs)(x5,{children:[(0,I.jsx)(C5,{value:`all tools`,onSelect:()=>{u(``),f(!1)},children:`All tools`}),T.map(e=>(0,I.jsx)(C5,{value:e,onSelect:()=>{u(e),f(!1)},children:e},e))]})]})]})})]}),v===`severity`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:k,children:`Expand all`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:O,children:`Collapse all`})]}),v===`tool`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:()=>D(!0),children:`Expand all`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:()=>D(!1),children:`Collapse all`})]})]})]})}),v===`severity`?(0,I.jsx)(`div`,{className:`space-y-4`,children:y7.filter(e=>x.has(e)).map(e=>{let t=w[e].filter(e=>E(e.toolLabel));if(t.length===0)return null;let n=s.has(e);return(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(qv,{className:`text-base capitalize`,children:e}),(0,I.jsxs)(Jv,{children:[t.length,` finding(s)`]})]}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:()=>A(e),children:n?`Expand`:`Collapse`})})]})}),!n&&(0,I.jsx)(q,{className:`space-y-2`,children:t.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded border p-2 text-xs`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground`,children:t+1}),(0,I.jsx)(`span`,{className:`min-w-0 font-bold leading-tight`,children:e.issue.title})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${b7(e.issue.severity)}`,children:e.issue.severity})]}),(0,I.jsxs)(`p`,{children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,e.issue.detail]}),(0,I.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-[11px]`,children:[(0,I.jsx)(Y,{variant:`secondary`,className:`font-normal`,children:e.sourceLabel}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`h-6 px-2 font-mono text-[11px]`,title:e.toolLabel,onClick:()=>{C(`tool`),requestAnimationFrame(()=>{document.getElementById(e.toolAnchorId)?.scrollIntoView({behavior:`smooth`,block:`start`})})},children:e.toolDisplayName})]}),e.issue.suggestion&&(0,I.jsx)(w7,{text:e.issue.suggestion})]},e.key))})]},e)})}):(0,I.jsx)(`div`,{ref:y,className:`space-y-4`,children:e.servers.map(e=>{let t=e.tokenEstimate,n=e.tools.filter(t=>{let n=`${e.serverName}::${t.publicToolName}`;if(!E(n))return!1;let r=[...t.metadataReview?.issues??[],...t.deeperAnalysis?.sampleCalls.flatMap(e=>e.issues)??[]];return r.length===0?a.length===y7.length:r.some(e=>x.has(e.severity))});return n.length===0?null:(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{className:`pb-3`,children:[(0,I.jsxs)(qv,{className:`flex items-center gap-2 text-base`,children:[e.serverName,(0,I.jsx)(v7,{total:t?.total,title:`Estimated tokens for the analyzed tool definitions and their schemas`})]}),(0,I.jsxs)(Jv,{children:[`Discovered `,e.toolCountDiscovered,` · Showing `,n.length,` of`,` `,e.toolCountAnalyzed,` analyzed · Skipped `,e.toolCountSkipped]})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[e.warnings.length>0&&(0,I.jsxs)(M5,{children:[(0,I.jsx)(N5,{children:`Warnings`}),(0,I.jsx)(P5,{children:(0,I.jsx)(`ul`,{className:`ml-4 list-disc space-y-1`,children:e.warnings.map(t=>(0,I.jsx)(`li`,{children:t},`${e.serverName}-${t}`))})})]}),n.map(n=>{let r=t?.tools.find(e=>e.name===n.toolName),i=n.publicToolName.split(`::`).pop()??n.publicToolName,a=c7(n.classificationReason),o=n.safetyClassification===`read_only`?`read-only`:a?`write/delete`:`unsafe/unknown`,s=n.safetyClassification===`read_only`?`border-emerald-200 bg-emerald-50 text-emerald-700`:a?`border-amber-300 bg-amber-50 text-amber-800`:`border-slate-300 bg-slate-100 text-slate-700`;return(0,I.jsxs)(`details`,{id:`tool-${S7(`${e.serverName}-${n.publicToolName}`)}`,className:`group rounded-md border p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer list-none`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`min-w-0 truncate font-mono text-sm`,title:n.publicToolName,children:i}),(0,I.jsx)(T7,{label:o,reason:n.classificationReason,variantClassName:s}),(0,I.jsx)(v7,{total:r?.total,className:`text-[10px]`})]}),(0,I.jsx)(rn,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),n.title&&(0,I.jsx)(`p`,{className:`text-sm text-foreground/85`,children:n.title}),n.description&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.description})]})}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-[11px]`,onClick:()=>void C7(`Tool info`,{server:e.serverName,name:n.publicToolName,title:n.title,description:n.description}),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy Tool Info`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-[11px]`,onClick:()=>void C7(`Schemas`,{server:e.serverName,name:n.publicToolName,inputSchema:n.inputSchema,outputSchema:n.outputSchema}),disabled:n.inputSchema===void 0&&n.outputSchema===void 0,children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy Schemas`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-[11px]`,onClick:()=>void C7(`Metadata review`,{server:e.serverName,name:n.publicToolName,metadataReview:n.metadataReview}),disabled:!n.metadataReview,children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy Metadata Review`]})]}),(0,I.jsx)(h7,{inputSchema:n.inputSchema,outputSchema:n.outputSchema,mode:h,onModeChange:g}),n.metadataReview&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Metadata review`}),n.metadataReview.issues.filter(e=>x.has(e.severity)).length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No metadata issues reported.`}):(0,I.jsx)(`div`,{className:`space-y-1`,children:n.metadataReview.issues.filter(e=>x.has(e.severity)).map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded border p-2 text-xs`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground`,children:t+1}),(0,I.jsx)(`span`,{className:`min-w-0 font-bold leading-tight`,children:e.title})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${b7(e.severity)}`,children:e.severity})]}),(0,I.jsxs)(`p`,{children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,e.detail]}),e.suggestion&&(0,I.jsx)(w7,{text:e.suggestion})]},e.id))})]}),n.deeperAnalysis&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Deeper analysis`}),n.deeperAnalysis.attempted?(0,I.jsx)(`div`,{className:`space-y-2`,children:n.deeperAnalysis.sampleCalls.map(e=>(0,I.jsxs)(`div`,{className:`rounded border p-2 text-xs`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,I.jsx)(Y,{variant:e.ok?`secondary`:`destructive`,className:`text-[10px]`,children:e.ok?`ok`:`error`}),(0,I.jsxs)(`span`,{children:[`Call `,e.callIndex]}),e.durationMs!==void 0&&(0,I.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.durationMs,`ms`]})]}),e.error&&(0,I.jsx)(`p`,{className:`text-destructive`,children:e.error}),e.observations.length>0&&(0,I.jsxs)(`div`,{className:`mt-2`,children:[(0,I.jsx)(`div`,{className:`mb-1 inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium text-muted-foreground`,children:`Observations`}),(0,I.jsx)(`ul`,{className:`ml-4 list-disc space-y-1`,children:e.observations.map((t,r)=>(0,I.jsx)(`li`,{children:t},`${n.publicToolName}-obs-${e.callIndex}-${r}`))})]}),e.issues.filter(e=>x.has(e.severity)).length>0&&(0,I.jsx)(`div`,{className:`mt-2 space-y-1`,children:e.issues.filter(e=>x.has(e.severity)).map((t,n)=>(0,I.jsxs)(`div`,{className:`rounded border p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground`,children:n+1}),(0,I.jsx)(`span`,{className:`min-w-0 font-bold leading-tight`,children:t.title})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${b7(t.severity)}`,children:t.severity})]}),(0,I.jsxs)(`p`,{children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,t.detail]}),t.suggestion&&(0,I.jsx)(w7,{text:t.suggestion})]},`${e.callIndex}-${t.id}`))})]},`${n.publicToolName}-call-${e.callIndex}`))}):(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.deeperAnalysis.skippedReason??`Skipped`})]})]})]},n.publicToolName)})]})]},e.serverName)})})]})]})}function O7(e){return{reportId:e.reportId,createdAt:e.createdAt,tools:e.report.servers.flatMap(e=>e.tools.map(t=>({server:e.serverName,name:t.publicToolName,title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema})))}}function k7(e){let t=e.selectedToolNames?.length?new Set(e.selectedToolNames):null;return{serverName:e.serverName,tools:e.tools.filter(e=>!t||t.has(e.name)).map(e=>({name:e.name,title:e.title,description:e.description,inputSchema:e.inputSchema,outputSchema:e.outputSchema}))}}function A7(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``)}function j7(e,t){let n=[`tool-info`,A7(e)],r=t?.trim();return r&&n.push(`v${A7(r)}`),`${n.filter(Boolean).join(`-`)}.json`}function M7(e){let t=0,n=new Set,r=new Set;for(let i of e){let e=typeof i.payload?.message==`string`?i.payload.message:``;if(!e)continue;let a=e.match(/\((\d+)\s+selected\s+of\s+\d+\s+discovered\)/i);a&&(t=Math.max(t,Number(a[1])||0));let o=e.match(/^Started\s+(.+)$/);o&&n.add(o[1]);let s=e.match(/^Finished\s+(.+)$/);s&&r.add(s[1])}let i=t>0?Math.max(0,Math.min(100,Math.round(r.size/t*100))):0;return{totalTools:t,startedTools:n.size,finishedTools:r.size,percent:i}}var N7=`mcplab.toolAnalysis.activeJobId`;function P7(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}async function F7(e,t){try{await navigator.clipboard.writeText(t),O({title:`${e} copied`})}catch(t){O({title:`Could not copy ${e.toLowerCase()}`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}}function I7({text:e}){return(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,className:`inline-flex h-4 w-4 items-center justify-center rounded text-muted-foreground hover:text-foreground`,onClick:e=>e.preventDefault(),"aria-label":e,children:(0,I.jsx)(un,{className:`h-3.5 w-3.5`})})}),(0,I.jsx)(hl,{className:`max-w-xs text-xs`,children:(0,I.jsx)(`p`,{children:e})})]})}function L7(e,t){let n=t.toLowerCase();return n.includes(`failed to load tools`)||n.includes(`failed to connect to mcp server`)?`Could not load tools from '${e}'. Check that the MCP server is running and reachable, then try Refresh Servers / Discover Tools again.`:t}function R7({label:e,reason:t,variantClassName:n}){return(0,I.jsx)(fl,{delayDuration:0,children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(Y,{variant:`outline`,className:n,children:e})}),(0,I.jsx)(hl,{className:`max-w-sm text-xs`,children:(0,I.jsx)(`p`,{children:t})})]})})}var z7=()=>{let e=e=>`tool-analysis-${Date.now()}.${e}`,{source:t}=Mv(),{servers:n,agents:r,loading:i,reload:a}=Gv(),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)([]),[m,h]=(0,_.useState)({}),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(!0),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(2),[T,E]=(0,_.useState)(1),[D,k]=(0,_.useState)(1e4),[A,j]=(0,_.useState)(null),[M,N]=(0,_.useState)([]),[P,F]=(0,_.useState)(null),[ee,L]=(0,_.useState)(null),[R,z]=(0,_.useState)(!1),[te,ne]=(0,_.useState)(`configure`),[re,ie]=(0,_.useState)(`explorer`),[ae,oe]=(0,_.useState)(`idle`),[se,ce]=(0,_.useState)(!1),B=(0,_.useRef)(null),le=(0,_.useRef)(null),ue=o||r[0]?.name||``,de=(0,_.useMemo)(()=>M7(M),[M]);(0,_.useEffect)(()=>{let e=!0;return t.getWorkspaceSettings().then(t=>{e&&t&&s(t.scenarioAssistantAgentName??``)}).catch(()=>{e&&s(``)}),()=>{e=!1}},[t]),(0,_.useEffect)(()=>()=>{B.current?.()},[]),(0,_.useEffect)(()=>{let e=le.current;e&&requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight})},[M.length]);let V=()=>{try{sessionStorage.removeItem(N7)}catch{}},fe=e=>{try{sessionStorage.setItem(N7,e)}catch{}},pe=e=>{B.current?.(),B.current=t.subscribeToolAnalysisJob(e,n=>{if(N(e=>[...e,n]),n.type===`completed`)t.getToolAnalysisResult(e).then(e=>{F(e.report),L(e.savedReportId??null)}).catch(e=>O({title:`Could not load analysis report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})).finally(()=>{V(),j(null),z(!1),oe(`idle`),ne(`run`)});else if(n.type===`error`){let e=String(n.payload?.message??``);V(),oe(e.toLowerCase().includes(`abort`)?`stopped`:`error`),j(null),z(!1)}})};(0,_.useEffect)(()=>{if(A||P)return;let e=``;try{e=sessionStorage.getItem(N7)??``}catch{e=``}if(e)return ne(`run`),oe(`running`),z(!0),j(e),N([]),pe(e),()=>{}},[t,A,P]);let me=async()=>{if(c.length===0){p([]),h({});return}let e=c.filter(e=>n.find(t=>t.id===e)?.authType===`oauth2`);try{e.length>0&&(ce(!0),await v4({serverNames:e,source:t,onServerAuthStart:e=>{O({title:`OAuth login required for ${e}`,description:`Complete login in the opened browser tab. Discovery will continue automatically.`})}}))}catch(e){O({title:`OAuth login failed`,description:e instanceof Error?e.message:String(e),variant:`destructive`}),ce(!1);return}finally{ce(!1)}d(!0);try{let e=await t.discoverToolsForAnalysis({serverNames:c});p(e.servers),h(t=>{let n={};for(let r of e.servers){let e=t[r.serverName]??[],i=r.tools.map(e=>e.name),a=e.filter(e=>i.includes(e));n[r.serverName]=a.length>0?a:i}return n})}catch(e){O({title:`Could not discover MCP tools`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{d(!1)}};(0,_.useEffect)(()=>{me()},[c.join(`|`)]);let he=(0,_.useMemo)(()=>{let e=g.trim().toLowerCase();return e?f.map(t=>({...t,tools:t.tools.filter(t=>t.name.toLowerCase().includes(e)||(t.description||``).toLowerCase().includes(e))})).filter(e=>e.tools.length>0):f},[f,g]),ge=(0,_.useMemo)(()=>Object.values(m).reduce((e,t)=>e+t.length,0),[m]),_e=(0,_.useMemo)(()=>_7(f,m),[f,m]),ve=c[0]??``,ye=async()=>{if(!y&&!x)O({title:`Select at least one mode`,variant:`destructive`});else if(c.length!==1)O({title:`Select exactly one server`,variant:`destructive`});else if(ge===0)O({title:`Select at least one tool`,variant:`destructive`});else{z(!0),N([]),F(null),L(null),ne(`run`),oe(`running`);try{let e=c[0];n.find(t=>t.id===e)?.authType===`oauth2`&&(ce(!0),await v4({serverNames:[e],source:t,onServerAuthStart:e=>{O({title:`OAuth login required for ${e}`,description:`Complete login in the opened browser tab. Analysis will continue automatically.`})}}));let{jobId:r}=await t.startToolAnalysis({serverNames:c,selectedToolsByServer:m,maxParallelTools:C,modes:{metadataReview:y,deeperAnalysis:x},deeperAnalysisOptions:{autoRunPolicy:`read_only_allowlist`,sampleCallsPerTool:T,toolCallTimeoutMs:D}});j(r),fe(r),pe(r)}catch(e){z(!1),oe(`error`),ne(`run`),O({title:`Could not start tool analysis`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ce(!1)}}},be=()=>{let e=c[0],t=f.find(t=>t.serverName===e);if(!e||!t){O({title:`No discovered tool info available`,description:`Select a server and discover tools before downloading tool info.`,variant:`destructive`});return}let n=k7({serverName:t.serverName,tools:t.tools,selectedToolNames:m[t.serverName]});P7(j7(t.serverName,t.mcpServerVersion),`${JSON.stringify(n,null,2)}\n`,`application/json`)},xe=async()=>{if(!A)return;let e=A;try{let n=await t.stopToolAnalysis(e);if(n.status===`completed`){B.current?.(),B.current=null;let n=await t.getToolAnalysisResult(e);F(n.report),L(n.savedReportId??null),V(),j(null),z(!1),oe(`idle`),ne(`run`),O({title:`Analysis already finished`,description:`Showing the result overview.`});return}if(n.status===`stopped`){B.current?.(),B.current=null,V(),j(null),z(!1),oe(`stopped`),O({title:`Analysis stopped`});return}if(n.status===`error`){B.current?.(),B.current=null,V(),j(null),z(!1),oe(`error`),O({title:`Analysis already ended with an error`,description:`Review the progress log and return to Configure Analysis.`});return}O({title:`Stopping analysis...`})}catch(e){O({title:`Could not stop analysis`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},Se=()=>{ne(`configure`),oe(`idle`),j(null)},Ce=(e,t)=>{l(n=>t?[e]:n.filter(t=>t!==e))},we=(e,t,n)=>{h(r=>{let i=new Set(r[e]??[]);return n?i.add(t):i.delete(t),{...r,[e]:Array.from(i)}})},Te=(e,t)=>{h(n=>({...n,[e]:t}))},Ee=A!==null||M.length>0||ae===`stopped`||ae===`error`,De=!!P,Oe=e=>{e===`configure`?ne(`configure`):e===`run`&&Ee?ne(`run`):e===`report`&&De&&ne(`report`)};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Ln,{className:`h-6 w-6`}),`Analyze MCP Tools`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Review MCP tools for schema quality, ergonomics, and agent/eval readiness.`})]}),(0,I.jsxs)(`div`,{className:`hidden flex-wrap items-center gap-2 md:flex`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>Oe(`configure`),className:`rounded-full`,"aria-label":`Open Configure Analysis`,children:(0,I.jsx)(Y,{variant:te===`configure`?`default`:`outline-solid`,className:`cursor-pointer`,children:`Configure Analysis`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>Oe(`run`),disabled:!Ee,className:`rounded-full disabled:cursor-not-allowed disabled:opacity-60`,"aria-label":`Open Run Analysis`,children:(0,I.jsx)(Y,{variant:te===`run`?`default`:`outline-solid`,className:Ee?`cursor-pointer`:`cursor-not-allowed`,children:`Run Analysis`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>Oe(`report`),disabled:!De,className:`rounded-full disabled:cursor-not-allowed disabled:opacity-60`,"aria-label":`Open Report`,children:(0,I.jsx)(Y,{variant:te===`report`?`default`:`outline-solid`,className:De?`cursor-pointer`:`cursor-not-allowed`,children:`Report`})})]})]}),te===`configure`&&(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{children:[(0,I.jsx)(qv,{className:`text-base`,children:`Run MCP analysis`}),(0,I.jsx)(Jv,{children:`Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report.`})]}),(0,I.jsxs)(q,{className:`space-y-5`,children:[!ue&&(0,I.jsxs)(M5,{children:[(0,I.jsx)(N5,{children:`No assistant agent available`}),(0,I.jsxs)(P5,{children:[`Add a library agent in`,` `,(0,I.jsx)(cp,{to:`/libraries/agents`,className:`underline`,children:`Agents`}),` `,`and optionally set the default Scenario Assistant Agent in`,` `,(0,I.jsx)(cp,{to:`/settings`,className:`underline`,children:`Settings`}),`.`]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Servers`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:i||se,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh Servers`]})]}),(0,I.jsx)(`div`,{className:`grid gap-2 rounded-md border p-3 md:grid-cols-2`,children:n.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No library servers configured.`}):n.map(e=>{let t=c.includes(e.id);return(0,I.jsxs)(`label`,{className:`flex items-start gap-2 rounded-md border p-2 text-sm`,children:[(0,I.jsx)(U0,{checked:t,onCheckedChange:t=>Ce(e.id,!!t)}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.name||e.id}),e.url&&(0,I.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.url})]})]},e.id)})}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Select exactly one MCP server for analysis.`})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Filter visible tools`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(Zn,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,I.jsx)(Pp,{className:`h-9 pl-8`,placeholder:`Filter tools by name or description...`,value:g,onChange:e=>v(e.target.value)})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Filtering only changes what is shown; selected tools remain selected.`})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)($,{className:`text-xs`,children:ve?`Tools for ${ve}`:`Tools`}),(0,I.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:be,disabled:u||se||c.length===0||f.length===0,children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Download Tool Info`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void me(),disabled:u||se||c.length===0,children:[u&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),`Discover Tools`]})]})]}),(0,I.jsx)(`div`,{className:`space-y-3 rounded-md border p-3`,children:c.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Select a server to discover tools.`}):u&&f.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading tools...`}):he.length===0&&!u?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No discovered tools match the current filters.`}):he.map(e=>{let t=new Set(m[e.serverName]??[]);return(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.serverName}),(0,I.jsx)(v7,{total:e.tokenEstimate?.total,title:`Estimated tokens for all discovered tool definitions and their schemas`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>void F7(`Tool list`,`${JSON.stringify({server:e.serverName,tools:e.tools.map(e=>({name:e.name,title:e.title,description:e.description}))},null,2)}\n`),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>Te(e.serverName,e.tools.map(e=>e.name)),children:`Select all`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>Te(e.serverName,[]),children:`Clear`})]})]}),e.warnings.length>0&&(0,I.jsx)(`div`,{className:`mb-2 space-y-1`,children:e.warnings.map(t=>(0,I.jsx)(`div`,{className:`text-xs text-amber-700`,children:L7(e.serverName,t)},`${e.serverName}-${t}`))}),(0,I.jsx)(`div`,{className:`grid gap-2`,children:e.tools.map(n=>{let r=e.tokenEstimate?.tools.find(e=>e.name===n.name),i=c7(n.classificationReason),a=n.safetyClassification===`read_only`?`read-only`:i?`write/delete`:`unsafe/unknown`,o=n.safetyClassification===`read_only`?`border-emerald-200 bg-emerald-50 text-emerald-700`:i?`border-amber-300 bg-amber-50 text-amber-800`:`border-slate-300 bg-slate-100 text-slate-700`;return(0,I.jsxs)(`label`,{className:`flex items-start gap-2 rounded border p-2`,children:[(0,I.jsx)(U0,{checked:t.has(n.name),onCheckedChange:t=>we(e.serverName,n.name,!!t)}),(0,I.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:n.name}),n.title&&(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.title}),(0,I.jsx)(R7,{label:a,reason:n.classificationReason,variantClassName:o}),n.inputSchema&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`schema: input`}),n.outputSchema&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`schema: output`}),(0,I.jsx)(v7,{total:r?.total,className:`text-[10px]`})]}),n.description&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:n.description}),(0,I.jsx)(h7,{inputSchema:n.inputSchema,outputSchema:n.outputSchema,mode:re,onModeChange:ie})]})]},`${e.serverName}-${n.name}`)})})]},e.serverName)})}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Selected tools: `,ge,_e!==void 0&&` · estimated context: ~${g7(_e)} tokens`]})]}),(0,I.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Analysis Modes`}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(U0,{checked:y,onCheckedChange:e=>b(!!e)}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Metadata / schema review`,(0,I.jsx)(I7,{text:`No tool execution. Reviews tool names, descriptions, and schemas only.`})]})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(U0,{checked:x,onCheckedChange:e=>S(!!e)}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Deeper analysis`,(0,I.jsx)(I7,{text:`Runs sample MCP tool calls automatically for read-only tools only (based on the safety allowlist).`})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-3 rounded-md border bg-muted/20 p-3 md:grid-cols-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Max parallel tools`}),(0,I.jsx)(Pp,{type:`number`,min:1,max:8,value:C,onChange:e=>w(Math.max(1,Math.min(8,Number(e.target.value)||2))),className:`h-8`})]}),x?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Safety profile`}),(0,I.jsx)(`div`,{className:`text-sm`,children:`Read-only allowlist only`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Sample calls per tool`}),(0,I.jsx)(Pp,{type:`number`,min:1,max:5,value:T,onChange:e=>E(Math.max(1,Math.min(5,Number(e.target.value)||1))),className:`h-8`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Tool call timeout (ms)`}),(0,I.jsx)(Pp,{type:`number`,min:1e3,max:6e4,step:500,value:D,onChange:e=>k(Math.max(1e3,Math.min(6e4,Number(e.target.value)||1e4))),className:`h-8`})]}),(0,I.jsx)(`div`,{className:`md:col-span-3 text-xs text-amber-700`,children:`Deeper analysis may execute read-only MCP tools automatically.`})]}):null]})]}),(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,I.jsxs)(W,{type:`button`,onClick:()=>void ye(),disabled:R||se||!!A,children:[(R||!!A)&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),`Analyze Tools`]})})]})]}),te===`run`&&(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(qv,{className:`flex items-center gap-2 text-base`,children:(0,I.jsx)(`span`,{children:`Progress`})}),(0,I.jsx)(Jv,{children:A?`Live tool-analysis job events:`:P?`Analysis finished. Review the summary below or open the saved report details.`:ae===`stopped`?`Analysis was stopped. You can return to Configure Analysis.`:ae===`error`?`Analysis ended with an error. Review the log and go back to Configure Analysis.`:`Analysis finished.`})]}),A?(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void xe(),children:`Stop Analysis`}):(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:Se,children:`Back to Configure Analysis`})]})}),(0,I.jsxs)(q,{className:`space-y-2`,children:[A&&(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-md border bg-muted/20 px-2.5 py-1 text-xs text-muted-foreground`,children:[(0,I.jsx)(In,{className:`h-3.5 w-3.5 animate-spin`}),`Analysis is still running...`]}),(de.totalTools>0||A)&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:de.totalTools>0?`${de.finishedTools}/${de.totalTools} tools finished`:`Preparing analysis...`}),(0,I.jsx)(`span`,{children:de.totalTools>0?`${de.percent}%`:`0%`})]}),(0,I.jsx)(s7,{value:de.totalTools>0?de.percent:0,className:`h-2`})]}),M.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:A?`Starting analysis...`:`No progress events captured.`}):(0,I.jsx)(`div`,{ref:le,className:`max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2`,children:M.map((e,t)=>(0,I.jsxs)(`div`,{className:`text-xs`,children:[(0,I.jsx)(`span`,{className:`mr-2 font-mono text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,I.jsx)(Y,{variant:`outline`,className:`mr-2 text-[10px]`,children:e.type}),(0,I.jsx)(`span`,{className:`break-all`,children:typeof e.payload.message==`string`?e.payload.message:JSON.stringify(e.payload)})]},`${e.ts}-${t}`))}),!A&&P&&(0,I.jsx)(K,{className:`mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-semibold`,children:`Result overview`}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[P.summary.toolsAnalyzed,` tools analyzed, `,P.summary.toolsSkipped,` `,`skipped, across `,P.summary.serversAnalyzed,` server`,P.summary.serversAnalyzed===1?``:`s`,`.`]})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[ee&&(0,I.jsx)(W,{asChild:!0,size:`sm`,children:(0,I.jsx)(cp,{to:`/tool-analysis-results/${ee}`,children:`Open result details`})}),(0,I.jsx)(W,{asChild:!0,size:`sm`,variant:`outline`,children:(0,I.jsx)(cp,{to:`/tool-analysis-results`,children:`View all results`})}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>Oe(`report`),children:`View inline report`})]})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[P.summary.issueCounts.critical>0&&(0,I.jsxs)(Y,{className:`bg-red-600 text-white hover:bg-red-600`,children:[`Critical: `,P.summary.issueCounts.critical]}),P.summary.issueCounts.high>0&&(0,I.jsxs)(Y,{className:`bg-orange-500 text-white hover:bg-orange-500`,children:[`High: `,P.summary.issueCounts.high]}),P.summary.issueCounts.medium>0&&(0,I.jsxs)(Y,{className:`bg-amber-500 text-white hover:bg-amber-500`,children:[`Medium: `,P.summary.issueCounts.medium]}),P.summary.issueCounts.low>0&&(0,I.jsxs)(Y,{className:`bg-blue-500 text-white hover:bg-blue-500`,children:[`Low: `,P.summary.issueCounts.low]}),P.summary.issueCounts.info>0&&(0,I.jsxs)(Y,{variant:`outline`,children:[`Info: `,P.summary.issueCounts.info]}),Object.values(P.summary.issueCounts).every(e=>e===0)&&(0,I.jsx)(Y,{className:`bg-green-600 text-white hover:bg-green-600`,children:`No findings`})]})]})})]})]}),te===`report`&&P&&(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`text-xl font-semibold`,children:`Report`}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[P.summary.toolsAnalyzed,` tools analyzed across`,` `,P.summary.serversAnalyzed,` server`,P.summary.serversAnalyzed===1?``:`s`,`.`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:Se,children:`Back to Configure Analysis`}),ee&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsx)(cp,{to:`/tool-analysis-results/${ee}`,children:`Open saved report`})}),(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsx)(cp,{to:`/tool-analysis-results`,children:`View all reports`})})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>P7(e(`json`),`${JSON.stringify(P,null,2)}\n`,`application/json`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export JSON`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>P7(e(`md`),E7(P),`text/markdown`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export Markdown`]})]})]}),(0,I.jsx)(D7,{report:P,schemaMode:re,onSchemaModeChange:ie})]})]})};function B7({versions:e,showPrefix:t=!0,className:n}){let r=Object.entries(e??{}).sort((e,t)=>e[0].localeCompare(t[0])).map(([e,t])=>`${e}@${t??`unknown`}`).join(`, `);return r?(0,I.jsx)(fl,{delayDuration:0,children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsxs)(`span`,{tabIndex:0,className:U(`inline-flex max-w-[18rem] min-w-0 items-center rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] leading-none text-muted-foreground`,n),children:[t?(0,I.jsx)(`span`,{className:`font-medium`,children:`MCP:`}):null,(0,I.jsx)(`span`,{className:U(t?`ml-1`:``,`min-w-0 truncate font-mono`),children:r})]})}),(0,I.jsx)(hl,{className:`max-w-md wrap-break-word text-xs`,children:(0,I.jsx)(`span`,{className:`font-mono`,children:r})})]})}):null}function V7(e){let[t,n]=(0,_.useState)(0),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(0),s=(0,_.useCallback)(()=>{n(t=>Math.max(0,t-e))},[e]),c=(0,_.useCallback)(()=>{n(t=>t+e)},[e]),l=(0,_.useCallback)(()=>n(0),[]),u=(0,_.useCallback)(e=>{i(e.has_more),o(e.total_count)},[]),d=(0,_.useCallback)(e=>a<=0||e<=0?`Showing 0 of 0`:`Showing ${t+1}-${Math.min(t+e,a)} of ${a}`,[t,a]);return(0,_.useMemo)(()=>({limit:e,offset:t,hasMore:r,totalCount:a,setOffset:n,setHasMore:i,setTotalCount:o,prev:s,next:c,reset:l,updateMeta:u,rangeLabel:d}),[r,e,c,t,s,d,l,a,u])}function H7(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}function U7(){let{source:e}=Mv(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(`all`),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)([]),h=V7(100),{offset:g,hasMore:v}=h,y=async()=>{i(!0);try{if(e.listToolAnalysisResultsPage){let t=await e.listToolAnalysisResultsPage({limit:100,offset:g,server:l===`all`?void 0:l});n(t.data),h.updateMeta(t)}else n(await e.listToolAnalysisResults({limit:100,offset:g,server:l===`all`?void 0:l}))}catch(e){O({title:`Could not load tool analysis results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{i(!1)}};(0,_.useEffect)(()=>{y()},[g,l]),(0,_.useEffect)(()=>{e.listToolAnalysisServers&&e.listToolAnalysisServers().then(e=>m(e)).catch(()=>{m([])})},[e]),(0,_.useEffect)(()=>{e.listToolAnalysisServers||m(Array.from(new Set(t.flatMap(e=>e.serverNames))).sort((e,t)=>e.localeCompare(t)))},[t,e]),(0,_.useEffect)(()=>{h.reset()},[h.reset,l]);let b=(0,_.useMemo)(()=>t.find(e=>e.reportId===a)??null,[t,a]),x=async()=>{if(a){c(!0);try{await e.deleteToolAnalysisSavedResult(a),n(e=>e.filter(e=>e.reportId!==a)),O({title:`Tool analysis report deleted`}),o(null)}catch(e){O({title:`Could not delete report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{c(!1)}}},S=async(t,n)=>{try{let r=await e.getToolAnalysisSavedResult(t);n===`json`?H7(`${t}.json`,`${JSON.stringify(r,null,2)}\n`,`application/json`):n===`tool_schemas`?H7(`${t}-tool-schemas.json`,`${JSON.stringify(O7(r),null,2)}\n`,`application/json`):H7(`${t}.md`,E7(r.report),`text/markdown`)}catch(e){O({title:`Could not export saved report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(zn,{className:`h-6 w-6`}),`Tool Analysis Results`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Browse persisted Analyze MCP Tools reports.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`MCP server`}),(0,I.jsxs)(y8,{open:d,onOpenChange:f,children:[(0,I.jsx)(b8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":d,"aria-controls":`tool-analysis-server-command-list`,className:`h-9 w-[240px] justify-between font-normal ${l===`all`?``:`border-primary/40`}`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:l===`all`?`All servers`:l}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(x8,{className:`w-[240px] p-0`,align:`start`,children:(0,I.jsxs)(_5,{children:[(0,I.jsx)(v5,{placeholder:`Search MCP servers...`}),(0,I.jsxs)(y5,{id:`tool-analysis-server-command-list`,children:[(0,I.jsx)(b5,{children:`No servers found.`}),(0,I.jsxs)(x5,{children:[(0,I.jsx)(C5,{value:`all servers`,onSelect:()=>{u(`all`),f(!1)},children:`All servers`}),p.map(e=>(0,I.jsx)(C5,{value:e,onSelect:()=>{u(e),f(!1)},children:e},e))]})]})]})})]})]}),(0,I.jsx)(W,{variant:`outline`,onClick:()=>void y(),disabled:r,children:r?`Refreshing...`:`Refresh`}),(0,I.jsx)(W,{variant:`outline`,onClick:h.prev,disabled:r||g===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:h.next,disabled:r||!v,children:`Next`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(cp,{to:`/tool-analysis`,children:`Analyze MCP Tools`})})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h.rangeLabel(t.length)}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:r?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`Loading tool analysis results...`}):t.length===0?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`No saved tool analysis reports yet.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Showing `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:t.length}),` `,`reports`]})}),t.length===0?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`No reports for the selected MCP server.`}):(0,I.jsxs)(Xv,{children:[(0,I.jsx)(Zv,{children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{children:`Report ID`}),(0,I.jsx)(ty,{children:`Evaluated`}),(0,I.jsx)(ty,{children:`Timestamp`}),(0,I.jsx)(ty,{children:`Issues`}),(0,I.jsx)(ty,{children:`Modes`}),(0,I.jsx)(ty,{className:`w-10`})]})}),(0,I.jsx)(Qv,{children:t.map(e=>(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(cp,{to:`/tool-analysis-results/${e.reportId}`,className:`font-mono text-xs text-primary hover:underline`,children:e.reportId}),(0,I.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:e.assistantAgentName})]})}),(0,I.jsx)(J,{className:`text-[11px] text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{children:[`Servers:`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.serverNames.length}),` `,`· Tools:`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.summary.toolsAnalyzed}),` · `,`Skipped:`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.summary.toolsSkipped})]}),Object.keys(e.mcpServerVersions??{}).length>0?(0,I.jsx)(B7,{versions:e.mcpServerVersions,showPrefix:!1}):(0,I.jsxs)(`div`,{className:`font-mono text-xs text-foreground/80`,children:[e.serverNames.slice(0,2).join(`, `),e.serverNames.length>2?` +${e.serverNames.length-2}`:``]})]})}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.createdAt).toLocaleString()]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[[`critical`,`high`,`medium`,`low`,`info`].map(t=>e.summary.issueCounts[t]>0?(0,I.jsxs)(Y,{variant:`outline`,className:`capitalize`,children:[t,`: `,e.summary.issueCounts[t]]},`${e.reportId}-${t}`):null),Object.values(e.summary.issueCounts).every(e=>e===0)&&(0,I.jsx)(Y,{variant:`outline`,children:`No issues`})]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.modes.metadataReview&&(0,I.jsx)(Y,{variant:`outline`,children:`metadata`}),e.modes.deeperAnalysis&&(0,I.jsx)(Y,{variant:`outline`,children:`deeper`})]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(FQ,{children:[(0,I.jsx)(IQ,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:(0,I.jsx)(vn,{className:`h-4 w-4`})})}),(0,I.jsxs)(zQ,{align:`end`,children:[(0,I.jsx)(BQ,{asChild:!0,children:(0,I.jsx)(cp,{to:`/tool-analysis-results/${e.reportId}`,children:`View`})}),(0,I.jsxs)(BQ,{onSelect:()=>void S(e.reportId,`json`),children:[(0,I.jsx)(gn,{className:`mr-2 h-3.5 w-3.5`}),` Export JSON`]}),(0,I.jsxs)(BQ,{onSelect:()=>void S(e.reportId,`markdown`),children:[(0,I.jsx)(gn,{className:`mr-2 h-3.5 w-3.5`}),` Export Markdown`]}),(0,I.jsxs)(BQ,{className:`text-destructive`,onSelect:t=>{t.preventDefault(),o(e.reportId)},children:[(0,I.jsx)(ar,{className:`mr-2 h-3.5 w-3.5`}),` Delete`]}),(0,I.jsxs)(BQ,{onSelect:()=>void S(e.reportId,`tool_schemas`),children:[(0,I.jsx)(gn,{className:`mr-2 h-3.5 w-3.5`}),` Export MCP Info`]})]})]})})]},e.reportId))})]})]})})}),(0,I.jsx)(I3,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(z3,{children:[(0,I.jsxs)(B3,{children:[(0,I.jsx)(H3,{children:`Delete tool analysis report?`}),(0,I.jsx)(U3,{children:b?`Delete saved report '${b.reportId}' from disk? This cannot be undone.`:`Delete this saved report from disk? This cannot be undone.`})]}),(0,I.jsxs)(V3,{children:[(0,I.jsx)(G3,{disabled:s,children:`Cancel`}),(0,I.jsx)(W3,{onClick:e=>{e.preventDefault(),x()},disabled:s,children:s?`Deleting...`:`Delete`})]})]})})]})}function W7(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}function Ste(){let{id:e=``}=Jd(),t=Wd(),{source:n}=Mv(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!0),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let t=!0;return o(!0),c(!1),n.getToolAnalysisSavedResult(e).then(e=>{t&&i(e)}).catch(e=>{if(!t)return;let n=e instanceof Error?e.message:String(e);n.includes(`(404)`)?(c(!0),i(null)):O({title:`Could not load saved tool analysis report`,description:n,variant:`destructive`})}).finally(()=>{t&&o(!1)}),()=>{t=!1}},[e,n]);let p=async()=>{f(!0);try{await n.deleteToolAnalysisSavedResult(e),O({title:`Tool analysis report deleted`}),t(`/tool-analysis-results`)}catch(e){O({title:`Could not delete report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{f(!1),u(!1)}};return a?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading saved tool analysis report...`}):s||!r?(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Tool Analysis Result`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Saved report not found.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(cp,{to:`/tool-analysis-results`,children:`Back to Tool Analysis Results`})})]}):(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`font-mono text-xl font-semibold`,children:r.reportId}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 align-middle`,children:[(0,I.jsx)(mn,{className:`h-3 w-3 shrink-0`}),new Date(r.createdAt).toLocaleString()]}),` `,`·`,` `,[r.report.assistantAgentProvider?T0(r.report.assistantAgentProvider):null,r.report.assistantAgentModel].filter(Boolean).join(` · `)||r.serverNames.join(`, `)||`—`]})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(B7,{versions:r.report.mcpServerVersions}),(0,I.jsx)(W,{asChild:!0,size:`sm`,variant:`outline`,children:(0,I.jsx)(cp,{to:`/tool-analysis-results`,children:`Back to results`})}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>W7(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}\n`,`application/json`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export JSON`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>W7(`${r.reportId}.md`,E7(r.report),`text/markdown`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export Markdown`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>W7(`${r.reportId}-tool-schemas.json`,`${JSON.stringify(O7(r),null,2)}\n`,`application/json`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export MCP info`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>u(!0),children:[(0,I.jsx)(ar,{className:`mr-2 h-4 w-4`}),`Delete`]})]})]}),(0,I.jsx)(D7,{report:r.report}),(0,I.jsx)(I3,{open:l,onOpenChange:u,children:(0,I.jsxs)(z3,{children:[(0,I.jsxs)(B3,{children:[(0,I.jsx)(H3,{children:`Delete tool analysis report?`}),(0,I.jsxs)(U3,{children:[`Delete saved report '`,r.reportId,`' from disk? This cannot be undone.`]})]}),(0,I.jsxs)(V3,{children:[(0,I.jsx)(G3,{disabled:d,children:`Cancel`}),(0,I.jsx)(W3,{onClick:e=>{e.preventDefault(),p()},disabled:d,children:d?`Deleting...`:`Delete`})]})]})})]})}var Cte=[{id:`configure`,label:`Configure Debug Session`},{id:`run`,label:`Run / Inspect Flow`},{id:`report`,label:`Report / Export`}],wte=`resolve_target_metadata`,Tte=`token_exchange`,Ete=`resource_probe`;function G7({text:e}){return(0,I.jsx)(fl,{delayDuration:200,children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{type:`button`,className:`inline-flex shrink-0 items-center`,onClick:e=>e.preventDefault(),children:(0,I.jsx)(An,{className:`h-3.5 w-3.5 text-muted-foreground/50 hover:text-muted-foreground`})}),(0,I.jsx)(hl,{className:`max-w-xs text-xs leading-relaxed`,children:e})]})})}function K7(e){return navigator.clipboard.writeText(e)}function q7(){return typeof window>`u`?``:window.location.port===`8685`?`http://127.0.0.1:8787`:``}function J7(e){if(!e)return`No metadata payload captured.`;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return`Non-JSON response body:\n${e}`}}function Dte(e,t){let n=[];n.push(`# OAuth Debugger Report`),n.push(``),n.push(`- Session ID: ${e.id}`),n.push(`- Status: ${e.status}`),n.push(`- Registration method: ${e.registrationMethod}`),n.push(`- Profile: ${e.profile}`),n.push(``),n.push(`## Steps`);for(let t of e.stepStates)n.push(`- ${t.title}: ${t.status}${t.outcomeSummary?` — ${t.outcomeSummary}`:``}`);if(n.push(``),n.push(`## Validation Findings`),e.validations.length===0)n.push(`- None`);else for(let t of e.validations)n.push(`- [${t.severity}] ${t.title} (${t.stepId})`),n.push(` - ${t.detail}`),t.recommendation&&n.push(` - Recommendation: ${t.recommendation}`);n.push(``),n.push(`## Event Log`);for(let e of t){let t=typeof e.payload.message==`string`?e.payload.message:JSON.stringify(e.payload);n.push(`- ${new Date(e.ts).toLocaleTimeString()} [${e.type}] ${t}`)}return`${n.join(`
140
+ `)}\n`}function Ote(){let{source:e}=Mv(),{servers:t,reload:n,loading:r}=Gv(),[i,a]=(0,_.useState)(`configure`),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(`pre_registered`),[u,d]=(0,_.useState)(`local_callback`),[f,p]=(0,_.useState)(!0),[m,h]=(0,_.useState)(!0),[g,v]=(0,_.useState)(!0),[y,b]=(0,_.useState)(``),[x,S]=(0,_.useState)(``),[C,w]=(0,_.useState)(``),[T,E]=(0,_.useState)(``),[D,k]=(0,_.useState)(`__default__`),[A,j]=(0,_.useState)(`{}`),[M,N]=(0,_.useState)(``),[P,F]=(0,_.useState)(``),[ee,L]=(0,_.useState)(``),[R,z]=(0,_.useState)(``),[te,ne]=(0,_.useState)(``),[re,ie]=(0,_.useState)(``),[ae,oe]=(0,_.useState)(``),[se,ce]=(0,_.useState)(``),[B,le]=(0,_.useState)(null),[ue,de]=(0,_.useState)(null),[V,fe]=(0,_.useState)([]),[pe,me]=(0,_.useState)(!1),[he,ge]=(0,_.useState)(!1),[_e,ve]=(0,_.useState)(!1),[ye,be]=(0,_.useState)(`all`),[xe,Se]=(0,_.useState)(`all`),[Ce,we]=(0,_.useState)(`inspector`),Te=(0,_.useRef)(null),Ee=(0,_.useRef)(null),De=(0,_.useRef)(!1),Oe=(0,_.useRef)(m);(0,_.useEffect)(()=>{Oe.current=m},[m]),(0,_.useEffect)(()=>()=>{Te.current?.(),Te.current=null},[]),(0,_.useEffect)(()=>{Ee.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[V.length]);let ke=(0,_.useMemo)(()=>t.filter(e=>e.authType===`oauth2`).slice().sort((e,t)=>(e.name||e.id).localeCompare(t.name||t.id,void 0,{sensitivity:`base`})),[t]),Ae=ke.find(e=>e.id===o);(0,_.useEffect)(()=>{o&&(ke.some(e=>e.id===o)||s(``))},[ke,o]),(0,_.useEffect)(()=>{Ae&&(Ae.oauthMode===`dcr`?(l(`dcr`),w(``),E(``)):(l(`pre_registered`),w(Ae.oauthClientId??``),E(Ae.oauthClientSecret??``)),b(Ae.oauthScope??``),z(Ae.oauthAuthorizationUrl??``),ne(Ae.oauthTokenEndpoint??``))},[Ae?.id]);let je=(0,_.useMemo)(()=>{let e=B?.stepStates.length??0,t=B?.stepStates.filter(e=>e.status===`completed`||e.status===`skipped`).length??0,n=B?.stepStates.filter(e=>e.status===`failed`).length??0;return{total:e,completed:t,failed:n,percent:e>0?Math.round((t+n)/e*100):0}},[B]),Me=(0,_.useMemo)(()=>{let e=B?.network??[],t=new Map,n=[],r=e=>`${e.stepId}::${e.label}::${e.url}`;for(let i of e){if(i.phase===`request`){let e=n.length;n.push({key:i.id,stepId:i.stepId,label:i.label,method:i.method,url:i.url,request:i});let a=r(i),o=t.get(a)??[];o.push(e),t.set(a,o);continue}let e=r(i),a=t.get(e),o=a?.shift();typeof o==`number`?(n[o]={...n[o],response:i},a&&a.length>0?t.set(e,a):t.delete(e)):n.push({key:i.id,stepId:i.stepId,label:i.label,method:i.method,url:i.url,response:i})}return n.filter(e=>ye!==`all`&&e.stepId!==ye?!1:xe===`error`?typeof e.response?.status==`number`&&e.response.status>=400:xe!==`ok`||typeof e.response?.status==`number`&&e.response.status<400)},[B?.network,ye,xe]),Ne=!!ue,H=!(!B||B.status!==`completed`&&B.status!==`error`&&B.status!==`stopped`),Pe=(0,_.useMemo)(()=>{let e=new Map;return(B?.stepStates??[]).forEach((t,n)=>{e.set(t.id,n+1)}),e},[B?.stepStates]),Fe=(0,_.useMemo)(()=>{let e=(B?.network??[]).filter(e=>e.phase===`response`),t=t=>{let n=e.filter(e=>e.label===t);return[...n].reverse().find(e=>typeof e.status==`number`&&e.status<400)??[...n].reverse()[0]};return{resourceMetadata:t(`Protected Resource Metadata`),authorizationServerMetadata:t(`Authorization Server Metadata`)}},[B?.network]),Ie=(0,_.useMemo)(()=>{let e=new Map;for(let t of B?.network??[]){let n=e.get(t.stepId)??{requests:[],responses:[]};t.phase===`request`&&n.requests.push(t),t.phase===`response`&&n.responses.push(t),e.set(t.stepId,n)}return e},[B?.network]),Le=e=>{if(e===`configure`||e===`run`&&Ne||e===`report`&&H)return a(e)},Re=()=>{let e;if(c===`dcr`&&A.trim())try{e=JSON.parse(A)}catch{throw Error(`DCR metadata JSON is invalid`)}if(!Ae)throw Error(`Select an MCP server`);return{profile:`latest`,target:{serverName:Ae.id,overrides:{authorizationServerMetadataUrl:ee||void 0,authorizationEndpoint:R||void 0,tokenEndpoint:te||void 0,registrationEndpoint:re||void 0,cimdUrl:M||void 0,resourceBaseUrl:ae||void 0}},registrationMethod:c,clientConfig:{preRegistered:c===`pre_registered`?{clientId:C.trim(),clientSecret:T.trim()||void 0,tokenEndpointAuthMethod:D===`__default__`?void 0:D||void 0}:void 0,dcr:c===`dcr`?{metadata:e,tokenEndpointAuthMethod:D===`__default__`?void 0:D||void 0}:void 0,cimd:c===`cimd`?{cimdUrl:M||void 0,expectedClientId:P||void 0}:void 0},runtime:{redirectMode:u,scopes:y.split(/[,\s]+/).map(e=>e.trim()).filter(Boolean),resource:x.trim()||void 0,usePkce:g,codeChallengeMethod:`S256`},display:{showSensitiveValues:f}}},ze=t=>{Te.current?.(),Te.current=e.subscribeOAuthDebuggerSession(t,n=>{fe(e=>[...e,n]),(n.type===`completed`||n.type===`error`||n.type===`stopped`)&&me(!1),e.getOAuthDebuggerSession(t).then(e=>{le(e.session),e.session.uiHints.authorizationUrl&&Be(`${q7()}/api/oauth-debugger/sessions/${t}/authorize`),e.session.status===`completed`&&a(`report`)}).catch(()=>{})})},Be=e=>{Oe.current&&!De.current&&e&&(De.current=!0,window.open(e,`_blank`,`noopener,noreferrer`))},Ve=async()=>{ge(!0),De.current=!1;try{let t=Re(),n=await e.createOAuthDebuggerSession(t);de(n.sessionId),le(n.session),fe([]),a(`run`),ze(n.sessionId);let r=await e.startOAuthDebuggerSession(n.sessionId);le(r.session),me(!0),(r.session.status===`waiting_for_user`||r.session.status===`waiting_for_browser_callback`)&&(me(!1),r.session.uiHints.authorizationUrl&&Be(`${q7()}/api/oauth-debugger/sessions/${n.sessionId}/authorize`))}catch(e){O({title:`Could not start OAuth Debugger session`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ge(!1)}},He=async()=>{if(ue)try{ge(!0);let t=await e.submitOAuthDebuggerManualCallback(ue,{redirectUrl:se.trim()||void 0});le(t.session),ce(``),me(!0)}catch(e){O({title:`Could not submit callback`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ge(!1)}},Ue=async()=>{if(ue){ve(!0);try{let t=await e.stopOAuthDebuggerSession(ue);if(me(!1),t.status!==`running`){let t=await e.getOAuthDebuggerSession(ue);le(t.session),t.session.status===`completed`?a(`report`):a(`run`)}}catch(e){O({title:`Could not stop session`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ve(!1)}}},We=async()=>{Te.current?.(),Te.current=null,le(null),de(null),fe([]),me(!1),ve(!1),ge(!1),ce(``),be(`all`),Se(`all`),we(`inspector`),a(`run`),await Ve()},Ge=async t=>{if(ue&&B)try{let n=await e.exportOAuthDebuggerSession(ue,t),r=``,i=t===`json`?`json`:t===`raw`?`txt`:`md`;r=typeof n==`string`?n:`${JSON.stringify(n,null,2)}\n`;let a=new Blob([r],{type:`text/plain;charset=utf-8`}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=`oauth-debugger-${ue}.${i}`,s.click(),URL.revokeObjectURL(o)}catch(e){if(t===`markdown`){let e=Dte(B,V),t=new Blob([e],{type:`text/markdown;charset=utf-8`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`oauth-debugger-${B.id}.md`,r.click(),URL.revokeObjectURL(n);return}O({title:`Export failed`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},Ke=ue?`${q7()}/api/oauth-debugger/sessions/${ue}/authorize`:void 0,qe=e=>e===`error`?`destructive`:e===`warning`?`outline-solid`:`secondary`;return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`OAuth Debugger`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Step-by-step OAuth flow debugging for MCP servers (latest MCP authorization draft profile).`})]}),(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:Cte.map(e=>{let t=i===e.id,n=e.id===`configure`||e.id===`run`&&Ne||e.id===`report`&&H;return(0,I.jsx)(`button`,{type:`button`,onClick:()=>n&&Le(e.id),disabled:!n,className:`rounded-full`,children:(0,I.jsx)(Y,{variant:t?`default`:`outline-solid`,className:n?``:`opacity-50`,children:e.label})},e.id)})})]}),i===`configure`&&(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(qv,{className:`text-base`,children:`Target MCP Server`}),(0,I.jsx)(Jv,{children:`Select one MCP server from Libraries and optionally override endpoints.`})]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void n(),disabled:r,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4 ${r?`animate-spin`:``}`}),`Refresh Servers`]})]})}),(0,I.jsx)(q,{className:`space-y-3`,children:(0,I.jsxs)(`div`,{className:`max-w-xl space-y-2`,children:[(0,I.jsx)($,{children:`MCP Server`}),(0,I.jsxs)(T1,{value:o,onValueChange:s,children:[(0,I.jsx)(D1,{children:(0,I.jsx)(E1,{placeholder:`Select an MCP server`})}),(0,I.jsx)(A1,{children:ke.map(e=>(0,I.jsx)(Q,{value:e.id,children:e.name||e.id},e.id))})]}),ke.length===0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`No MCP servers with OAuth configured found. Add OAuth 2.0 auth in`,` `,(0,I.jsx)(`a`,{href:`/libraries/servers`,className:`underline text-primary`,children:`Manage Servers`}),`.`]}),Ae&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[Ae.transport,` ·`,` `,Ae.url||Ae.command||`No URL/command`,` · `,(0,I.jsxs)(`span`,{className:`text-primary`,children:[Ae.oauthMode===`dcr`?`DCR`:`pre-registered`,` fields pre-filled`]})]})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{className:`pb-3`,children:[(0,I.jsx)(qv,{className:`text-base`,children:`Client Registration Method`}),(0,I.jsx)(Jv,{children:`How your OAuth client is identified with the authorization server.`})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsx)(`div`,{className:`grid gap-2 md:grid-cols-3`,children:[{id:`pre_registered`,label:`Pre-registered client`,hint:`You already have a client_id issued by the authorization server.`},{id:`dcr`,label:`Dynamic Client Registration`,hint:`The server issues a client_id automatically at the start of the flow (RFC 7591).`},{id:`cimd`,label:`Client ID Metadata Document`,hint:`The client identifies itself via a hosted JSON metadata document at a public URL (RFC 9728).`}].map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>l(e.id),className:`rounded-md border p-3 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 shrink-0 rounded-full ${c===e.id?`bg-primary`:`bg-muted-foreground/30`}`}),(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:e.label})]}),(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-xs text-muted-foreground`,children:e.hint})]},e.id))}),(0,I.jsx)(`div`,{className:`grid gap-3 md:grid-cols-1`,children:(0,I.jsxs)(`div`,{className:`max-w-md space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Redirect mode`,(0,I.jsx)(G7,{text:`Local callback (recommended): MCP Lab automatically captures the redirect after you log in — no copy-pasting needed. Manual: you complete the browser login and then paste the final redirect URL back here.`})]}),(0,I.jsxs)(T1,{value:u,onValueChange:e=>d(e),children:[(0,I.jsx)(D1,{children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`local_callback`,children:`Local callback (recommended)`}),(0,I.jsx)(Q,{value:`manual`,children:`Manual paste redirect URL`})]})]})]})}),c===`pre_registered`&&(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`client_id`,(0,I.jsx)(G7,{text:`The unique identifier for your application, issued by the authorization server when you registered the client.`})]}),(0,I.jsx)(Pp,{value:C,onChange:e=>w(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`client_secret`,(0,I.jsx)(G7,{text:`Leave empty for public clients (e.g. SPAs or mobile apps). Required for confidential clients that authenticate with the token endpoint.`})]}),(0,I.jsx)(q3,{value:T,onChange:e=>E(e.target.value),placeholder:`optional`})]})]}),c===`cimd`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`CIMD URL`,(0,I.jsx)(G7,{text:`A publicly reachable URL hosting a JSON document that describes this client. The authorization server fetches it to identify the client.`})]}),(0,I.jsx)(Pp,{value:M,onChange:e=>N(e.target.value),placeholder:`https://.../client-metadata.json`})]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Kv,{className:`pb-3`,children:[(0,I.jsx)(qv,{className:`text-base`,children:`Runtime OAuth Inputs`}),(0,I.jsx)(Jv,{children:`Parameters sent in the authorization request.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Scopes`}),(0,I.jsx)(Pp,{value:y,onChange:e=>b(e.target.value),placeholder:`openid profile email`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Space or comma separated. Leave empty to use scopes auto-discovered from the server metadata.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 md:col-span-2`,children:[(0,I.jsx)(U0,{checked:g,onCheckedChange:e=>v(!!e)}),(0,I.jsxs)($,{className:`flex items-center gap-1`,children:[`Use PKCE (S256)`,(0,I.jsx)(G7,{text:`Proof Key for Code Exchange — generates a one-time code verifier so the authorization code can't be hijacked. Recommended for all clients; required for public clients.`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 md:col-span-2`,children:[(0,I.jsx)(U0,{checked:m,onCheckedChange:e=>h(!!e)}),(0,I.jsx)($,{children:`Auto-open browser when authorization URL is ready`})]})]})]}),(0,I.jsxs)(`details`,{className:`rounded-md border bg-card p-3 shadow-xs`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:`Advanced`}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Token endpoint auth method`,(0,I.jsx)(G7,{text:`How your client authenticates when exchanging the authorization code for a token. Choose 'none' for public clients (no secret). Leave as server default if unsure.`})]}),(0,I.jsxs)(T1,{value:D,onValueChange:k,children:[(0,I.jsx)(D1,{children:(0,I.jsx)(E1,{placeholder:`Server default (recommended)`})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`__default__`,children:`Server default (let the server decide)`}),(0,I.jsx)(Q,{value:`client_secret_basic`,children:`client_secret_basic — credentials in Authorization header`}),(0,I.jsx)(Q,{value:`client_secret_post`,children:`client_secret_post — credentials in request body`}),(0,I.jsx)(Q,{value:`none`,children:`none — public client, no secret`}),(0,I.jsx)(Q,{value:`private_key_jwt`,children:`private_key_jwt — signed JWT assertion`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Use "server default" unless the server requires a specific method.`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Resource / audience`,(0,I.jsx)(G7,{text:`Some servers (RFC 8707) require the target API's URI in the token request to scope the token. Only set this if your server explicitly requires it.`})]}),(0,I.jsx)(Pp,{value:x,onChange:e=>S(e.target.value),placeholder:`https://api.example.com`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Optional. Only needed for servers that use resource indicators.`})]})]}),c===`dcr`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`DCR metadata JSON`,(0,I.jsx)(G7,{text:`Extra fields for the dynamic client registration request (RFC 7591), e.g. {"client_name": "My App"}. redirect_uris and grant_types are always added automatically.`})]}),(0,I.jsx)(t0,{value:A,onChange:e=>j(e.target.value),className:`min-h-32 font-mono text-xs`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Optional extra fields for the registration request body.`})]}),c===`cimd`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Expected client_id`,(0,I.jsx)(G7,{text:`If you know what client_id the server should assign from the metadata document, enter it here for verification. Leave blank to accept whatever the server returns.`})]}),(0,I.jsx)(Pp,{value:P,onChange:e=>F(e.target.value),placeholder:`optional`})]}),(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-3`,children:[(0,I.jsx)(`div`,{className:`mb-1 text-sm font-medium`,children:`Endpoint overrides`}),(0,I.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Override specific endpoints if auto-discovery fails or you want to test against a specific URL. Leave blank to use what the server advertises.`}),(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Authorization server metadata URL`,(0,I.jsx)(G7,{text:`The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path.`})]}),(0,I.jsx)(Pp,{value:ee,onChange:e=>L(e.target.value),placeholder:`https://.../.well-known/oauth-authorization-server`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Resource server base URL`,(0,I.jsx)(G7,{text:`The MCP server's base URL used to look up its /.well-known/oauth-protected-resource metadata. Override if the server uses a different base path.`})]}),(0,I.jsx)(Pp,{value:ae,onChange:e=>oe(e.target.value),placeholder:`https://resource.example.com`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Authorization endpoint`,(0,I.jsx)(G7,{text:`The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata.`})]}),(0,I.jsx)(Pp,{value:R,onChange:e=>z(e.target.value),placeholder:`https://.../authorize`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Token endpoint`,(0,I.jsx)(G7,{text:`The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically.`})]}),(0,I.jsx)(Pp,{value:te,onChange:e=>ne(e.target.value),placeholder:`https://.../token`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Registration endpoint (DCR)`,(0,I.jsx)(G7,{text:`The URL used to dynamically register a new client (RFC 7591). Only relevant when using DCR. Override if the server doesn't advertise it in its metadata.`})]}),(0,I.jsx)(Pp,{value:re,onChange:e=>ie(e.target.value),placeholder:`https://.../register`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`CIMD URL override`,(0,I.jsx)(G7,{text:`Override the Client ID Metadata Document URL. Use this if the server doesn't discover it automatically or you want to test with a specific metadata document.`})]}),(0,I.jsx)(Pp,{value:M,onChange:e=>N(e.target.value),placeholder:`https://.../client-metadata.json`})]})]})]}),(0,I.jsxs)(M5,{children:[(0,I.jsx)(cn,{className:`h-4 w-4`}),(0,I.jsx)(N5,{children:`Secrets display`}),(0,I.jsxs)(P5,{className:`space-y-2`,children:[(0,I.jsx)(`p`,{children:`By default, full tokens and secrets are visible in the network inspector and exports — useful for debugging but not for sharing.`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(U0,{checked:!f,onCheckedChange:e=>p(e===!1)}),(0,I.jsx)($,{children:`Hide sensitive values in inspector`})]})]})]})]})]}),(0,I.jsx)(`div`,{className:`flex justify-end`,children:(0,I.jsxs)(W,{type:`button`,onClick:()=>void Ve(),disabled:he,children:[he&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),`Start OAuth Debug Session`]})})]}),i===`run`&&(0,I.jsx)(`div`,{className:`space-y-4`,children:(0,I.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[1.2fr_1fr]`,children:[(0,I.jsxs)(K,{className:`xl:col-span-1 min-w-0`,children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(qv,{className:`text-base`,children:`Progress`}),(0,I.jsx)(Jv,{children:`Visual OAuth flow guide with live session events and next-step actions.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[B?.uiHints.authorizationUrl&&Ke&&(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsxs)(`a`,{href:Ke,target:`_blank`,rel:`noopener noreferrer`,children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Open Authorization URL`]})}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void We(),disabled:he,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Restart`]}),ue&&(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ue(),disabled:_e||!ue,children:[(_e||pe)&&_e&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),(0,I.jsx)(rr,{className:`mr-2 h-4 w-4`}),`Stop Debug Session`]})]})]})}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{children:[je.completed+je.failed,`/`,je.total,` steps`]}),(0,I.jsxs)(`span`,{children:[je.percent,`%`]})]}),(0,I.jsx)(s7,{value:je.percent,className:`h-2`})]}),B?.status===`waiting_for_user`&&(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4 space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Manual callback required`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open the authorization URL, complete authentication, then paste the final redirect URL here.`}),(0,I.jsx)(t0,{value:se,onChange:e=>ce(e.target.value),placeholder:`Paste the final redirect URL (with code and state)`,className:`min-h-24 text-xs font-mono`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void He(),disabled:he||!se.trim(),children:[he&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),`Continue`]}),B.uiHints.authorizationUrl&&Ke&&(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsx)(`a`,{href:Ke,target:`_blank`,rel:`noopener noreferrer`,children:`Open Authorization URL`})})]})]})}),B?.status===`waiting_for_browser_callback`&&(0,I.jsxs)(M5,{children:[(0,I.jsx)(cn,{className:`h-4 w-4`}),(0,I.jsx)(N5,{children:`Waiting for browser callback`}),(0,I.jsxs)(P5,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs`,children:`Complete the authorization flow in your browser. MCP Lab is listening for the callback at:`}),(0,I.jsx)(`p`,{className:`text-xs font-mono break-all`,children:B.uiHints.callbackUrl}),B.uiHints.authorizationUrl&&Ke&&(0,I.jsx)(`div`,{className:`pt-2`,children:(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsxs)(`a`,{href:Ke,target:`_blank`,rel:`noopener noreferrer`,children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Open Authorization URL`]})})})]})]}),(0,I.jsx)(`div`,{className:`space-y-2`,children:B?.stepStates.map(e=>{let t=Pe.get(e.id),n=Ie.get(e.id),r=e.id===Tte||e.id===Ete,i=!!(n&&(n.requests.length>0||n.responses.length>0)),a=r&&e.status!==`pending`&&i;return(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-start gap-2`,children:[(0,I.jsx)(`div`,{className:`mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border bg-muted text-xs font-semibold`,children:t}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-1 text-sm font-medium`,children:[(0,I.jsx)(`span`,{children:e.title}),e.status===`completed`&&(0,I.jsx)(ln,{className:`h-4 w-4 shrink-0 text-emerald-600`,"aria-hidden":`true`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.description})]})]}),(0,I.jsx)(Y,{variant:e.status===`failed`?`destructive`:e.status===`completed`?`outline-solid`:e.status===`active`?`secondary`:`outline-solid`,className:e.status===`completed`?`border-emerald-300 bg-emerald-50 text-emerald-700`:void 0,children:e.status})]}),e.outcomeSummary&&(0,I.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground break-all whitespace-pre-line`,children:e.outcomeSummary}),e.id===wte&&(0,I.jsxs)(`details`,{className:`mt-3 rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-xs font-semibold text-muted-foreground`,children:`OAuth Metadata Sources`}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Resource Metadata`}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[`From `,Fe.resourceMetadata?.url??`not captured`]}),(0,I.jsx)(`pre`,{className:`max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs`,children:J7(Fe.resourceMetadata?.bodyText)})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Authorization Server Metadata`}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[`From`,` `,Fe.authorizationServerMetadata?.url??`not captured`]}),(0,I.jsx)(`pre`,{className:`max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs`,children:J7(Fe.authorizationServerMetadata?.bodyText)})]})]})]}),a&&n&&(0,I.jsxs)(`details`,{className:`mt-3 rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-xs font-semibold text-muted-foreground`,children:`Captured exchange details`}),(0,I.jsx)(`div`,{className:`mt-3 space-y-3`,children:Array.from({length:Math.max(n.requests.length,n.responses.length)}).map((t,r)=>{let i=n.requests[r],a=n.responses[r];return(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-2`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:i?.label??a?.label??`Exchange ${r+1}`}),(0,I.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground break-all`,children:[i?.method?`${i.method} `:``,i?.url??a?.url??`-`]}),typeof a?.status==`number`&&(0,I.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`HTTP `,a.status]}),i?.bodyText&&(0,I.jsx)(`pre`,{className:`mt-2 max-h-40 overflow-auto rounded bg-muted p-2 text-xs`,children:i.bodyText}),a?.bodyText&&(0,I.jsx)(`pre`,{className:`mt-2 max-h-48 overflow-auto rounded bg-muted p-2 text-xs`,children:J7(a.bodyText)})]},`${e.id}-exchange-${r}`)})})]})]},e.id)})||(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No steps yet.`})})]})]}),(0,I.jsx)(`div`,{className:`space-y-4 xl:col-span-1 min-w-0`,children:(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(qv,{className:`text-base`,children:`Inspect`}),(0,I.jsx)(Jv,{children:`Live events and network requests/responses for the OAuth flow.`})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ge(`raw`),disabled:!ue||!B,children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Copy/Export Raw Trace`]})]})}),(0,I.jsx)(q,{className:`space-y-3`,children:(0,I.jsxs)(b0,{value:Ce,onValueChange:e=>we(e),className:`min-w-0`,children:[(0,I.jsxs)(x0,{className:`grid grid-cols-2`,children:[(0,I.jsx)(S0,{value:`inspector`,children:`Network Inspector`}),(0,I.jsx)(S0,{value:`events`,children:`Live Debug`})]}),(0,I.jsx)(C0,{value:`events`,className:`mt-3`,children:(0,I.jsxs)(`div`,{className:`max-h-64 space-y-1 overflow-auto rounded-md border bg-muted/10 p-3 text-xs`,children:[V.length===0?(0,I.jsx)(`p`,{className:`text-muted-foreground`,children:`No events yet.`}):V.map((e,t)=>(0,I.jsxs)(`div`,{className:`break-all`,children:[(0,I.jsx)(`span`,{className:`mr-2 font-mono text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,I.jsx)(Y,{variant:`outline`,className:`mr-2 text-[10px]`,children:e.type}),typeof e.payload.message==`string`?e.payload.message:JSON.stringify(e.payload)]},`${e.ts}-${t}`)),(0,I.jsx)(`div`,{ref:Ee})]})}),(0,I.jsxs)(C0,{value:`inspector`,className:`space-y-3 mt-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Filter by step`}),(0,I.jsxs)(T1,{value:ye,onValueChange:be,children:[(0,I.jsx)(D1,{className:`h-8`,children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`all`,children:`All steps`}),(B?.stepStates??[]).map(e=>(0,I.jsxs)(Q,{value:e.id,children:[Pe.get(e.id),`. `,e.title]},e.id))]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Filter by status`}),(0,I.jsxs)(T1,{value:xe,onValueChange:Se,children:[(0,I.jsx)(D1,{className:`h-8`,children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`all`,children:`All`}),(0,I.jsx)(Q,{value:`ok`,children:`Successful responses`}),(0,I.jsx)(Q,{value:`error`,children:`Error responses`})]})]})]})]}),(0,I.jsx)(`div`,{className:`max-h-136 min-w-0 space-y-2 overflow-auto`,children:Me.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No network exchanges captured yet.`}):Me.map(e=>(0,I.jsxs)(`details`,{className:`rounded-md border p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer list-none`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-start gap-2`,children:[(0,I.jsx)(`div`,{className:`mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border bg-muted text-xs font-semibold`,children:Pe.get(e.stepId)}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:e.label}),(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground break-all`,children:[e.method?`${e.method} `:``,e.url]})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(Y,{variant:`outline`,children:`request`}),(0,I.jsx)(Y,{variant:`outline`,children:`response`}),typeof e.response?.status==`number`&&(0,I.jsx)(Y,{variant:e.response.status>=400?`destructive`:`secondary`,children:e.response.status})]})]})}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Request Headers`}),(0,I.jsx)(`pre`,{className:`max-h-40 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs`,children:JSON.stringify(e.request?.headers??{},null,2)})]}),e.request?.bodyText&&(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Request Body`}),(0,I.jsx)(`pre`,{className:`max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs`,children:e.request.bodyText})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Response Headers`}),(0,I.jsx)(`pre`,{className:`max-h-40 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs`,children:JSON.stringify(e.response?.headers??{},null,2)})]}),e.response?.bodyText&&(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Response Body`}),(0,I.jsx)(`pre`,{className:`max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs`,children:e.response.bodyText})]}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void K7(JSON.stringify(e,null,2)),children:[(0,I.jsx)(hn,{className:`mr-2 h-4 w-4`}),`Copy JSON`]})})]})]},e.key))})]})]})})]})})]})}),i===`report`&&B&&(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`text-xl font-semibold`,children:`Report / Export`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`OAuth debug session summary, validations, and trace exports.`})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>a(`configure`),children:`Back to Configure`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ge(`json`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export JSON`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ge(`markdown`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export Markdown`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ge(`raw`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Copy/Export Raw Trace`]})]})]}),(0,I.jsxs)(M5,{children:[(0,I.jsx)(cn,{className:`h-4 w-4`}),(0,I.jsx)(N5,{children:`Secrets display mode`}),(0,I.jsx)(P5,{children:B.summary?.showSensitiveValues?`This session is configured to show full tokens and secrets in network logs/exports.`:`Sensitive values are hidden in the inspector for this session.`})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-4`,children:[(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Status`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:B.status})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Requests`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:B.networkSummary.requestCount})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Network errors`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:B.networkSummary.errorCount})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Validation findings`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:B.validations.length})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsx)(qv,{className:`text-base`,children:`Key values`})}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Issuer`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:B.summary?.issuer||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Client ID`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:B.summary?.clientId||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Redirect URI`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:B.summary?.redirectUri||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Token endpoint status`}),(0,I.jsx)(`p`,{className:`text-sm`,children:B.summary?.tokenEndpointStatus??`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Token type`}),(0,I.jsx)(`p`,{className:`text-sm`,children:B.summary?.tokenType||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Scopes granted`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:(B.summary?.grantedScopes??[]).join(`, `)||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Token validity`}),(0,I.jsxs)(`p`,{className:`text-sm`,children:[typeof B.summary?.accessTokenValidForSeconds==`number`?`${k4(B.summary.accessTokenValidForSeconds)} remaining`:typeof B.summary?.accessTokenExpiresInSeconds==`number`?`${k4(B.summary.accessTokenExpiresInSeconds)} from issuance`:`No expiry advertised by token endpoint`,B.summary?.accessTokenExpiresAt?(0,I.jsxs)(I.Fragment,{children:[` (until `,(0,I.jsx)(`span`,{children:new Date(B.summary.accessTokenExpiresAt).toLocaleTimeString()}),`)`]}):``]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Source:`,` `,B.summary?.accessTokenExpirySource===`expires_in`?`token endpoint expires_in`:B.summary?.accessTokenExpirySource===`jwt_exp`?`JWT exp claim`:`not available`]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Refresh option`}),(0,I.jsx)(`p`,{className:`text-sm`,children:B.summary?.refreshTokenAvailable?`Refresh token available (silent refresh possible)`:`No refresh token in response (full login likely required after expiry)`})]}),B.summary?.accessToken&&(0,I.jsxs)(`div`,{className:`md:col-span-2 space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Access token`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`code`,{className:`flex-1 truncate rounded bg-muted px-2 py-1 text-xs font-mono text-muted-foreground`,children:[B.summary.accessToken.slice(0,48),`…`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`shrink-0 h-7 px-2 text-xs`,onClick:()=>void K7(B.summary.accessToken),children:[(0,I.jsx)(hn,{className:`mr-1 h-3 w-3`}),`Copy token`]})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Visible because "Hide sensitive values" is off. Use this token with the CLI via`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:`--oauth-token`}),`.`]})]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsx)(qv,{className:`text-base`,children:`Validation findings`})}),(0,I.jsx)(q,{className:`space-y-2`,children:B.validations.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No validation findings recorded.`}):B.validations.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground`,children:t+1}),(0,I.jsx)(`span`,{className:`font-bold`,children:e.title})]}),(0,I.jsx)(Y,{variant:qe(e.severity),children:e.severity})]}),(0,I.jsxs)(`p`,{className:`text-sm`,children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,e.detail]}),e.recommendation&&(0,I.jsxs)(`div`,{className:`mt-2 rounded-md border px-2.5 py-2 text-xs`,children:[(0,I.jsx)(`div`,{className:`mb-1 font-medium text-muted-foreground`,children:`Suggested improvement`}),(0,I.jsx)(`p`,{children:e.recommendation})]}),(0,I.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Step: `,e.stepId,e.specReference&&(0,I.jsxs)(I.Fragment,{children:[` · `,(0,I.jsx)(`a`,{href:e.specReference,target:`_blank`,rel:`noreferrer`,className:`text-primary underline`,children:`Spec reference`})]})]})]},e.id))})]})]})]})}var Y7=`Switch`,[kte,Ate]=L(Y7),[jte,Mte]=kte(Y7),X7=_.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=_.useState(null),m=P(t,e=>p(e)),h=_.useRef(!1),g=!f||u||!!f.closest(`form`),[v,y]=Re({prop:i,defaultProp:a??!1,onChange:l,caller:Y7});return(0,I.jsxs)(jte,{scope:n,checked:v,disabled:s,children:[(0,I.jsx)(V.button,{type:`button`,role:`switch`,"aria-checked":v,"aria-required":o,"data-state":e9(v),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:j(e.onClick,e=>{y(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,I.jsx)($7,{control:f,bubbles:!h.current,name:r,value:c,checked:v,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});X7.displayName=Y7;var Z7=`SwitchThumb`,Q7=_.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=Mte(Z7,n);return(0,I.jsx)(V.span,{"data-state":e9(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});Q7.displayName=Z7;var Nte=`SwitchBubbleInput`,$7=_.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=_.useRef(null),s=P(o,a),c=QQ(n),l=nc(t);return _.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,I.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});$7.displayName=Nte;function e9(e){return e?`checked`:`unchecked`}var t9=X7,Pte=Q7,n9=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(t9,{className:U(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,e),...t,ref:n,children:(0,I.jsx)(Pte,{className:U(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)})}));n9.displayName=t9.displayName;function Fte(e){let t=e.filter(e=>typeof e.sourcePath==`string`&&e.sourcePath.trim().length>0&&typeof e.relativePath==`string`&&e.relativePath.trim().length>0).map(e=>[e.sourcePath,e.relativePath]);return new Map(t)}function Ite(e){let t=e.filter(e=>typeof e.sourcePath==`string`&&e.sourcePath.trim().length>0).map(e=>[e.sourcePath,e.configName?.trim()||e.name]);return new Map(t)}function Lte(e,t){let n=new Map;for(let r of e){if(!r.sourcePath)continue;let e=new Map,i=r.scenarioEntries&&r.scenarioEntries.length>0?r.scenarioEntries:r.scenarios.map(e=>({kind:`inline`,scenario:e}));for(let n of i){if(n.kind===`inline`){e.set(n.scenario.id,n.scenario.name?.trim()||n.scenario.id);continue}let r=t.find(e=>e.id===n.ref);e.set(n.ref,r?.name?.trim()||n.ref)}n.set(r.sourcePath,e)}return n}function r9(e,t){let n=t.get(e);if(n)return n;let r=e.replace(/\\/g,`/`),i=r.lastIndexOf(`/evals/`);if(i>=0)return r.slice(i+7);let a=r.split(`/`).filter(Boolean);return a.length<=1?r:a.slice(-3).join(`/`)}function i9(e,t,n){let r=t.get(n);if(!e||e.length===0){if(r&&r.size===1){let e=r.values().next().value;if(e)return e}return`All scenarios`}if(!r)return e.length===1?e[0]:`${e[0]} +${e.length-1}`;let i=e.map(e=>r.get(e)??e);return i.length===1?i[0]:`${i[0]} +${i.length-1}`}var a9=`mcplab.runEvaluation.activeJobId`;function Rte(e){return e.configName?.trim()||e.name}function zte(e){if(e.suitePath?.trim())return e.suitePath.trim();if(e.relativePath?.includes(`/`)){let t=e.relativePath.lastIndexOf(`/`);return e.relativePath.slice(0,t)}return null}function o9(){return new Date().toLocaleTimeString()}function s9(e){return e.executionType===`rover`&&[`queued`,`waiting_for_rover`,`running`,`paused_rover`].includes(e.status)}function Bte(e){return e.jobs.flatMap(e=>e.childProgress?.length?e.childProgress.map(t=>({job:e,child:t})):[{job:e}])}var Vte=()=>{let[e]=mp(),[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(`1`),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(0),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(``),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)([]),[E,D]=(0,_.useState)(`agent_default`),[k,A]=(0,_.useState)([]),[j,M]=(0,_.useState)(!1),[N,P]=(0,_.useState)([]),[F,ee]=(0,_.useState)({}),[L,R]=(0,_.useState)({}),[z,te]=(0,_.useState)(``),[ne,re]=(0,_.useState)([]),[ie,ae]=(0,_.useState)([]),[oe,se]=(0,_.useState)([]),[ce,B]=(0,_.useState)([]),[le,ue]=(0,_.useState)(null),[de,V]=(0,_.useState)(null),[fe,pe]=(0,_.useState)(!1),[me,he]=(0,_.useState)(null),ge=(0,_.useRef)(null),_e=(0,_.useRef)(null),ve=(0,_.useRef)(null),ye=(0,_.useRef)(!1),{configs:be,reload:xe}=Hv(),{source:Se}=Mv(),{agents:Ce,scenarios:we,servers:Te,reload:Ee}=Gv(),De=b.trim(),Oe=De?`/results/${encodeURIComponent(De)}${t?`?configId=${encodeURIComponent(t)}`:``}`:`/results`,ke=be.find(e=>e.id===t),Ae=(0,_.useMemo)(()=>Fte(be),[be]),je=(0,_.useMemo)(()=>Ite(be),[be]),Me=(0,_.useMemo)(()=>Lte(be,we),[be,we]),Ne=ie[0]??null,H=(0,_.useMemo)(()=>ce.find(e=>e.jobs.some(e=>e.jobId===S))??null,[ce,S]),Pe=H?Math.max(s,H.totalJobs>0?Math.round(H.completedJobs/H.totalJobs*100):0):s,Fe=e.get(`configId`),Ie=(0,_.useMemo)(()=>{if(!ke)return[];let e=new Map,t=ke.agentEntries&&ke.agentEntries.length>0?ke.agentEntries:ke.agents.map(e=>({kind:`inline`,agent:e}));for(let n of t){if(n.kind===`inline`){let t=n.agent.id;e.has(t)||e.set(t,n.agent);continue}let t=Ce.find(e=>e.id===n.ref);t&&!e.has(t.id)&&e.set(t.id,t)}for(let t of Ce)e.has(t.id)||e.set(t.id,t);return Array.from(e.values())},[ke,Ce]),Le=(0,_.useMemo)(()=>{if(!ke)return[];let e=new Map,t=ke.scenarioEntries&&ke.scenarioEntries.length>0?ke.scenarioEntries:ke.scenarios.map(e=>({kind:`inline`,scenario:e}));for(let n of t){if(n.kind===`inline`){e.has(n.scenario.id)||e.set(n.scenario.id,n.scenario);continue}let t=we.find(e=>e.id===n.ref);t&&!e.has(t.id)&&e.set(t.id,t)}return Array.from(e.values())},[ke,we]),Re=(0,_.useMemo)(()=>Ie.filter(e=>e.type===`browser`&&w.includes(e.id)),[Ie,w]),ze=Re.length>0?1:Number(r),Be=(0,_.useMemo)(()=>[{label:`LLM Agents`,agents:Ie.filter(e=>e.type!==`browser`)},{label:`Browser Agents`,agents:Ie.filter(e=>e.type===`browser`)}],[Ie]),Ve=(0,_.useMemo)(()=>{let e=new Map;for(let t of Te)e.has(t.id)||e.set(t.id,{id:t.id,name:t.name});for(let t of ke?.servers??[])e.set(t.id,{id:t.id,name:t.name});return Array.from(e.values()).sort((e,t)=>e.id.localeCompare(t.id))},[ke?.servers,Te]);(0,_.useEffect)(()=>{Fe&&be.some(e=>e.id===Fe)&&n(Fe)},[Fe,be]);let He=(0,_.useRef)(``);(0,_.useEffect)(()=>{let e=ke?`${ke.id}::${ke.sourcePath??``}`:``;if(e===He.current)return;if(He.current=e,!ke){T([]),D(`agent_default`),A([]),M(!1),P([]),ee({}),R({});return}let t=N1(ke);T(t.length>0?t:Ie.map(e=>e.id)),D(`agent_default`),A(Le.map(e=>e.id)),M(!1),P([]),ee({}),R({})},[ke?.id,ke?.sourcePath,Ie,Le]);let Ue=async()=>{if(!ke?.sourcePath){u(e=>[...e,`[${o9()}] Missing source path for selected config.`]);return}let e=Ie.filter(e=>w.includes(e.id));if(e.length===0){u(e=>[...e,`[${o9()}] Select at least one agent.`]);return}let t=Le.filter(e=>k.includes(e.id)),n=new Set(t.map(e=>e.id)),r=j||Object.values(F).some(Boolean),i=Object.fromEntries(Object.entries(L).filter(([e])=>n.has(e)&&F[e])),a=t.map(e=>{let t=i[e.id]??(j?N:e.serverIds||[]);return`${e.id}=[${t.join(`, `)}]`}).join(`; `);if(t.length===0){u(e=>[...e,`[${o9()}] Select at least one test.`]);return}if(j&&N.length===0){u(e=>[...e,`[${o9()}] Select at least one server for "Override MCP Servers for Selected Tests", or turn that override off.`]);return}let s=Object.entries(i).filter(([,e])=>!Array.isArray(e)||e.length===0).map(([e])=>e);if(s.length>0){u(e=>[...e,`[${o9()}] Select at least one server for per-scenario overrides on: ${s.join(`, `)}, or turn those overrides off.`]);return}let l=Array.from(new Set(t.flatMap(e=>r?i[e.id]?i[e.id]??[]:j?N:e.serverIds||[]:e.serverIds||[]).filter(e=>{let t=(ke.servers??[]).find(t=>t.id===e),n=Te.find(t=>t.id===e);return(t||n)?.authType===`oauth2`})));try{l.length>0&&(pe(!0),await v4({serverNames:l,source:Se,onServerAuthStart:e=>{u(t=>[...t,`[${o9()}] OAuth login required for '${e}'. Complete the browser sign-in flow...`])}}),u(e=>[...e,`[${o9()}] OAuth login completed for required server(s): ${l.join(`, `)}.`]))}catch(e){let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${o9()}] OAuth error: ${t}`]),pe(!1);return}finally{pe(!1)}o(!0),f(!1),y(!1),x(``);let d=(ke.serverEntries??[]).some(e=>e.kind===`referenced`)||(ke.agentEntries??[]).some(e=>e.kind===`referenced`)||(ke.scenarioEntries??[]).some(e=>e.kind===`referenced`)?`refs-composed`:`single-file/inline`,p={...Re.length>0&&E!==`agent_default`?{newConversationBeforeStart:E===`new`,newConversationBetweenScenarios:E===`new`}:{}};u([`[${o9()}] Starting evaluation run...`,`[${o9()}] Config=${ke.name} mode=${d} agents=${e.map(e=>e.name||e.id).join(`, `)} tests=${t.map(e=>e.id).join(`, `)} runs=${ze}${Re.length>0?` newConversationBeforeStart=${p.newConversationBeforeStart??`agent_default`} newConversationBetweenScenarios=${p.newConversationBetweenScenarios??`agent_default`}`:``}${z.trim()?` note=${z.trim()}`:``}`,`[${o9()}] Effective MCP servers per selected test: ${a||`(none)`}`]),c(10);try{let{jobId:n}=await Se.startRun({configPath:ke.sourcePath,runsPerScenario:ze,agents:e.map(e=>e.id),scenarioIds:t.map(e=>e.id),...p,...r&&j?{serverOverrideAll:N}:{},...r&&Object.keys(i).length>0?{scenarioServerOverrides:i}:{},runNote:z.trim()?z.trim():void 0});C(n),qe(n),tt(n),Je()}catch(e){let t=e instanceof Error?e.message:String(e),n=t.includes(`Anthropic model not found`)?` Hint: this usually means the API key works but the model ID is not enabled for that Anthropic account. Change the agent model in Manage Agents (library) or inline config.`:``;u(e=>[...e,`[${o9()}] Error: ${t}${n}`]),o(!1),c(0),C(null),pe(!1)}},We=()=>{Ue()},Ge=()=>{ve.current=null,S&&Se.stopRun(S),_e.current?.(),_e.current=null,Ke(),C(null),o(!1),f(!1),y(!0),u(e=>[...e,`[${o9()}] Run aborted by user.`]),Je()};(0,_.useEffect)(()=>{ge.current&&(ge.current.scrollTop=ge.current.scrollHeight)},[l]),(0,_.useEffect)(()=>()=>{ve.current=null,_e.current?.()},[]),(0,_.useEffect)(()=>{if(S||d)return;let e=``;try{e=sessionStorage.getItem(a9)??``}catch{e=``}if(e)return C(e),o(!0),f(!1),y(!1),u(e=>e.length>0?e:[`[${o9()}] Reattached to in-progress evaluation run...`]),tt(e),()=>{}},[S,d]);let Ke=()=>{try{sessionStorage.removeItem(a9)}catch{}},qe=e=>{try{sessionStorage.setItem(a9,e)}catch{}},Je=async()=>{try{let e=await Se.getRunQueue();re(e.queued),ae(e.active_jobs??(e.active?[e.active]:[])),se(e.admitting_jobs??[]),B((e.evaluations??[]).filter(e=>![`completed`,`partial`,`failed`].includes(e.status)));let t=S==null?void 0:e.queued.find(e=>e.jobId===S&&e.status===`blocked_auth`&&e.blockedReason===`oauth_required`);t&&(t.requiredServers??[]).length>0?he(e=>e?.jobId===t.jobId?e:{jobId:t.jobId,servers:t.requiredServers}):(me?.jobId&&me.jobId!==S||S!=null&&!e.queued.some(e=>e.jobId===S&&e.status===`blocked_auth`&&e.blockedReason===`oauth_required`))&&he(null)}catch{}},Ye=()=>{xe(),Ee()};(0,_.useEffect)(()=>{Ye(),Je();let e=()=>{Ye(),Je()},t=()=>{Je()};return window.addEventListener(`focus`,e),window.addEventListener(`mcplab:run-queue-changed`,t),()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`mcplab:run-queue-changed`,t)}},[xe,Ee]);let Xe=async e=>{try{await Se.removeQueuedRun(e),re(t=>t.filter(t=>t.jobId!==e))}catch(t){let n=t instanceof Error?t.message:String(t);if(n.includes(`Use the /stop endpoint`))try{await Se.stopRun(e)}catch{}else O({title:`Could not remove queued run`,description:n,variant:`destructive`})}Je()},Ze=async e=>{let t=Array.from(new Set(e.jobs.flatMap(e=>e.requiredServers??[])));if(!(t.length===0||ye.current)){ye.current=!0,pe(!0);try{await v4({serverNames:t,source:Se}),await Se.resumeQueue()}catch(e){O({title:`Could not connect OAuth`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ye.current=!1,pe(!1),Je()}}},Qe=async e=>{if(de!==e){V(e);try{await Se.stopEvaluationRun(e),await Je()}catch(e){O({title:`Could not stop run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{V(null)}}},$e=async e=>{try{await Se.removeEvaluationRun(e),await Je()}catch(e){O({title:`Could not remove run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},et=async e=>{try{await Se.openRover(e),await Je()}catch(e){O({title:`Could not open browser agent`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},tt=e=>{S===e&&_e.current||(_e.current?.(),ve.current=e,_e.current=Se.subscribeRunJob(e,t=>{let n=new Date(t.ts).toLocaleTimeString();if(t.type===`queued`)u(e=>{let r=t.payload.position?` (position ${t.payload.position})`:``,i=`[${n}] Run queued${r}. Waiting for active run to finish...`;return e.includes(i)?e:[...e,i]}),c(5);else if(t.type===`oauth_required`){let e=Array.isArray(t.payload.servers)?t.payload.servers:[],r=String(t.payload.jobId??``);he({jobId:r,servers:e}),u(t=>{let r=`[${n}] OAuth required for server(s): ${e.join(`, `)}. Click "Connect & Resume" to authenticate.`;return t.includes(r)?t:[...t,r]})}else{if(t.type===`started`&&(he(null),ye.current=!1,o(!0),f(!1),y(!1),u(e=>{let t=`[${n}] Run started.`;return e.includes(t)?e:[...e,t]}),c(e=>Math.max(e,30)),Je()),t.type===`log`){let e=String(t.payload.message??``).trim();e&&(u(t=>{let r=`[${n}] ${e}`;return t.includes(r)?t:[...t,r]}),c(t=>{let n=e.toLowerCase();if(n.startsWith(`loading mcp evaluation config`))return Math.max(t,15);if(n.startsWith(`loaded config`))return Math.max(t,20);if(n.startsWith(`selected `))return Math.max(t,30);if(n.startsWith(`using requested agents`)||n.startsWith(`using run default agents`)||n.startsWith(`using config-declared agents`))return Math.max(t,35);if(n.startsWith(`expanded to `))return Math.max(t,45);if(n.startsWith(`running evaluation`))return Math.max(t,50);let r=n.match(/^scenario (\d+)\/(\d+) finished:/);if(r){let e=Number(r[1]),n=Number(r[2]);return Math.max(t,50+Math.round(e/n*25))}return n.startsWith(`evaluation execution finished`)?Math.max(t,78):n.startsWith(`writing results to `)?Math.max(t,94):n.startsWith(`run finished:`)?Math.max(t,98):t}))}if(t.type===`completed`||t.type===`error`){let r=t.type===`error`,i=String(t.payload.runId??``).trim(),a=n=>t.payload.status===`stopped`||[`Run stopped by user`,`Run aborted by user`].includes(String(t.payload.message))||n?.status===`stopped`||n?.jobs.find(t=>t.jobId===e)?.status===`stopped`,s=e=>{if(!r||a(e))return;let i=String(t.payload.message??`Unknown error`),o=i.includes(`Anthropic model not found`)?` Hint: this usually means the API key works but the model ID is not enabled for that Anthropic account. Change the agent model in Manage Agents (library) or inline config.`:``;u(e=>[...e,`[${n}] Error: ${i}${o}`])},l=e=>{s(e);let t=r&&!a(e)||(e?.failedJobs??0)-(e?.stoppedJobs??0)>0,l=a(e)&&!t&&!e?.completedJobs&&!i;he(null),ye.current=!1,u(r=>{let i=`[${n}] ${t?`Run completed with errors.`:a(e)?`Run stopped.`:`Run completed.`}`;return r.includes(i)?r:[...r,i]}),c(100),o(!1),f(!l),m(t),g(e??null),y(l),x(e?.completedJobs?e.evaluationRunId:r&&!a(e)?``:i),Ke(),C(null),ve.current=null,_e.current?.(),_e.current=null,Je()};Se.getRunQueue().then(t=>{if(ve.current!==e)return;let r=t.evaluations?.find(t=>t.jobs.some(t=>t.jobId===e))??t.evaluations?.find(e=>e.evaluationRunId===i),a=r?.jobs.find(t=>t.jobId!==e&&[`queued`,`waiting_for_rover`,`paused_rover`,`running`].includes(t.status))??r?.jobs.find(t=>t.jobId!==e&&t.status===`blocked_auth`);if(a&&r){s(r);let e=r.completedJobs+r.failedJobs,t=`[${n}] Subtask finished. ${e}/${r.totalJobs} finished. Continuing with the remaining run tasks...`;u(e=>e.includes(t)?e:[...e,t]),c(t=>Math.max(t,r.totalJobs>0?Math.round(e/r.totalJobs*100):t)),he(a.status===`blocked_auth`?{jobId:a.jobId,servers:a.requiredServers??[]}:null),ye.current=!1,o(!0),f(!1),y(!1),C(a.jobId),qe(a.jobId),Je(),tt(a.jobId)}else l(r)}).catch(()=>{ve.current===e&&l()})}}}))},nt=e=>{S===e&&_e.current||(C(e),qe(e),o(!0),f(!1),y(!1),u([`[${o9()}] Attached to running job ${e}...`]),c(10),tt(e))};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Kn,{className:`h-6 w-6`}),`Run Evaluation`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Execute evaluation scenarios against MCP servers`})]}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6 space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{children:`MCP Evaluation`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(T1,{value:t,onValueChange:n,children:[(0,I.jsx)(D1,{children:(0,I.jsx)(E1,{placeholder:`Select a config`})}),(0,I.jsx)(A1,{children:be.map(e=>{let t=zte(e);return(0,I.jsxs)(Q,{value:e.id,children:[(0,I.jsx)(`span`,{children:Rte(e)}),t&&(0,I.jsxs)(`span`,{className:`ml-2 text-muted-foreground`,children:[`(`,t,`)`]})]},e.id)})})]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`icon`,className:`h-10 w-10 shrink-0`,onClick:Ye,"aria-label":`Refresh configs`,title:`Refresh configs`,children:(0,I.jsx)(Yn,{className:`h-4 w-4`})})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{htmlFor:`variance-runs`,children:`Variance Runs`}),(0,I.jsx)(Pp,{id:`variance-runs`,type:`number`,min:`1`,max:`10`,value:Re.length>0?`1`:r,onChange:e=>i(e.target.value),disabled:Re.length>0}),Re.length>0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Browser agents support one run per scenario.`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)($,{htmlFor:`run-note`,children:`Run Note`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[z.length,`/500`]})]}),(0,I.jsx)(t0,{id:`run-note`,value:z,onChange:e=>te(e.target.value.slice(0,500)),placeholder:`Optional context for this run (for example: mcp-server v1.8.2 #staging)`,rows:2})]}),ke&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)($,{children:`Agents`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>T(Ie.map(e=>e.id)),children:`Select all`}),(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>T([]),children:`Clear`})]})]}),(0,I.jsx)(`div`,{className:`space-y-3`,children:Be.map(e=>e.agents.length>0?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:e.label}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,"aria-label":`Select all ${e.label}`,onClick:()=>{let t=new Set(e.agents.map(e=>e.id));T(e=>[...e.filter(e=>!t.has(e)),...t])},children:`Select all`}),(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,"aria-label":`Clear ${e.label}`,onClick:()=>{let t=new Set(e.agents.map(e=>e.id));T(e=>e.filter(e=>!t.has(e)))},children:`Clear`})]})]}),(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.agents.map(e=>{let t=w.includes(e.id);return(0,I.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border p-2 text-sm`,children:[(0,I.jsx)(U0,{checked:t,onCheckedChange:t=>{let n=t===!0;T(t=>n?[...t,e.id]:t.filter(t=>t!==e.id))}}),(0,I.jsx)(`span`,{children:e.name||e.id})]},e.id)})})]},e.label):null)}),Re.length>0&&(0,I.jsxs)(`div`,{className:`space-y-1.5 rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)($,{htmlFor:`conversation-behavior`,children:`Conversation behavior`}),(0,I.jsxs)(T1,{value:E,onValueChange:e=>D(e),children:[(0,I.jsx)(D1,{id:`conversation-behavior`,children:(0,I.jsx)(E1,{})}),(0,I.jsxs)(A1,{children:[(0,I.jsx)(Q,{value:`agent_default`,children:`Use agent default`}),(0,I.jsx)(Q,{value:`new`,children:`Start a new conversation`}),(0,I.jsx)(Q,{value:`same`,children:`Continue the same conversation`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This setting is frozen into the Rover job. Rover cannot change it locally.`})]}),Ie.length===0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No agents available. Add agents to your workspace library, or define inline agents in this config.`})]}),ke&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)($,{children:`Tests`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>A(Le.map(e=>e.id)),children:`Select all`}),(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>A([]),children:`Clear`})]})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[k.length,` of `,Le.length,` selected`]}),(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:Le.map(e=>{let t=k.includes(e.id),n=L[e.id],r=!!F[e.id],i=r&&Array.isArray(n),a=new Set(e.serverIds||[]);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm rounded-md border p-2 cursor-pointer`,onClick:n=>{let r=n.target;r&&(r.closest(`button, a, input, select, textarea, [role='button']`)||A(n=>t?n.filter(t=>t!==e.id):[...n,e.id]))},children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(U0,{checked:t,onCheckedChange:t=>{let n=t===!0;A(t=>n?[...t,e.id]:t.filter(t=>t!==e.id))}}),(0,I.jsxs)(`span`,{className:`min-w-0`,children:[(0,I.jsxs)(`span`,{className:`block font-medium`,children:[e.name||e.id,` `,i&&(0,I.jsx)(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary`,children:`Override`})]}),(0,I.jsx)(`span`,{className:`block font-mono text-xs text-muted-foreground truncate`,children:e.id})]})]}),t&&(0,I.jsxs)(`div`,{className:`pl-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)($,{className:`text-[11px] text-muted-foreground`,children:`Per-scenario: "Override MCP Servers"`}),(0,I.jsx)(n9,{checked:r,onCheckedChange:t=>{if(ee(n=>({...n,[e.id]:t})),!t)R(t=>{let n={...t};return delete n[e.id],n});else if(!L[e.id]){let t=j&&N.length>0?[...N]:[...e.serverIds||[]];R(n=>({...n,[e.id]:t}))}}})]}),r&&(0,I.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:Ve.map(t=>{let r=t.id,i=(n??[]).includes(r),o=a.has(r);return(0,I.jsx)(Y,{variant:i?`default`:`outline-solid`,className:`cursor-pointer text-xs ${i?``:`opacity-60 hover:opacity-100`}`,style:!i&&o?{borderColor:`hsl(var(--primary))`}:void 0,onClick:t=>{t.stopPropagation(),R(t=>{let n=t[e.id]??[],i=n.includes(r)?n.filter(e=>e!==r):[...n,r];return{...t,[e.id]:i}})},children:t.name?.trim()?t.name:r},r)})})]})]},e.id)})}),(0,I.jsxs)(`div`,{className:`space-y-1 rounded-md border p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`div`,{className:`text-xs`,children:[(0,I.jsx)(`span`,{children:`Override MCP Servers for selected Tests `}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`Selected tests run against the servers you choose here. Applies only to this run.`})]}),(0,I.jsx)(n9,{checked:j,onCheckedChange:M})]}),j&&(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Ve.map(e=>{let t=e.id,n=N.includes(t);return(0,I.jsx)(Y,{variant:n?`default`:`outline-solid`,className:`cursor-pointer text-xs ${n?``:`opacity-60 hover:opacity-100`}`,onClick:()=>P(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]),children:e.name?.trim()?e.name:t},t)})})]})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsxs)(W,{onClick:We,disabled:!t||fe||Ie.length>0&&w.length===0||Le.length>0&&k.length===0,children:[(0,I.jsx)(Kn,{className:`mr-2 h-4 w-4`}),Ne?`Queue Run`:`Run`]}),a&&(0,I.jsxs)(W,{variant:`destructive`,onClick:Ge,children:[(0,I.jsx)(rr,{className:`mr-2 h-4 w-4`}),`Stop`]})]})]})}),(a||l.length>0)&&(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(qv,{className:`text-base`,children:`Progress`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground font-mono`,children:[Math.round(Pe),`%`]})]})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsx)(s7,{value:Pe,className:`h-2`}),(H||Ne)&&(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:H?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{children:[H.completedJobs,`/`,H.totalJobs,` subtasks complete`]}),H.failedJobs-H.stoppedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-destructive`,children:[H.failedJobs-H.stoppedJobs,` failed`]}),H.stoppedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-muted-foreground`,children:[H.stoppedJobs,` stopped`]}),H.pausedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-yellow-700 dark:text-yellow-400`,children:[H.pausedJobs,` paused`]}),(0,I.jsx)(Y,{variant:`outline`,className:`capitalize`,children:H.status})]}):(0,I.jsx)(`span`,{children:Ne?.roverProgress?`${Ne.roverProgress.completed}/${Ne.roverProgress.total} scenarios complete`:`Attached to active run`})}),me&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-yellow-500/40 bg-yellow-500/10 px-3 py-2 text-sm`,children:[(0,I.jsxs)(`span`,{className:`text-yellow-700 dark:text-yellow-400`,children:[`OAuth required for: `,(0,I.jsx)(`strong`,{children:me.servers.join(`, `)})]}),(0,I.jsx)(W,{size:`sm`,variant:`outline`,disabled:fe,onClick:()=>{ye.current||(ye.current=!0,pe(!0),v4({serverNames:me.servers,source:Se,onServerAuthStart:e=>{u(t=>[...t,`[${o9()}] OAuth sign-in opened for '${e}'...`])}}).then(()=>Se.resumeQueue()).then(()=>{let e=me?.jobId;u(e=>[...e,`[${o9()}] OAuth complete. Resuming run...`]),e&&(C(e),qe(e),o(!0),f(!1),tt(e))}).catch(e=>{let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${o9()}] OAuth error: ${t}`]),ye.current=!1}).finally(()=>{pe(!1)}))},children:fe?`Connecting...`:`Connect & Resume`})]}),(0,I.jsx)(`div`,{ref:ge,className:`h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5`,children:l.map((e,t)=>(0,I.jsx)(`div`,{className:e.includes(`✓`)?`text-success`:e.includes(`aborted`)?`text-destructive`:`text-foreground`,children:e},t))})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(qv,{className:`inline-flex items-center gap-2 text-base`,children:[(0,I.jsx)(mn,{className:`h-4 w-4`}),`Run Queue`]}),(0,I.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>void Je(),children:(0,I.jsx)(Yn,{className:`h-3 w-3`})})]})}),(0,I.jsx)(q,{children:!Ne&&oe.length===0&&ne.length===0&&ce.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No active or queued runs. Start a run above.`}):(0,I.jsxs)(`div`,{className:`space-y-2`,children:[ce.map(e=>(0,I.jsxs)(`div`,{onClick:()=>{let t=e.jobs.find(e=>e.status===`running`||e.status===`waiting_for_rover`||e.status===`paused_rover`);t&&nt(t.jobId)},className:`rounded-md border p-3 text-sm ${e.status===`failed`?`border-destructive/40 bg-destructive/5`:e.status===`stopped`?`border-muted-foreground/30 bg-muted/40`:e.status===`partial`?`border-yellow-500/40 bg-yellow-500/5`:e.status===`running`?`border-primary/20 bg-primary/5`:`border-border bg-background`}`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`font-semibold`,children:e.evaluationName||`Evaluation`}),(0,I.jsx)(Y,{variant:`outline`,className:`capitalize ${e.status===`running`?`border-emerald-500/40 bg-emerald-500/15 text-emerald-700 dark:text-emerald-400`:``}`,children:e.status}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.completedJobs,`/`,e.totalJobs,` scenario-agent runs complete`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[e.jobs.some(e=>e.status===`blocked_auth`)&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7 text-xs border-yellow-500/50 text-yellow-700 dark:text-yellow-400`,disabled:fe,onClick:()=>void Ze(e),children:fe?`Connecting...`:`Connect OAuth`}),e.jobs.some(s9)&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7 text-xs`,onClick:()=>{let t=e.jobs.find(s9);t&&et(t.jobId)},title:`Open the browser-agent URL, then activate the Rover extension`,children:`Open browser agent`}),(0,I.jsx)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:()=>ue(t=>t===e.evaluationRunId?null:e.evaluationRunId),"aria-label":`${le===e.evaluationRunId?`Collapse`:`Expand`} evaluation details`,children:le===e.evaluationRunId?`Hide`:`Details`}),e.jobs.length>0&&(e.jobs.every(e=>[`queued`,`blocked_auth`,`waiting_for_rover`,`stopped`].includes(e.status))||e.status===`stopped`&&e.jobs.every(e=>[`completed`,`error`,`stopped`].includes(e.status)))&&(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-destructive`,onClick:()=>void $e(e.evaluationRunId),title:e.status===`stopped`?`Remove stopped run from the queue`:`Remove evaluation from queue`,"aria-label":e.status===`stopped`?`Remove stopped run from queue`:`Remove evaluation from queue`,children:[(0,I.jsx)(dr,{className:`mr-1 h-3 w-3`}),e.status===`stopped`?`Remove run`:`Remove`]}),e.jobs.some(e=>[`blocked_auth`,`waiting_for_rover`,`paused_rover`,`running`].includes(e.status))&&(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10`,disabled:de===e.evaluationRunId,onClick:()=>void Qe(e.evaluationRunId),title:`Stop this evaluation run and its queued or running tasks`,children:[(0,I.jsx)(rr,{className:`mr-1 h-3 w-3`}),de===e.evaluationRunId?`Stopping run...`:`Stop run`]})]})]}),le===e.evaluationRunId&&(0,I.jsx)(`div`,{className:`mt-2 space-y-1 text-xs text-muted-foreground`,children:Bte(e).map(({job:e,child:t},n)=>(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded px-2 py-1 ${t?.status===`completed`?`border border-emerald-500/30 bg-emerald-500/10 text-emerald-800 dark:text-emerald-300`:t?.status===`error`||t?.status===`stopped`?`border border-destructive/30 bg-destructive/5`:`bg-background`}`,onClick:()=>nt(e.jobId),children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 truncate`,children:[(0,I.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[n+1,`.`]}),(t?t.status===`running`:e.status===`running`)&&(0,I.jsx)(i_,{label:`Subjob running`}),t?.status===`completed`&&(0,I.jsx)(ln,{className:`h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`}),(t?.status===`error`||t?.status===`stopped`)&&(0,I.jsx)(dr,{className:`h-3.5 w-3.5 shrink-0 text-destructive`}),t?`${t.scenarioId} · ${t.agentName}: `:`${e.roverAgent?.name??e.runParams.agents?.join(`, `)??`Agent`}: `,t?.status===`queued`?`queued`:t?.status===`running`?`running`:t?.status===`completed`?`completed`:t?.status===`error`?`error`:t?.status===`stopped`?`stopped`:e.status===`waiting_for_rover`?`waiting for Rover`:e.status===`paused_rover`?`paused`:e.status.replaceAll(`_`,` `),t?` (${t.completed}/${t.total} attempts)`:e.roverProgress&&` (${e.roverProgress.completed}/${e.roverProgress.total} scenarios)`,!t&&e.roverProgress?.lastDurationMs!=null&&` · ${Math.round(e.roverProgress.lastDurationMs/1e3)}s`,t?.error&&` · ${t.error}`,!t&&e.roverProgress?.error&&` · ${e.roverProgress.error}`]}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1`,onClick:e=>e.stopPropagation(),children:[s9(e)&&(!t||e.childProgress?.[0]?.scenarioId===t.scenarioId)&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-6 px-1.5 text-[11px]`,onClick:()=>void et(e.jobId),children:`Open browser agent`}),!t&&e.executionType===`rover`&&e.status===`paused_rover`&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-6 px-1.5 text-[11px]`,onClick:()=>{Se.resumeRover(e.jobId).then(()=>void Je())},children:`Resume`}),(t&&(t.status===`running`||t.status===`queued`)||!t&&e.status===`queued`||!t&&e.executionType===`rover`&&(e.status===`waiting_for_rover`||e.status===`paused_rover`||e.status===`running`))&&(0,I.jsx)(W,{size:`sm`,variant:`ghost`,className:`h-6 px-1.5 text-[11px] text-destructive`,onClick:()=>{(t?Se.stopScenario(e.jobId,t.scenarioId,t.agentName):Se.stopRun(e.jobId)).then(()=>void Je())},children:t?.status===`queued`||e.status===`queued`?`Remove`:`Stop`})]})]},`${e.jobId}:${t?.scenarioId??`job`}:${t?.agentName??`job`}`))})]},e.evaluationRunId)),ie.filter(e=>!e.evaluationRunId).map(e=>(0,I.jsxs)(`div`,{role:`button`,tabIndex:0,className:`flex items-center justify-between rounded-md border border-primary/30 bg-primary/5 p-2 text-sm cursor-pointer hover:bg-primary/10 transition-colors ${S===e.jobId?`ring-2 ring-primary/40`:``}`,onClick:()=>{S!==e.jobId&&(C(e.jobId),qe(e.jobId),o(!0),f(!1),y(!1),u([`[${o9()}] Attached to running job ${e.jobId}...`]),c(10),tt(e.jobId))},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&S!==e.jobId&&(t.preventDefault(),C(e.jobId),qe(e.jobId),o(!0),f(!1),y(!1),u([`[${o9()}] Attached to running job ${e.jobId}...`]),c(10),tt(e.jobId))},title:`Click to view progress`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary`,children:`Running`}),(0,I.jsx)(`span`,{className:`text-xs font-bold`,children:je.get(e.runParams.configPath)||i9(e.runParams.scenarioIds,Me,e.runParams.configPath)}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:r9(e.runParams.configPath,Ae)}),e.runParams.agents&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`agents: `,e.runParams.agents.join(`, `)]}),e.runParams.runNote&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate`,children:[`note: `,e.runParams.runNote]})]}),(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10`,onClick:t=>{t.stopPropagation(),Se.stopRun(e.jobId),Je()},title:`Stop running job`,children:[(0,I.jsx)(rr,{className:`mr-1 h-3 w-3`}),`Stop`]})]},e.jobId)),oe.filter(e=>!e.evaluationRunId).map(e=>{let t=r9(e.runParams.configPath,Ae),n=i9(e.runParams.scenarioIds,Me,e.runParams.configPath),r=je.get(e.runParams.configPath)||n,i=e.status===`blocked_auth`;return(0,I.jsx)(`div`,{className:`flex items-center justify-between rounded-md border p-2 text-sm ${i?`border-yellow-500/40 bg-yellow-500/5`:`border-border bg-background`}`,children:(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${i?`bg-yellow-500/15 text-yellow-700 dark:text-yellow-400`:`bg-primary/10 text-primary`}`,children:i?`Retrying OAuth`:`Starting`}),(0,I.jsx)(`span`,{className:`text-xs font-bold`,children:r}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:t}),i&&(e.requiredServers??[]).length>0&&(0,I.jsxs)(`span`,{className:`text-xs text-yellow-700 dark:text-yellow-400`,children:[`OAuth: `,e.requiredServers.join(`, `)]})]})},e.jobId)}),ne.filter(e=>!e.evaluationRunId).map((e,t)=>{let n=r9(e.runParams.configPath,Ae),r=i9(e.runParams.scenarioIds,Me,e.runParams.configPath),i=je.get(e.runParams.configPath)||r,a=e.status===`blocked_auth`;return(0,I.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-2 text-sm ${a?`border-yellow-500/40 bg-yellow-500/5`:``}`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2 flex-wrap`,children:[a?(0,I.jsxs)(`span`,{className:`inline-flex items-center rounded-full bg-yellow-500/15 px-2 py-0.5 text-xs font-medium text-yellow-700 dark:text-yellow-400`,children:[`#`,t+1,` Blocked`]}):(0,I.jsxs)(`span`,{className:`inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:[`#`,t+1,` Queued`]}),(0,I.jsx)(`span`,{className:`text-xs font-bold`,children:i}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:n}),a&&(e.requiredServers??[]).length>0&&(0,I.jsxs)(`span`,{className:`text-xs text-yellow-700 dark:text-yellow-400`,children:[`OAuth: `,e.requiredServers.join(`, `)]}),!a&&e.runParams.agents&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`agents: `,e.runParams.agents.join(`, `)]}),e.runParams.runNote&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate`,children:[`note: `,e.runParams.runNote]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[a&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7 text-xs border-yellow-500/50 text-yellow-700 dark:text-yellow-400 hover:bg-yellow-500/10`,disabled:fe,onClick:()=>{if(ye.current)return;let t=e.requiredServers??[];t.length!==0&&(ye.current=!0,he({jobId:e.jobId,servers:t}),pe(!0),v4({serverNames:t,source:Se,onServerAuthStart:e=>{u(t=>[...t,`[${o9()}] OAuth sign-in opened for '${e}'...`])}}).then(()=>Se.resumeQueue()).then(()=>{u(e=>[...e,`[${o9()}] OAuth complete. Resuming run...`]),C(e.jobId),qe(e.jobId),o(!0),f(!1),tt(e.jobId)}).catch(e=>{let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${o9()}] OAuth error: ${t}`]),ye.current=!1}).finally(()=>{pe(!1)}))},children:fe&&me?.jobId===e.jobId?`Connecting...`:`Connect & Resume`}),(0,I.jsx)(W,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0 text-muted-foreground hover:text-destructive`,onClick:()=>void Xe(e.jobId),title:`Remove from queue`,children:(0,I.jsx)(dr,{className:`h-4 w-4`})})]})]},e.jobId)})]})})]}),v&&!a&&!d&&(0,I.jsx)(K,{className:`border-amber-300/60 bg-amber-50/40`,children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,I.jsx)(rr,{className:`h-5 w-5 text-amber-700`}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`font-medium`,children:`Run stopped`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The evaluation was stopped before completion. You can start it again or clear the progress log.`})]}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,onClick:()=>{u([]),c(0),y(!1)},children:`Clear Progress`}),(0,I.jsxs)(W,{type:`button`,onClick:We,disabled:!t,children:[(0,I.jsx)(Kn,{className:`mr-2 h-4 w-4`}),`Run Again`]})]})]})})}),d&&(0,I.jsx)(K,{className:p?`border-amber-500/50`:h?.stoppedJobs?`border-border`:`border-success/50`,children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[p?(0,I.jsx)(dr,{className:`h-6 w-6 text-destructive`}):h?.stoppedJobs?(0,I.jsx)(mn,{className:`h-6 w-6 text-muted-foreground`}):(0,I.jsx)(ln,{className:`h-6 w-6 text-success`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`font-medium`,children:p?`Completed with errors`:h?.stoppedJobs?h.completedJobs?`Completed with stopped scenarios`:`Run stopped`:`Evaluation Complete`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:h?`${h.totalJobs}/${h.totalJobs} finished, ${h.completedJobs} completed, ${Math.max(0,h.failedJobs-h.stoppedJobs)} error(s), ${h.stoppedJobs} stopped.`:p?`The evaluation ended with errors. Review the log for details.`:`All scenarios have finished. Review the results for their outcomes.`})]}),(0,I.jsx)(W,{asChild:!0,className:`ml-auto`,children:(0,I.jsx)(cp,{to:Oe,children:De?`View Results`:`View Runs`})})]})})})]})};function c9({title:e,description:t,expanded:n,onToggleExpanded:r,onHide:i,messages:a,pendingToolCalls:o,loading:s,input:c,onInputChange:l,onSend:u,onCancel:d,inputPlaceholder:f,snippets:p,snippetsLabel:m=`Result Assistant Snippets`,onSnippetSelect:h,onApproveToolCall:g,onDenyToolCall:_,chatEndRef:v,inputRef:y,renderMessage:b,renderMessageExtras:x,className:S=`min-w-0 overflow-hidden xl:flex xl:h-full xl:min-h-0 xl:flex-col`,contentClassName:C=`flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1`}){return(0,I.jsxs)(K,{className:S,children:[(0,I.jsx)(Kv,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(qv,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),e]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1 px-2 text-xs`,onClick:r,children:[n?(0,I.jsx)(Hn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(Un,{className:`h-3.5 w-3.5`}),n?`Compact`:`Expand`]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:i,children:`Hide`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]})}),(0,I.jsxs)(q,{className:C,children:[(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-muted/15 px-4 py-4`,children:(0,I.jsxs)(`div`,{className:`space-y-3 pr-2`,children:[a.map((e,t)=>{let n=e.role===`user`,r=e.role===`assistant`,i=e.role===`system`,a=e.role===`tool`,c=e.pendingToolCallId?o.find(t=>t.id===e.pendingToolCallId):void 0;return b?b({message:e,index:t,linkedPendingToolCall:c,isUser:n,isAssistant:r,isSystem:i,isTool:a}):r&&e.pendingToolCallId?(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-3`,children:[(0,I.jsx)(a2,{text:e.text,className:`text-sm`}),c&&(0,I.jsx)(f2,{call:c,loading:s,onApprove:g,onDeny:_,className:`mt-3`})]},`${e.id??`${e.role}-${t}`}-tool`):(0,I.jsx)(d2,{message:e},e.id??`${e.role}-${t}`)}),x,s&&(0,I.jsx)(p2,{}),(0,I.jsx)(`div`,{ref:v})]})}),(0,I.jsx)(`div`,{className:`border-t bg-background px-4 py-3`,children:(0,I.jsx)(h2,{input:c,onInputChange:l,onSend:u,onCancel:d,inputPlaceholder:f,snippets:p,snippetsLabel:m,onSnippetSelect:h,loading:s,inputRef:y})})]})]})}function l9(e,t){if(!Number.isFinite(e)||e<=0)return`0ms`;if(e<1e3)return`${Math.round(e)}ms`;if(t?.preciseUnderTenSeconds&&e<1e4){let t=e/1e3,n=Math.round(t*10)/10;return`${Number.isInteger(n)?n.toFixed(0):n.toFixed(1)}s`}let n=Math.floor(e/1e3),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60;return r>0?`${r}h ${i}m ${a}s`:i>0?`${i}m ${a}s`:`${a}s`}function u9(e){return e.runs.length>0?e.runs.reduce((e,t)=>e+t.duration,0):e.avgDuration}function d9(e){return e.scenarios.some(e=>e.runs.length>0)?e.scenarios.reduce((e,t)=>e+u9(t),0):typeof e.totalDurationMs==`number`&&e.totalDurationMs>=0?e.totalDurationMs:null}function f9(e){return e.runs.length>0?e.runs.reduce((e,t)=>e+t.toolCalls.reduce((e,t)=>e+t.duration,0),0):0}function p9(e){return e.scenarios.some(e=>e.runs.length>0)?e.scenarios.reduce((e,t)=>e+f9(t),0):typeof e.totalToolDurationMs==`number`&&e.totalToolDurationMs>=0?e.totalToolDurationMs:null}var m9=`hsl(152, 69%, 40%)`,h9=`hsl(0, 72%, 51%)`,g9=`hsl(215, 16%, 47%)`,_9=`hsl(38, 92%, 50%)`,v9=`hsl(38, 92%, 50%)`,y9=`hsl(270, 55%, 50%)`,b9=`hsl(215, 16%, 47%)`;function x9(e,t=0){return e.toLocaleString(void 0,{maximumFractionDigits:t,minimumFractionDigits:t})}function S9({title:e,passed:t,failed:n,incomplete:r=0,error:i=0,stopped:a=0,notEvaluated:o=0,notExecuted:s=0}){let c=[{name:`Passed`,value:t,color:m9},{name:`Failed`,value:n,color:h9},...r>0?[{name:`Incomplete`,value:r,color:v9}]:[],...i>0?[{name:`Error`,value:i,color:y9}]:[],...a>0?[{name:`Stopped`,value:a,color:b9}]:[],...o>0?[{name:`Not evaluated`,value:o,color:g9}]:[],...s>0?[{name:`Not executed`,value:s,color:_9}]:[]];return(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`p-2.5 pb-0`,children:(0,I.jsx)(qv,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:e})}),(0,I.jsxs)(q,{className:`flex h-[92px] items-center justify-center gap-2 p-0`,children:[(0,I.jsx)(`div`,{className:`h-[82px] w-[82px] shrink-0`,children:(0,I.jsx)(GE,{width:`100%`,height:`100%`,children:(0,I.jsxs)(DY,{children:[(0,I.jsx)(GH,{data:c,dataKey:`value`,nameKey:`name`,innerRadius:`55%`,outerRadius:`78%`,paddingAngle:3,children:c.map(e=>(0,I.jsx)(KE,{fill:e.color},e.name))}),(0,I.jsx)(EE,{})]})})}),(0,I.jsxs)(`div`,{className:`space-y-0.5 text-xs`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:m9}}),x9(t),` passed`]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:h9}}),x9(n),` failed`]}),r>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:v9}}),x9(r),` incomplete`]}),i>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:y9}}),x9(i),` error`]}),a>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:b9}}),x9(a),` stopped`]}),o>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:g9}}),x9(o),` not evaluated`]}),s>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:_9}}),x9(s),` not executed`]})]})]})]})}function Hte({runs:e,loading:t}){let n=(0,_.useMemo)(()=>{let t=e.reduce((e,t)=>e+Math.max(0,t.totalRuns),0),n=e.reduce((e,t)=>e+(t.outcomes?.passed??Math.round(Math.max(0,t.totalRuns)*(t.overallPassRate??0))),0),r=e.reduce((e,t)=>e+(t.outcomes?.incomplete??0),0),i=e.reduce((e,t)=>e+(t.outcomes?.error??0),0),a=e.reduce((e,t)=>e+(t.outcomes?.stopped??0),0),o=e.reduce((e,t)=>e+(t.outcomes?.failed??Math.max(0,t.totalRuns-Math.round(Math.max(0,t.totalRuns)*(t.overallPassRate??0))-(t.outcomes?.incomplete??0)-(t.outcomes?.error??0)-(t.outcomes?.stopped??0))),0),s=e.reduce((e,t)=>e+Math.max(0,t.totalScenarios),0),c=e.reduce((e,t)=>(e.passed+=t.checkCounts?.passed??0,e.failed+=t.checkCounts?.failed??0,e.not_evaluated+=t.checkCounts?.not_evaluated??0,e.not_executed+=t.checkCounts?.not_executed??0,e.total+=t.checkCounts?.total??0,e),{passed:0,failed:0,not_evaluated:0,not_executed:0,total:0}),l=n=>t===0?0:e.reduce((e,t)=>e+n(t)*Math.max(0,t.totalRuns),0)/t,u=e.reduce((e,t)=>e+(t.toolTokenUsage?.totalTokens??0),0),d=e.reduce((e,t)=>e+(t.totalDurationMs??0),0),f=e.reduce((e,t)=>e+(t.totalToolDurationMs??0),0);return{totalRuns:t,passedRuns:n,failedRuns:o,incompleteRuns:r,errorRuns:i,stoppedRuns:a,checkCounts:c,totalScenarios:s,passRate:V_(n,t,a),avgToolCalls:l(e=>e.avgToolCalls),avgLatency:l(e=>e.avgLatency),totalTokens:u,totalDurationMs:d,totalToolDurationMs:f}},[e]);return t?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-6 text-sm text-muted-foreground`,children:`Calculating dashboard…`})}):e.length===0?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-6 text-sm text-muted-foreground`,children:`No results in the selected range.`})}):(0,I.jsx)(`div`,{className:`space-y-2`,"data-testid":`results-dashboard`,children:(0,I.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-4`,children:[(0,I.jsx)(S9,{title:`Runs Pass / Fail / Incomplete / Error / Stopped`,passed:n.passedRuns,failed:n.failedRuns,incomplete:n.incompleteRuns,error:n.errorRuns,stopped:n.stoppedRuns}),(0,I.jsx)(S9,{title:`Checks Pass / Fail / Not evaluated / Not executed`,passed:n.checkCounts.passed,failed:n.checkCounts.failed,notEvaluated:n.checkCounts.not_evaluated,notExecuted:n.checkCounts.not_executed}),(0,I.jsxs)(`div`,{className:`grid self-start content-start gap-3 sm:grid-cols-2 lg:col-span-2 lg:grid-cols-4`,children:[(0,I.jsx)(ry,{compact:!0,title:`Scenarios`,value:x9(n.totalScenarios),icon:jn}),(0,I.jsx)(ry,{compact:!0,title:`Total Runs`,value:x9(n.totalRuns),icon:Xt}),(0,I.jsx)(ry,{compact:!0,title:`Pass Rate`,value:n.passRate===null?`–`:`${x9(n.passRate*100,1)}%`,icon:tn}),(0,I.jsx)(ry,{compact:!0,title:`Avg Tool Calls`,value:x9(n.avgToolCalls,1),icon:ln}),(0,I.jsx)(ry,{compact:!0,title:`Avg Latency`,value:`${x9(n.avgLatency)}ms`,icon:ir}),(0,I.jsx)(ry,{compact:!0,title:`Tool Tokens`,value:x9(n.totalTokens),icon:ur}),n.totalDurationMs>0?(0,I.jsx)(ry,{compact:!0,title:`Total Time`,value:l9(n.totalDurationMs),icon:mn}):null,n.totalToolDurationMs>0?(0,I.jsx)(ry,{compact:!0,title:`Tool Duration`,value:l9(n.totalToolDurationMs),icon:mn}):null]})]})})}function Ute(e){let t=[];for(let n of e.scenarios)for(let e of n.runs)e.error&&t.push(e.error),t.push(...e.failureReasons);return t.map(e=>String(e??``).trim()).filter(Boolean)}function Wte(e){let t=e.toLowerCase();return t.includes(`invalid_token`)||t.includes(`authentication failed`)||t.includes(`bearer token`)||t.includes(`oauth`)?`auth`:t.includes(`429`)||t.includes(`too many requests`)||t.includes(`rate limit`)?`rate_limit`:t.includes(`scenario error:`)||t.includes(`failed to list tools`)||t.includes(`failed to connect to mcp server`)||t.includes(`tool call failed`)||t.includes(`fetch failed`)||t.includes(`streamable http error`)?`infra`:null}function Gte(e){return e===`auth`?`Auth error`:e===`rate_limit`?`Rate limited`:`Infra error`}function Kte(e){let t=Ute(e);for(let e of[`auth`,`rate_limit`,`infra`]){let n=t.find(t=>Wte(t)===e);if(n)return{kind:e,label:Gte(e),detail:n}}return null}function qte(e){return e===`auth`?`border-amber-500/30 bg-amber-500/10 text-amber-700`:e===`rate_limit`?`border-orange-500/30 bg-orange-500/10 text-orange-700`:`border-slate-500/30 bg-slate-500/10 text-slate-700`}function Jte({run:e}){let t=Kte(e);return t?(0,I.jsx)(fl,{delayDuration:0,children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(Y,{variant:`outline`,className:`h-5 text-[10px] ${qte(t.kind)}`,children:t.label})}),(0,I.jsx)(hl,{className:`max-w-sm text-xs`,children:(0,I.jsx)(`p`,{children:t.detail})})]})}):null}function C9(e){return e instanceof xv&&e.status===404}function w9(e){let{source:t,open:n,scope:r,runId:i,onSessionSync:a}=e,[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(!1),y=(0,_.useRef)(null),b=(0,_.useRef)(null),x=(0,_.useRef)(0),S=(0,_.useRef)(t),C=(0,_.useRef)(a),w=(0,_.useRef)(null),T=(0,_.useRef)(null);(0,_.useEffect)(()=>{y.current=o},[o]),(0,_.useEffect)(()=>{S.current=t},[t]),(0,_.useEffect)(()=>{C.current=a},[a]);let E=(0,_.useCallback)(()=>{let e=b.current;e&&e.controller.abort()},[]),D=(0,_.useCallback)((e,t)=>{s(t??e.id),l(t=>t.length>e.messages.length?t:e.messages),d(e.pendingToolCalls),C.current?.(e)},[]),k=(0,_.useCallback)(async(e,t)=>{let n=t.session.id||e;D(t.session,n)},[D]),A=(0,_.useCallback)(()=>{let e=b.current;e&&(E(),p(e.prompt),h(!1),v(!1))},[E]),j=(0,_.useCallback)(async()=>{let e=f.trim();if(!e||r===`run`&&!i)return;let n=++x.current,a=new AbortController,s=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,c={id:s,role:`user`,text:e,createdAt:new Date().toISOString()};b.current={id:n,controller:a,prompt:e},v(!0),p(``),l(e=>[...e,c]),h(!0);try{let u=o;if(!u){let e=r===`run`&&i?await t.createResultAssistantSession({runId:i,scope:`run`},a.signal):await t.createResultAssistantSession({scope:`all_runs`},a.signal);if(a.signal.aborted||b.current?.id!==n)return;u=e.sessionId||e.session.id,D(e.session,u),l(t=>t.some(e=>e.id===s)?[...e.session.messages,c]:e.session.messages)}try{let r=await t.sendResultAssistantMessage(u,e,a.signal);if(a.signal.aborted||b.current?.id!==n)return;await k(u,r)}catch(o){if(l4(o)||a.signal.aborted||b.current?.id!==n)return;if(!C9(o))throw o;let u=r===`run`&&i?await t.createResultAssistantSession({runId:i,scope:`run`},a.signal):await t.createResultAssistantSession({scope:`all_runs`},a.signal);if(a.signal.aborted||b.current?.id!==n)return;let d=u.sessionId||u.session.id;if(D(u.session,d),l(e=>e.some(e=>e.id===s)?[...u.session.messages,c]:u.session.messages),a.signal.aborted||b.current?.id!==n)return;let f=await t.sendResultAssistantMessage(d,e,a.signal);if(a.signal.aborted||b.current?.id!==n)return;await k(d,f)}}catch(e){if(l4(e)||a.signal.aborted||b.current?.id!==n)return;l(e=>e.filter(e=>e.id!==s)),O({title:`MCP Lab Assistant error`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{b.current?.id===n&&(b.current=null,h(!1),v(!1))}},[f,r,i,o,t,D,k]),M=(0,_.useCallback)(async e=>{if(o){v(!1),h(!0);try{let n=await t.approveResultAssistantToolCall(o,e);await k(o,n)}catch(e){C9(e)&&(s(null),d([])),O({title:`Could not approve assistant action`,description:C9(e)?`Assistant session expired. Ask a new question to start a fresh session.`:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{h(!1)}}},[o,t,k]),N=(0,_.useCallback)(async e=>{if(o){v(!1),h(!0);try{let n=await t.denyResultAssistantToolCall(o,e);await k(o,n)}catch(e){C9(e)&&(s(null),d([])),O({title:`Could not deny assistant action`,description:C9(e)?`Assistant session expired. Ask a new question to start a fresh session.`:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{h(!1)}}},[o,t,k]),P=(0,_.useCallback)(()=>{E();let e=y.current;e&&t.closeResultAssistantSession(e).catch(()=>void 0),y.current=null,s(null),l([]),d([]),p(``),v(!1)},[E,t]),F=(0,_.useCallback)(e=>{l(t=>t.length>0?t:[{id:`msg-${Date.now()}`,role:`assistant`,text:e,createdAt:new Date().toISOString()}])},[]),I=(0,_.useCallback)(e=>{p(e),requestAnimationFrame(()=>T.current?.focus())},[]);return(0,_.useEffect)(()=>{if(!n)return;let e=window.setTimeout(()=>{w.current?.scrollIntoView({behavior:`smooth`,block:`end`})},0);return()=>window.clearTimeout(e)},[n,c.length,m]),(0,_.useEffect)(()=>{let e=T.current;if(!e)return;e.style.height=`0px`;let t=Math.min(e.scrollHeight,160);e.style.height=`${Math.max(40,t)}px`},[f,n]),(0,_.useEffect)(()=>{if(n&&o)return S.current.subscribeResultAssistantSessionEvents(o,e=>{D(e.payload.session,e.payload.sessionId)})},[n,o,D]),(0,_.useEffect)(()=>()=>{E();let e=y.current;e&&S.current.closeResultAssistantSession(e).catch(()=>void 0)},[E]),{assistantSessionId:o,assistantMessages:c,assistantPendingToolCalls:u,assistantInput:f,assistantLoading:m,assistantTurnCancelable:g,cancelAssistantTurn:A,assistantChatEndRef:w,assistantInputRef:T,setAssistantInput:p,setAssistantMessages:l,askAssistant:j,approveResultAssistantToolCall:M,denyResultAssistantToolCall:N,applyResultAssistantSnippet:I,ensureIntroMessage:F,resetAssistantSession:P}}function T9(e){let t=String(e??``).trim();return t&&(t.split(`::`).pop()??t).replace(/^mcplab__/,``).replace(/^mcplab_/,``).replace(/_/g,` `).replace(/\s+/g,` `).trim()||`unknown_tool`}async function E9(e,t){let n=t.configPath?.trim();if(!n)throw Error(`This run has no config path in metadata.`);let r=await e.getResult(t.id)??t,i=r.rerunAgents&&r.rerunAgents.length>0?r.rerunAgents:Array.from(new Set(r.scenarios.map(e=>e.agentId).filter(Boolean)));await e.startRun({configPath:n,runsPerScenario:1,scenarioIds:r.rerunScenarioIds,agents:i.length>0?i:void 0,runNote:r.runNote,serverOverrideAll:r.rerunServerOverrideAll,scenarioServerOverrides:r.rerunScenarioServerOverrides,newConversationBeforeStart:r.rerunNewConversationBeforeStart,newConversationBetweenScenarios:r.rerunNewConversationBetweenScenarios})}var D9=[{value:`15min`,label:`Last 15min`,durationMs:9e5},{value:`30min`,label:`Last 30min`,durationMs:18e5},{value:`1h`,label:`Last hour`,durationMs:36e5},{value:`2h`,label:`Last 2 hours`,durationMs:72e5},{value:`4h`,label:`Last 4 hours`,durationMs:144e5},{value:`8h`,label:`Last 8 hours`,durationMs:288e5},{value:`24h`,label:`Last 24 hours`,durationMs:864e5},{value:`7d`,label:`Last 7 days`,durationMs:6048e5},{value:`14d`,label:`Last 14 days`,durationMs:12096e5},{value:`30d`,label:`Last 30 days`,durationMs:2592e6}];function O9(e){return e===`all`||e===`last`||e===`custom`}function k9(e){return e===`15min`||e===`30min`||e===`1h`||e===`2h`||e===`4h`||e===`8h`||e===`24h`||e===`7d`||e===`14d`||e===`30d`}function A9(e){let t=e.get(`time_filter`),n=e.get(`time_preset`);return{mode:O9(t)?t:`all`,preset:k9(n)?n:`15min`,start:e.get(`time_start`)??``,end:e.get(`time_end`)??``}}var j9=8,M9=`mcplab:results:time-filter`,N9=`mcplab:results:dashboard-visible`;function P9(e){if(!e.trim())return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function F9(e,t,n,r){if(e===`all`)return{};if(e===`last`){let e=D9.find(e=>e.value===t)??D9[0],n=new Date(Date.now());return{since:new Date(n.getTime()-e.durationMs).toISOString(),until:n.toISOString()}}let i=P9(n),a=P9(r);return i&&a?i.getTime()<=a.getTime()?{since:i.toISOString(),until:a.toISOString()}:{since:a.toISOString(),until:i.toISOString()}:i?{since:i.toISOString()}:a?{until:a.toISOString()}:{}}function I9(e){let t=P9(e);return t?t.toLocaleString():``}function Yte(e){let t=P9(e);return t?`${t.getUTCFullYear()}-${String(t.getUTCMonth()+1).padStart(2,`0`)}-${String(t.getUTCDate()).padStart(2,`0`)}`:e}function Xte(e){let t=P9(e);return t?t.toLocaleDateString(void 0,{weekday:`long`,month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):`Unknown day`}function Zte(e){return e.has(`time_filter`)||e.has(`time_preset`)||e.has(`time_start`)||e.has(`time_end`)}function Qte(){try{let e=localStorage.getItem(M9);if(!e)return null;let t=JSON.parse(e);return{mode:O9(typeof t.mode==`string`?t.mode:null)?t.mode:`all`,preset:k9(typeof t.preset==`string`?t.preset:null)?t.preset:`15min`,start:typeof t.start==`string`?t.start:``,end:typeof t.end==`string`?t.end:``}}catch{return null}}function $te(){try{let e=localStorage.getItem(N9);return e===null||e===`true`}catch{return!0}}var ene=[{label:`Summarize Run Trends`,description:`Highlight the main changes across the selected runs.`,prompt:`Summarize the main trends across these runs. Call out pass-rate changes, latency, and tool usage shifts.`},{label:`Explain Failures`,description:`Identify the most important failures and likely root causes.`,prompt:`Identify the most important failures across these runs and explain likely root causes from the traces.`},{label:`Compare Agents`,description:`Compare agent behavior, tool use, and answer quality across runs.`,prompt:`Compare agent behavior across these runs. Highlight differences in tool use, answer quality, and consistency.`},{label:`Spot Anomalies`,description:`Find outliers in latency, tool calls, or pass rate.`,prompt:`Find unusual runs or outliers in latency, tool calls, or pass rate, and explain why they stand out.`}],L9=100,tne=()=>{let[e,t]=mp(),{source:n}=Mv(),[r]=(0,_.useState)(()=>Zte(e)?A9(e):Qte()??A9(e)),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),c=(0,_.useRef)(0),[l,u]=(0,_.useState)(!0),[d,f]=(0,_.useState)($te),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(`timestamp`),[S,C]=(0,_.useState)(`desc`),[w,T]=(0,_.useState)(`all`),[E,D]=(0,_.useState)(!1),[k,A]=(0,_.useState)(r.mode),[j,M]=(0,_.useState)(r.preset),[N,P]=(0,_.useState)(r.start),[F,ee]=(0,_.useState)(r.end),[L,R]=(0,_.useState)(!1),[z,te]=(0,_.useState)(!1),[ne,re]=(0,_.useState)(!1),{completionVersion:ie}=Lv(),ae=V7(L9),{offset:oe,totalCount:se,hasMore:ce}=ae,[B,le]=(0,_.useState)(null),ue=w===`all`?void 0:w,de=e=>{b===e?C(e=>e===`asc`?`desc`:`asc`):(x(e),C(e===`timestamp`?`desc`:`asc`))},V=(0,_.useCallback)(async()=>{if(!d||!n.listRunSummaries)return;let e=++c.current;u(!0);try{let t=await n.listRunSummaries({...F9(k,j,N,F),scenario:ue});c.current===e&&s(t.map(AY))}catch{c.current===e&&s([])}finally{c.current===e&&u(!1)}},[ue,d,n,F,k,j,N]),fe=async()=>{m(!0);try{let e=F9(k,j,N,F);if(n.listRunSummariesPage){let t=await n.listRunSummariesPage({...e,scenario:ue,limit:L9,offset:oe});ae.updateMeta(t),a(t.data.map(AY))}else if(n.listRunSummaries){let t=await n.listRunSummaries({...e,scenario:ue,limit:L9,offset:oe});ae.setTotalCount(t.length),ae.setHasMore(!1),a(t.map(AY))}else ae.setTotalCount(0),ae.setHasMore(!1),a(await n.listResults());V()}catch(e){O({title:`Could not load results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{m(!1)}};(0,_.useEffect)(()=>{let e=!0;m(!0);let t=F9(k,j,N,F);return(n.listRunSummariesPage?n.listRunSummariesPage({...t,scenario:ue,limit:L9,offset:oe}).then(t=>(e&&ae.updateMeta(t),t.data.map(AY))):n.listRunSummaries?n.listRunSummaries({...t,scenario:ue,limit:L9,offset:oe}).then(t=>(e&&(ae.setTotalCount(t.length),ae.setHasMore(!1)),t.map(AY))):n.listResults()).then(t=>{e&&a(t)}).catch(t=>{e&&O({title:`Could not load results`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}).finally(()=>{e&&m(!1)}),()=>{e=!1}},[ue,ie,oe,n,F,k,j,N]),(0,_.useEffect)(()=>{try{localStorage.setItem(N9,String(d))}catch{}},[d]),(0,_.useEffect)(()=>{V()},[ie,V]),(0,_.useEffect)(()=>{d&&n.listRunSummaries||(d&&s(i),u(!1))},[d,i,n]);let{assistantMessages:pe,assistantPendingToolCalls:me,assistantInput:he,assistantLoading:ge,assistantTurnCancelable:_e,cancelAssistantTurn:ve,assistantChatEndRef:ye,assistantInputRef:be,setAssistantInput:xe,askAssistant:Se,approveResultAssistantToolCall:Ce,denyResultAssistantToolCall:we,applyResultAssistantSnippet:Te,ensureIntroMessage:Ee}=w9({source:n,open:z,scope:`all_runs`}),De=(0,_.useMemo)(()=>{let e=new Map;return i.forEach(t=>{t.scenarios.forEach(t=>{let n=String(t.scenarioName??``).trim(),r=String(t.scenarioId??``).trim();r?e.set(r,n||r):n&&e.set(n,n)})}),Array.from(e.entries()).map(([e,t])=>({value:e,label:t})).sort((e,t)=>e.label.localeCompare(t.label))},[i]);(0,_.useEffect)(()=>{let t=(e.get(`scenario`)??``).trim();t&&(De.some(e=>e.value===t||e.label===t)?T(t):i.length>0&&T(`all`))},[e,De,i.length]),(0,_.useEffect)(()=>{let n=new URLSearchParams(e);k===`all`?(n.delete(`time_filter`),n.delete(`time_preset`),n.delete(`time_start`),n.delete(`time_end`)):k===`last`?(n.set(`time_filter`,`last`),n.set(`time_preset`,j),n.delete(`time_start`),n.delete(`time_end`)):(n.set(`time_filter`,`custom`),n.delete(`time_preset`),N.trim()?n.set(`time_start`,N.trim()):n.delete(`time_start`),F.trim()?n.set(`time_end`,F.trim()):n.delete(`time_end`)),n.toString()!==e.toString()&&t(n,{replace:!0})},[e,t,F,k,j,N]),(0,_.useEffect)(()=>{try{if(k===`all`){localStorage.removeItem(M9);return}let e={mode:k,preset:j,start:N,end:F};localStorage.setItem(M9,JSON.stringify(e))}catch{}},[F,k,j,N]);let Oe=(0,_.useMemo)(()=>{if(n.listRunSummariesPage)return i;let e=w===`all`?i:i.filter(e=>e.scenarios.some(e=>{let t=String(e.scenarioName??``).trim(),n=String(e.scenarioId??``).trim();return t===w||n===w}));if(k===`all`)return e;let t=Date.now();if(k===`last`){let n=t-(D9.find(e=>e.value===j)??D9[0]).durationMs;return e.filter(e=>{let r=new Date(e.timestamp).getTime();return r>=n&&r<=t})}let r=P9(N)?.getTime()??null,a=P9(F)?.getTime()??null,o=r!==null&&a!==null?Math.min(r,a):r??null,s=r!==null&&a!==null?Math.max(r,a):a??null;return e.filter(e=>{let t=new Date(e.timestamp).getTime();return!(Number.isNaN(t)||o!==null&&t<o||s!==null&&t>s)})},[i,w,n.listRunSummariesPage,F,k,j,N]);(0,_.useEffect)(()=>{ae.reset()},[ue,ae.reset,F,k,j,N]);let ke=(0,_.useMemo)(()=>w===`all`?`All scenarios`:De.find(e=>e.value===w||e.label===w)?.label??w,[w,De]),Ae=(0,_.useMemo)(()=>{if(k===`all`)return`All time`;if(k===`last`)return D9.find(e=>e.value===j)?.label??`Last range`;let e=!!N.trim(),t=!!F.trim();return!e&&!t?`Custom range`:e&&t?`${I9(N)} - ${I9(F)}`:e?`From ${I9(N)}`:`Until ${I9(F)}`},[F,k,j,N]),je=(0,_.useMemo)(()=>{let e=(e,t)=>e===null&&t===null?0:e===null?1:t===null?-1:S===`asc`?e-t:t-e;return[...Oe].sort((t,n)=>{if(b===`toolTokens`)return e(t.toolTokenUsage?.totalTokens??null,n.toolTokenUsage?.totalTokens??null);let r=0;return b===`id`&&(r=t.id.localeCompare(n.id)),b===`timestamp`&&(r=new Date(t.timestamp).getTime()-new Date(n.timestamp).getTime()),b===`passRate`&&(r=(t.overallPassRate??-1)-(n.overallPassRate??-1)),b===`scenarios`&&(r=t.totalScenarios-n.totalScenarios),b===`avgToolCalls`&&(r=t.avgToolCalls-n.avgToolCalls),S===`asc`?r:-r})},[Oe,b,S]),Me=(0,_.useMemo)(()=>{let e=[],t=null;for(let n of je){let r=Yte(n.timestamp);r!==t&&(e.push({type:`day-separator`,dayKey:r,dayLabel:Xte(n.timestamp)}),t=r),e.push({type:`run`,run:n})}return e},[je]),Ne=e=>b===e?S===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`}),H=e=>{let t=e.toolTokenUsage?.totalTokens;return typeof t==`number`?t.toLocaleString():`n/a`},Pe=()=>{A(`all`),M(`15min`),P(``),ee(``)},Fe=(0,_.useMemo)(()=>{let e=new Map;for(let t of je){if(t.scenarios.length>0){e.set(t.id,kY(t));continue}let n=t.configName?.trim()||``,r=t.configPath?.trim()||``,i=n||r;e.set(t.id,{scenarioCount:t.totalScenarios,agentCount:0,scopePreview:i||`n/a`,modelSummary:``})}return e},[je]),Ie=()=>{te(!0),Ee(`Ask me to compare runs, explain regressions over time, or summarize historical drift patterns.`)},Le=async e=>{y(!0);try{await n.deleteResult(e),a(t=>t.filter(t=>t.id!==e)),s(t=>t.filter(t=>t.id!==e)),ae.setTotalCount(e=>Math.max(0,e-1)),O({title:`Run deleted`,description:e}),g(null)}catch(e){O({title:`Could not delete run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{y(!1)}},Re=async e=>{if(!e.configPath?.trim())O({title:`Cannot rerun`,description:`This run has no config path in metadata.`,variant:`destructive`});else{le(e.id);try{await E9(n,e),O({title:`Rerun queued`,description:`${e.id} queued with previous run settings.`})}catch(e){O({title:`Could not rerun`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{le(t=>t===e.id?null:t)}}};return(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[(0,I.jsx)(I3,{open:h!==null,onOpenChange:e=>{!e&&!v&&g(null)},children:(0,I.jsxs)(z3,{children:[(0,I.jsxs)(B3,{children:[(0,I.jsx)(H3,{children:`Delete run?`}),(0,I.jsxs)(U3,{children:[`This will permanently remove the run artifacts from disk for`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:h??``}),`.`]})]}),(0,I.jsxs)(V3,{children:[(0,I.jsx)(G3,{disabled:v,children:`Cancel`}),(0,I.jsx)(W3,{disabled:v||!h,onClick:e=>{e.preventDefault(),h&&Le(h)},className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:v?`Deleting...`:`Delete run`})]})]})}),(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(tn,{className:`h-6 w-6`}),`Results`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Browse evaluation runs and open detailed results`})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(y8,{open:E,onOpenChange:D,children:[(0,I.jsx)(b8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":E,"aria-controls":`results-scenario-command-list`,className:`w-[260px] justify-between font-normal ${w===`all`?``:`border-primary/40`}`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:ke}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(x8,{className:`w-[260px] p-0`,align:`start`,children:(0,I.jsxs)(_5,{children:[(0,I.jsx)(v5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(y5,{id:`results-scenario-command-list`,children:[(0,I.jsx)(b5,{children:`No scenarios found.`}),(0,I.jsxs)(x5,{children:[(0,I.jsx)(C5,{value:`all scenarios`,onSelect:()=>{T(`all`),D(!1)},children:`All scenarios`}),De.map(e=>(0,I.jsx)(C5,{value:`${e.label} ${e.value}`,onSelect:()=>{T(e.value),D(!1)},children:e.label},e.value))]})]})]})})]}),(0,I.jsxs)(y8,{open:L,onOpenChange:R,children:[(0,I.jsx)(b8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":L,"aria-controls":`results-time-command-list`,className:`w-[320px] justify-between font-normal ${k===`all`?``:`border-primary/40`}`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 truncate text-left`,children:[(0,I.jsx)(en,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`truncate`,children:Ae})]}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsxs)(x8,{className:`w-[360px] p-0`,align:`start`,children:[(0,I.jsxs)(`div`,{className:`border-b px-3 py-2`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Date and time filter`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Filter runs by timestamp.`})]}),(0,I.jsxs)(`div`,{id:`results-time-command-list`,className:`grid gap-1 p-2`,children:[(0,I.jsx)(W,{type:`button`,variant:k===`all`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{Pe(),R(!1)},children:`All time`}),D9.map(e=>(0,I.jsx)(W,{type:`button`,variant:k===`last`&&j===e.value?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{A(`last`),M(e.value),R(!1)},children:e.label},e.value)),(0,I.jsx)(W,{type:`button`,variant:k===`custom`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>A(`custom`),children:`Custom date time range`})]}),k===`custom`&&(0,I.jsxs)(`div`,{className:`space-y-3 border-t p-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{htmlFor:`results-time-filter-start`,children:`Start`}),(0,I.jsx)(Pp,{id:`results-time-filter-start`,type:`datetime-local`,value:N,onChange:e=>P(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{htmlFor:`results-time-filter-end`,children:`End`}),(0,I.jsx)(Pp,{id:`results-time-filter-end`,type:`datetime-local`,value:F,onChange:e=>ee(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`px-2`,onClick:Pe,children:[(0,I.jsx)(dr,{className:`mr-1.5 h-3.5 w-3.5`}),`Clear`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,onClick:()=>R(!1),children:`Done`})]})]})]})]}),(0,I.jsx)(W,{variant:`outline`,onClick:()=>void fe(),disabled:p,children:p?`Refreshing...`:`Refresh`}),(0,I.jsx)(W,{variant:`outline`,onClick:ae.prev,disabled:p||oe===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:ae.next,disabled:p||!ce,children:`Next`}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,className:`gap-1.5`,onClick:Ie,children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),`MCP Lab Assistant`]})]})]}),(0,I.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-3`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:ae.rangeLabel(i.length)}),(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs text-muted-foreground`,onClick:()=>f(e=>!e),"aria-pressed":d,children:[(0,I.jsx)(Mn,{className:`h-3 w-3`}),d?`Hide dashboard`:`Show dashboard`]})]}),d?(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Hte,{runs:o,loading:l})}):null,(0,I.jsxs)(`div`,{className:`mt-4 grid gap-6 ${z?ne?`xl:grid-cols-[minmax(0,1fr)_52rem]`:`xl:grid-cols-[minmax(0,1fr)_30rem]`:`grid-cols-1`}`,children:[(0,I.jsx)(K,{"data-testid":`results-table`,className:`results-table-container`,children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(Xv,{className:`table-auto`,children:[(0,I.jsx)(Zv,{children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{className:`results-table-column-run-id w-120 max-w-120`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>de(`id`),children:[`Run ID`,Ne(`id`)]})}),(0,I.jsx)(ty,{className:`results-table-column-evaluation w-[20rem] max-w-[20rem] min-w-0`,children:`Evaluation`}),(0,I.jsx)(ty,{className:`results-table-column-timestamp w-44 min-w-44 max-w-44`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>de(`timestamp`),children:[`Timestamp`,Ne(`timestamp`)]})}),(0,I.jsx)(ty,{className:`results-table-column-pass-rate w-30 min-w-30 max-w-30 text-center`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex w-full items-center justify-end gap-1 hover:text-foreground`,onClick:()=>de(`passRate`),children:[`Pass Rate`,Ne(`passRate`)]})}),(0,I.jsx)(ty,{className:`results-table-column-scenarios w-22 min-w-22 max-w-22 text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>de(`scenarios`),children:[`Scenarios`,Ne(`scenarios`)]})}),(0,I.jsx)(ty,{className:`results-table-column-avg-tools w-30 min-w-30 max-w-30 text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>de(`avgToolCalls`),children:[`Avg Tools`,Ne(`avgToolCalls`)]})}),(0,I.jsx)(ty,{className:`results-table-column-tool-tokens w-36 min-w-36 max-w-36 text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>de(`toolTokens`),children:[`Tool Tokens`,Ne(`toolTokens`)]})}),(0,I.jsx)(ty,{className:`results-table-column-actions w-36 min-w-36 max-w-36`})]})}),(0,I.jsx)(Qv,{children:Me.length===0?(0,I.jsx)(ey,{children:(0,I.jsx)(J,{colSpan:j9,className:`px-4 py-10 text-center text-sm text-muted-foreground`,children:k===`all`&&w===`all`?`No runs yet.`:`No runs match current filters.`})}):Me.map((e,t)=>e.type===`day-separator`?(0,I.jsx)(ey,{className:`bg-muted/30 hover:bg-muted/30`,children:(0,I.jsx)(J,{colSpan:j9,className:`px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`}),(0,I.jsx)(`span`,{className:`shrink-0 rounded-full border border-border bg-background px-2.5 py-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.dayLabel}),(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`})]})})},`day-${e.dayKey}-${t}`):(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`results-table-column-run-id w-120 max-w-120`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(cp,{to:`/results/${e.run.id}`,className:`font-mono text-xs text-primary hover:underline`,children:e.run.id}),(0,I.jsx)(`div`,{className:`min-w-0 truncate font-mono text-xs text-foreground/80`,title:Fe.get(e.run.id)?.scopePreview??`n/a`,children:Fe.get(e.run.id)?.scopePreview??`n/a`}),e.run.runNote?(0,I.jsxs)(`div`,{className:`text-[11px] text-muted-foreground wrap-break-word`,children:[`Note: `,e.run.runNote]}):null]})}),(0,I.jsx)(J,{className:`results-table-column-evaluation w-[20rem] max-w-[20rem] min-w-0 text-[11px] text-muted-foreground`,children:(()=>{let t=Fe.get(e.run.id)??{scenarioCount:0,agentCount:0,scopePreview:`n/a`,modelSummary:``};return(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,I.jsxs)(`span`,{className:`shrink-0 whitespace-nowrap`,children:[t.scenarioCount,` scenario`,t.scenarioCount===1?``:`s`,` · `,t.agentCount,` `,`agent`,t.agentCount===1?``:`s`]}),t.modelSummary?(0,I.jsxs)(`span`,{className:`min-w-0 truncate`,title:t.modelSummary,children:[`· `,t.modelSummary]}):null]}),(0,I.jsx)(B7,{versions:e.run.mcpServerVersions,showPrefix:!1,className:`max-w-[18rem]`})]})})()}),(0,I.jsx)(J,{className:`results-table-column-timestamp w-44 min-w-44 max-w-44 text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.run.timestamp).toLocaleString()]}),(()=>{let t=d9(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Total time: `,l9(t)]})})()]})}),(0,I.jsx)(J,{className:`results-table-column-pass-rate w-30 min-w-30 max-w-30 text-right`,children:(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,I.jsx)(ay,{rate:e.run.overallPassRate}),e.run.checkCounts&&e.run.checkCounts.total>0?(0,I.jsxs)(`span`,{className:`font-mono text-[11px] leading-none`,"aria-label":`${e.run.checkCounts.passed} checks passed, ${e.run.checkCounts.failed} checks failed${e.run.checkCounts.not_evaluated>0?`, ${e.run.checkCounts.not_evaluated} not evaluated`:``}${(e.run.checkCounts.not_executed??0)>0?`, ${e.run.checkCounts.not_executed} not executed`:``}`,title:`${e.run.checkCounts.passed} passed · ${e.run.checkCounts.failed} failed${e.run.checkCounts.not_evaluated>0?` · ${e.run.checkCounts.not_evaluated} not evaluated`:``}${(e.run.checkCounts.not_executed??0)>0?` · ${e.run.checkCounts.not_executed} not executed`:``}`,children:[(0,I.jsxs)(`span`,{className:`text-success`,children:[e.run.checkCounts.passed,` ✓`]}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,I.jsxs)(`span`,{className:`text-destructive`,children:[e.run.checkCounts.failed,` ✕`]})]}):null,(0,I.jsx)(Jte,{run:e.run})]})}),(0,I.jsx)(J,{className:`results-table-column-scenarios w-22 min-w-22 max-w-22 text-right font-mono text-sm`,children:e.run.totalScenarios}),(0,I.jsx)(J,{className:`results-table-column-avg-tools w-30 min-w-30 max-w-30 text-center font-mono text-sm`,children:e.run.avgToolCalls.toFixed(0)}),(0,I.jsx)(J,{className:`results-table-column-tool-tokens w-36 min-w-36 max-w-36 text-right`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{className:`font-mono text-sm`,children:H(e.run)}),(()=>{let t=p9(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Tool time: `,l9(t)]})})()]})}),(0,I.jsx)(J,{className:`results-table-column-actions w-36 min-w-36 max-w-36`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(W,{size:`sm`,variant:`outline`,disabled:B===e.run.id,onClick:()=>void Re(e.run),children:[(0,I.jsx)(Kn,{className:`mr-1.5 h-3.5 w-3.5`}),B===e.run.id?`Queueing...`:`Rerun`]}),(0,I.jsxs)(FQ,{children:[(0,I.jsx)(IQ,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":`More actions`,children:(0,I.jsx)(vn,{className:`h-4 w-4`})})}),(0,I.jsxs)(zQ,{align:`end`,children:[(0,I.jsx)(BQ,{asChild:!0,children:(0,I.jsxs)(cp,{to:`/results/${e.run.id}`,children:[(0,I.jsx)(xn,{className:`mr-2 h-3.5 w-3.5`}),`View`]})}),Object.entries(e.run.langsmithTraceUrls??{}).map(([e,t])=>(0,I.jsx)(BQ,{asChild:!0,children:(0,I.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(yn,{className:`mr-2 h-3.5 w-3.5`}),`LangSmith trace`]})},e)),(0,I.jsxs)(BQ,{children:[(0,I.jsx)(gn,{className:`mr-2 h-3.5 w-3.5`}),`Export JSON`]}),(0,I.jsxs)(BQ,{className:`text-destructive`,onSelect:t=>{t.preventDefault();let n=document.activeElement;n instanceof HTMLElement&&n.blur(),g(e.run.id)},children:[(0,I.jsx)(ar,{className:`mr-2 h-3.5 w-3.5`}),`Delete`]})]})]})]})})]},e.run.id))})]})})}),z&&(0,I.jsx)(c9,{title:`MCP Lab Assistant`,description:`Analyze historical differences and trends across all result runs.`,expanded:ne,onToggleExpanded:()=>re(e=>!e),onHide:()=>te(!1),messages:pe,pendingToolCalls:me,loading:ge,onCancel:_e?ve:void 0,input:he,onInputChange:xe,onSend:()=>void Se(),inputPlaceholder:`Ask about historical run differences...`,snippets:ene,onSnippetSelect:e=>{te(!0),Te(e)},onApproveToolCall:e=>void Ce(e),onDenyToolCall:e=>void we(e),chatEndRef:ye,inputRef:be,className:`min-w-0 overflow-hidden xl:flex xl:h-[calc(100vh-14rem)] xl:min-h-0 xl:flex-col`,renderMessage:({message:e,index:t,linkedPendingToolCall:n,isUser:r,isAssistant:i,isSystem:a,isTool:o})=>{let s=i&&!!e.pendingToolCallId;if(o&&/^(Approved|Denied) tool call\b/i.test(String(e.text??``).trim()))return null;if(s){let r=T9(n?.tool??e.toolRequestName??n?.publicToolName??e.toolRequestPublicName??`unknown_tool`);return(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700`,children:(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsxs)(`details`,{open:!!n,className:`group min-w-0 w-full max-w-[92%] overflow-hidden rounded-md border border-border/60 bg-background`,children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2`,children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:`Tool call ${r}`}),(0,I.jsx)(`span`,{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${n?`bg-amber-100 text-amber-900`:`bg-muted text-muted-foreground`}`,children:n?`Needs approval`:`Completed`})]})}),(0,I.jsx)(rn,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,I.jsx)(`div`,{className:`min-w-0 space-y-2 border-t border-border/50 px-3 py-2`,children:(0,I.jsx)(a2,{text:e.text,className:`text-sm`})})]})]},`${e.id??`${e.role}-${t}`}:tool`)}return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 ${r?`justify-end`:`justify-start`}`,children:[!r&&(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700`,children:a?(0,I.jsx)(Jn,{className:`h-3 w-3`}):(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsx)(`div`,{className:`min-w-0 max-w-[92%] wrap-break-word rounded-md border p-3 text-sm ${r?`border-primary/20 bg-primary/10`:a?`border-amber-400/30 bg-amber-50/70`:o?`border-blue-300/30 bg-blue-50/50`:`border-border/80 bg-background shadow-xs`}`,children:r?(0,I.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.text}):(0,I.jsx)(a2,{text:e.text,className:`text-sm`})}),r&&(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary`,children:(0,I.jsx)(cr,{className:`h-3 w-3`})})]},e.id??`${e.role}-${t}`)}})]})]})};function nne(e){let t=e.scenarios.reduce((e,t)=>e+t.runs.filter(e=>e.passed).length,0),n=e.outcomes?.stopped??e.scenarios.reduce((e,t)=>e+t.runs.filter(e=>e.outcome===`stopped`).length,0),r=Math.max(0,e.totalRuns-t-n),i=V_(t,e.totalRuns,n),a={};e.scenarios.forEach(e=>e.runs.forEach(e=>e.toolCalls.forEach(e=>{a[e.name]=(a[e.name]||0)+1})));let o=Object.keys(a),s=Object.values(a),c=e.scenarios.map(e=>{let t=V_(e.runs.filter(e=>e.passed).length,e.runs.length,e.runs.filter(e=>e.outcome===`stopped`).length);return`
141
+ <div class="scenario-card">
142
+ <div class="scenario-header" onclick="this.parentElement.classList.toggle('open')">
143
+ <span class="chevron">▶</span>
144
+ <span class="scenario-name">${R9(e.scenarioName)}</span>
145
+ <span class="scenario-agent">${R9(e.agentName)}</span>
146
+ <span class="mono">${e.runs.length} runs</span>
147
+ <span class="badge ${t===null?`badge-neutral`:t>=.8?`badge-pass`:t>=.5?`badge-warn`:`badge-fail`}">${Bi(t)}</span>
148
+ <span class="mono">${e.avgToolCalls.toFixed(1)} avg tools</span>
149
+ </div>
150
+ <div class="scenario-detail">
151
+ ${e.runs.map(e=>`
152
+ <div class="run-row">
153
+ <span class="run-status ${e.outcome===`stopped`?`stopped`:e.passed?`pass`:`fail`}" title="${e.outcome===`stopped`?`Stopped`:e.passed?`Passed`:`Failed`}">${e.outcome===`stopped`?`◷`:e.passed?`✓`:`✗`}</span>
154
+ <span class="mono run-label">Run #${e.runIndex+1}</span>
155
+ <span class="mono run-duration">${e.duration}ms</span>
156
+ <div class="tool-pills">
157
+ ${e.toolCalls.map(e=>`<span class="pill">${R9(e.name)} <small>${e.duration}ms</small></span>`).join(``)}
158
+ </div>
159
+ ${e.failureReasons.length?`<div class="failure-reasons">${e.failureReasons.map(e=>R9(e)).join(`, `)}</div>`:``}
160
+ </div>`).join(``)}
161
+ </div>
162
+ </div>`}).join(``);return`<!DOCTYPE html>
163
+ <html lang="en">
164
+ <head>
165
+ <meta charset="UTF-8">
166
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
167
+ <title>MCPLab Report — ${R9(e.id)}</title>
168
+ <script src="https://cdn.jsdelivr.net/npm/chart.js@4"><\/script>
169
+ <style>
170
+ *{box-sizing:border-box;margin:0;padding:0}
171
+ body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f9fafb;color:#1f2937;padding:2rem;max-width:1100px;margin:0 auto}
172
+ h1{font-size:1.5rem;font-weight:700}
173
+ .mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.8rem}
174
+ .header{display:flex;align-items:center;gap:1rem;margin-bottom:.25rem}
175
+ .sub{font-size:.75rem;color:#6b7280;margin-bottom:1.5rem}
176
+ .stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;margin-bottom:2rem}
177
+ .stat{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
178
+ .stat-label{font-size:.7rem;color:#6b7280;text-transform:uppercase;letter-spacing:.05em}
179
+ .stat-value{font-size:1.5rem;font-weight:700;margin-top:.25rem}
180
+ .charts{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-bottom:2rem}
181
+ .chart-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
182
+ .chart-card h3{font-size:.85rem;font-weight:600;margin-bottom:.75rem}
183
+ canvas{max-height:220px}
184
+ .scenario-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;margin-bottom:.75rem;overflow:hidden}
185
+ .scenario-header{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;cursor:pointer;font-size:.85rem}
186
+ .scenario-header:hover{background:#f9fafb}
187
+ .chevron{font-size:.6rem;transition:transform .15s;color:#9ca3af}
188
+ .scenario-card.open .chevron{transform:rotate(90deg)}
189
+ .scenario-name{font-weight:600;flex:1}
190
+ .scenario-agent{color:#6b7280;font-size:.8rem}
191
+ .scenario-detail{display:none;border-top:1px solid #e5e7eb;padding:.75rem 1rem;background:#fafafa}
192
+ .scenario-card.open .scenario-detail{display:block}
193
+ .run-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.5rem 0;border-bottom:1px solid #f3f4f6;font-size:.8rem}
194
+ .run-row:last-child{border-bottom:none}
195
+ .run-status{font-weight:700;font-size:1rem}
196
+ .run-status.pass{color:#059669}
197
+ .run-status.fail{color:#dc2626}
198
+ .run-status.stopped{color:#6b7280}
199
+ .run-duration{color:#6b7280}
200
+ .tool-pills{display:flex;flex-wrap:wrap;gap:.25rem}
201
+ .pill{background:#fef3c7;color:#92400e;padding:2px 8px;border-radius:9999px;font-size:.7rem;font-family:'JetBrains Mono',monospace}
202
+ .pill small{color:#b45309;margin-left:2px}
203
+ .failure-reasons{width:100%;color:#dc2626;font-size:.75rem;margin-top:.25rem}
204
+ .badge{padding:2px 10px;border-radius:9999px;font-size:.75rem;font-weight:600}
205
+ .badge-pass{background:#d1fae5;color:#065f46}
206
+ .badge-warn{background:#fef3c7;color:#92400e}
207
+ .badge-fail{background:#fee2e2;color:#991b1b}
208
+ .badge-neutral{background:#f3f4f6;color:#6b7280}
209
+ .footer{text-align:center;color:#9ca3af;font-size:.7rem;margin-top:2rem;padding-top:1rem;border-top:1px solid #e5e7eb}
210
+ </style>
211
+ </head>
212
+ <body>
213
+ <div class="header">
214
+ <h1 class="mono">${R9(e.id)}</h1>
215
+ <span class="badge ${i===null?`badge-neutral`:i>=.8?`badge-pass`:i>=.5?`badge-warn`:`badge-fail`}">${Bi(i)}${i===null?``:` pass`}</span>
216
+ </div>
217
+ <p class="sub">${new Date(e.timestamp).toLocaleString()} · Config hash: <span class="mono">${R9(e.configHash)}</span></p>
218
+
219
+ <div class="stats">
220
+ <div class="stat"><div class="stat-label">Scenarios</div><div class="stat-value">${e.totalScenarios}</div></div>
221
+ <div class="stat"><div class="stat-label">Total Runs</div><div class="stat-value">${e.totalRuns}</div></div>
222
+ <div class="stat"><div class="stat-label">Pass Rate</div><div class="stat-value">${Bi(i)}</div></div>
223
+ <div class="stat"><div class="stat-label">Avg Tool Calls</div><div class="stat-value">${e.avgToolCalls.toFixed(1)}</div></div>
224
+ <div class="stat"><div class="stat-label">Avg Latency</div><div class="stat-value">${e.avgLatency}ms</div></div>
225
+ </div>
226
+
227
+ <div class="charts">
228
+ <div class="chart-card"><h3>Run outcomes</h3><canvas id="pieChart"></canvas></div>
229
+ <div class="chart-card"><h3>Tool Usage</h3><canvas id="barChart"></canvas></div>
230
+ </div>
231
+
232
+ <h2 style="font-size:1rem;font-weight:600;margin-bottom:.75rem">Scenarios</h2>
233
+ ${c}
234
+
235
+ <div class="footer">Generated by MCPLab · ${new Date().toISOString()}</div>
236
+
237
+ <script>
238
+ new Chart(document.getElementById('pieChart'),{type:'doughnut',data:{labels:['Pass','Fail','Stopped'],datasets:[{data:[${t},${r},${n}],backgroundColor:['#059669','#dc2626','#6b7280'],borderWidth:0}]},options:{cutout:'60%',plugins:{legend:{position:'bottom',labels:{font:{size:11}}}}}});
239
+ new Chart(document.getElementById('barChart'),{type:'bar',data:{labels:${JSON.stringify(o)},datasets:[{data:${JSON.stringify(s)},backgroundColor:'#f59e0b',borderRadius:4}]},options:{indexAxis:'y',plugins:{legend:{display:false}},scales:{x:{grid:{display:false}},y:{grid:{display:false},ticks:{font:{family:'monospace',size:11}}}}}});
240
+ <\/script>
241
+ </body>
242
+ </html>`}function R9(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var rne=`mcplab.resultAssistantScenarioHandoff`,ine=[{label:`Summarize Run Results`,description:`Highlight failures first, then notable tool usage and extracted values.`,prompt:`Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values.`},{label:`Compare Agent Answer Quality`,description:`Rank agents by completeness, depth, and recommendation quality.`,prompt:`Compare the answer quality across all agents for this run. Rank them by completeness, analytical depth, and usefulness of recommendations. Highlight concrete differences in tool usage.`},{label:`Explain Key Failures`,description:`Use traces and tool outputs to identify likely root causes.`,prompt:`Identify the most important failures in this run and explain likely root causes using the trace and tool outputs.`},{label:`Compare With Previous Run`,description:`Summarize changes in outcomes, tool usage, and extracted values.`,prompt:`Compare this run with the previous run and summarize changes in outcomes, tool usage, and extracted values.`}];function z9(e){return`mcplab/reports/result-assistant/${e}-${new Date().toISOString().replace(/[:]/g,`-`).replace(/\..+/,``)}.md`}function B9(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}var ane=()=>{let{id:e}=Jd(),t=Wd(),[n]=mp(),{source:r}=Mv(),i=n.get(`embed`)===`1`,{configs:a}=Hv(),{scenarios:o}=Gv(),[s,c]=(0,_.useState)(void 0),[l,u]=(0,_.useState)(!0),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(new Set),[b,x]=(0,_.useState)(new Set),[S,C]=(0,_.useState)(``),[w,T]=(0,_.useState)(!1),[E,D]=(0,_.useState)(!1),[k,A]=(0,_.useState)(`assistant`),[j,M]=(0,_.useState)(null),[N,P]=(0,_.useState)(!1),[F,ee]=(0,_.useState)(``),[L,R]=(0,_.useState)(``),[z,te]=(0,_.useState)(!1),[ne,re]=(0,_.useState)(!1),[ie,ae]=(0,_.useState)(!1),[oe,se]=(0,_.useState)([]),[ce,B]=(0,_.useState)(!1),[le,ue]=(0,_.useState)(``),[de,V]=(0,_.useState)(null),[fe,pe]=(0,_.useState)(!1),[me,he]=(0,_.useState)(null),[ge,_e]=(0,_.useState)(!1),[ve,ye]=(0,_.useState)(!1),[be,xe]=(0,_.useState)(!1),Se=(0,_.useRef)(null),[Ce,we]=(0,_.useState)(!1),{assistantMessages:Te,assistantPendingToolCalls:Ee,assistantInput:De,assistantLoading:Oe,assistantTurnCancelable:ke,cancelAssistantTurn:Ae,assistantChatEndRef:je,assistantInputRef:Me,setAssistantInput:Ne,askAssistant:H,approveResultAssistantToolCall:Pe,denyResultAssistantToolCall:Fe,applyResultAssistantSnippet:Ie,ensureIntroMessage:Le,resetAssistantSession:Re}=w9({source:r,open:w,scope:`run`,runId:e,onSessionSync:void 0}),ze=(0,_.useCallback)(async(e,t)=>{B(!0);try{let n=(await r.listMarkdownReports()).filter(t=>{let n=String(t.relativePath??``),r=String(t.name??``);return n.includes(e)||r.includes(e)});if(se(n),t&&n.length>0){let e=n.find(e=>e.relativePath===t||e.path===t||e.relativePath.endsWith(t)||e.path.endsWith(t));e&&ue(e.relativePath)}return n}catch{return se([]),[]}finally{B(!1)}},[r]);(0,_.useEffect)(()=>{if(!e)return;let t=!0;return Re(),u(!0),r.getResult(e).then(e=>{t&&(c(e),m(e?.runNote??``),f(!1),u(!1))}),()=>{t=!1}},[e,r,Re]),(0,_.useEffect)(()=>{let e=Se.current;if(!e)return;let t=()=>{we(e.clientWidth<800)};if(t(),typeof ResizeObserver<`u`){let n=new ResizeObserver(()=>t());return n.observe(e),()=>n.disconnect()}return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[l]),(0,_.useEffect)(()=>{if(!s?.id)se([]);else return(async()=>{await ze(s.id)})(),()=>{}},[s?.id,ze]),(0,_.useEffect)(()=>{oe.length===0?(ue(``),V(null),he(null)):(!le||!oe.some(e=>e.relativePath===le))&&ue(oe[0].relativePath)},[oe,le]),(0,_.useEffect)(()=>{if(!w||k!==`reports`)return;if(!le){V(null),he(null);return}let e=!0;return pe(!0),he(null),r.getMarkdownReport(le).then(t=>{e&&V(t)}).catch(t=>{e&&(V(null),he(t instanceof Error?t.message:String(t)))}).finally(()=>{e&&pe(!1)}),()=>{e=!1}},[w,k,le,r]);let Be=n.get(`configId`)??``,Ve=(n.get(`agent`)??``).trim(),He=(0,_.useMemo)(()=>{let e=Be?a.find(e=>e.id===Be):void 0;if(e)return e;if(!s)return;let t=s.configPath?.trim(),n=s.configName?.trim(),r=a.find(e=>e.id===s.configId);if(r)return r;let i=e=>[e.relativePath,e.sourcePath,e.suitePath];return(t?a.find(e=>i(e).some(e=>e?.trim()===t)):void 0)||(t?a.find(e=>i(e).some(e=>e?.endsWith(`/${t}`)===!0)):void 0)||a.find(e=>n?e.name===n||e.configName===n:!1)},[a,Be,s]),Ue=(0,_.useMemo)(()=>s?.configName?.trim()||s?.configPath?.trim()||He?.relativePath?.trim()||He?.name?.trim()||s?.configId?.trim()||``,[s,He]),We=(0,_.useMemo)(()=>s?.configName?.trim()||He?.name?.trim()||``,[s,He]),Ge=(0,_.useMemo)(()=>s?.configPath?.trim()||He?.relativePath?.trim()||``,[s,He]),Ke=(0,_.useMemo)(()=>{let e=new Map;if(He){for(let t of He.scenarios)e.set(t.id,t),t.name&&!e.has(t.name)&&e.set(t.name,t);for(let t of He.scenarioEntries??[]){if(t.kind!==`referenced`)continue;let n=o.find(e=>e.id===t.ref);n&&(e.set(n.id,n),n.name&&e.set(n.name,n),e.has(t.ref)||e.set(t.ref,n))}}for(let t of o)e.has(t.id)||e.set(t.id,t),t.name&&!e.has(t.name)&&e.set(t.name,t);return e},[He,o]),qe=(0,_.useMemo)(()=>``,[]);(0,_.useEffect)(()=>{Be&&a.some(e=>e.id===Be)?C(Be):qe&&C(e=>e||qe)},[Be,a,qe]);let{filteredScenarios:Je,filteredTotalRuns:Ye,filteredPassCount:Xe,displayPassRate:Ze,displayAvgToolCalls:Qe,displayAvgLatency:$e,displayDurationMs:et,displayToolTimeMs:tt,displayToolTokenUsage:nt,filteredStoppedRuns:rt}=(0,_.useMemo)(()=>{if(!s)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayDurationMs:null,displayToolTimeMs:null,displayToolTokenUsage:null,filteredStoppedRuns:0};let e=Ve?s.scenarios.filter(e=>e.agentId===Ve||e.agentName===Ve):s.scenarios,t=e.reduce((e,t)=>e+t.runs.length,0),n=e.reduce((e,t)=>e+t.runs.filter(e=>e.passed).length,0),r=e.reduce((e,t)=>e+t.runs.filter(e=>e.outcome===`stopped`).length,0),i=!Ve&&s.outcomes?s.totalRuns:t,a=!Ve&&s.outcomes?.passed!==void 0?s.outcomes.passed:n,o=!Ve&&s.outcomes?.stopped!==void 0?s.outcomes.stopped:r,c=e.reduce((e,t)=>e+t.runs.reduce((e,t)=>e+t.toolCalls.length,0),0),l=d9({...s,scenarios:e}),u=p9({...s,scenarios:e});return{filteredScenarios:e,filteredTotalRuns:i,filteredPassCount:a,displayPassRate:V_(a,i,o),displayAvgToolCalls:i===0?0:c/i,displayAvgLatency:i===0||l===null?0:Math.round(l/i),displayDurationMs:l,displayToolTimeMs:u,displayToolTokenUsage:m_(e.map(e=>e.toolTokenUsage)),filteredStoppedRuns:o}},[s,Ve]),it=(0,_.useMemo)(()=>{let e={};return Je.forEach(t=>t.runs.forEach(t=>t.toolCalls.forEach(t=>{e[t.name]=(e[t.name]||0)+1}))),Object.entries(e).map(([e,t])=>({name:e,count:t})).sort((e,t)=>t.count-e.count)},[Je]);if(l)return(0,I.jsx)(`div`,{className:`p-8 text-center text-muted-foreground`,children:`Loading result...`});if(!s)return(0,I.jsx)(`div`,{className:`p-8 text-center text-muted-foreground`,children:`Result not found`});let at=y_(Je.flatMap(e=>e.runs.flatMap(e=>e.checkResults??[]))),ot=Je.flatMap(e=>e.runs),st=!Ve&&s.outcomes?.incomplete!==void 0?s.outcomes.incomplete:ot.filter(e=>e.outcome===`incomplete`).length,ct=!Ve&&s.outcomes?.error!==void 0?s.outcomes.error:ot.filter(e=>e.outcome===`error`).length,lt=rt,ut=e=>{y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},dt=(e,t,n,r)=>`${e}:${t}:${n}:${r}`,ft=(e,t)=>`${e}::${t}`,pt=e=>{x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},mt=(e,t=!e.endsWith(`:conversation`))=>b.has(e)?!t:t,ht=(e,t)=>{A(`assistant`),T(!0),M(t?.scenarioId??null),Le(`Ask me to explain failures, tool usage, or suggest what to inspect next in this result.`),e&&Ne(e)},gt=Ee.filter(e=>e.status===`pending`&&!Te.some(t=>t.pendingToolCallId===e.id)),_t=e=>{e&&ue(e),A(`reports`),T(!0)},vt=()=>{A(`note`),T(!0)},yt=e=>{if(!s)return;if(!j){O({title:`No scenario context`,description:`Ask about a specific scenario or run first, then send the suggestion.`,variant:`destructive`});return}let n=o.find(e=>e.id===j)??o.find(e=>e.name===j);if(!n){O({title:`Scenario not found in library`,description:`Could not find library scenario '${j}' to open in Scenario Assistant.`,variant:`destructive`});return}let r=[`I am sending a suggestion from the Result Assistant for scenario '${j}' based on run '${s.id}'.`,`Please review the suggestion, check it against the current scenario configuration, and propose concrete updates to the Checks and/or Value Capture Rules if appropriate.`,``,`Result Assistant suggestion:`,e].join(`
243
+ `);try{window.sessionStorage.setItem(rne,JSON.stringify({type:`result-assistant-handoff-v1`,runId:s.id,configId:Be||s.configId||``,scenarioId:n.id,prompt:r,sourceReply:e})),t(`/libraries/test-cases/${encodeURIComponent(n.id)}?assistantHandoff=1`)}catch(e){O({title:`Could not create handoff`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},bt=e=>{s&&(ae(!1),ee(e),R(z9(s.id)),te(!1),P(!0))},xt=()=>{s&&(ae(!0),ee(``),R(z9(s.id)),te(!1),P(!0))},St=async()=>{if(s){if(!F.trim())O({title:`No markdown to write`,description:`The selected assistant response is empty.`,variant:`destructive`});else{re(!0);try{let e=await r.applyResultAssistantReport({runId:s.id,markdown:F,outputPath:L.trim()||void 0,overwrite:z});O({title:`Markdown report written`,description:typeof e.path==`string`&&e.path?e.path:e.outputPath}),await ze(s.id,typeof e.path==`string`&&e.path||e.outputPath||void 0),w&&A(`reports`),P(!1)}catch(e){O({title:`Could not write markdown report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{re(!1)}}}},Ct=async e=>{try{await navigator.clipboard.writeText(e),O({title:`Copied`})}catch(e){O({title:`Could not copy`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},wt=async()=>{if(s){g(!0);try{let e=p.trim();await r.updateRunNote(s.id,e||void 0),c(t=>t&&{...t,runNote:e||void 0}),m(e),f(!1),O({title:`Run note saved`})}catch(e){O({title:`Could not save run note`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{g(!1)}}},Tt=async()=>{if(s?.id){ye(!0);try{await r.deleteResult(s.id),O({title:`Run deleted`,description:s.id}),t(`/results`)}catch(e){O({title:`Could not delete run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ye(!1),_e(!1)}}},Et=async()=>{if(!s?.id)return;let e=Ge.trim();if(!e)O({title:`Cannot rerun`,description:`This run has no config path in metadata.`,variant:`destructive`});else{xe(!0);try{await E9(r,{...s,configPath:e}),O({title:`Rerun queued`,description:`${s.id} queued with previous run settings.`})}catch(e){O({title:`Could not rerun`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{xe(!1)}}};return(0,I.jsxs)(`div`,{className:`${w?`xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden`:``}`,children:[(0,I.jsx)(`div`,{className:`${w?`xl:shrink-0 xl:pb-6`:`mb-6`}`,children:(0,I.jsxs)(`div`,{ref:Se,className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[!i&&(0,I.jsx)(W,{variant:`ghost`,size:`icon`,asChild:!0,children:(0,I.jsx)(cp,{to:`/results`,children:(0,I.jsx)(Qt,{className:`h-4 w-4`})})}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold font-mono`,children:s.id}),(0,I.jsx)(ay,{rate:Ze})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 align-middle`,children:[(0,I.jsx)(pn,{className:`h-3 w-3 shrink-0`}),new Date(s.timestamp).toLocaleString()]}),(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),Ve?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Agent: `,Ve]}),(0,I.jsx)(`span`,{className:`mx-1`,children:`·`})]}):null,We?(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Eval: `,(0,I.jsx)(`span`,{className:`ml-1 font-medium`,children:We})]}):null,We&&Ge?(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}):null,Ge?(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Path: `,(0,I.jsx)(`span`,{className:`ml-1 font-mono`,children:Ge})]}):null,!We&&!Ge&&Ue?(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Config: `,(0,I.jsx)(`span`,{className:`ml-1 font-mono`,children:Ue})]}):null,s.executionSource?(0,I.jsxs)(I.Fragment,{children:[(We||Ge||Ue)&&(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Source: `,(0,I.jsx)(`span`,{className:`ml-1 font-medium`,children:s.executionSource}),s.executionClient?(0,I.jsxs)(`span`,{className:`ml-1`,children:[`(`,s.executionClient,`)`]}):null]})]}):null]})]})]}),(0,I.jsxs)(`div`,{className:`flex w-full min-w-0 items-center justify-between gap-2 sm:ml-auto sm:w-auto`,children:[(0,I.jsx)(B7,{versions:s.mcpServerVersions}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-2`,children:[Object.entries(s.langsmithTraceUrls??{}).map(([e,t])=>(0,I.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex max-w-full items-center gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground`,"aria-label":`LangSmith trace`,title:`Open LangSmith trace`,children:[(0,I.jsx)(yn,{className:`h-3.5 w-3.5`}),!i&&`LangSmith trace`]},e)),(0,I.jsxs)(W,{variant:`outline`,size:`sm`,className:`max-w-full gap-1.5 ${i?`px-2`:``}`,onClick:()=>{let e=nne(s),t=new Blob([e],{type:`text/html`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`mcplab-report-${s.id}.html`,r.click(),URL.revokeObjectURL(n)},"aria-label":`Download Report`,title:`Download Report`,children:[(0,I.jsx)(gn,{className:`h-3.5 w-3.5`}),!i&&`Download Report`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,onClick:()=>_t(),disabled:ce,children:[(0,I.jsx)(Bn,{className:`h-3.5 w-3.5`}),ce?`Reports...`:`Reports${oe.length?` (${oe.length})`:``}`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,"aria-label":`Run Note`,onClick:()=>vt(),children:[(0,I.jsx)(Bn,{className:`h-3.5 w-3.5`}),Ce?`Note`:`Run Note`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,"aria-label":`MCP Lab Assistant`,onClick:()=>ht(),children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),Ce?`Assistant`:`MCP Lab Assistant`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,onClick:()=>void Et(),disabled:be||!Ge.trim(),children:[(0,I.jsx)(Kn,{className:`h-3.5 w-3.5`}),be?`Queueing...`:`Rerun`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5 text-destructive`,onClick:()=>_e(!0),disabled:ve,"aria-label":ve?`Deleting run`:`Delete run`,children:[ve?(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}):(0,I.jsx)(dn,{className:`h-4 w-4`}),Ce?null:ve?`Deleting...`:`Delete`]})]})]})]})}),(0,I.jsxs)(`div`,{className:`grid gap-6 items-start ${w?E?`xl:grid-cols-[minmax(0,1fr)_52rem] xl:flex-1 xl:min-h-0 xl:overflow-hidden`:`xl:grid-cols-[minmax(0,1fr)_28rem] xl:flex-1 xl:min-h-0 xl:overflow-hidden`:`grid-cols-1`}`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 space-y-6 ${w?`xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2`:``}`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 ${w?`grid-cols-3`:`sm:grid-cols-2 lg:grid-cols-8`}`,children:[(0,I.jsx)(ry,{title:`Scenarios`,value:Je.length,icon:jn}),(0,I.jsx)(ry,{title:`Total Runs`,value:Ye,icon:Xt}),(0,I.jsx)(ry,{title:`Pass Rate`,value:Bi(Ze),icon:tn}),(0,I.jsx)(ry,{title:`Avg Tool Calls`,value:B9(Qe),icon:ln}),(0,I.jsx)(ry,{title:`Avg Latency`,value:`${$e}ms`,icon:ir}),et===null?null:(0,I.jsx)(ry,{title:`Total Time`,value:l9(et),icon:mn}),tt===null?null:(0,I.jsx)(ry,{title:`Tool Duration`,value:l9(tt),icon:mn}),(0,I.jsx)(ry,{title:`Tool Tokens`,value:O4(nt?.totalTokens),icon:ur})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-4`,children:[(0,I.jsx)(S9,{title:`Runs Pass / Fail`,passed:Xe,failed:Math.max(0,Ye-Xe-st-ct-lt),incomplete:st,error:ct,stopped:lt}),(0,I.jsx)(S9,{title:`Checks Pass / Fail`,passed:at.passed,failed:at.failed,notEvaluated:at.not_evaluated,notExecuted:at.not_executed}),(0,I.jsxs)(K,{className:`lg:col-span-2`,children:[(0,I.jsx)(Kv,{className:`p-2.5 pb-0`,children:(0,I.jsx)(qv,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:`Tool Usage`})}),(0,I.jsx)(q,{children:(0,I.jsx)(GE,{width:`100%`,height:120,children:(0,I.jsxs)(EY,{data:it,layout:`vertical`,children:[(0,I.jsx)(Lq,{type:`number`,tick:{fontSize:11}}),(0,I.jsx)(eJ,{type:`category`,dataKey:`name`,tick:{fontSize:11},width:120}),(0,I.jsx)(EE,{}),(0,I.jsx)(pW,{dataKey:`count`,fill:`hsl(38, 92%, 50%)`,radius:[0,4,4,0]})]})})})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(qv,{className:`text-base`,children:`Scenarios`}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 gap-1.5 px-2 text-xs`,onClick:()=>ht(`Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values.`),children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),`Ask Assistant`]})]})}),(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(Xv,{children:[(0,I.jsx)(Zv,{children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{className:`w-8`}),(0,I.jsx)(ty,{children:`Scenario`}),(0,I.jsx)(ty,{children:`Agent`}),(0,I.jsx)(ty,{children:`Runs`}),(0,I.jsx)(ty,{children:`Pass Rate`}),(0,I.jsx)(ty,{children:`Checks`}),(0,I.jsx)(ty,{className:`text-right`,children:`Total Time`}),(0,I.jsx)(ty,{className:`text-right`,children:`Tool Calls`}),(0,I.jsx)(ty,{className:`text-right`,children:`Tool Tokens`}),(0,I.jsx)(ty,{className:`text-right`,children:`Tool Duration`})]})}),(0,I.jsx)(Qv,{children:Je.map(t=>{let n=ft(t.scenarioId,t.agentName),r=t.scenarioName||t.scenarioId,i=y_(t.runs.flatMap(e=>e.checkResults??[])),a=t.runs.some(e=>(e.checkResults?.length??0)>0),c=He?.id||s?.configId?.trim(),l=c?`/mcp-evaluations/${encodeURIComponent(c)}/scenarios`:null,u=o.find(e=>e.id===t.scenarioId),d=u?`/libraries/test-cases/${encodeURIComponent(u.id)}?returnTo=${encodeURIComponent(`/results/${s?.id??e}`)}`:null;return(0,I.jsx)(t2,{open:v.has(n),onOpenChange:()=>ut(n),asChild:!0,children:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsxs)(ey,{className:`cursor-pointer hover:bg-muted/50`,children:[(0,I.jsx)(J,{children:(0,I.jsx)(rn,{className:`h-4 w-4 transition-transform ${v.has(n)?`rotate-180`:``}`})}),(0,I.jsx)(J,{className:`font-medium text-sm`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`span`,{children:t.scenarioName}),l?(0,I.jsx)(cp,{to:l,"aria-label":`Edit scenario`,title:`Edit scenario`,className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:e=>e.stopPropagation(),children:(0,I.jsx)(Gn,{className:`h-3.5 w-3.5`})}):null]})}),(0,I.jsxs)(J,{className:`text-sm`,children:[(0,I.jsx)(`div`,{children:t.agentName}),t.provider||t.model?(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:[t.provider?T0(t.provider):null,t.model].filter(Boolean).join(` · `)}):null]}),(0,I.jsx)(J,{className:`font-mono text-sm`,children:t.runs.length}),(0,I.jsx)(J,{children:(0,I.jsx)(ay,{rate:t.passRate})}),(0,I.jsx)(J,{className:`font-mono text-sm`,children:a?(0,I.jsxs)(`span`,{title:`${i.passed} passed · ${i.failed} failed${i.not_evaluated?` · ${i.not_evaluated} not evaluated`:``}${i.not_executed?` · ${i.not_executed} not executed`:``}`,"aria-label":`${i.passed} checks passed, ${i.failed} checks failed${i.not_evaluated?`, ${i.not_evaluated} not evaluated`:``}${i.not_executed?`, ${i.not_executed} not executed`:``}`,children:[(0,I.jsxs)(`span`,{className:`text-success`,children:[i.passed,` ✓`]}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{className:`text-destructive`,children:[i.failed,` ✕`]}),i.not_evaluated>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[i.not_evaluated,` ○`]})]}),i.not_executed>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[i.not_executed,` ⊘`]})]})]}):`—`}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:l9(u9(t),{preciseUnderTenSeconds:!0})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:B9(t.avgToolCalls)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:O4(t.toolTokenUsage?.totalTokens)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:l9(f9(t),{preciseUnderTenSeconds:!0})})]})}),(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{colSpan:10,className:`p-0`,children:(0,I.jsxs)(`div`,{className:`bg-muted/30 p-4 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border bg-card px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-xs font-semibold`,children:`Scenario details`}),(0,I.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[r,` · `,t.agentName,` ·`,` `,Bi(t.passRate),` pass rate ·`,` `,a?`Checks ${i.passed} ✓ · ${i.failed} ✕${i.not_evaluated?` · ${i.not_evaluated} ○`:``}${i.not_executed?` · ${i.not_executed} ⊘`:``} · `:``,O4(t.toolTokenUsage?.totalTokens),` tool tokens ·`,` `,l9(u9(t),{preciseUnderTenSeconds:!0}),` `,`total time ·`,` `,l9(f9(t),{preciseUnderTenSeconds:!0}),` `,`tool time`]})]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[d?(0,I.jsx)(W,{asChild:!0,type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1 px-2 text-xs text-muted-foreground`,children:(0,I.jsxs)(cp,{to:d,"aria-label":`Edit test case`,children:[(0,I.jsx)(Sn,{className:`h-3.5 w-3.5`}),`Edit test case`]})}):null,(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>ht(`Explain why scenario '${r}' failed (agent: ${t.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:t.scenarioId}),children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),`Ask Assistant`]})]})]}),t.runs.map(e=>(0,I.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border bg-card p-3 text-sm`,children:[(0,I.jsx)(`div`,{className:`mt-0.5`,children:e.outcome===`incomplete`||e.outcome===`stopped`?(0,I.jsx)(pn,{className:`h-4 w-4 text-amber-500`}):e.passed?(0,I.jsx)(ln,{className:`h-4 w-4 text-success`}):(0,I.jsx)(dn,{className:`h-4 w-4 text-destructive`})}),(0,I.jsxs)(`div`,{className:`flex-1 space-y-1`,children:[(()=>{let n=Ke.get(t.scenarioId),r=n?cne(n.evalRules,e.failureReasons,e.error,e.checkResults):[],i=r.filter(e=>e.status===`failed`),a=r.filter(e=>e.status===`passed`),o=r.filter(e=>e.status===`not_evaluated`),s=r.filter(e=>e.status===`not_executed`);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[`Run #`,e.runIndex+1]}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`·`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.duration,`ms`]}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`·`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[O4(e.toolTokenUsage?.totalTokens),` `,`tool tokens`]}),e.outcome===`incomplete`?(0,I.jsx)(Y,{variant:`outline`,className:`h-5 border-amber-500/30 bg-amber-500/10 text-amber-600 text-[10px]`,children:`Incomplete`}):e.outcome===`stopped`?(0,I.jsx)(Y,{variant:`outline`,className:`h-5 border-muted-foreground/30 bg-muted text-muted-foreground text-[10px]`,children:`Stopped`}):e.passed?null:(0,I.jsx)(Y,{variant:`outline`,className:`h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]`,children:`Failed`})]}),e.failureReasons.length>0&&(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 p-2`,children:[(0,I.jsxs)(`p`,{className:`mb-1 flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-destructive`,children:[(0,I.jsx)(dn,{className:`h-3.5 w-3.5`}),`Failure reasons`]}),(0,I.jsx)(`ul`,{className:`space-y-1 text-xs text-destructive`,children:e.failureReasons.map((e,t)=>(0,I.jsxs)(`li`,{children:[`• `,G9(e)]},t))})]}),e.outcome===`stopped`&&e.stopReason?(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-muted/40 p-2`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Stop reason`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.stopReason})]}):null,r.length>0&&(0,I.jsx)(t2,{open:mt(dt(t.scenarioId,t.agentName,e.runIndex,`checks`)),onOpenChange:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`checks`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-2`,children:[(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full flex-wrap items-center gap-2 text-left`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${mt(dt(t.scenarioId,t.agentName,e.runIndex,`checks`))?`rotate-180`:``}`}),(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Checks`}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-success/30 bg-success/10 text-success text-[10px]`,children:[a.length,` passed`]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px] ${i.length>0?`border-destructive/30 bg-destructive/10 text-destructive`:``}`,children:[i.length,` failed`]}),o.length>0&&(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-muted-foreground/30 bg-muted text-[10px] text-muted-foreground`,children:[o.length,` not evaluated`]}),s.length>0&&(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-amber-500/30 bg-amber-500/10 text-[10px] text-amber-600`,children:[s.length,` not executed`]})]})}),(0,I.jsxs)(r2,{children:[s.length>0&&(0,I.jsx)(`p`,{className:`mb-2 text-[11px] text-muted-foreground`,children:`Checks were not executed because this run ended before evaluation.`}),(0,I.jsx)(`div`,{className:`space-y-1`,children:r.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${e.status===`failed`?`border-destructive/20 bg-destructive/5`:e.status===`not_executed`?`border-amber-500/20 bg-amber-500/5`:e.status===`not_evaluated`?`border-muted-foreground/20 bg-muted/40`:`border-success/20 bg-success/5`}`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.status===`failed`?(0,I.jsx)(dn,{className:`h-3.5 w-3.5 shrink-0 text-destructive`}):e.status===`not_executed`?(0,I.jsx)(pn,{className:`h-3.5 w-3.5 shrink-0 text-amber-600`}):e.status===`not_evaluated`?(0,I.jsx)(pn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,I.jsx)(ln,{className:`h-3.5 w-3.5 shrink-0 text-success`}),(0,I.jsx)(`span`,{className:`font-medium`,children:p4(e.rule)})]}),e.failureReason&&(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-[11px] text-muted-foreground`,children:G9(e.failureReason)})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${e.status===`failed`?`border-destructive/30 text-destructive`:e.status===`not_executed`?`border-amber-500/30 text-amber-600`:e.status===`not_evaluated`?`border-muted-foreground/30 text-muted-foreground`:`border-success/30 text-success`}`,children:d4(e.status)})]},`${e.rule.type}-${e.rule.value??e.rule.path??``}-${t}`))})]})]})})]})})(),(0,I.jsx)(t2,{open:mt(dt(t.scenarioId,t.agentName,e.runIndex,`extracts`),Object.keys(e.extractedValues??{}).length>0),onOpenChange:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`extracts`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border border-violet-500/20 bg-violet-500/5 p-2`,children:[(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${mt(dt(t.scenarioId,t.agentName,e.runIndex,`extracts`),Object.keys(e.extractedValues??{}).length>0)?`rotate-180`:``}`}),(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)(jn,{className:`h-3.5 w-3.5 text-violet-600`}),`Extracted values`]})]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:[Object.keys(e.extractedValues??{}).length,` `,`total`]})]})}),(0,I.jsx)(r2,{children:Object.keys(e.extractedValues??{}).length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No extracted values captured for this run.`}):(0,I.jsx)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:Object.entries(e.extractedValues??{}).map(([e,t])=>(0,I.jsxs)(`div`,{className:`rounded-md border bg-background px-2 py-1.5 text-xs`,children:[(0,I.jsx)(`div`,{className:`mb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,I.jsx)(`div`,{className:`font-mono break-all text-foreground`,children:t===null?`null`:String(t)})]},e))})})]})}),(0,I.jsx)(t2,{open:mt(dt(t.scenarioId,t.agentName,e.runIndex,`tools`),e.toolCalls.length>0),onOpenChange:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`tools`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border border-sky-500/20 bg-sky-500/5 p-2`,children:[(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${mt(dt(t.scenarioId,t.agentName,e.runIndex,`tools`),e.toolCalls.length>0)?`rotate-180`:``}`}),(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5 text-sky-600`}),`Tool call sequence`]})]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:[e.toolCalls.length,` total`]})]})}),(0,I.jsx)(r2,{children:e.toolCalls.length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No tool calls captured for this run.`}):(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:(0,I.jsx)(fl,{delayDuration:0,children:e.toolCalls.map((t,n)=>{let r=e.conversation.filter(e=>e.kind===`tool_call`)[n]?.estimatedTokens,i=typeof r?.totalTokens==`number`;return(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsxs)(Y,{variant:`outline`,className:`font-mono text-xs bg-background`,children:[(0,I.jsxs)(`span`,{className:`mr-1 text-muted-foreground`,children:[`#`,n+1]}),t.name,(0,I.jsxs)(`span`,{className:`ml-1 text-muted-foreground`,children:[t.duration,`ms`]}),i&&(0,I.jsxs)(`span`,{className:`ml-1 text-muted-foreground`,children:[`·`,` `,O4(r?.totalTokens),`tok`]})]})}),i&&(0,I.jsx)(hl,{className:`text-xs`,children:`${t.name} · tokens total: ${O4(r?.totalTokens)} · in: ${O4(r?.inputTokens)} · out: ${O4(r?.outputTokens)}`})]},n)})})}),(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between gap-2`,children:[(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Tool token estimate`}),(0,I.jsx)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:`estimated`})]}),Object.keys(e.toolTokenUsageByTool??{}).length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`n/a`}):(0,I.jsx)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:Object.entries(e.toolTokenUsageByTool??{}).map(([e,t])=>(0,I.jsxs)(`div`,{className:`rounded border bg-muted/30 px-2 py-1.5 text-xs`,children:[(0,I.jsx)(`div`,{className:`font-mono text-[11px]`,children:e}),(0,I.jsxs)(`div`,{className:`text-muted-foreground`,children:[`total:`,` `,O4(t.totalTokens),` `,`· in:`,` `,O4(t.inputTokens),` `,`· out:`,` `,O4(t.outputTokens)]})]},e))})]})]})})]})}),(0,I.jsx)(t2,{open:mt(dt(t.scenarioId,t.agentName,e.runIndex,`final`)),onOpenChange:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`final`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-card p-2`,children:[(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full items-center gap-2 text-left`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${mt(dt(t.scenarioId,t.agentName,e.runIndex,`final`))?`rotate-180`:``}`}),(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)($t,{className:`h-3.5 w-3.5`}),`Final answer`]})]})}),(0,I.jsx)(r2,{children:(0,I.jsx)(W9,{text:e.finalAnswer||`No final answer captured.`,maxLength:1200,className:`text-xs text-foreground`})})]})}),(0,I.jsx)(t2,{open:mt(dt(t.scenarioId,t.agentName,e.runIndex,`conversation`)),onOpenChange:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`conversation`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/10 p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${mt(dt(t.scenarioId,t.agentName,e.runIndex,`conversation`))?`rotate-180`:``}`}),(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Conversation trace`})]})}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>ht(`Explain Run #${e.runIndex+1} for scenario '${r}'. Its outcome was ${e.outcome??(e.passed?`passed`:`failed`)} in ${e.duration}ms. Focus on the tool sequence and evaluated checks.`,{scenarioId:t.scenarioId}),children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),`Ask Assistant`]})})]}),(0,I.jsx)(r2,{children:(0,I.jsx)(`div`,{className:`space-y-2 rounded-md border bg-muted/20 p-2`,children:e.conversation.length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No conversation trace captured.`}):e.conversation.map(e=>(0,I.jsx)(one,{item:e,fallbackUserPrompt:Ke.get(t.scenarioId)?.prompt},e.id))})}),!mt(dt(t.scenarioId,t.agentName,e.runIndex,`conversation`))&&(0,I.jsx)(`button`,{type:`button`,className:`text-xs text-muted-foreground underline decoration-dotted underline-offset-2 hover:text-foreground`,onClick:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`conversation`)),children:`Expand to inspect user/assistant/tool messages for this run.`})]})})]})]},e.runIndex))]})})})})]})},n)})})]})})]})]}),w&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,I.jsx)(b0,{value:k,onValueChange:e=>A(e),className:`min-w-0 -mb-px px-3 pt-1`,children:(0,I.jsxs)(x0,{className:`h-auto w-full justify-start rounded-none border-b bg-transparent p-0`,children:[(0,I.jsx)(S0,{value:`assistant`,className:`-mb-px h-9 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-3 text-xs text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none`,children:`Assistant`}),(0,I.jsx)(S0,{value:`reports`,className:`-mb-px h-9 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-3 text-xs text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none`,children:`Reports`}),(0,I.jsx)(S0,{value:`note`,className:`-mb-px h-9 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-3 text-xs text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none`,children:`Note`})]})}),k===`assistant`?(0,I.jsx)(c9,{title:`MCP Lab Assistant`,description:`Ask questions about this run result, failures, and tool usage.`,expanded:E,onToggleExpanded:()=>D(e=>!e),onHide:()=>T(!1),messages:Te,pendingToolCalls:Ee,loading:Oe,onCancel:ke?Ae:void 0,input:De,onInputChange:Ne,onSend:()=>void H(),inputPlaceholder:`Ask about this result...`,snippets:ine,onSnippetSelect:Ie,onApproveToolCall:e=>void Pe(e),onDenyToolCall:e=>void Fe(e),chatEndRef:je,inputRef:Me,className:`min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col`,renderMessage:({message:e,index:t,linkedPendingToolCall:n,isUser:r,isAssistant:i,isSystem:a,isTool:o})=>{let s=i&&!!e.pendingToolCallId;if(o&&/^(Approved|Denied) tool call\\b/i.test(String(e.text??``).trim()))return null;let c=n?.tool??e.toolRequestName,l=n?.publicToolName??e.toolRequestPublicName,u=i&&!s&&sne(e.text,!!j);if(s){let r=n?.status===`pending`,i=T9(c??l??`unknown_tool`);return(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700`,children:(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsxs)(`details`,{open:!!n,className:`group min-w-0 w-full max-w-[92%] overflow-hidden rounded-md border border-border/60 bg-background`,children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2`,children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:`Tool call ${i}`}),(0,I.jsx)(`span`,{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${r?`bg-amber-100 text-amber-900`:`bg-muted text-muted-foreground`}`,children:r?`Needs approval`:`Completed`})]})}),(0,I.jsx)(rn,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,I.jsxs)(`div`,{className:`min-w-0 space-y-2 border-t border-border/50 px-3 py-2`,children:[(0,I.jsx)(a2,{text:e.text,className:`text-sm`}),r&&n&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`pre`,{className:`max-h-40 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap wrap-break-word rounded border bg-muted/50 p-2 text-xs`,children:(0,I.jsx)(`code`,{className:`wrap-break-word`,children:JSON.stringify(n.arguments??{},null,2)})}),(0,I.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-xs`,disabled:Oe,onClick:()=>void Fe(n.id),children:`Deny`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:Oe,onClick:()=>void Pe(n.id),children:`Approve`})]})]})]})]})]},`${e.id??`${e.role}-${t}`}:${n?`pending`:`completed`}`)}let d=r||i&&!o&&!a;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 ${r?`justify-end`:`justify-start`}`,children:[!r&&(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700`,children:a?(0,I.jsx)(Jn,{className:`h-3 w-3`}):(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`relative max-w-[92%]`,children:[(0,I.jsxs)(`div`,{className:`max-w-full rounded-md border p-3 text-sm ${r?`border-primary/20 bg-primary/10`:a?`border-amber-400/30 bg-amber-50/70`:o?`border-blue-300/30 bg-blue-50/50`:`border-border/80 bg-background shadow-xs`}`,children:[!(r||a)&&(0,I.jsx)(`p`,{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${r?`text-right`:``}`,children:o?`Tool`:`Assistant`}),r?(0,I.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.text}):(0,I.jsx)(a2,{text:e.text,className:`text-sm`}),u&&(0,I.jsxs)(`div`,{className:`mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>yt(e.text),children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),`Send to Scenario Assistant`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>bt(e.text),children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),`Apply: Write Markdown Report`]})]}),!u&&i&&!s&&(0,I.jsx)(`div`,{className:`mt-3 flex max-w-full justify-end overflow-x-auto pb-1`,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>bt(e.text),children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),`Apply: Write Markdown Report`]})})]}),d&&(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground`,onClick:()=>void Ct(e.text),"aria-label":`Copy message`,title:`Copy message`,children:(0,I.jsx)(hn,{className:`h-3.5 w-3.5`})})]}),r&&(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary`,children:(0,I.jsx)(cr,{className:`h-3 w-3`})})]},e.id??`${e.role}-${t}`)},renderMessageExtras:gt.length>0?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Pending actions (approve/deny)`}),gt.map(e=>(0,I.jsxs)(`details`,{open:!0,className:`group min-w-0 rounded-md border bg-background`,children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 p-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`p`,{className:`break-all font-mono text-xs font-semibold`,children:T9(e.publicToolName)}),(0,I.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[e.server,`::`,T9(e.tool)]})]}),(0,I.jsx)(rn,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,I.jsxs)(`div`,{className:`border-t px-3 pb-3 pt-2`,children:[(0,I.jsx)(`pre`,{className:`max-h-48 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap wrap-break-word rounded border bg-muted/50 p-2 text-xs`,children:(0,I.jsx)(`code`,{className:`wrap-break-word`,children:JSON.stringify(e.arguments??{},null,2)})}),(0,I.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-xs`,disabled:Oe,onClick:()=>void Fe(e.id),children:`Deny`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:Oe,onClick:()=>void Pe(e.id),children:`Approve`})]})]})]},e.id))]}):null}):k===`reports`?(0,I.jsxs)(K,{className:`min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,I.jsx)(Kv,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(qv,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(Bn,{className:`h-4 w-4 text-muted-foreground`}),`Reports`]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1 px-2 text-xs`,onClick:()=>D(e=>!e),children:[E?(0,I.jsx)(Hn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(Un,{className:`h-3.5 w-3.5`}),E?`Compact`:`Expand`]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:()=>T(!1),children:`Hide`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Review markdown reports for this run while keeping the result visible.`})]})}),(0,I.jsxs)(q,{className:`flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1`,children:[(ce||oe.length===0||oe.length>1)&&(0,I.jsx)(`div`,{className:`border-b px-4 py-3`,children:ce?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading reference reports...`}):oe.length===0?(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No reference reports for this run yet.`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`shrink-0 gap-1.5`,onClick:()=>xt(),children:[(0,I.jsx)(qn,{className:`h-3.5 w-3.5`}),`New Report`]})]}):(0,I.jsx)(`div`,{className:`space-y-2`,children:oe.length>1?(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Selected report`}),(0,I.jsxs)(T1,{value:le,onValueChange:ue,children:[(0,I.jsx)(D1,{className:`h-8`,children:(0,I.jsx)(E1,{placeholder:`Select a report`})}),(0,I.jsx)(A1,{children:oe.map(e=>(0,I.jsx)(Q,{value:e.relativePath,children:e.name},e.path))})]})]}):null})}),(0,I.jsx)(s4,{className:`min-h-0 flex-1 bg-muted/15 px-4 py-4`,children:oe.length===0?(0,I.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`No report selected.`}):fe?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}),`Loading report...`]}):me?(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive`,children:[`Could not load report: `,me]}):de?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-3`,children:[(0,I.jsx)(`p`,{className:`font-mono text-xs font-semibold`,children:de.name}),(0,I.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:de.relativePath}),(0,I.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:new Date(de.mtime).toLocaleString()})]}),(0,I.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,I.jsx)(a2,{text:de.content,className:`text-sm`})})]}):(0,I.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Select a report to preview.`})})]})]}):(0,I.jsxs)(K,{className:`min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,I.jsx)(Kv,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(qv,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(Bn,{className:`h-4 w-4 text-muted-foreground`}),`Run Note`]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1 px-2 text-xs`,onClick:()=>D(e=>!e),children:[E?(0,I.jsx)(Hn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(Un,{className:`h-3.5 w-3.5`}),E?`Compact`:`Expand`]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:()=>T(!1),children:`Hide`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add context for this run, such as server version or environment details.`})]})}),(0,I.jsx)(q,{className:`flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1`,children:d?(0,I.jsxs)(`div`,{className:`w-full max-w-xl space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium`,children:`Run note`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[p.length,`/500`]})]}),(0,I.jsx)(t0,{value:p,onChange:e=>m(e.target.value.slice(0,500)),placeholder:`Optional context for this run`,rows:3,className:`min-h-20 resize`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{size:`sm`,onClick:()=>void wt(),disabled:h,children:h?`Saving...`:`Save note`}),(0,I.jsx)(W,{size:`sm`,variant:`outline`,onClick:()=>{m(s.runNote??``),f(!1)},disabled:h,children:`Cancel`})]})]}):(0,I.jsxs)(`div`,{className:`flex w-full max-w-3xl items-center gap-2 rounded-md border bg-muted/20 px-2 py-1 text-xs`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`Run note:`}),(0,I.jsx)(`span`,{className:`wrap-break-word ${s.runNote?`text-foreground`:`text-muted-foreground`}`,children:s.runNote||`none`})]}),(0,I.jsx)(W,{size:`sm`,variant:`ghost`,className:`ml-auto h-6 px-2 text-xs`,onClick:()=>f(!0),children:s.runNote?`Edit`:`Add note`})]})})]})]}),(0,I.jsx)(I3,{open:N,onOpenChange:e=>!ne&&P(e),children:(0,I.jsxs)(z3,{className:`max-w-2xl`,children:[(0,I.jsxs)(B3,{children:[(0,I.jsx)(H3,{children:ie?`Create markdown report`:`Approve MCP action: write markdown report`}),(0,I.jsx)(U3,{children:ie?`Write a custom markdown report and save it to the workspace.`:(0,I.jsxs)(I.Fragment,{children:[`This will call `,(0,I.jsx)(`code`,{children:`mcplab_write_markdown_report`}),` via the local MCPLab MCP server.`]})})]}),(0,I.jsxs)(`div`,{className:`space-y-3`,children:[!ie&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Output path`}),(0,I.jsx)(Pp,{value:L,onChange:e=>R(e.target.value),placeholder:`mcplab/reports/result-assistant/my-report.md`,disabled:ne})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(U0,{checked:z,onCheckedChange:e=>te(e===!0),disabled:ne}),(0,I.jsx)(`span`,{children:`Overwrite if file exists`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:ie?`Markdown content`:`Markdown preview (to be written)`}),(0,I.jsx)(t0,{value:F,onChange:e=>ee(e.target.value),rows:10,className:`font-mono text-xs`,disabled:ne})]})]}),(0,I.jsxs)(V3,{children:[(0,I.jsx)(G3,{disabled:ne,children:`Cancel`}),(0,I.jsx)(W3,{onClick:e=>{e.preventDefault(),St()},disabled:ne,children:ne?`Writing...`:ie?`Save Report`:`Approve & Write`})]})]})}),(0,I.jsx)(I3,{open:ge,onOpenChange:_e,children:(0,I.jsxs)(z3,{children:[(0,I.jsxs)(B3,{children:[(0,I.jsx)(H3,{children:`Delete run?`}),(0,I.jsxs)(U3,{children:[`This will permanently remove run `,(0,I.jsx)(`span`,{className:`font-mono`,children:s?.id}),`. This action cannot be undone.`]})]}),(0,I.jsxs)(V3,{children:[(0,I.jsx)(G3,{disabled:ve,children:`Cancel`}),(0,I.jsx)(W3,{disabled:ve||!s?.id,onClick:e=>{e.preventDefault(),Tt()},className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:ve?`Deleting...`:`Delete`})]})]})})]})]})};function one({item:e,fallbackUserPrompt:t}){if(e.kind===`tool_call`){let t=V9(e,`input`);return(0,I.jsx)(U9,{variant:`call`,title:`Tool call · ${e.toolName||`unknown`}${t}`,text:e.text})}if(e.kind===`tool_result`){let t=V9(e,`output`),n=e.ok?(0,I.jsx)(ln,{className:`h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300`}):(0,I.jsx)(dn,{className:`h-3.5 w-3.5 text-rose-700 dark:text-rose-300`});return(0,I.jsx)(U9,{variant:e.ok?`result_ok`:`result_error`,title:`Tool result · ${e.toolName||`unknown`} · ${e.ok?`ok`:`error`}${typeof e.durationMs==`number`?` · ${e.durationMs}ms`:``}${t}`,text:e.text,icon:n})}let n=e.kind===`user_prompt`,r=H9(e.text,e.kind),i=t?H9(t,`user_prompt`):``,a=n&&!r&&i?i:r,o=n?`User prompt`:e.kind===`assistant_final`?`Agent final`:`Agent`,s=n?cr:$t;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 text-xs ${n?`justify-end`:`justify-start`}`,children:[!n&&(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`,children:(0,I.jsx)(s,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`max-w-[90%] rounded-md p-2 ${n?`bg-primary/10`:`bg-muted/50`}`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?`text-right`:``}`,children:o}),n?(0,I.jsx)(W9,{text:a,maxLength:280,className:`text-xs`}):(0,I.jsx)(W9,{text:a,maxLength:500,className:`text-xs`})]}),n&&(0,I.jsx)(`div`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary`,children:(0,I.jsx)(s,{className:`h-3 w-3`})})]})}function V9(e,t){let n=t===`input`?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n==`number`?` · ${O4(n)} tokens`:``}function H9(e,t){let n=String(e??``).replace(/^\s+/,``);return t===`user_prompt`?n.replace(/^user:\s*/i,``):t===`assistant_final`||t===`assistant_thought`?n.replace(/^assistant:\s*/i,``):n}function sne(e,t){if(!t)return!1;let n=String(e??``).toLowerCase();if(!n.trim())return!1;let r=[`check`,`checks`,`rule`,`rules`,`regex`,`pattern`,`value capture`,`extract rule`,`update`,`change`,`replace`,`modify`,`adjust`,`use `,`set `],i=[`change `,`replace `,`update `,`use `,`set the`,`suggested`,`you should`,`try `,`text match failed`,`text must match pattern`];if([`i can only read`,`i don't have write access`,`i cannot directly edit`,`what happened`,`summary`].some(e=>n.includes(e))&&!i.some(e=>n.includes(e)))return!1;let a=r.some(e=>n.includes(e)),o=i.some(e=>n.includes(e)),s=/(^|\n)\s*[-*]\s+/.test(e)||/(^|\n)\s*\d+\.\s+/.test(e),c=/["'`][^"'`\n]{2,}["'`]/.test(e);return a&&(o||s||c)}function U9({variant:e,title:t,text:n,icon:r}){let[i,a]=(0,_.useState)(!1);return(0,I.jsx)(t2,{open:i,onOpenChange:a,children:(0,I.jsxs)(`div`,{className:`rounded-md border p-2 text-xs ${{call:`border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300`,result_ok:`border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`,result_error:`border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-300`}[e]}`,children:[(0,I.jsx)(n2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-[11px]`,children:[r??(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{children:t})]}),(0,I.jsx)(`span`,{className:`text-[11px] font-semibold`,children:i?`Hide content`:`Show content`})]})}),(0,I.jsx)(r2,{children:(0,I.jsx)(`p`,{className:`mt-2 font-mono whitespace-pre-wrap text-foreground`,children:n})})]})})}function W9({text:e,maxLength:t,className:n}){let[r,i]=(0,_.useState)(!1),a=e.length>t,o=r||!a?e:`${e.slice(0,t)}...`;return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(a2,{text:o,className:n}),a&&(0,I.jsx)(`button`,{type:`button`,className:`mt-1 text-[11px] font-medium text-primary hover:underline`,onClick:()=>i(e=>!e),children:r?`Show less`:`Show all`})]})}function cne(e,t,n,r){return f4({evalRules:e,failureReasons:t,runError:n,checkResults:r})}function G9(e){let t=String(e??``).trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}var K9=[`hsl(38, 92%, 50%)`,`hsl(200, 80%, 50%)`,`hsl(152, 69%, 40%)`,`hsl(280, 60%, 50%)`,`hsl(0, 72%, 51%)`],lne=9,q9=`mcplab.compare.showDaySeparators`;function J9(e){if(!e.trim())return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Y9(e){let t=J9(e);return t?t.toLocaleString():``}function une(e){let t=J9(e);return t?`${t.getUTCFullYear()}-${String(t.getUTCMonth()+1).padStart(2,`0`)}-${String(t.getUTCDate()).padStart(2,`0`)}`:e}function dne(e){let t=J9(e);return t?t.toLocaleDateString(void 0,{weekday:`long`,month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):`Unknown day`}function X9({counts:e}){return!e||e.total===0?(0,I.jsx)(I.Fragment,{children:`—`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`text-success`,children:[e.passed,` ✓`]}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,I.jsxs)(`span`,{className:`text-destructive`,children:[e.failed,` ✕`]}),e.not_evaluated>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[e.not_evaluated,` ○`]})]}),e.not_executed>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[e.not_executed,` ⊘`]})]})]})}function fne(e){return e.configName?.trim()||OY(e).slice(0,2).join(`, `)||`n/a`}function pne(e){return e.configPath?.trim()||void 0}function Z9({run:e,className:t}){let n=fne(e),r=pne(e);return(0,I.jsx)(`div`,{className:t,title:r,children:n})}function mne(e){let t=e.checkCounts;if(!t||t.total===0)return`—`;let n=t.passed+t.failed;return n===0?`—`:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(X9,{counts:t}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,I.jsxs)(`span`,{children:[Math.round(t.passed/n*100),`%`]})]})}function hne(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function gne(e){let t=e.find(e=>e.provider&&e.model)??e.find(e=>e.provider||e.model);return{provider:t?.provider,model:t?.model}}var _ne=()=>{let{source:e}=Mv(),[t,n]=mp(),r=A9(t),i=t.get(`mode`)===`within-run`?`within-run`:`runs`,[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)({}),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(new Set),[p,m]=(0,_.useState)(`timestamp`),[h,g]=(0,_.useState)(`desc`),[v,y]=(0,_.useState)(`all`),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(()=>{if(typeof window>`u`)return!1;try{return window.localStorage.getItem(q9)===`1`}catch{return!1}}),[w,T]=(0,_.useState)(r.mode),[E,D]=(0,_.useState)(r.preset),[k,A]=(0,_.useState)(r.start),[j,M]=(0,_.useState)(r.end),[N,P]=(0,_.useState)(!1),F=V7(100),{offset:ee,hasMore:L,totalCount:R}=F,z=t.get(`runId`)??``,te=(t.get(`agents`)??``).split(`,`).map(e=>e.trim()).filter(Boolean),ne=t.get(`scenario`)??`all`,[re,ie]=(0,_.useState)(z),[ae,oe]=(0,_.useState)(te),[se,ce]=(0,_.useState)(ne),[B,le]=(0,_.useState)(!1),ue=(0,_.useRef)(0),de=(0,_.useMemo)(()=>{if(w===`all`)return{};if(w===`last`){let e=D9.find(e=>e.value===E)??D9[0],t=new Date;return{since:new Date(t.getTime()-e.durationMs).toISOString(),until:t.toISOString()}}return{since:J9(k)?.toISOString(),until:J9(j)?.toISOString()}},[j,w,E,k]),V=async()=>{let t=ue.current+1;ue.current=t,u(!0);try{if(e.listRunSummariesPage){let n={limit:100,offset:ee};v!==`all`&&(n.scenario=v),de.since&&(n.since=de.since),de.until&&(n.until=de.until);let r=await e.listRunSummariesPage(n);if(ue.current!==t)return;F.updateMeta(r),o(r.data.map(AY))}else{let n=await e.listResults();if(ue.current!==t)return;o(n)}}catch(e){O({title:`Could not load results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ue.current===t&&u(!1)}};(0,_.useEffect)(()=>{let t=!0;return ue.current+=1,u(!0),(e.listRunSummariesPage?e.listRunSummariesPage({limit:100,offset:ee,scenario:v===`all`?void 0:v,since:de.since,until:de.until}).then(e=>(t&&F.updateMeta(e),e.data.map(AY))):e.listResults()).then(e=>{t&&o(e)}).catch(e=>{t&&O({title:`Could not load results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}).finally(()=>{t&&u(!1)}),()=>{t=!1}},[ee,v,e,de]);let fe=e=>{p===e?g(e=>e===`asc`?`desc`:`asc`):(m(e),g(e===`timestamp`?`desc`:`asc`))},pe=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},me=(0,_.useMemo)(()=>{let e=new Set;return a.forEach(t=>{t.scenarios.forEach(t=>{let n=String(t.scenarioName??``).trim(),r=String(t.scenarioId??``).trim(),i=n||r;i&&e.add(i)})}),Array.from(e).sort((e,t)=>e.localeCompare(t))},[a]),he=(0,_.useMemo)(()=>{let e=v===`all`?a:a.filter(e=>e.scenarios.some(e=>{let t=String(e.scenarioName??``).trim(),n=String(e.scenarioId??``).trim();return(t||n)===v}));if(i!==`runs`||w===`all`)return e;let t=Date.now();if(w===`last`){let n=t-(D9.find(e=>e.value===E)??D9[0]).durationMs;return e.filter(e=>{let r=new Date(e.timestamp).getTime();return r>=n&&r<=t})}let n=J9(k)?.getTime()??null,r=J9(j)?.getTime()??null,o=n!==null&&r!==null?Math.min(n,r):n??null,s=n!==null&&r!==null?Math.max(n,r):r??null;return e.filter(e=>{let t=new Date(e.timestamp).getTime();return!(Number.isNaN(t)||o!==null&&t<o||s!==null&&t>s)})},[i,a,v,j,w,E,k]),ge=(0,_.useMemo)(()=>[...he].sort((e,t)=>{let n=0;return p===`id`&&(n=e.id.localeCompare(t.id)),p===`timestamp`&&(n=new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()),p===`passRate`&&(n=(e.overallPassRate??-1)-(t.overallPassRate??-1)),p===`scenarios`&&(n=e.totalScenarios-t.totalScenarios),h===`asc`?n:-n}),[he,p,h]),_e=(0,_.useMemo)(()=>ge.filter(e=>d.has(e.id)).map(e=>s[e.id]??e),[s,ge,d]),ve=(0,_.useMemo)(()=>{if(!S)return ge.map(e=>({type:`run`,run:e}));let e=[],t=null;for(let n of ge){let r=une(n.timestamp);r!==t&&(e.push({type:`day-separator`,dayKey:r,dayLabel:dne(n.timestamp)}),t=r),e.push({type:`run`,run:n})}return e},[S,ge]);(0,_.useEffect)(()=>{if(typeof window<`u`)try{window.localStorage.setItem(q9,S?`1`:`0`)}catch{}},[S]);let ye=e=>p===e?h===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`}),be=(0,_.useMemo)(()=>{let e=new Map;for(let t of ge)e.set(t.id,kY(t));return e},[ge]),xe=e=>{let t=Array.from(new Set(e.scenarios.map(e=>e.agentId).filter(Boolean)));return t.slice(0,Math.min(2,t.length))},Se=e=>{let r=xe(e);ie(e.id),oe(r),ce(`all`);let i=new URLSearchParams(t);i.set(`mode`,`within-run`),i.set(`runId`,e.id),r.length>0?i.set(`agents`,r.join(`,`)):i.delete(`agents`),i.delete(`scenario`),n(i,{replace:!0})},Ce=(0,_.useMemo)(()=>[...new Set(_e.flatMap(e=>e.scenarios.map(e=>e.scenarioId)))],[_e]),we=(0,_.useMemo)(()=>{let e=new Map;for(let t of _e)for(let n of t.scenarios){let t=String(n.scenarioId??``).trim();if(!t)continue;let r=String(n.scenarioName??``).trim();e.set(t,r||t)}return e},[_e]),Te=(0,_.useMemo)(()=>s[re]??a.find(e=>e.id===re),[s,a,re]);(0,_.useEffect)(()=>{if(typeof e.getResult!=`function`||d.size===0&&!re)return;let t=new Set([...d]);re&&t.add(re);for(let n of t)s[n]||e.getResult(n).then(e=>{e&&c(t=>t[n]?t:{...t,[n]:e})})},[s,d,e,re]),(0,_.useEffect)(()=>{F.reset()},[F.reset,v,w,E,k,j]);let Ee=(0,_.useMemo)(()=>{if(!Te)return[];let e=new Map;for(let t of Te.scenarios)e.set(t.agentId,t.agentName||t.agentId);return Array.from(e.entries()).map(([e,t])=>({id:e,name:t})).sort((e,t)=>e.name.localeCompare(t.name))},[Te]),De=(0,_.useMemo)(()=>{if(!Te)return[];let e=new Set;for(let t of Te.scenarios){let n=String(t.scenarioName??``).trim(),r=String(t.scenarioId??``).trim(),i=n||r;i&&e.add(i)}return Array.from(e).sort((e,t)=>e.localeCompare(t))},[Te]),Oe=(0,_.useMemo)(()=>ae.join(`,`),[ae]);(0,_.useEffect)(()=>{if(i===`within-run`){let e=t.get(`runId`)??``,n=(t.get(`agents`)??``).split(`,`).map(e=>e.trim()).filter(Boolean),r=t.get(`scenario`)??`all`;ie(t=>t===e?t:e),oe(e=>hne(e,n)?e:n),ce(e=>e===r?e:r)}},[i,t]),(0,_.useEffect)(()=>{if(i!==`within-run`||a.length===0)return;let e=re;(!e||!a.some(t=>t.id===e))&&(e=a[0].id);let t=a.find(t=>t.id===e),n=(()=>{if(!t)return[];let e=new Map;for(let n of t.scenarios)e.set(n.agentId,n.agentName||n.agentId);return Array.from(e.keys())})(),r=new Set(n),o=Oe.split(`,`).map(e=>e.trim()).filter(e=>!!e).filter(e=>r.has(e));o.length===0&&n.length>0&&(o=n.slice(0,Math.min(2,n.length)));let s=(()=>{if(!t)return new Set;let e=new Set;for(let n of t.scenarios){let t=String(n.scenarioName??``).trim(),r=String(n.scenarioId??``).trim(),i=t||r;i&&e.add(i)}return new Set(e)})(),c=se!==`all`&&!s.has(se)?`all`:se;e!==re&&ie(e),o.join(`,`)!==Oe&&oe(o),c!==se&&ce(c)},[i,a,re,Oe,se]),(0,_.useEffect)(()=>{let e=new URLSearchParams(t);i===`within-run`?(e.set(`mode`,`within-run`),re?e.set(`runId`,re):e.delete(`runId`),ae.length>0?e.set(`agents`,ae.join(`,`)):e.delete(`agents`),se===`all`?e.delete(`scenario`):e.set(`scenario`,se),e.delete(`time_filter`),e.delete(`time_preset`),e.delete(`time_start`),e.delete(`time_end`)):(e.delete(`mode`),e.delete(`runId`),e.delete(`agents`),e.delete(`scenario`),w===`all`?(e.delete(`time_filter`),e.delete(`time_preset`),e.delete(`time_start`),e.delete(`time_end`)):w===`last`?(e.set(`time_filter`,`last`),e.set(`time_preset`,E),e.delete(`time_start`),e.delete(`time_end`)):(e.set(`time_filter`,`custom`),e.delete(`time_preset`),k.trim()?e.set(`time_start`,k.trim()):e.delete(`time_start`),j.trim()?e.set(`time_end`,j.trim()):e.delete(`time_end`))),t.toString()!==e.toString()&&n(e,{replace:!0})},[i,j,w,E,k,re,ae,se,t,n]);let ke=(0,_.useMemo)(()=>{if(w===`all`)return`All time`;if(w===`last`)return D9.find(e=>e.value===E)?.label??`Last range`;let e=!!k.trim(),t=!!j.trim();return!e&&!t?`Custom range`:e&&t?`${Y9(k)} - ${Y9(j)}`:e?`From ${Y9(k)}`:`Until ${Y9(j)}`},[j,w,E,k]),Ae=()=>{T(`all`),D(`15min`),A(``),M(``)},je=(0,_.useMemo)(()=>{if(!Te)return[];let e=new Map;for(let t of Te.scenarios){let n=String(t.scenarioId??``).trim(),r=String(t.scenarioName??``).trim(),i=r||n;if(!n&&!i)continue;let a=n||i,o=e.get(a);o?o.byAgent[t.agentId]=t:e.set(a,{scenarioId:n||i,scenarioName:r,displayLabel:i||n,byAgent:{[t.agentId]:t}})}let t=Array.from(e.values()).sort((e,t)=>{let n=(e.displayLabel||e.scenarioId).toLowerCase(),r=(t.displayLabel||t.scenarioId).toLowerCase();return n.localeCompare(r)});return se===`all`?t:t.filter(e=>e.displayLabel===se)},[Te,se]),Me=(0,_.useMemo)(()=>{let e=new Map(Ee.map(e=>[e.id,e]));return ae.map(t=>e.get(t)).filter(e=>!!e)},[ae,Ee]),Ne=(0,_.useMemo)(()=>{if(!Te||Me.length!==2)return null;let[e,t]=Me;return{left:e,right:t,link:`/compare/results?left=${encodeURIComponent(Te.id)}&right=${encodeURIComponent(Te.id)}&leftConfig=${encodeURIComponent(Te.configId)}&rightConfig=${encodeURIComponent(Te.configId)}&leftAgent=${encodeURIComponent(e.id)}&rightAgent=${encodeURIComponent(t.id)}`}},[Te,Me]),H=(0,_.useMemo)(()=>!Te||Me.length===0?[]:Me.map(e=>{let t=je.map(t=>t.byAgent[e.id]).filter(e=>!!e),n=t.flatMap(e=>e.runs),r=n.length,i=n.filter(e=>e.passed).length,a=n.reduce((e,t)=>e+t.toolCalls.length,0),o=n.reduce((e,t)=>e+t.duration,0),{provider:s,model:c}=gne(t);return{agentId:e.id,agentName:e.name,provider:s,model:c,passRate:V_(i,r,n.filter(e=>e.outcome===`stopped`).length),totalRuns:r,avgToolCalls:r===0?0:a/r,avgLatency:r===0?0:o/r}}),[Te,Me,je]),Pe=e=>{oe(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},Fe=e=>(0,I.jsxs)(`div`,{className:`min-w-0 rounded border bg-muted/20 px-2 py-1.5`,children:[(0,I.jsxs)(`div`,{className:`text-xs`,children:[(0,I.jsxs)(`span`,{className:`font-mono`,children:[`#`,e.runIndex+1]}),` `,(0,I.jsx)(`span`,{className:e.passed?`text-emerald-700`:`text-destructive`,children:e.passed?`PASS`:`FAIL`}),` `,`· tools: `,e.toolCalls.length,` · `,e.duration,`ms`]}),!e.passed&&e.failureReasons.length>0&&(0,I.jsx)(`div`,{className:`mt-1 max-h-16 overflow-y-auto whitespace-pre-wrap break-all pr-1 text-[11px] text-muted-foreground`,children:e.failureReasons.join(`; `)})]},e.runIndex);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Dn,{className:`h-6 w-6`}),`Compare Runs`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i===`runs`?`Select 2–5 runs to compare`:`Compare agents side-by-side within one run`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i===`within-run`&&(0,I.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>{let e=new URLSearchParams(t);e.delete(`mode`),e.delete(`runId`),e.delete(`agents`),e.delete(`scenario`),n(e,{replace:!0})},children:[(0,I.jsx)(Zt,{className:`mr-1.5 h-4 w-4`}),`Back to Compare`]}),i===`runs`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(y8,{open:b,onOpenChange:x,children:[(0,I.jsx)(b8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":b,"aria-controls":`compare-scenario-command-list`,className:`w-[260px] justify-between font-normal ${v===`all`?``:`border-primary/40`}`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:v===`all`?`All scenarios`:v}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(x8,{className:`w-[260px] p-0`,align:`start`,children:(0,I.jsxs)(_5,{children:[(0,I.jsx)(v5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(y5,{id:`compare-scenario-command-list`,children:[(0,I.jsx)(b5,{children:`No scenarios found.`}),(0,I.jsxs)(x5,{children:[(0,I.jsx)(C5,{value:`all scenarios`,onSelect:()=>{y(`all`),x(!1)},children:`All scenarios`}),me.map(e=>(0,I.jsx)(C5,{value:e,onSelect:()=>{y(e),x(!1)},children:e},e))]})]})]})})]}),(0,I.jsxs)(y8,{open:N,onOpenChange:P,children:[(0,I.jsx)(b8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":N,"aria-controls":`compare-time-command-list`,className:`w-[320px] justify-between font-normal ${w===`all`?``:`border-primary/40`}`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 truncate text-left`,children:[(0,I.jsx)(en,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`truncate`,children:ke})]}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsxs)(x8,{className:`w-[360px] p-0`,align:`start`,children:[(0,I.jsxs)(`div`,{className:`border-b px-3 py-2`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Date and time filter`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Filter runs by timestamp.`})]}),(0,I.jsxs)(`div`,{id:`compare-time-command-list`,className:`grid gap-1 p-2`,children:[(0,I.jsx)(W,{type:`button`,variant:w===`all`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{Ae(),P(!1)},children:`All time`}),D9.map(e=>(0,I.jsx)(W,{type:`button`,variant:w===`last`&&E===e.value?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{T(`last`),D(e.value),P(!1)},children:e.label},e.value)),(0,I.jsx)(W,{type:`button`,variant:w===`custom`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>T(`custom`),children:`Custom date time range`})]}),w===`custom`&&(0,I.jsxs)(`div`,{className:`space-y-3 border-t p-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{htmlFor:`compare-time-filter-start`,children:`Start`}),(0,I.jsx)(Pp,{id:`compare-time-filter-start`,type:`datetime-local`,value:k,onChange:e=>A(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{htmlFor:`compare-time-filter-end`,children:`End`}),(0,I.jsx)(Pp,{id:`compare-time-filter-end`,type:`datetime-local`,value:j,onChange:e=>M(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`px-2`,onClick:Ae,children:[(0,I.jsx)(dr,{className:`mr-1.5 h-3.5 w-3.5`}),`Clear`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,onClick:()=>P(!1),children:`Done`})]})]})]})]})]}),(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-md border px-3 py-2`,children:[(0,I.jsx)($,{htmlFor:`compare-day-separators-switch`,className:`text-sm font-medium`,children:`Group by day`}),(0,I.jsx)(n9,{id:`compare-day-separators-switch`,checked:S,onCheckedChange:C,"aria-label":`Group by day`})]}),(0,I.jsx)(W,{variant:`outline`,onClick:()=>void V(),disabled:l,children:l?`Refreshing...`:`Refresh`}),(0,I.jsx)(W,{variant:`outline`,onClick:F.prev,disabled:l||ee===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:F.next,disabled:l||!L,children:`Next`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F.rangeLabel(a.length)}),i===`within-run`&&(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsx)(qv,{className:`text-base`,children:`Within One Run Controls`})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Run`}),(0,I.jsxs)(T1,{value:re,onValueChange:ie,children:[(0,I.jsx)(D1,{children:(0,I.jsx)(E1,{placeholder:`Select run`})}),(0,I.jsx)(A1,{children:a.map(e=>(0,I.jsx)(Q,{value:e.id,children:e.id},e.id))})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Scenario filter`}),(0,I.jsxs)(y8,{open:B,onOpenChange:le,children:[(0,I.jsx)(b8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":B,"aria-controls":`compare-within-run-scenario-command-list`,className:`w-full justify-between font-normal`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:se===`all`?`All scenarios`:se}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(x8,{className:`w-(--radix-popover-trigger-width) p-0`,align:`start`,children:(0,I.jsxs)(_5,{children:[(0,I.jsx)(v5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(y5,{id:`compare-within-run-scenario-command-list`,children:[(0,I.jsx)(b5,{children:`No scenarios found.`}),(0,I.jsxs)(x5,{children:[(0,I.jsx)(C5,{value:`all scenarios`,onSelect:()=>{ce(`all`),le(!1)},children:`All scenarios`}),De.map(e=>(0,I.jsx)(C5,{value:e,onSelect:()=>{ce(e),le(!1)},children:e},e))]})]})]})})]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Agents (select 2+)`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-3 rounded-md border p-3`,children:[Ee.length===0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No agents available for selected run.`}),Ee.map(e=>(0,I.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-sm`,children:[(0,I.jsx)(U0,{checked:ae.includes(e.id),onCheckedChange:()=>Pe(e.id)}),(0,I.jsx)(`span`,{children:e.name})]},e.id))]})]})]})]}),i===`runs`&&(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(Xv,{containerClassName:`max-h-144 overflow-auto`,children:[(0,I.jsx)(Zv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{className:`w-10`}),(0,I.jsx)(ty,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>fe(`id`),children:[`Run ID`,ye(`id`)]})}),(0,I.jsx)(ty,{children:`Evaluated`}),(0,I.jsx)(ty,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>fe(`timestamp`),children:[`Timestamp`,ye(`timestamp`)]})}),(0,I.jsx)(ty,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex w-full items-center justify-end gap-1 hover:text-foreground`,onClick:()=>fe(`passRate`),children:[`Pass Rate`,ye(`passRate`)]})}),(0,I.jsx)(ty,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>fe(`scenarios`),children:[`Scenarios`,ye(`scenarios`)]})}),(0,I.jsx)(ty,{className:`text-right`,children:`Tool Tokens`}),(0,I.jsx)(ty,{className:`text-right`,children:`Agents`}),(0,I.jsx)(ty,{className:`w-[140px] text-right`,children:`Action`})]})}),(0,I.jsx)(Qv,{children:ve.map((e,t)=>e.type===`day-separator`?(0,I.jsx)(ey,{className:`bg-muted/30 hover:bg-muted/30`,children:(0,I.jsx)(J,{colSpan:lne,className:`px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`}),(0,I.jsx)(`span`,{className:`shrink-0 rounded-full border border-border bg-background px-2.5 py-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.dayLabel}),(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`})]})})},`day-${e.dayKey}-${t}`):(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{children:(0,I.jsx)(U0,{checked:d.has(e.run.id),onCheckedChange:()=>pe(e.run.id),disabled:!d.has(e.run.id)&&d.size>=5})}),(0,I.jsx)(J,{className:`font-mono text-xs`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{children:e.run.id}),(0,I.jsx)(Z9,{run:e.run,className:`truncate font-sans text-xs text-foreground/80`})]})}),(0,I.jsx)(J,{className:`text-[11px] text-muted-foreground`,children:(()=>{let t=be.get(e.run.id)??{scenarioCount:0,agentCount:0,scopePreview:`n/a`,modelSummary:``};return(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{children:[`Evaluated: `,t.scenarioCount,` scenario`,t.scenarioCount===1?``:`s`,` · `,t.agentCount,` agent`,t.agentCount===1?``:`s`,t.modelSummary?` · ${t.modelSummary}`:``]}),(0,I.jsx)(B7,{versions:e.run.mcpServerVersions,showPrefix:!1})]})})()}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.run.timestamp).toLocaleString()]}),(()=>{let t=d9(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Total time: `,l9(t)]})})()]})}),(0,I.jsx)(J,{className:`text-right`,children:(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,I.jsx)(ay,{rate:e.run.overallPassRate}),e.run.checkCounts&&e.run.checkCounts.total>0?(0,I.jsx)(`span`,{className:`font-mono text-[11px] leading-none`,"aria-label":`${e.run.checkCounts.passed} checks passed, ${e.run.checkCounts.failed} checks failed`,title:`${e.run.checkCounts.passed} passed · ${e.run.checkCounts.failed} failed`,children:(0,I.jsx)(X9,{counts:e.run.checkCounts})}):null]})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:e.run.totalScenarios}),(0,I.jsx)(J,{className:`text-right`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{className:`font-mono text-sm`,children:O4(e.run.toolTokenUsage?.totalTokens)}),(()=>{let t=p9(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Tool time: `,l9(t)]})})()]})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:be.get(e.run.id)?.agentCount??0}),(0,I.jsx)(J,{className:`text-right`,children:(be.get(e.run.id)?.agentCount??0)>1?(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>Se(e.run),children:`Compare agents`}):(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})})]},e.run.id))})]})})}),i===`runs`&&_e.length<2&&(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`py-12 text-center`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`No runs selected`}),(0,I.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Select 2–5 runs from the table above to start a comparison.`})]})}),i===`runs`&&_e.length>=2&&(0,I.jsxs)(I.Fragment,{children:[_e.length===2&&(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Need a deeper comparison?`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open the two selected runs in a dedicated side-by-side full result compare view.`})]}),(0,I.jsx)(W,{asChild:!0,size:`sm`,children:(0,I.jsx)(cp,{to:`/compare/results?left=${encodeURIComponent(_e[0].id)}&right=${encodeURIComponent(_e[1].id)}&leftConfig=${encodeURIComponent(_e[0].configId)}&rightConfig=${encodeURIComponent(_e[1].configId)}`,children:`Compare full results`})})]})})}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsx)(qv,{className:`text-base`,children:`Summary Comparison`})}),(0,I.jsx)(q,{className:`max-h-96 overflow-auto p-0`,children:(0,I.jsxs)(Xv,{className:`table-fixed`,children:[(0,I.jsx)(Zv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{className:`w-[220px]`,children:`Metric`}),_e.map((e,t)=>(0,I.jsxs)(ty,{style:{color:K9[t]},className:`font-mono text-xs`,children:[(0,I.jsx)(`div`,{children:e.id}),(0,I.jsx)(Z9,{run:e,className:`mt-0.5 truncate text-[10px] font-normal text-muted-foreground`})]},e.id))]})}),(0,I.jsxs)(Qv,{children:[(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Pass Rate`}),_e.map(e=>(0,I.jsx)(J,{children:(0,I.jsx)(ay,{rate:e.overallPassRate})},e.id))]}),(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Checks Pass Rate`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:mne(e)},e.id))]}),(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Total Runs`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.totalRuns},e.id))]}),(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Tool Calls`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.avgToolCalls.toFixed(1)},e.id))]}),(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Avg Latency`}),_e.map(e=>(0,I.jsxs)(J,{className:`font-mono`,children:[e.avgLatency,`ms`]},e.id))]}),(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Total Time`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:(()=>{let t=d9(e);return t===null?`—`:l9(t)})()},e.id))]}),(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Tool Time`}),_e.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:(()=>{let t=p9(e);return t===null?`—`:l9(t)})()},e.id))]})]})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsx)(qv,{className:`text-base`,children:`Scenario Breakdown`})}),(0,I.jsx)(q,{className:`max-h-104 overflow-auto p-0`,children:(0,I.jsxs)(Xv,{className:`table-fixed`,children:[(0,I.jsx)(Zv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{className:`w-[220px]`,children:`Scenario`}),_e.map((e,t)=>(0,I.jsxs)(ty,{style:{color:K9[t]},className:`font-mono text-xs`,children:[(0,I.jsx)(`div`,{children:e.id}),(0,I.jsx)(Z9,{run:e,className:`mt-0.5 truncate text-[10px] font-normal text-muted-foreground`}),(0,I.jsx)(B7,{versions:e.mcpServerVersions,className:`mt-0.5 max-w-full border-0 bg-transparent p-0 text-[10px] font-normal`})]},e.id))]})}),(0,I.jsx)(Qv,{children:Ce.map(e=>(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium text-sm`,children:we.get(e)??e}),_e.map(t=>{let n=t.scenarios.find(t=>t.scenarioId===e);return(0,I.jsx)(J,{children:n?(0,I.jsxs)(`div`,{className:`flex items-center justify-start gap-2`,children:[(0,I.jsx)(ay,{rate:n.passRate}),n.checkCounts?.total?(0,I.jsx)(`span`,{className:`font-mono text-[11px] leading-none`,children:(0,I.jsx)(X9,{counts:n.checkCounts})}):null]}):(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})},t.id)})]},e))})]})})]})]}),i===`runs`&&_e.length>=2&&(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsx)(qv,{className:`text-base`,children:`Pass Rate Trend`})}),(0,I.jsx)(q,{className:`h-72`,children:(0,I.jsx)(GE,{width:`100%`,height:`100%`,children:(0,I.jsxs)(TY,{data:_e.map((e,t)=>({idx:t+1,runId:e.id,passRate:e.overallPassRate===null?null:Number((e.overallPassRate*100).toFixed(1))})),children:[(0,I.jsx)(Lq,{dataKey:`idx`,tickFormatter:e=>String(e)}),(0,I.jsx)(eJ,{unit:`%`,domain:[0,100]}),(0,I.jsx)(EE,{formatter:e=>[`${e}%`,`Pass Rate`],labelFormatter:e=>`Run ${e}`}),(0,I.jsx)(Zw,{}),(0,I.jsx)(bq,{type:`monotone`,dataKey:`passRate`,stroke:K9[0],strokeWidth:2.5,dot:!0})]})})})]}),i===`within-run`&&Te&&Me.length<2&&(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6 text-sm text-muted-foreground`,children:`Select at least 2 agents to compare side-by-side within this run.`})}),i===`within-run`&&Te&&Me.length>=2&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Need full result details?`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Ne?`Open a side-by-side full result view filtered by the selected agents.`:`Open the complete run result page for all details and trace navigation.`})]}),(0,I.jsx)(W,{asChild:!0,size:`sm`,children:Ne?(0,I.jsx)(cp,{to:Ne.link,children:`Compare full results`}):(0,I.jsx)(cp,{to:`/results/${encodeURIComponent(Te.id)}${Te.configId?`?configId=${encodeURIComponent(Te.configId)}`:``}`,children:`Open full result`})})]})})}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsx)(qv,{className:`text-base`,children:`Agent Summary`})}),(0,I.jsx)(q,{className:`max-h-96 overflow-auto p-0`,children:(0,I.jsxs)(Xv,{children:[(0,I.jsx)(Zv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{children:`Metric`}),H.map(e=>(0,I.jsxs)(ty,{children:[(0,I.jsx)(`div`,{className:`font-medium text-sm`,children:e.agentName}),(e.provider||e.model)&&(0,I.jsx)(`div`,{className:`font-mono text-xs font-normal text-muted-foreground`,children:[e.provider?T0(e.provider):null,e.model].filter(Boolean).join(` · `)})]},e.agentId))]})}),(0,I.jsxs)(Qv,{children:[(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Pass Rate`}),H.map(e=>(0,I.jsx)(J,{children:(0,I.jsx)(ay,{rate:e.passRate})},e.agentId))]}),(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Total Runs`}),H.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.totalRuns},e.agentId))]}),(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Avg Tool Calls`}),H.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.avgToolCalls.toFixed(1)},e.agentId))]}),(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Avg Latency`}),H.map(e=>(0,I.jsxs)(J,{className:`font-mono`,children:[Math.round(e.avgLatency),`ms`]},e.agentId))]})]})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{className:`pb-3`,children:(0,I.jsx)(qv,{className:`text-base`,children:`Scenario × Agent Matrix`})}),(0,I.jsx)(q,{className:`max-h-136 overflow-auto p-0`,children:(0,I.jsxs)(Xv,{className:`table-fixed`,children:[(0,I.jsx)(Zv,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{className:`w-[260px]`,children:`Scenario`}),Me.map(e=>{let t=H.find(t=>t.agentId===e.id);return(0,I.jsxs)(ty,{children:[(0,I.jsx)(`div`,{className:`font-medium text-sm`,children:e.name}),(t?.provider||t?.model)&&(0,I.jsx)(`div`,{className:`font-mono text-xs font-normal text-muted-foreground`,children:[t.provider?T0(t.provider):null,t.model].filter(Boolean).join(` · `)})]},e.id)})]})}),(0,I.jsx)(Qv,{children:je.map(e=>(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{className:`font-medium text-sm`,children:e.displayLabel}),Me.map(t=>{let n=e.byAgent[t.id];return n?(0,I.jsx)(J,{className:`min-w-0 align-top`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsx)(ay,{rate:n.passRate}),` `,(0,I.jsxs)(`span`,{className:`ml-2`,children:[`runs: `,n.runs.length]}),` · calls:`,` `,n.avgToolCalls.toFixed(1),` · latency:`,` `,Math.round(n.avgDuration),`ms`]}),n.runs.length>0?(0,I.jsx)(`div`,{className:`space-y-1.5`,children:n.runs.map(e=>Fe(e))}):(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No runs captured.`})]})},t.id):(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})},t.id)})]},e.scenarioId))})]})})]})]})]})},Q9=(e,t,n)=>{let r=new URLSearchParams;return t&&r.set(`configId`,t),n&&r.set(`agent`,n),r.set(`embed`,`1`),`/results/${encodeURIComponent(e)}?${r.toString()}`},$9=(e,t,n)=>{let r=new URLSearchParams;t&&r.set(`configId`,t),n&&r.set(`agent`,n);let i=r.toString();return`/results/${encodeURIComponent(e)}${i?`?${i}`:``}`},vne=()=>{let{source:e}=Mv(),[t]=mp(),n=t.get(`left`)??``,r=t.get(`right`)??``,i=t.get(`leftConfig`),a=t.get(`rightConfig`),o=t.get(`leftAgent`),s=t.get(`rightAgent`),c=o?`${n} · ${o}`:n,l=s?`${r} · ${s}`:r,[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(!n||typeof e.getResult!=`function`){d(null);return}let t=!0;return e.getResult(n).then(e=>{t&&d(e??null)}),()=>{t=!1}},[n,e]),(0,_.useEffect)(()=>{if(!r||typeof e.getResult!=`function`){p(null);return}let t=!0;return e.getResult(r).then(e=>{t&&p(e??null)}),()=>{t=!1}},[r,e]),!n||!r?(0,I.jsxs)(K,{children:[(0,I.jsx)(Kv,{children:(0,I.jsx)(qv,{className:`text-base`,children:`Full Result Compare`})}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Select exactly two runs in Compare and use the “Compare full results” action.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(cp,{to:`/compare`,children:`Back to Compare`})})]})]}):(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Full Result Compare`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o||s?`Side-by-side Result Detail views for deep inspection, filtered by selected agents.`:`Side-by-side Result Detail views for deep inspection.`})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(W,{variant:`outline`,size:`sm`,asChild:!0,children:(0,I.jsxs)(cp,{to:`/compare`,children:[(0,I.jsx)(Zt,{className:`mr-1.5 h-4 w-4`}),`Back to Compare`]})}),(0,I.jsx)(W,{variant:`outline`,size:`sm`,asChild:!0,children:(0,I.jsxs)(`a`,{href:$9(n,i,o),target:`_blank`,rel:`noreferrer`,children:[`Open Left`,(0,I.jsx)(yn,{className:`ml-1.5 h-3.5 w-3.5`})]})}),(0,I.jsx)(W,{variant:`outline`,size:`sm`,asChild:!0,children:(0,I.jsxs)(`a`,{href:$9(r,a,s),target:`_blank`,rel:`noreferrer`,children:[`Open Right`,(0,I.jsx)(yn,{className:`ml-1.5 h-3.5 w-3.5`})]})})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,I.jsxs)(K,{className:`overflow-hidden`,children:[(0,I.jsx)(Kv,{className:`py-3`,children:(0,I.jsx)(qv,{className:`text-sm font-mono`,children:c})}),(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsx)(`iframe`,{title:`Result ${c}`,src:Q9(n,i,o),className:`h-[calc(100vh-12rem)] w-full border-0`})})]}),(0,I.jsxs)(K,{className:`overflow-hidden`,children:[(0,I.jsx)(Kv,{className:`py-3`,children:(0,I.jsx)(qv,{className:`text-sm font-mono`,children:l})}),(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsx)(`iframe`,{title:`Result ${l}`,src:Q9(r,a,s),className:`h-[calc(100vh-12rem)] w-full border-0`})})]})]})]})};function yne(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function bne(){let{source:e}=Mv(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),l=V7(100),{offset:u,hasMore:d}=l,f=async()=>{i(!0);try{if(e.listMarkdownReportsPage){let t=await e.listMarkdownReportsPage({limit:100,offset:u});n(t.data),l.updateMeta(t)}else n(await e.listMarkdownReports({limit:100,offset:u}))}catch(e){O({title:`Could not load markdown reports`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{i(!1)}};(0,_.useEffect)(()=>{f()},[u]);let p=(0,_.useMemo)(()=>t[0],[t]),m=(0,_.useMemo)(()=>t.find(e=>e.relativePath===a)??null,[t,a]),h=async()=>{if(a){c(!0);try{await e.deleteMarkdownReport(a),n(e=>e.filter(e=>e.relativePath!==a)),O({title:`Markdown report deleted`}),o(null)}catch(e){O({title:`Could not delete markdown report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{c(!1)}}};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Bn,{className:`h-6 w-6`}),`Markdown Reports`]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Browse Markdown files under `,(0,I.jsx)(`code`,{children:`mcplab/reports`}),`.`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{variant:`outline`,onClick:()=>void f(),children:`Refresh`}),p?(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(cp,{to:`/markdown-reports/view?id=${encodeURIComponent(p.reportId)}`,children:`Open latest`})}):null,(0,I.jsx)(W,{variant:`outline`,onClick:l.prev,disabled:r||u===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:l.next,disabled:r||!d,children:`Next`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l.rangeLabel(t.length)}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:r?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`Loading markdown reports...`}):t.length===0?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`No markdown reports found yet.`}):(0,I.jsxs)(Xv,{children:[(0,I.jsx)(Zv,{children:(0,I.jsxs)(ey,{children:[(0,I.jsx)(ty,{children:`Report`}),(0,I.jsx)(ty,{children:`Result`}),(0,I.jsx)(ty,{children:`Folder`}),(0,I.jsx)(ty,{children:`Timestamp`}),(0,I.jsx)(ty,{className:`w-10`})]})}),(0,I.jsx)(Qv,{children:t.map(e=>(0,I.jsxs)(ey,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(cp,{to:`/markdown-reports/view?id=${encodeURIComponent(e.reportId)}`,className:`font-mono text-xs text-primary hover:underline`,children:e.name}),(0,I.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:e.relativePath})]})}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground font-mono`,children:(()=>{let t=yne(e.relativePath);return t?(0,I.jsx)(cp,{to:`/results/${encodeURIComponent(t)}`,className:`text-primary hover:underline`,children:t}):(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})})()}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground font-mono`,children:e.relativePath.includes(`/`)?e.relativePath.slice(0,e.relativePath.lastIndexOf(`/`)):`.`}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.mtime).toLocaleString()]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(FQ,{children:[(0,I.jsx)(IQ,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:(0,I.jsx)(vn,{className:`h-4 w-4`})})}),(0,I.jsxs)(zQ,{align:`end`,children:[(0,I.jsx)(BQ,{asChild:!0,children:(0,I.jsx)(cp,{to:`/markdown-reports/view?id=${encodeURIComponent(e.reportId)}`,children:`View`})}),(0,I.jsxs)(BQ,{className:`text-destructive`,onSelect:t=>{t.preventDefault(),o(e.relativePath)},children:[(0,I.jsx)(ar,{className:`mr-2 h-3.5 w-3.5`}),` Delete`]})]})]})})]},e.path))})]})})}),(0,I.jsx)(I3,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(z3,{children:[(0,I.jsxs)(B3,{children:[(0,I.jsx)(H3,{children:`Delete markdown report?`}),(0,I.jsx)(U3,{children:m?`Delete '${m.name}' from disk? This cannot be undone.`:`Delete this report from disk? This cannot be undone.`})]}),(0,I.jsxs)(V3,{children:[(0,I.jsx)(G3,{disabled:s,children:`Cancel`}),(0,I.jsx)(W3,{onClick:e=>{e.preventDefault(),h()},disabled:s,children:s?`Deleting...`:`Delete`})]})]})})]})}function xne(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Sne(e){let t=e.relativePath.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i);return t?.[1]?t[1]:(e.content.match(/(?:^|\n)\s*\*\*Run:\*\*\s*`([^`]+)`/i)??e.content.match(/(?:^|\n)\s*Run ID:\s*([^\s]+)/i))?.[1]?.trim()||null}function Cne(){let{source:e}=Mv(),[t]=mp(),n=(t.get(`id`)??``).trim(),r=(t.get(`path`)??``).trim(),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!1);if((0,_.useEffect)(()=>{let t=!0;if(a(null),l(!1),!n&&!r)s(!1);else return s(!0),(n&&e.getMarkdownReportById?e.getMarkdownReportById(n):e.getMarkdownReport(r)).then(e=>{t&&a(e)}).catch(e=>{if(!t)return;let n=e instanceof Error?e.message:String(e);n.includes(`(404)`)?l(!0):O({title:`Could not load markdown report`,description:n,variant:`destructive`})}).finally(()=>{t&&s(!1)}),()=>{t=!1}},[r,n,e]),!n&&!r)return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Markdown Report`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Missing report identifier.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(cp,{to:`/markdown-reports`,children:`Back to Markdown Reports`})})]});if(o)return(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading markdown report...`});if(c||!i)return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Markdown Report`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Report not found.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(cp,{to:`/markdown-reports`,children:`Back to Markdown Reports`})})]});let f=Sne(i);return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`h1`,{className:`font-mono text-xl font-semibold`,children:i.name}),(0,I.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`font-mono`,children:i.relativePath}),(0,I.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 align-middle`,children:[(0,I.jsx)(mn,{className:`h-3 w-3 shrink-0`}),new Date(i.mtime).toLocaleString()]}),(0,I.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,I.jsx)(`span`,{children:xne(i.sizeBytes)})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>d(!0),children:`Open Result Panel`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsx)(cp,{to:`/results/${encodeURIComponent(f)}`,children:`Open Result`})})]}):null,(0,I.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsx)(cp,{to:`/markdown-reports`,children:`Back to reports`})})]})]}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsx)(a2,{text:i.content,variant:`assistant`})})}),f?(0,I.jsx)(fg,{open:u,onOpenChange:d,children:(0,I.jsxs)(gg,{side:`right`,className:`w-[96vw] max-w-none p-0 sm:max-w-5xl`,children:[(0,I.jsx)(_g,{className:`border-b px-4 py-3 pr-12`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(vg,{className:`text-base`,children:[`Result `,f]}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsx)(cp,{to:`/results/${encodeURIComponent(f)}`,target:`_blank`,rel:`noreferrer`,children:`Open full page`})})]})}),(0,I.jsx)(`div`,{className:`h-[calc(100vh-64px)]`,children:(0,I.jsx)(`iframe`,{title:`Result ${f}`,src:`/results/${encodeURIComponent(f)}?embed=1`,className:`h-full w-full border-0`})})]})}):null]})}var wne=()=>{let e=Vd();return(0,_.useEffect)(()=>{console.error(`404 Error: User attempted to access non-existent route:`,e.pathname)},[e.pathname]),(0,I.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-muted`,children:(0,I.jsxs)(`div`,{className:`text-center`,children:[(0,I.jsx)(`h1`,{className:`mb-4 text-4xl font-bold`,children:`404`}),(0,I.jsx)(`p`,{className:`mb-4 text-xl text-muted-foreground`,children:`Oops! Page not found`}),(0,I.jsx)(`a`,{href:`/`,className:`text-primary underline hover:text-primary/90`,children:`Return to Home`})]})})},Tne=new mu;function Ene(){let{scenarioId:e}=Jd();return(0,I.jsx)(_f,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:`/libraries/test-cases`,replace:!0})}function Dne(){return(0,I.jsxs)(xf,{children:[(0,I.jsxs)(yf,{element:(0,I.jsx)(zv,{}),children:[(0,I.jsx)(yf,{path:`/`,element:(0,I.jsx)(PY,{})}),(0,I.jsx)(yf,{path:`/mcp-evaluations`,element:(0,I.jsx)(Y1,{})}),(0,I.jsx)(yf,{path:`/mcp-evaluations/:id`,element:(0,I.jsx)(t3,{})}),(0,I.jsx)(yf,{path:`/mcp-evaluations/:id/:tab`,element:(0,I.jsx)(t3,{})}),(0,I.jsx)(yf,{path:`/tool-analysis`,element:(0,I.jsx)(z7,{})}),(0,I.jsx)(yf,{path:`/tool-analysis-results`,element:(0,I.jsx)(U7,{})}),(0,I.jsx)(yf,{path:`/tool-analysis-results/:id`,element:(0,I.jsx)(Ste,{})}),(0,I.jsx)(yf,{path:`/oauth-debugger`,element:(0,I.jsx)(Ote,{})}),(0,I.jsx)(yf,{path:`/libraries/servers`,element:(0,I.jsx)(K3,{})}),(0,I.jsx)(yf,{path:`/libraries/servers/:serverId`,element:(0,I.jsx)(X3,{})}),(0,I.jsx)(yf,{path:`/libraries/agents`,element:(0,I.jsx)(Z3,{defaultType:`llm`})}),(0,I.jsx)(yf,{path:`/libraries/agents/:agentName`,element:(0,I.jsx)(D5,{})}),(0,I.jsx)(yf,{path:`/libraries/test-cases`,element:(0,I.jsx)(k5,{})}),(0,I.jsx)(yf,{path:`/libraries/test-cases/:testCaseId`,element:(0,I.jsx)(k5,{})}),(0,I.jsx)(yf,{path:`/libraries/scenarios`,element:(0,I.jsx)(_f,{to:`/libraries/test-cases`,replace:!0})}),(0,I.jsx)(yf,{path:`/libraries/scenarios/:scenarioId`,element:(0,I.jsx)(Ene,{})}),(0,I.jsx)(yf,{path:`/settings`,element:(0,I.jsx)(A5,{})}),(0,I.jsx)(yf,{path:`/settings/mcp`,element:(0,I.jsx)(B5,{})}),(0,I.jsx)(yf,{path:`/run`,element:(0,I.jsx)(Vte,{})}),(0,I.jsx)(yf,{path:`/results`,element:(0,I.jsx)(tne,{})}),(0,I.jsx)(yf,{path:`/results/:id`,element:(0,I.jsx)(ane,{})}),(0,I.jsx)(yf,{path:`/markdown-reports`,element:(0,I.jsx)(bne,{})}),(0,I.jsx)(yf,{path:`/markdown-reports/view`,element:(0,I.jsx)(Cne,{})}),(0,I.jsx)(yf,{path:`/compare`,element:(0,I.jsx)(_ne,{})}),(0,I.jsx)(yf,{path:`/compare/results`,element:(0,I.jsx)(vne,{})})]}),(0,I.jsx)(yf,{path:`*`,element:(0,I.jsx)(wne,{})})]})}(0,g.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(()=>(0,I.jsx)(gu,{client:Tne,children:(0,I.jsx)(fl,{children:(0,I.jsx)(jv,{children:(0,I.jsx)(Wv,{children:(0,I.jsxs)(Vv,{children:[(0,I.jsx)(Xi,{}),(0,I.jsx)(ja,{}),(0,I.jsx)(sp,{children:(0,I.jsx)(Dne,{})})]})})})})}),{}));