@inspectr/mcplab 1.15.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -35
- package/dist/app/assets/index-BSGuUMv-.js +254 -0
- package/dist/app/assets/index-Bekohuot.css +1 -0
- package/dist/app/index.html +2 -2
- package/dist/app-server/app-context.d.ts +0 -22
- package/dist/app-server/app-context.d.ts.map +1 -1
- package/dist/app-server/evals-routes.d.ts.map +1 -1
- package/dist/app-server/evals-routes.js +1 -38
- package/dist/app-server/evals-routes.js.map +1 -1
- package/dist/app-server/libraries-store.d.ts.map +1 -1
- package/dist/app-server/libraries-store.js +2 -3
- package/dist/app-server/libraries-store.js.map +1 -1
- package/dist/app-server/result-assistant-domain.js +1 -2
- package/dist/app-server/result-assistant-domain.js.map +1 -1
- package/dist/app-server/result-assistant.d.ts.map +1 -1
- package/dist/app-server/result-assistant.js +7 -1
- package/dist/app-server/result-assistant.js.map +1 -1
- package/dist/app-server/router.d.ts.map +1 -1
- package/dist/app-server/router.js +0 -24
- package/dist/app-server/router.js.map +1 -1
- package/dist/app-server/runs-routes.d.ts +15 -4
- package/dist/app-server/runs-routes.d.ts.map +1 -1
- package/dist/app-server/runs-routes.js +176 -133
- package/dist/app-server/runs-routes.js.map +1 -1
- package/dist/app-server/runs-store.d.ts +22 -16
- package/dist/app-server/scenario-assistant-domain.d.ts +0 -16
- package/dist/app-server/scenario-assistant-domain.d.ts.map +1 -1
- package/dist/app-server/scenario-assistant-domain.js +5 -8
- package/dist/app-server/scenario-assistant-domain.js.map +1 -1
- package/dist/app-server/scenario-assistant.d.ts.map +1 -1
- package/dist/app-server/scenario-assistant.js +7 -1
- package/dist/app-server/scenario-assistant.js.map +1 -1
- package/dist/app-server/snapshots-routes.d.ts +1 -13
- package/dist/app-server/snapshots-routes.d.ts.map +1 -1
- package/dist/app-server/snapshots-routes.js +9 -79
- package/dist/app-server/snapshots-routes.js.map +1 -1
- package/dist/app-server/types.d.ts +0 -2
- package/dist/app-server/types.d.ts.map +1 -1
- package/dist/cli.js +79 -288
- package/dist/cli.js.map +1 -1
- package/dist/interactive-helpers.d.ts +0 -1
- package/dist/interactive-helpers.d.ts.map +1 -1
- package/dist/interactive-helpers.js +0 -3
- package/dist/interactive-helpers.js.map +1 -1
- package/package.json +4 -4
- package/dist/app/assets/index-BH8cCzoo.css +0 -1
- package/dist/app/assets/index-C2W0NrXX.js +0 -250
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
function wU(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var sh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vy={exports:{}},id={},gy={exports:{}},Yt={};var RE;function jU(){if(RE)return Yt;RE=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function g($){return $===null||typeof $!="object"?null:($=p&&$[p]||$["@@iterator"],typeof $=="function"?$:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,y={};function b($,I,ee){this.props=$,this.context=I,this.refs=y,this.updater=ee||x}b.prototype.isReactComponent={},b.prototype.setState=function($,I){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,I,"setState")},b.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function N(){}N.prototype=b.prototype;function C($,I,ee){this.props=$,this.context=I,this.refs=y,this.updater=ee||x}var S=C.prototype=new N;S.constructor=C,j(S,b.prototype),S.isPureReactComponent=!0;var E=Array.isArray,A=Object.prototype.hasOwnProperty,k={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function O($,I,ee){var Q,ie={},ue=null,re=null;if(I!=null)for(Q in I.ref!==void 0&&(re=I.ref),I.key!==void 0&&(ue=""+I.key),I)A.call(I,Q)&&!T.hasOwnProperty(Q)&&(ie[Q]=I[Q]);var je=arguments.length-2;if(je===1)ie.children=ee;else if(1<je){for(var pe=Array(je),oe=0;oe<je;oe++)pe[oe]=arguments[oe+2];ie.children=pe}if($&&$.defaultProps)for(Q in je=$.defaultProps,je)ie[Q]===void 0&&(ie[Q]=je[Q]);return{$$typeof:e,type:$,key:ue,ref:re,props:ie,_owner:k.current}}function D($,I){return{$$typeof:e,type:$.type,key:I,ref:$.ref,props:$.props,_owner:$._owner}}function q($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function U($){var I={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(ee){return I[ee]})}var B=/\/+/g;function X($,I){return typeof $=="object"&&$!==null&&$.key!=null?U(""+$.key):I.toString(36)}function W($,I,ee,Q,ie){var ue=typeof $;(ue==="undefined"||ue==="boolean")&&($=null);var re=!1;if($===null)re=!0;else switch(ue){case"string":case"number":re=!0;break;case"object":switch($.$$typeof){case e:case t:re=!0}}if(re)return re=$,ie=ie(re),$=Q===""?"."+X(re,0):Q,E(ie)?(ee="",$!=null&&(ee=$.replace(B,"$&/")+"/"),W(ie,I,ee,"",function(oe){return oe})):ie!=null&&(q(ie)&&(ie=D(ie,ee+(!ie.key||re&&re.key===ie.key?"":(""+ie.key).replace(B,"$&/")+"/")+$)),I.push(ie)),1;if(re=0,Q=Q===""?".":Q+":",E($))for(var je=0;je<$.length;je++){ue=$[je];var pe=Q+X(ue,je);re+=W(ue,I,ee,pe,ie)}else if(pe=g($),typeof pe=="function")for($=pe.call($),je=0;!(ue=$.next()).done;)ue=ue.value,pe=Q+X(ue,je++),re+=W(ue,I,ee,pe,ie);else if(ue==="object")throw I=String($),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.");return re}function M($,I,ee){if($==null)return $;var Q=[],ie=0;return W($,Q,"","",function(ue){return I.call(ee,ue,ie++)}),Q}function z($){if($._status===-1){var I=$._result;I=I(),I.then(function(ee){($._status===0||$._status===-1)&&($._status=1,$._result=ee)},function(ee){($._status===0||$._status===-1)&&($._status=2,$._result=ee)}),$._status===-1&&($._status=0,$._result=I)}if($._status===1)return $._result.default;throw $._result}var K={current:null},V={transition:null},R={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:V,ReactCurrentOwner:k};function G(){throw Error("act(...) is not supported in production builds of React.")}return Yt.Children={map:M,forEach:function($,I,ee){M($,function(){I.apply(this,arguments)},ee)},count:function($){var I=0;return M($,function(){I++}),I},toArray:function($){return M($,function(I){return I})||[]},only:function($){if(!q($))throw Error("React.Children.only expected to receive a single React element child.");return $}},Yt.Component=b,Yt.Fragment=n,Yt.Profiler=s,Yt.PureComponent=C,Yt.StrictMode=r,Yt.Suspense=d,Yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,Yt.act=G,Yt.cloneElement=function($,I,ee){if($==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+$+".");var Q=j({},$.props),ie=$.key,ue=$.ref,re=$._owner;if(I!=null){if(I.ref!==void 0&&(ue=I.ref,re=k.current),I.key!==void 0&&(ie=""+I.key),$.type&&$.type.defaultProps)var je=$.type.defaultProps;for(pe in I)A.call(I,pe)&&!T.hasOwnProperty(pe)&&(Q[pe]=I[pe]===void 0&&je!==void 0?je[pe]:I[pe])}var pe=arguments.length-2;if(pe===1)Q.children=ee;else if(1<pe){je=Array(pe);for(var oe=0;oe<pe;oe++)je[oe]=arguments[oe+2];Q.children=je}return{$$typeof:e,type:$.type,key:ie,ref:ue,props:Q,_owner:re}},Yt.createContext=function($){return $={$$typeof:o,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},$.Provider={$$typeof:i,_context:$},$.Consumer=$},Yt.createElement=O,Yt.createFactory=function($){var I=O.bind(null,$);return I.type=$,I},Yt.createRef=function(){return{current:null}},Yt.forwardRef=function($){return{$$typeof:c,render:$}},Yt.isValidElement=q,Yt.lazy=function($){return{$$typeof:h,_payload:{_status:-1,_result:$},_init:z}},Yt.memo=function($,I){return{$$typeof:f,type:$,compare:I===void 0?null:I}},Yt.startTransition=function($){var I=V.transition;V.transition={};try{$()}finally{V.transition=I}},Yt.unstable_act=G,Yt.useCallback=function($,I){return K.current.useCallback($,I)},Yt.useContext=function($){return K.current.useContext($)},Yt.useDebugValue=function(){},Yt.useDeferredValue=function($){return K.current.useDeferredValue($)},Yt.useEffect=function($,I){return K.current.useEffect($,I)},Yt.useId=function(){return K.current.useId()},Yt.useImperativeHandle=function($,I,ee){return K.current.useImperativeHandle($,I,ee)},Yt.useInsertionEffect=function($,I){return K.current.useInsertionEffect($,I)},Yt.useLayoutEffect=function($,I){return K.current.useLayoutEffect($,I)},Yt.useMemo=function($,I){return K.current.useMemo($,I)},Yt.useReducer=function($,I,ee){return K.current.useReducer($,I,ee)},Yt.useRef=function($){return K.current.useRef($)},Yt.useState=function($){return K.current.useState($)},Yt.useSyncExternalStore=function($,I,ee){return K.current.useSyncExternalStore($,I,ee)},Yt.useTransition=function(){return K.current.useTransition()},Yt.version="18.3.1",Yt}var IE;function uN(){return IE||(IE=1,gy.exports=jU()),gy.exports}var ME;function SU(){if(ME)return id;ME=1;var e=uN(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(c,d,f){var h,p={},g=null,x=null;f!==void 0&&(g=""+f),d.key!==void 0&&(g=""+d.key),d.ref!==void 0&&(x=d.ref);for(h in d)r.call(d,h)&&!i.hasOwnProperty(h)&&(p[h]=d[h]);if(c&&c.defaultProps)for(h in d=c.defaultProps,d)p[h]===void 0&&(p[h]=d[h]);return{$$typeof:t,type:c,key:g,ref:x,props:p,_owner:s.current}}return id.Fragment=n,id.jsx=o,id.jsxs=o,id}var $E;function NU(){return $E||($E=1,vy.exports=SU()),vy.exports}var a=NU(),ih={},xy={exports:{}},qr={},yy={exports:{}},by={};var DE;function CU(){return DE||(DE=1,(function(e){function t(V,R){var G=V.length;V.push(R);e:for(;0<G;){var $=G-1>>>1,I=V[$];if(0<s(I,R))V[$]=R,V[G]=I,G=$;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var R=V[0],G=V.pop();if(G!==R){V[0]=G;e:for(var $=0,I=V.length,ee=I>>>1;$<ee;){var Q=2*($+1)-1,ie=V[Q],ue=Q+1,re=V[ue];if(0>s(ie,G))ue<I&&0>s(re,ie)?(V[$]=re,V[ue]=G,$=ue):(V[$]=ie,V[Q]=G,$=Q);else if(ue<I&&0>s(re,G))V[$]=re,V[ue]=G,$=ue;else break e}}return R}function s(V,R){var G=V.sortIndex-R.sortIndex;return G!==0?G:V.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],f=[],h=1,p=null,g=3,x=!1,j=!1,y=!1,b=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(V){for(var R=n(f);R!==null;){if(R.callback===null)r(f);else if(R.startTime<=V)r(f),R.sortIndex=R.expirationTime,t(d,R);else break;R=n(f)}}function E(V){if(y=!1,S(V),!j)if(n(d)!==null)j=!0,z(A);else{var R=n(f);R!==null&&K(E,R.startTime-V)}}function A(V,R){j=!1,y&&(y=!1,N(O),O=-1),x=!0;var G=g;try{for(S(R),p=n(d);p!==null&&(!(p.expirationTime>R)||V&&!U());){var $=p.callback;if(typeof $=="function"){p.callback=null,g=p.priorityLevel;var I=$(p.expirationTime<=R);R=e.unstable_now(),typeof I=="function"?p.callback=I:p===n(d)&&r(d),S(R)}else r(d);p=n(d)}if(p!==null)var ee=!0;else{var Q=n(f);Q!==null&&K(E,Q.startTime-R),ee=!1}return ee}finally{p=null,g=G,x=!1}}var k=!1,T=null,O=-1,D=5,q=-1;function U(){return!(e.unstable_now()-q<D)}function B(){if(T!==null){var V=e.unstable_now();q=V;var R=!0;try{R=T(!0,V)}finally{R?X():(k=!1,T=null)}}else k=!1}var X;if(typeof C=="function")X=function(){C(B)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,M=W.port2;W.port1.onmessage=B,X=function(){M.postMessage(null)}}else X=function(){b(B,0)};function z(V){T=V,k||(k=!0,X())}function K(V,R){O=b(function(){V(e.unstable_now())},R)}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(V){V.callback=null},e.unstable_continueExecution=function(){j||x||(j=!0,z(A))},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(V){switch(g){case 1:case 2:case 3:var R=3;break;default:R=g}var G=g;g=R;try{return V()}finally{g=G}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(V,R){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var G=g;g=V;try{return R()}finally{g=G}},e.unstable_scheduleCallback=function(V,R,G){var $=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?$+G:$):G=$,V){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=G+I,V={id:h++,callback:R,priorityLevel:V,startTime:G,expirationTime:I,sortIndex:-1},G>$?(V.sortIndex=G,t(f,V),n(d)===null&&V===n(f)&&(y?(N(O),O=-1):y=!0,K(E,G-$))):(V.sortIndex=I,t(d,V),j||x||(j=!0,z(A))),V},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(V){var R=g;return function(){var G=g;g=R;try{return V.apply(this,arguments)}finally{g=G}}}})(by)),by}var LE;function _U(){return LE||(LE=1,yy.exports=CU()),yy.exports}var FE;function AU(){if(FE)return qr;FE=1;var e=uN(),t=_U();function n(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,v=1;v<arguments.length;v++)u+="&args[]="+encodeURIComponent(arguments[v]);return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(l,u){o(l,u),o(l+"Capture",u)}function o(l,u){for(s[l]=u,l=0;l<u.length;l++)r.add(u[l])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},p={};function g(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function x(l,u,v,w){if(v!==null&&v.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return w?!1:v!==null?!v.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function j(l,u,v,w){if(u===null||typeof u>"u"||x(l,u,v,w))return!0;if(w)return!1;if(v!==null)switch(v.type){case 3:return!u;case 4:return u===!1;case 5:return isNaN(u);case 6:return isNaN(u)||1>u}return!1}function y(l,u,v,w,_,P,L){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=_,this.mustUseProperty=v,this.propertyName=l,this.type=u,this.sanitizeURL=P,this.removeEmptyString=L}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){b[l]=new y(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var u=l[0];b[u]=new y(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){b[l]=new y(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){b[l]=new y(l,2,!1,l,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(l){b[l]=new y(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){b[l]=new y(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){b[l]=new y(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){b[l]=new y(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){b[l]=new y(l,5,!1,l.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function C(l){return l[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(l){var u=l.replace(N,C);b[u]=new y(u,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var u=l.replace(N,C);b[u]=new y(u,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var u=l.replace(N,C);b[u]=new y(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){b[l]=new y(l,1,!1,l.toLowerCase(),null,!1,!1)}),b.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){b[l]=new y(l,1,!1,l.toLowerCase(),null,!0,!0)});function S(l,u,v,w){var _=b.hasOwnProperty(u)?b[u]:null;(_!==null?_.type!==0:w||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(j(u,v,_,w)&&(v=null),w||_===null?g(u)&&(v===null?l.removeAttribute(u):l.setAttribute(u,""+v)):_.mustUseProperty?l[_.propertyName]=v===null?_.type===3?!1:"":v:(u=_.attributeName,w=_.attributeNamespace,v===null?l.removeAttribute(u):(_=_.type,v=_===3||_===4&&v===!0?"":""+v,w?l.setAttributeNS(w,u,v):l.setAttribute(u,v))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),k=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),q=Symbol.for("react.provider"),U=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),V=Symbol.iterator;function R(l){return l===null||typeof l!="object"?null:(l=V&&l[V]||l["@@iterator"],typeof l=="function"?l:null)}var G=Object.assign,$;function I(l){if($===void 0)try{throw Error()}catch(v){var u=v.stack.trim().match(/\n( *(at )?)/);$=u&&u[1]||""}return`
|
|
2
|
-
`+$+l}var ee=!1;function Q(l,u){if(!l||ee)return"";ee=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(Se){var w=Se}Reflect.construct(l,[],u)}else{try{u.call()}catch(Se){w=Se}l.call(u.prototype)}else{try{throw Error()}catch(Se){w=Se}l()}}catch(Se){if(Se&&w&&typeof Se.stack=="string"){for(var _=Se.stack.split(`
|
|
3
|
-
`),P=w.stack.split(`
|
|
4
|
-
`),L=_.length-1,Z=P.length-1;1<=L&&0<=Z&&_[L]!==P[Z];)Z--;for(;1<=L&&0<=Z;L--,Z--)if(_[L]!==P[Z]){if(L!==1||Z!==1)do if(L--,Z--,0>Z||_[L]!==P[Z]){var ae=`
|
|
5
|
-
`+_[L].replace(" at new "," at ");return l.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",l.displayName)),ae}while(1<=L&&0<=Z);break}}}finally{ee=!1,Error.prepareStackTrace=v}return(l=l?l.displayName||l.name:"")?I(l):""}function ie(l){switch(l.tag){case 5:return I(l.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return l=Q(l.type,!1),l;case 11:return l=Q(l.type.render,!1),l;case 1:return l=Q(l.type,!0),l;default:return""}}function ue(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case T:return"Fragment";case k:return"Portal";case D:return"Profiler";case O:return"StrictMode";case X:return"Suspense";case W:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case U:return(l.displayName||"Context")+".Consumer";case q:return(l._context.displayName||"Context")+".Provider";case B:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case M:return u=l.displayName||null,u!==null?u:ue(l.type)||"Memo";case z:u=l._payload,l=l._init;try{return ue(l(u))}catch{}}return null}function re(l){var u=l.type;switch(l.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=u.render,l=l.displayName||l.name||"",u.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(u);case 8:return u===O?"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 u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function je(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function pe(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function oe(l){var u=pe(l)?"checked":"value",v=Object.getOwnPropertyDescriptor(l.constructor.prototype,u),w=""+l[u];if(!l.hasOwnProperty(u)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var _=v.get,P=v.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return _.call(this)},set:function(L){w=""+L,P.call(this,L)}}),Object.defineProperty(l,u,{enumerable:v.enumerable}),{getValue:function(){return w},setValue:function(L){w=""+L},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function _e(l){l._valueTracker||(l._valueTracker=oe(l))}function ce(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var v=u.getValue(),w="";return l&&(w=pe(l)?l.checked?"true":"false":l.value),l=w,l!==v?(u.setValue(l),!0):!1}function de(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function ve(l,u){var v=u.checked;return G({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??l._wrapperState.initialChecked})}function Pe(l,u){var v=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;v=je(u.value!=null?u.value:v),l._wrapperState={initialChecked:w,initialValue:v,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function F(l,u){u=u.checked,u!=null&&S(l,"checked",u,!1)}function te(l,u){F(l,u);var v=je(u.value),w=u.type;if(v!=null)w==="number"?(v===0&&l.value===""||l.value!=v)&&(l.value=""+v):l.value!==""+v&&(l.value=""+v);else if(w==="submit"||w==="reset"){l.removeAttribute("value");return}u.hasOwnProperty("value")?Ee(l,u.type,v):u.hasOwnProperty("defaultValue")&&Ee(l,u.type,je(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function fe(l,u,v){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var w=u.type;if(!(w!=="submit"&&w!=="reset"||u.value!==void 0&&u.value!==null))return;u=""+l._wrapperState.initialValue,v||u===l.value||(l.value=u),l.defaultValue=u}v=l.name,v!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,v!==""&&(l.name=v)}function Ee(l,u,v){(u!=="number"||de(l.ownerDocument)!==l)&&(v==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+v&&(l.defaultValue=""+v))}var Me=Array.isArray;function et(l,u,v,w){if(l=l.options,u){u={};for(var _=0;_<v.length;_++)u["$"+v[_]]=!0;for(v=0;v<l.length;v++)_=u.hasOwnProperty("$"+l[v].value),l[v].selected!==_&&(l[v].selected=_),_&&w&&(l[v].defaultSelected=!0)}else{for(v=""+je(v),u=null,_=0;_<l.length;_++){if(l[_].value===v){l[_].selected=!0,w&&(l[_].defaultSelected=!0);return}u!==null||l[_].disabled||(u=l[_])}u!==null&&(u.selected=!0)}}function st(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return G({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function xt(l,u){var v=u.value;if(v==null){if(v=u.children,u=u.defaultValue,v!=null){if(u!=null)throw Error(n(92));if(Me(v)){if(1<v.length)throw Error(n(93));v=v[0]}u=v}u==null&&(u=""),v=u}l._wrapperState={initialValue:je(v)}}function qt(l,u){var v=je(u.value),w=je(u.defaultValue);v!=null&&(v=""+v,v!==l.value&&(l.value=v),u.defaultValue==null&&l.defaultValue!==v&&(l.defaultValue=v)),w!=null&&(l.defaultValue=""+w)}function Ut(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function xe(l){switch(l){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 Ye(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?xe(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var he,Te=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,v,w,_){MSApp.execUnsafeLocalFunction(function(){return l(u,v,w,_)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for(he=he||document.createElement("div"),he.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=he.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function Ie(l,u){if(u){var v=l.firstChild;if(v&&v===l.lastChild&&v.nodeType===3){v.nodeValue=u;return}}l.textContent=u}var Ot={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},Ht=["Webkit","ms","Moz","O"];Object.keys(Ot).forEach(function(l){Ht.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),Ot[u]=Ot[l]})});function Ct(l,u,v){return u==null||typeof u=="boolean"||u===""?"":v||typeof u!="number"||u===0||Ot.hasOwnProperty(l)&&Ot[l]?(""+u).trim():u+"px"}function ge(l,u){l=l.style;for(var v in u)if(u.hasOwnProperty(v)){var w=v.indexOf("--")===0,_=Ct(v,u[v],w);v==="float"&&(v="cssFloat"),w?l.setProperty(v,_):l[v]=_}}var qe=G({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 Ve(l,u){if(u){if(qe[l]&&(u.children!=null||u.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(u.dangerouslySetInnerHTML!=null){if(u.children!=null)throw Error(n(60));if(typeof u.dangerouslySetInnerHTML!="object"||!("__html"in u.dangerouslySetInnerHTML))throw Error(n(61))}if(u.style!=null&&typeof u.style!="object")throw Error(n(62))}}function St(l,u){if(l.indexOf("-")===-1)return typeof u.is=="string";switch(l){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 Oe=null;function Ze(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var we=null,at=null,wt=null;function Dt(l){if(l=Vu(l)){if(typeof we!="function")throw Error(n(280));var u=l.stateNode;u&&(u=bp(u),we(l.stateNode,l.type,u))}}function Fn(l){at?wt?wt.push(l):wt=[l]:at=l}function lt(){if(at){var l=at,u=wt;if(wt=at=null,Dt(l),u)for(l=0;l<u.length;l++)Dt(u[l])}}function zt(l,u){return l(u)}function Jt(){}var dn=!1;function mn(l,u,v){if(dn)return l(u,v);dn=!0;try{return zt(l,u,v)}finally{dn=!1,(at!==null||wt!==null)&&(Jt(),lt())}}function Xt(l,u){var v=l.stateNode;if(v===null)return null;var w=bp(v);if(w===null)return null;v=w[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(w=!w.disabled)||(l=l.type,w=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!w;break e;default:l=!1}if(l)return null;if(v&&typeof v!="function")throw Error(n(231,u,typeof v));return v}var ir=!1;if(c)try{var se={};Object.defineProperty(se,"passive",{get:function(){ir=!0}}),window.addEventListener("test",se,se),window.removeEventListener("test",se,se)}catch{ir=!1}function Je(l,u,v,w,_,P,L,Z,ae){var Se=Array.prototype.slice.call(arguments,3);try{u.apply(v,Se)}catch(De){this.onError(De)}}var Nt=!1,ln=null,jt=!1,qn=null,xr={onError:function(l){Nt=!0,ln=l}};function or(l,u,v,w,_,P,L,Z,ae){Nt=!1,ln=null,Je.apply(xr,arguments)}function $r(l,u,v,w,_,P,L,Z,ae){if(or.apply(this,arguments),Nt){if(Nt){var Se=ln;Nt=!1,ln=null}else throw Error(n(198));jt||(jt=!0,qn=Se)}}function Un(l){var u=l,v=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,(u.flags&4098)!==0&&(v=u.return),l=u.return;while(l)}return u.tag===3?v:null}function qs(l){if(l.tag===13){var u=l.memoizedState;if(u===null&&(l=l.alternate,l!==null&&(u=l.memoizedState)),u!==null)return u.dehydrated}return null}function H(l){if(Un(l)!==l)throw Error(n(188))}function ye(l){var u=l.alternate;if(!u){if(u=Un(l),u===null)throw Error(n(188));return u!==l?null:l}for(var v=l,w=u;;){var _=v.return;if(_===null)break;var P=_.alternate;if(P===null){if(w=_.return,w!==null){v=w;continue}break}if(_.child===P.child){for(P=_.child;P;){if(P===v)return H(_),l;if(P===w)return H(_),u;P=P.sibling}throw Error(n(188))}if(v.return!==w.return)v=_,w=P;else{for(var L=!1,Z=_.child;Z;){if(Z===v){L=!0,v=_,w=P;break}if(Z===w){L=!0,w=_,v=P;break}Z=Z.sibling}if(!L){for(Z=P.child;Z;){if(Z===v){L=!0,v=P,w=_;break}if(Z===w){L=!0,w=P,v=_;break}Z=Z.sibling}if(!L)throw Error(n(189))}}if(v.alternate!==w)throw Error(n(190))}if(v.tag!==3)throw Error(n(188));return v.stateNode.current===v?l:u}function Xe(l){return l=ye(l),l!==null?ft(l):null}function ft(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=ft(l);if(u!==null)return u;l=l.sibling}return null}var Vt=t.unstable_scheduleCallback,Kt=t.unstable_cancelCallback,Wn=t.unstable_shouldYield,tn=t.unstable_requestPaint,$e=t.unstable_now,yn=t.unstable_getCurrentPriorityLevel,yt=t.unstable_ImmediatePriority,rn=t.unstable_UserBlockingPriority,ta=t.unstable_NormalPriority,wo=t.unstable_LowPriority,tp=t.unstable_IdlePriority,Us=null,na=null;function Lg(l){if(na&&typeof na.onCommitFiberRoot=="function")try{na.onCommitFiberRoot(Us,l,void 0,(l.current.flags&128)===128)}catch{}}var ra=Math.clz32?Math.clz32:zg,Fg=Math.log,np=Math.LN2;function zg(l){return l>>>=0,l===0?32:31-(Fg(l)/np|0)|0}var Rl=64,Il=4194304;function jo(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function J(l,u){var v=l.pendingLanes;if(v===0)return 0;var w=0,_=l.suspendedLanes,P=l.pingedLanes,L=v&268435455;if(L!==0){var Z=L&~_;Z!==0?w=jo(Z):(P&=L,P!==0&&(w=jo(P)))}else L=v&~_,L!==0?w=jo(L):P!==0&&(w=jo(P));if(w===0)return 0;if(u!==0&&u!==w&&(u&_)===0&&(_=w&-w,P=u&-u,_>=P||_===16&&(P&4194240)!==0))return u;if((w&4)!==0&&(w|=v&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=w;0<u;)v=31-ra(u),_=1<<v,w|=l[v],u&=~_;return w}function Ae(l,u){switch(l){case 1:case 2:case 4:return u+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 u+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 vt(l,u){for(var v=l.suspendedLanes,w=l.pingedLanes,_=l.expirationTimes,P=l.pendingLanes;0<P;){var L=31-ra(P),Z=1<<L,ae=_[L];ae===-1?((Z&v)===0||(Z&w)!==0)&&(_[L]=Ae(Z,u)):ae<=u&&(l.expiredLanes|=Z),P&=~Z}}function Be(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Zt(){var l=Rl;return Rl<<=1,(Rl&4194240)===0&&(Rl=64),l}function $t(l){for(var u=[],v=0;31>v;v++)u.push(l);return u}function fn(l,u,v){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-ra(u),l[u]=v}function yr(l,u){var v=l.pendingLanes&~u;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=u,l.mutableReadLanes&=u,l.entangledLanes&=u,u=l.entanglements;var w=l.eventTimes;for(l=l.expirationTimes;0<v;){var _=31-ra(v),P=1<<_;u[_]=0,w[_]=-1,l[_]=-1,v&=~P}}function vn(l,u){var v=l.entangledLanes|=u;for(l=l.entanglements;v;){var w=31-ra(v),_=1<<w;_&u|l[w]&u&&(l[w]|=u),v&=~_}}var en=0;function Eu(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var rp,So,ap,h_,m_,Bg=!1,sp=[],Ai=null,Ei=null,ki=null,ku=new Map,Pu=new Map,Pi=[],U6="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 v_(l,u){switch(l){case"focusin":case"focusout":Ai=null;break;case"dragenter":case"dragleave":Ei=null;break;case"mouseover":case"mouseout":ki=null;break;case"pointerover":case"pointerout":ku.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pu.delete(u.pointerId)}}function Tu(l,u,v,w,_,P){return l===null||l.nativeEvent!==P?(l={blockedOn:u,domEventName:v,eventSystemFlags:w,nativeEvent:P,targetContainers:[_]},u!==null&&(u=Vu(u),u!==null&&So(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,_!==null&&u.indexOf(_)===-1&&u.push(_),l)}function W6(l,u,v,w,_){switch(u){case"focusin":return Ai=Tu(Ai,l,u,v,w,_),!0;case"dragenter":return Ei=Tu(Ei,l,u,v,w,_),!0;case"mouseover":return ki=Tu(ki,l,u,v,w,_),!0;case"pointerover":var P=_.pointerId;return ku.set(P,Tu(ku.get(P)||null,l,u,v,w,_)),!0;case"gotpointercapture":return P=_.pointerId,Pu.set(P,Tu(Pu.get(P)||null,l,u,v,w,_)),!0}return!1}function g_(l){var u=No(l.target);if(u!==null){var v=Un(u);if(v!==null){if(u=v.tag,u===13){if(u=qs(v),u!==null){l.blockedOn=u,m_(l.priority,function(){ap(v)});return}}else if(u===3&&v.stateNode.current.memoizedState.isDehydrated){l.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}l.blockedOn=null}function ip(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var v=Ug(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(v===null){v=l.nativeEvent;var w=new v.constructor(v.type,v);Oe=w,v.target.dispatchEvent(w),Oe=null}else return u=Vu(v),u!==null&&So(u),l.blockedOn=v,!1;u.shift()}return!0}function x_(l,u,v){ip(l)&&v.delete(u)}function V6(){Bg=!1,Ai!==null&&ip(Ai)&&(Ai=null),Ei!==null&&ip(Ei)&&(Ei=null),ki!==null&&ip(ki)&&(ki=null),ku.forEach(x_),Pu.forEach(x_)}function Ou(l,u){l.blockedOn===u&&(l.blockedOn=null,Bg||(Bg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,V6)))}function Ru(l){function u(_){return Ou(_,l)}if(0<sp.length){Ou(sp[0],l);for(var v=1;v<sp.length;v++){var w=sp[v];w.blockedOn===l&&(w.blockedOn=null)}}for(Ai!==null&&Ou(Ai,l),Ei!==null&&Ou(Ei,l),ki!==null&&Ou(ki,l),ku.forEach(u),Pu.forEach(u),v=0;v<Pi.length;v++)w=Pi[v],w.blockedOn===l&&(w.blockedOn=null);for(;0<Pi.length&&(v=Pi[0],v.blockedOn===null);)g_(v),v.blockedOn===null&&Pi.shift()}var Ml=E.ReactCurrentBatchConfig,op=!0;function H6(l,u,v,w){var _=en,P=Ml.transition;Ml.transition=null;try{en=1,qg(l,u,v,w)}finally{en=_,Ml.transition=P}}function K6(l,u,v,w){var _=en,P=Ml.transition;Ml.transition=null;try{en=4,qg(l,u,v,w)}finally{en=_,Ml.transition=P}}function qg(l,u,v,w){if(op){var _=Ug(l,u,v,w);if(_===null)ix(l,u,w,lp,v),v_(l,w);else if(W6(_,l,u,v,w))w.stopPropagation();else if(v_(l,w),u&4&&-1<U6.indexOf(l)){for(;_!==null;){var P=Vu(_);if(P!==null&&rp(P),P=Ug(l,u,v,w),P===null&&ix(l,u,w,lp,v),P===_)break;_=P}_!==null&&w.stopPropagation()}else ix(l,u,w,null,v)}}var lp=null;function Ug(l,u,v,w){if(lp=null,l=Ze(w),l=No(l),l!==null)if(u=Un(l),u===null)l=null;else if(v=u.tag,v===13){if(l=qs(u),l!==null)return l;l=null}else if(v===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;l=null}else u!==l&&(l=null);return lp=l,null}function y_(l){switch(l){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(yn()){case yt:return 1;case rn:return 4;case ta:case wo:return 16;case tp:return 536870912;default:return 16}default:return 16}}var Ti=null,Wg=null,cp=null;function b_(){if(cp)return cp;var l,u=Wg,v=u.length,w,_="value"in Ti?Ti.value:Ti.textContent,P=_.length;for(l=0;l<v&&u[l]===_[l];l++);var L=v-l;for(w=1;w<=L&&u[v-w]===_[P-w];w++);return cp=_.slice(l,1<w?1-w:void 0)}function up(l){var u=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&u===13&&(l=13)):l=u,l===10&&(l=13),32<=l||l===13?l:0}function dp(){return!0}function w_(){return!1}function aa(l){function u(v,w,_,P,L){this._reactName=v,this._targetInst=_,this.type=w,this.nativeEvent=P,this.target=L,this.currentTarget=null;for(var Z in l)l.hasOwnProperty(Z)&&(v=l[Z],this[Z]=v?v(P):P[Z]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?dp:w_,this.isPropagationStopped=w_,this}return G(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=dp)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=dp)},persist:function(){},isPersistent:dp}),u}var $l={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vg=aa($l),Iu=G({},$l,{view:0,detail:0}),G6=aa(Iu),Hg,Kg,Mu,fp=G({},Iu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yg,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Mu&&(Mu&&l.type==="mousemove"?(Hg=l.screenX-Mu.screenX,Kg=l.screenY-Mu.screenY):Kg=Hg=0,Mu=l),Hg)},movementY:function(l){return"movementY"in l?l.movementY:Kg}}),j_=aa(fp),Y6=G({},fp,{dataTransfer:0}),X6=aa(Y6),Q6=G({},Iu,{relatedTarget:0}),Gg=aa(Q6),J6=G({},$l,{animationName:0,elapsedTime:0,pseudoElement:0}),Z6=aa(J6),eq=G({},$l,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),tq=aa(eq),nq=G({},$l,{data:0}),S_=aa(nq),rq={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aq={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"},sq={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iq(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=sq[l])?!!u[l]:!1}function Yg(){return iq}var oq=G({},Iu,{key:function(l){if(l.key){var u=rq[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=up(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?aq[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yg,charCode:function(l){return l.type==="keypress"?up(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?up(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),lq=aa(oq),cq=G({},fp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),N_=aa(cq),uq=G({},Iu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yg}),dq=aa(uq),fq=G({},$l,{propertyName:0,elapsedTime:0,pseudoElement:0}),pq=aa(fq),hq=G({},fp,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),mq=aa(hq),vq=[9,13,27,32],Xg=c&&"CompositionEvent"in window,$u=null;c&&"documentMode"in document&&($u=document.documentMode);var gq=c&&"TextEvent"in window&&!$u,C_=c&&(!Xg||$u&&8<$u&&11>=$u),__=" ",A_=!1;function E_(l,u){switch(l){case"keyup":return vq.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function k_(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Dl=!1;function xq(l,u){switch(l){case"compositionend":return k_(u);case"keypress":return u.which!==32?null:(A_=!0,__);case"textInput":return l=u.data,l===__&&A_?null:l;default:return null}}function yq(l,u){if(Dl)return l==="compositionend"||!Xg&&E_(l,u)?(l=b_(),cp=Wg=Ti=null,Dl=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return C_&&u.locale!=="ko"?null:u.data;default:return null}}var bq={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 P_(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!bq[l.type]:u==="textarea"}function T_(l,u,v,w){Fn(w),u=gp(u,"onChange"),0<u.length&&(v=new Vg("onChange","change",null,v,w),l.push({event:v,listeners:u}))}var Du=null,Lu=null;function wq(l){Y_(l,0)}function pp(l){var u=ql(l);if(ce(u))return l}function jq(l,u){if(l==="change")return u}var O_=!1;if(c){var Qg;if(c){var Jg="oninput"in document;if(!Jg){var R_=document.createElement("div");R_.setAttribute("oninput","return;"),Jg=typeof R_.oninput=="function"}Qg=Jg}else Qg=!1;O_=Qg&&(!document.documentMode||9<document.documentMode)}function I_(){Du&&(Du.detachEvent("onpropertychange",M_),Lu=Du=null)}function M_(l){if(l.propertyName==="value"&&pp(Lu)){var u=[];T_(u,Lu,l,Ze(l)),mn(wq,u)}}function Sq(l,u,v){l==="focusin"?(I_(),Du=u,Lu=v,Du.attachEvent("onpropertychange",M_)):l==="focusout"&&I_()}function Nq(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return pp(Lu)}function Cq(l,u){if(l==="click")return pp(u)}function _q(l,u){if(l==="input"||l==="change")return pp(u)}function Aq(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Ba=typeof Object.is=="function"?Object.is:Aq;function Fu(l,u){if(Ba(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var v=Object.keys(l),w=Object.keys(u);if(v.length!==w.length)return!1;for(w=0;w<v.length;w++){var _=v[w];if(!d.call(u,_)||!Ba(l[_],u[_]))return!1}return!0}function $_(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function D_(l,u){var v=$_(l);l=0;for(var w;v;){if(v.nodeType===3){if(w=l+v.textContent.length,l<=u&&w>=u)return{node:v,offset:u-l};l=w}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=$_(v)}}function L_(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?L_(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function F_(){for(var l=window,u=de();u instanceof l.HTMLIFrameElement;){try{var v=typeof u.contentWindow.location.href=="string"}catch{v=!1}if(v)l=u.contentWindow;else break;u=de(l.document)}return u}function Zg(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u&&(u==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||u==="textarea"||l.contentEditable==="true")}function Eq(l){var u=F_(),v=l.focusedElem,w=l.selectionRange;if(u!==v&&v&&v.ownerDocument&&L_(v.ownerDocument.documentElement,v)){if(w!==null&&Zg(v)){if(u=w.start,l=w.end,l===void 0&&(l=u),"selectionStart"in v)v.selectionStart=u,v.selectionEnd=Math.min(l,v.value.length);else if(l=(u=v.ownerDocument||document)&&u.defaultView||window,l.getSelection){l=l.getSelection();var _=v.textContent.length,P=Math.min(w.start,_);w=w.end===void 0?P:Math.min(w.end,_),!l.extend&&P>w&&(_=w,w=P,P=_),_=D_(v,P);var L=D_(v,w);_&&L&&(l.rangeCount!==1||l.anchorNode!==_.node||l.anchorOffset!==_.offset||l.focusNode!==L.node||l.focusOffset!==L.offset)&&(u=u.createRange(),u.setStart(_.node,_.offset),l.removeAllRanges(),P>w?(l.addRange(u),l.extend(L.node,L.offset)):(u.setEnd(L.node,L.offset),l.addRange(u)))}}for(u=[],l=v;l=l.parentNode;)l.nodeType===1&&u.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<u.length;v++)l=u[v],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var kq=c&&"documentMode"in document&&11>=document.documentMode,Ll=null,ex=null,zu=null,tx=!1;function z_(l,u,v){var w=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;tx||Ll==null||Ll!==de(w)||(w=Ll,"selectionStart"in w&&Zg(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),zu&&Fu(zu,w)||(zu=w,w=gp(ex,"onSelect"),0<w.length&&(u=new Vg("onSelect","select",null,u,v),l.push({event:u,listeners:w}),u.target=Ll)))}function hp(l,u){var v={};return v[l.toLowerCase()]=u.toLowerCase(),v["Webkit"+l]="webkit"+u,v["Moz"+l]="moz"+u,v}var Fl={animationend:hp("Animation","AnimationEnd"),animationiteration:hp("Animation","AnimationIteration"),animationstart:hp("Animation","AnimationStart"),transitionend:hp("Transition","TransitionEnd")},nx={},B_={};c&&(B_=document.createElement("div").style,"AnimationEvent"in window||(delete Fl.animationend.animation,delete Fl.animationiteration.animation,delete Fl.animationstart.animation),"TransitionEvent"in window||delete Fl.transitionend.transition);function mp(l){if(nx[l])return nx[l];if(!Fl[l])return l;var u=Fl[l],v;for(v in u)if(u.hasOwnProperty(v)&&v in B_)return nx[l]=u[v];return l}var q_=mp("animationend"),U_=mp("animationiteration"),W_=mp("animationstart"),V_=mp("transitionend"),H_=new Map,K_="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 Oi(l,u){H_.set(l,u),i(u,[l])}for(var rx=0;rx<K_.length;rx++){var ax=K_[rx],Pq=ax.toLowerCase(),Tq=ax[0].toUpperCase()+ax.slice(1);Oi(Pq,"on"+Tq)}Oi(q_,"onAnimationEnd"),Oi(U_,"onAnimationIteration"),Oi(W_,"onAnimationStart"),Oi("dblclick","onDoubleClick"),Oi("focusin","onFocus"),Oi("focusout","onBlur"),Oi(V_,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bu="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(" "),Oq=new Set("cancel close invalid load scroll toggle".split(" ").concat(Bu));function G_(l,u,v){var w=l.type||"unknown-event";l.currentTarget=v,$r(w,u,void 0,l),l.currentTarget=null}function Y_(l,u){u=(u&4)!==0;for(var v=0;v<l.length;v++){var w=l[v],_=w.event;w=w.listeners;e:{var P=void 0;if(u)for(var L=w.length-1;0<=L;L--){var Z=w[L],ae=Z.instance,Se=Z.currentTarget;if(Z=Z.listener,ae!==P&&_.isPropagationStopped())break e;G_(_,Z,Se),P=ae}else for(L=0;L<w.length;L++){if(Z=w[L],ae=Z.instance,Se=Z.currentTarget,Z=Z.listener,ae!==P&&_.isPropagationStopped())break e;G_(_,Z,Se),P=ae}}}if(jt)throw l=qn,jt=!1,qn=null,l}function kn(l,u){var v=u[fx];v===void 0&&(v=u[fx]=new Set);var w=l+"__bubble";v.has(w)||(X_(u,l,2,!1),v.add(w))}function sx(l,u,v){var w=0;u&&(w|=4),X_(v,l,w,u)}var vp="_reactListening"+Math.random().toString(36).slice(2);function qu(l){if(!l[vp]){l[vp]=!0,r.forEach(function(v){v!=="selectionchange"&&(Oq.has(v)||sx(v,!1,l),sx(v,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[vp]||(u[vp]=!0,sx("selectionchange",!1,u))}}function X_(l,u,v,w){switch(y_(u)){case 1:var _=H6;break;case 4:_=K6;break;default:_=qg}v=_.bind(null,u,v,l),_=void 0,!ir||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(_=!0),w?_!==void 0?l.addEventListener(u,v,{capture:!0,passive:_}):l.addEventListener(u,v,!0):_!==void 0?l.addEventListener(u,v,{passive:_}):l.addEventListener(u,v,!1)}function ix(l,u,v,w,_){var P=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var L=w.tag;if(L===3||L===4){var Z=w.stateNode.containerInfo;if(Z===_||Z.nodeType===8&&Z.parentNode===_)break;if(L===4)for(L=w.return;L!==null;){var ae=L.tag;if((ae===3||ae===4)&&(ae=L.stateNode.containerInfo,ae===_||ae.nodeType===8&&ae.parentNode===_))return;L=L.return}for(;Z!==null;){if(L=No(Z),L===null)return;if(ae=L.tag,ae===5||ae===6){w=P=L;continue e}Z=Z.parentNode}}w=w.return}mn(function(){var Se=P,De=Ze(v),Fe=[];e:{var Re=H_.get(l);if(Re!==void 0){var rt=Vg,pt=l;switch(l){case"keypress":if(up(v)===0)break e;case"keydown":case"keyup":rt=lq;break;case"focusin":pt="focus",rt=Gg;break;case"focusout":pt="blur",rt=Gg;break;case"beforeblur":case"afterblur":rt=Gg;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":rt=j_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":rt=X6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":rt=dq;break;case q_:case U_:case W_:rt=Z6;break;case V_:rt=pq;break;case"scroll":rt=G6;break;case"wheel":rt=mq;break;case"copy":case"cut":case"paste":rt=tq;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":rt=N_}var mt=(u&4)!==0,Vn=!mt&&l==="scroll",me=mt?Re!==null?Re+"Capture":null:Re;mt=[];for(var le=Se,be;le!==null;){be=le;var Ue=be.stateNode;if(be.tag===5&&Ue!==null&&(be=Ue,me!==null&&(Ue=Xt(le,me),Ue!=null&&mt.push(Uu(le,Ue,be)))),Vn)break;le=le.return}0<mt.length&&(Re=new rt(Re,pt,null,v,De),Fe.push({event:Re,listeners:mt}))}}if((u&7)===0){e:{if(Re=l==="mouseover"||l==="pointerover",rt=l==="mouseout"||l==="pointerout",Re&&v!==Oe&&(pt=v.relatedTarget||v.fromElement)&&(No(pt)||pt[Ws]))break e;if((rt||Re)&&(Re=De.window===De?De:(Re=De.ownerDocument)?Re.defaultView||Re.parentWindow:window,rt?(pt=v.relatedTarget||v.toElement,rt=Se,pt=pt?No(pt):null,pt!==null&&(Vn=Un(pt),pt!==Vn||pt.tag!==5&&pt.tag!==6)&&(pt=null)):(rt=null,pt=Se),rt!==pt)){if(mt=j_,Ue="onMouseLeave",me="onMouseEnter",le="mouse",(l==="pointerout"||l==="pointerover")&&(mt=N_,Ue="onPointerLeave",me="onPointerEnter",le="pointer"),Vn=rt==null?Re:ql(rt),be=pt==null?Re:ql(pt),Re=new mt(Ue,le+"leave",rt,v,De),Re.target=Vn,Re.relatedTarget=be,Ue=null,No(De)===Se&&(mt=new mt(me,le+"enter",pt,v,De),mt.target=be,mt.relatedTarget=Vn,Ue=mt),Vn=Ue,rt&&pt)t:{for(mt=rt,me=pt,le=0,be=mt;be;be=zl(be))le++;for(be=0,Ue=me;Ue;Ue=zl(Ue))be++;for(;0<le-be;)mt=zl(mt),le--;for(;0<be-le;)me=zl(me),be--;for(;le--;){if(mt===me||me!==null&&mt===me.alternate)break t;mt=zl(mt),me=zl(me)}mt=null}else mt=null;rt!==null&&Q_(Fe,Re,rt,mt,!1),pt!==null&&Vn!==null&&Q_(Fe,Vn,pt,mt,!0)}}e:{if(Re=Se?ql(Se):window,rt=Re.nodeName&&Re.nodeName.toLowerCase(),rt==="select"||rt==="input"&&Re.type==="file")var gt=jq;else if(P_(Re))if(O_)gt=_q;else{gt=Nq;var _t=Sq}else(rt=Re.nodeName)&&rt.toLowerCase()==="input"&&(Re.type==="checkbox"||Re.type==="radio")&&(gt=Cq);if(gt&&(gt=gt(l,Se))){T_(Fe,gt,v,De);break e}_t&&_t(l,Re,Se),l==="focusout"&&(_t=Re._wrapperState)&&_t.controlled&&Re.type==="number"&&Ee(Re,"number",Re.value)}switch(_t=Se?ql(Se):window,l){case"focusin":(P_(_t)||_t.contentEditable==="true")&&(Ll=_t,ex=Se,zu=null);break;case"focusout":zu=ex=Ll=null;break;case"mousedown":tx=!0;break;case"contextmenu":case"mouseup":case"dragend":tx=!1,z_(Fe,v,De);break;case"selectionchange":if(kq)break;case"keydown":case"keyup":z_(Fe,v,De)}var At;if(Xg)e:{switch(l){case"compositionstart":var Mt="onCompositionStart";break e;case"compositionend":Mt="onCompositionEnd";break e;case"compositionupdate":Mt="onCompositionUpdate";break e}Mt=void 0}else Dl?E_(l,v)&&(Mt="onCompositionEnd"):l==="keydown"&&v.keyCode===229&&(Mt="onCompositionStart");Mt&&(C_&&v.locale!=="ko"&&(Dl||Mt!=="onCompositionStart"?Mt==="onCompositionEnd"&&Dl&&(At=b_()):(Ti=De,Wg="value"in Ti?Ti.value:Ti.textContent,Dl=!0)),_t=gp(Se,Mt),0<_t.length&&(Mt=new S_(Mt,l,null,v,De),Fe.push({event:Mt,listeners:_t}),At?Mt.data=At:(At=k_(v),At!==null&&(Mt.data=At)))),(At=gq?xq(l,v):yq(l,v))&&(Se=gp(Se,"onBeforeInput"),0<Se.length&&(De=new S_("onBeforeInput","beforeinput",null,v,De),Fe.push({event:De,listeners:Se}),De.data=At))}Y_(Fe,u)})}function Uu(l,u,v){return{instance:l,listener:u,currentTarget:v}}function gp(l,u){for(var v=u+"Capture",w=[];l!==null;){var _=l,P=_.stateNode;_.tag===5&&P!==null&&(_=P,P=Xt(l,v),P!=null&&w.unshift(Uu(l,P,_)),P=Xt(l,u),P!=null&&w.push(Uu(l,P,_))),l=l.return}return w}function zl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Q_(l,u,v,w,_){for(var P=u._reactName,L=[];v!==null&&v!==w;){var Z=v,ae=Z.alternate,Se=Z.stateNode;if(ae!==null&&ae===w)break;Z.tag===5&&Se!==null&&(Z=Se,_?(ae=Xt(v,P),ae!=null&&L.unshift(Uu(v,ae,Z))):_||(ae=Xt(v,P),ae!=null&&L.push(Uu(v,ae,Z)))),v=v.return}L.length!==0&&l.push({event:u,listeners:L})}var Rq=/\r\n?/g,Iq=/\u0000|\uFFFD/g;function J_(l){return(typeof l=="string"?l:""+l).replace(Rq,`
|
|
6
|
-
`).replace(Iq,"")}function xp(l,u,v){if(u=J_(u),J_(l)!==u&&v)throw Error(n(425))}function yp(){}var ox=null,lx=null;function cx(l,u){return l==="textarea"||l==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var ux=typeof setTimeout=="function"?setTimeout:void 0,Mq=typeof clearTimeout=="function"?clearTimeout:void 0,Z_=typeof Promise=="function"?Promise:void 0,$q=typeof queueMicrotask=="function"?queueMicrotask:typeof Z_<"u"?function(l){return Z_.resolve(null).then(l).catch(Dq)}:ux;function Dq(l){setTimeout(function(){throw l})}function dx(l,u){var v=u,w=0;do{var _=v.nextSibling;if(l.removeChild(v),_&&_.nodeType===8)if(v=_.data,v==="/$"){if(w===0){l.removeChild(_),Ru(u);return}w--}else v!=="$"&&v!=="$?"&&v!=="$!"||w++;v=_}while(v);Ru(u)}function Ri(l){for(;l!=null;l=l.nextSibling){var u=l.nodeType;if(u===1||u===3)break;if(u===8){if(u=l.data,u==="$"||u==="$!"||u==="$?")break;if(u==="/$")return null}}return l}function eA(l){l=l.previousSibling;for(var u=0;l;){if(l.nodeType===8){var v=l.data;if(v==="$"||v==="$!"||v==="$?"){if(u===0)return l;u--}else v==="/$"&&u++}l=l.previousSibling}return null}var Bl=Math.random().toString(36).slice(2),vs="__reactFiber$"+Bl,Wu="__reactProps$"+Bl,Ws="__reactContainer$"+Bl,fx="__reactEvents$"+Bl,Lq="__reactListeners$"+Bl,Fq="__reactHandles$"+Bl;function No(l){var u=l[vs];if(u)return u;for(var v=l.parentNode;v;){if(u=v[Ws]||v[vs]){if(v=u.alternate,u.child!==null||v!==null&&v.child!==null)for(l=eA(l);l!==null;){if(v=l[vs])return v;l=eA(l)}return u}l=v,v=l.parentNode}return null}function Vu(l){return l=l[vs]||l[Ws],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function ql(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function bp(l){return l[Wu]||null}var px=[],Ul=-1;function Ii(l){return{current:l}}function Pn(l){0>Ul||(l.current=px[Ul],px[Ul]=null,Ul--)}function Sn(l,u){Ul++,px[Ul]=l.current,l.current=u}var Mi={},br=Ii(Mi),Dr=Ii(!1),Co=Mi;function Wl(l,u){var v=l.type.contextTypes;if(!v)return Mi;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var _={},P;for(P in v)_[P]=u[P];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=_),_}function Lr(l){return l=l.childContextTypes,l!=null}function wp(){Pn(Dr),Pn(br)}function tA(l,u,v){if(br.current!==Mi)throw Error(n(168));Sn(br,u),Sn(Dr,v)}function nA(l,u,v){var w=l.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return v;w=w.getChildContext();for(var _ in w)if(!(_ in u))throw Error(n(108,re(l)||"Unknown",_));return G({},v,w)}function jp(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Mi,Co=br.current,Sn(br,l),Sn(Dr,Dr.current),!0}function rA(l,u,v){var w=l.stateNode;if(!w)throw Error(n(169));v?(l=nA(l,u,Co),w.__reactInternalMemoizedMergedChildContext=l,Pn(Dr),Pn(br),Sn(br,l)):Pn(Dr),Sn(Dr,v)}var Vs=null,Sp=!1,hx=!1;function aA(l){Vs===null?Vs=[l]:Vs.push(l)}function zq(l){Sp=!0,aA(l)}function $i(){if(!hx&&Vs!==null){hx=!0;var l=0,u=en;try{var v=Vs;for(en=1;l<v.length;l++){var w=v[l];do w=w(!0);while(w!==null)}Vs=null,Sp=!1}catch(_){throw Vs!==null&&(Vs=Vs.slice(l+1)),Vt(yt,$i),_}finally{en=u,hx=!1}}return null}var Vl=[],Hl=0,Np=null,Cp=0,wa=[],ja=0,_o=null,Hs=1,Ks="";function Ao(l,u){Vl[Hl++]=Cp,Vl[Hl++]=Np,Np=l,Cp=u}function sA(l,u,v){wa[ja++]=Hs,wa[ja++]=Ks,wa[ja++]=_o,_o=l;var w=Hs;l=Ks;var _=32-ra(w)-1;w&=~(1<<_),v+=1;var P=32-ra(u)+_;if(30<P){var L=_-_%5;P=(w&(1<<L)-1).toString(32),w>>=L,_-=L,Hs=1<<32-ra(u)+_|v<<_|w,Ks=P+l}else Hs=1<<P|v<<_|w,Ks=l}function mx(l){l.return!==null&&(Ao(l,1),sA(l,1,0))}function vx(l){for(;l===Np;)Np=Vl[--Hl],Vl[Hl]=null,Cp=Vl[--Hl],Vl[Hl]=null;for(;l===_o;)_o=wa[--ja],wa[ja]=null,Ks=wa[--ja],wa[ja]=null,Hs=wa[--ja],wa[ja]=null}var sa=null,ia=null,Rn=!1,qa=null;function iA(l,u){var v=_a(5,null,null,0);v.elementType="DELETED",v.stateNode=u,v.return=l,u=l.deletions,u===null?(l.deletions=[v],l.flags|=16):u.push(v)}function oA(l,u){switch(l.tag){case 5:var v=l.type;return u=u.nodeType!==1||v.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(l.stateNode=u,sa=l,ia=Ri(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,sa=l,ia=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(v=_o!==null?{id:Hs,overflow:Ks}:null,l.memoizedState={dehydrated:u,treeContext:v,retryLane:1073741824},v=_a(18,null,null,0),v.stateNode=u,v.return=l,l.child=v,sa=l,ia=null,!0):!1;default:return!1}}function gx(l){return(l.mode&1)!==0&&(l.flags&128)===0}function xx(l){if(Rn){var u=ia;if(u){var v=u;if(!oA(l,u)){if(gx(l))throw Error(n(418));u=Ri(v.nextSibling);var w=sa;u&&oA(l,u)?iA(w,v):(l.flags=l.flags&-4097|2,Rn=!1,sa=l)}}else{if(gx(l))throw Error(n(418));l.flags=l.flags&-4097|2,Rn=!1,sa=l}}}function lA(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;sa=l}function _p(l){if(l!==sa)return!1;if(!Rn)return lA(l),Rn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!cx(l.type,l.memoizedProps)),u&&(u=ia)){if(gx(l))throw cA(),Error(n(418));for(;u;)iA(l,u),u=Ri(u.nextSibling)}if(lA(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,u=0;l;){if(l.nodeType===8){var v=l.data;if(v==="/$"){if(u===0){ia=Ri(l.nextSibling);break e}u--}else v!=="$"&&v!=="$!"&&v!=="$?"||u++}l=l.nextSibling}ia=null}}else ia=sa?Ri(l.stateNode.nextSibling):null;return!0}function cA(){for(var l=ia;l;)l=Ri(l.nextSibling)}function Kl(){ia=sa=null,Rn=!1}function yx(l){qa===null?qa=[l]:qa.push(l)}var Bq=E.ReactCurrentBatchConfig;function Hu(l,u,v){if(l=v.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(n(309));var w=v.stateNode}if(!w)throw Error(n(147,l));var _=w,P=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===P?u.ref:(u=function(L){var Z=_.refs;L===null?delete Z[P]:Z[P]=L},u._stringRef=P,u)}if(typeof l!="string")throw Error(n(284));if(!v._owner)throw Error(n(290,l))}return l}function Ap(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function uA(l){var u=l._init;return u(l._payload)}function dA(l){function u(me,le){if(l){var be=me.deletions;be===null?(me.deletions=[le],me.flags|=16):be.push(le)}}function v(me,le){if(!l)return null;for(;le!==null;)u(me,le),le=le.sibling;return null}function w(me,le){for(me=new Map;le!==null;)le.key!==null?me.set(le.key,le):me.set(le.index,le),le=le.sibling;return me}function _(me,le){return me=Wi(me,le),me.index=0,me.sibling=null,me}function P(me,le,be){return me.index=be,l?(be=me.alternate,be!==null?(be=be.index,be<le?(me.flags|=2,le):be):(me.flags|=2,le)):(me.flags|=1048576,le)}function L(me){return l&&me.alternate===null&&(me.flags|=2),me}function Z(me,le,be,Ue){return le===null||le.tag!==6?(le=uy(be,me.mode,Ue),le.return=me,le):(le=_(le,be),le.return=me,le)}function ae(me,le,be,Ue){var gt=be.type;return gt===T?De(me,le,be.props.children,Ue,be.key):le!==null&&(le.elementType===gt||typeof gt=="object"&>!==null&>.$$typeof===z&&uA(gt)===le.type)?(Ue=_(le,be.props),Ue.ref=Hu(me,le,be),Ue.return=me,Ue):(Ue=Qp(be.type,be.key,be.props,null,me.mode,Ue),Ue.ref=Hu(me,le,be),Ue.return=me,Ue)}function Se(me,le,be,Ue){return le===null||le.tag!==4||le.stateNode.containerInfo!==be.containerInfo||le.stateNode.implementation!==be.implementation?(le=dy(be,me.mode,Ue),le.return=me,le):(le=_(le,be.children||[]),le.return=me,le)}function De(me,le,be,Ue,gt){return le===null||le.tag!==7?(le=Mo(be,me.mode,Ue,gt),le.return=me,le):(le=_(le,be),le.return=me,le)}function Fe(me,le,be){if(typeof le=="string"&&le!==""||typeof le=="number")return le=uy(""+le,me.mode,be),le.return=me,le;if(typeof le=="object"&&le!==null){switch(le.$$typeof){case A:return be=Qp(le.type,le.key,le.props,null,me.mode,be),be.ref=Hu(me,null,le),be.return=me,be;case k:return le=dy(le,me.mode,be),le.return=me,le;case z:var Ue=le._init;return Fe(me,Ue(le._payload),be)}if(Me(le)||R(le))return le=Mo(le,me.mode,be,null),le.return=me,le;Ap(me,le)}return null}function Re(me,le,be,Ue){var gt=le!==null?le.key:null;if(typeof be=="string"&&be!==""||typeof be=="number")return gt!==null?null:Z(me,le,""+be,Ue);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case A:return be.key===gt?ae(me,le,be,Ue):null;case k:return be.key===gt?Se(me,le,be,Ue):null;case z:return gt=be._init,Re(me,le,gt(be._payload),Ue)}if(Me(be)||R(be))return gt!==null?null:De(me,le,be,Ue,null);Ap(me,be)}return null}function rt(me,le,be,Ue,gt){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number")return me=me.get(be)||null,Z(le,me,""+Ue,gt);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case A:return me=me.get(Ue.key===null?be:Ue.key)||null,ae(le,me,Ue,gt);case k:return me=me.get(Ue.key===null?be:Ue.key)||null,Se(le,me,Ue,gt);case z:var _t=Ue._init;return rt(me,le,be,_t(Ue._payload),gt)}if(Me(Ue)||R(Ue))return me=me.get(be)||null,De(le,me,Ue,gt,null);Ap(le,Ue)}return null}function pt(me,le,be,Ue){for(var gt=null,_t=null,At=le,Mt=le=0,ur=null;At!==null&&Mt<be.length;Mt++){At.index>Mt?(ur=At,At=null):ur=At.sibling;var an=Re(me,At,be[Mt],Ue);if(an===null){At===null&&(At=ur);break}l&&At&&an.alternate===null&&u(me,At),le=P(an,le,Mt),_t===null?gt=an:_t.sibling=an,_t=an,At=ur}if(Mt===be.length)return v(me,At),Rn&&Ao(me,Mt),gt;if(At===null){for(;Mt<be.length;Mt++)At=Fe(me,be[Mt],Ue),At!==null&&(le=P(At,le,Mt),_t===null?gt=At:_t.sibling=At,_t=At);return Rn&&Ao(me,Mt),gt}for(At=w(me,At);Mt<be.length;Mt++)ur=rt(At,me,Mt,be[Mt],Ue),ur!==null&&(l&&ur.alternate!==null&&At.delete(ur.key===null?Mt:ur.key),le=P(ur,le,Mt),_t===null?gt=ur:_t.sibling=ur,_t=ur);return l&&At.forEach(function(Vi){return u(me,Vi)}),Rn&&Ao(me,Mt),gt}function mt(me,le,be,Ue){var gt=R(be);if(typeof gt!="function")throw Error(n(150));if(be=gt.call(be),be==null)throw Error(n(151));for(var _t=gt=null,At=le,Mt=le=0,ur=null,an=be.next();At!==null&&!an.done;Mt++,an=be.next()){At.index>Mt?(ur=At,At=null):ur=At.sibling;var Vi=Re(me,At,an.value,Ue);if(Vi===null){At===null&&(At=ur);break}l&&At&&Vi.alternate===null&&u(me,At),le=P(Vi,le,Mt),_t===null?gt=Vi:_t.sibling=Vi,_t=Vi,At=ur}if(an.done)return v(me,At),Rn&&Ao(me,Mt),gt;if(At===null){for(;!an.done;Mt++,an=be.next())an=Fe(me,an.value,Ue),an!==null&&(le=P(an,le,Mt),_t===null?gt=an:_t.sibling=an,_t=an);return Rn&&Ao(me,Mt),gt}for(At=w(me,At);!an.done;Mt++,an=be.next())an=rt(At,me,Mt,an.value,Ue),an!==null&&(l&&an.alternate!==null&&At.delete(an.key===null?Mt:an.key),le=P(an,le,Mt),_t===null?gt=an:_t.sibling=an,_t=an);return l&&At.forEach(function(bU){return u(me,bU)}),Rn&&Ao(me,Mt),gt}function Vn(me,le,be,Ue){if(typeof be=="object"&&be!==null&&be.type===T&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case A:e:{for(var gt=be.key,_t=le;_t!==null;){if(_t.key===gt){if(gt=be.type,gt===T){if(_t.tag===7){v(me,_t.sibling),le=_(_t,be.props.children),le.return=me,me=le;break e}}else if(_t.elementType===gt||typeof gt=="object"&>!==null&>.$$typeof===z&&uA(gt)===_t.type){v(me,_t.sibling),le=_(_t,be.props),le.ref=Hu(me,_t,be),le.return=me,me=le;break e}v(me,_t);break}else u(me,_t);_t=_t.sibling}be.type===T?(le=Mo(be.props.children,me.mode,Ue,be.key),le.return=me,me=le):(Ue=Qp(be.type,be.key,be.props,null,me.mode,Ue),Ue.ref=Hu(me,le,be),Ue.return=me,me=Ue)}return L(me);case k:e:{for(_t=be.key;le!==null;){if(le.key===_t)if(le.tag===4&&le.stateNode.containerInfo===be.containerInfo&&le.stateNode.implementation===be.implementation){v(me,le.sibling),le=_(le,be.children||[]),le.return=me,me=le;break e}else{v(me,le);break}else u(me,le);le=le.sibling}le=dy(be,me.mode,Ue),le.return=me,me=le}return L(me);case z:return _t=be._init,Vn(me,le,_t(be._payload),Ue)}if(Me(be))return pt(me,le,be,Ue);if(R(be))return mt(me,le,be,Ue);Ap(me,be)}return typeof be=="string"&&be!==""||typeof be=="number"?(be=""+be,le!==null&&le.tag===6?(v(me,le.sibling),le=_(le,be),le.return=me,me=le):(v(me,le),le=uy(be,me.mode,Ue),le.return=me,me=le),L(me)):v(me,le)}return Vn}var Gl=dA(!0),fA=dA(!1),Ep=Ii(null),kp=null,Yl=null,bx=null;function wx(){bx=Yl=kp=null}function jx(l){var u=Ep.current;Pn(Ep),l._currentValue=u}function Sx(l,u,v){for(;l!==null;){var w=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,w!==null&&(w.childLanes|=u)):w!==null&&(w.childLanes&u)!==u&&(w.childLanes|=u),l===v)break;l=l.return}}function Xl(l,u){kp=l,bx=Yl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(Fr=!0),l.firstContext=null)}function Sa(l){var u=l._currentValue;if(bx!==l)if(l={context:l,memoizedValue:u,next:null},Yl===null){if(kp===null)throw Error(n(308));Yl=l,kp.dependencies={lanes:0,firstContext:l}}else Yl=Yl.next=l;return u}var Eo=null;function Nx(l){Eo===null?Eo=[l]:Eo.push(l)}function pA(l,u,v,w){var _=u.interleaved;return _===null?(v.next=v,Nx(u)):(v.next=_.next,_.next=v),u.interleaved=v,Gs(l,w)}function Gs(l,u){l.lanes|=u;var v=l.alternate;for(v!==null&&(v.lanes|=u),v=l,l=l.return;l!==null;)l.childLanes|=u,v=l.alternate,v!==null&&(v.childLanes|=u),v=l,l=l.return;return v.tag===3?v.stateNode:null}var Di=!1;function Cx(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hA(l,u){l=l.updateQueue,u.updateQueue===l&&(u.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Ys(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function Li(l,u,v){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(nn&2)!==0){var _=w.pending;return _===null?u.next=u:(u.next=_.next,_.next=u),w.pending=u,Gs(l,v)}return _=w.interleaved,_===null?(u.next=u,Nx(w)):(u.next=_.next,_.next=u),w.interleaved=u,Gs(l,v)}function Pp(l,u,v){if(u=u.updateQueue,u!==null&&(u=u.shared,(v&4194240)!==0)){var w=u.lanes;w&=l.pendingLanes,v|=w,u.lanes=v,vn(l,v)}}function mA(l,u){var v=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,v===w)){var _=null,P=null;if(v=v.firstBaseUpdate,v!==null){do{var L={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};P===null?_=P=L:P=P.next=L,v=v.next}while(v!==null);P===null?_=P=u:P=P.next=u}else _=P=u;v={baseState:w.baseState,firstBaseUpdate:_,lastBaseUpdate:P,shared:w.shared,effects:w.effects},l.updateQueue=v;return}l=v.lastBaseUpdate,l===null?v.firstBaseUpdate=u:l.next=u,v.lastBaseUpdate=u}function Tp(l,u,v,w){var _=l.updateQueue;Di=!1;var P=_.firstBaseUpdate,L=_.lastBaseUpdate,Z=_.shared.pending;if(Z!==null){_.shared.pending=null;var ae=Z,Se=ae.next;ae.next=null,L===null?P=Se:L.next=Se,L=ae;var De=l.alternate;De!==null&&(De=De.updateQueue,Z=De.lastBaseUpdate,Z!==L&&(Z===null?De.firstBaseUpdate=Se:Z.next=Se,De.lastBaseUpdate=ae))}if(P!==null){var Fe=_.baseState;L=0,De=Se=ae=null,Z=P;do{var Re=Z.lane,rt=Z.eventTime;if((w&Re)===Re){De!==null&&(De=De.next={eventTime:rt,lane:0,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null});e:{var pt=l,mt=Z;switch(Re=u,rt=v,mt.tag){case 1:if(pt=mt.payload,typeof pt=="function"){Fe=pt.call(rt,Fe,Re);break e}Fe=pt;break e;case 3:pt.flags=pt.flags&-65537|128;case 0:if(pt=mt.payload,Re=typeof pt=="function"?pt.call(rt,Fe,Re):pt,Re==null)break e;Fe=G({},Fe,Re);break e;case 2:Di=!0}}Z.callback!==null&&Z.lane!==0&&(l.flags|=64,Re=_.effects,Re===null?_.effects=[Z]:Re.push(Z))}else rt={eventTime:rt,lane:Re,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},De===null?(Se=De=rt,ae=Fe):De=De.next=rt,L|=Re;if(Z=Z.next,Z===null){if(Z=_.shared.pending,Z===null)break;Re=Z,Z=Re.next,Re.next=null,_.lastBaseUpdate=Re,_.shared.pending=null}}while(!0);if(De===null&&(ae=Fe),_.baseState=ae,_.firstBaseUpdate=Se,_.lastBaseUpdate=De,u=_.shared.interleaved,u!==null){_=u;do L|=_.lane,_=_.next;while(_!==u)}else P===null&&(_.shared.lanes=0);To|=L,l.lanes=L,l.memoizedState=Fe}}function vA(l,u,v){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var w=l[u],_=w.callback;if(_!==null){if(w.callback=null,w=v,typeof _!="function")throw Error(n(191,_));_.call(w)}}}var Ku={},gs=Ii(Ku),Gu=Ii(Ku),Yu=Ii(Ku);function ko(l){if(l===Ku)throw Error(n(174));return l}function _x(l,u){switch(Sn(Yu,u),Sn(Gu,l),Sn(gs,Ku),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Ye(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=Ye(u,l)}Pn(gs),Sn(gs,u)}function Ql(){Pn(gs),Pn(Gu),Pn(Yu)}function gA(l){ko(Yu.current);var u=ko(gs.current),v=Ye(u,l.type);u!==v&&(Sn(Gu,l),Sn(gs,v))}function Ax(l){Gu.current===l&&(Pn(gs),Pn(Gu))}var Mn=Ii(0);function Op(l){for(var u=l;u!==null;){if(u.tag===13){var v=u.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||v.data==="$?"||v.data==="$!"))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Ex=[];function kx(){for(var l=0;l<Ex.length;l++)Ex[l]._workInProgressVersionPrimary=null;Ex.length=0}var Rp=E.ReactCurrentDispatcher,Px=E.ReactCurrentBatchConfig,Po=0,$n=null,Qn=null,lr=null,Ip=!1,Xu=!1,Qu=0,qq=0;function wr(){throw Error(n(321))}function Tx(l,u){if(u===null)return!1;for(var v=0;v<u.length&&v<l.length;v++)if(!Ba(l[v],u[v]))return!1;return!0}function Ox(l,u,v,w,_,P){if(Po=P,$n=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,Rp.current=l===null||l.memoizedState===null?Hq:Kq,l=v(w,_),Xu){P=0;do{if(Xu=!1,Qu=0,25<=P)throw Error(n(301));P+=1,lr=Qn=null,u.updateQueue=null,Rp.current=Gq,l=v(w,_)}while(Xu)}if(Rp.current=Dp,u=Qn!==null&&Qn.next!==null,Po=0,lr=Qn=$n=null,Ip=!1,u)throw Error(n(300));return l}function Rx(){var l=Qu!==0;return Qu=0,l}function xs(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lr===null?$n.memoizedState=lr=l:lr=lr.next=l,lr}function Na(){if(Qn===null){var l=$n.alternate;l=l!==null?l.memoizedState:null}else l=Qn.next;var u=lr===null?$n.memoizedState:lr.next;if(u!==null)lr=u,Qn=l;else{if(l===null)throw Error(n(310));Qn=l,l={memoizedState:Qn.memoizedState,baseState:Qn.baseState,baseQueue:Qn.baseQueue,queue:Qn.queue,next:null},lr===null?$n.memoizedState=lr=l:lr=lr.next=l}return lr}function Ju(l,u){return typeof u=="function"?u(l):u}function Ix(l){var u=Na(),v=u.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=l;var w=Qn,_=w.baseQueue,P=v.pending;if(P!==null){if(_!==null){var L=_.next;_.next=P.next,P.next=L}w.baseQueue=_=P,v.pending=null}if(_!==null){P=_.next,w=w.baseState;var Z=L=null,ae=null,Se=P;do{var De=Se.lane;if((Po&De)===De)ae!==null&&(ae=ae.next={lane:0,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null}),w=Se.hasEagerState?Se.eagerState:l(w,Se.action);else{var Fe={lane:De,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null};ae===null?(Z=ae=Fe,L=w):ae=ae.next=Fe,$n.lanes|=De,To|=De}Se=Se.next}while(Se!==null&&Se!==P);ae===null?L=w:ae.next=Z,Ba(w,u.memoizedState)||(Fr=!0),u.memoizedState=w,u.baseState=L,u.baseQueue=ae,v.lastRenderedState=w}if(l=v.interleaved,l!==null){_=l;do P=_.lane,$n.lanes|=P,To|=P,_=_.next;while(_!==l)}else _===null&&(v.lanes=0);return[u.memoizedState,v.dispatch]}function Mx(l){var u=Na(),v=u.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=l;var w=v.dispatch,_=v.pending,P=u.memoizedState;if(_!==null){v.pending=null;var L=_=_.next;do P=l(P,L.action),L=L.next;while(L!==_);Ba(P,u.memoizedState)||(Fr=!0),u.memoizedState=P,u.baseQueue===null&&(u.baseState=P),v.lastRenderedState=P}return[P,w]}function xA(){}function yA(l,u){var v=$n,w=Na(),_=u(),P=!Ba(w.memoizedState,_);if(P&&(w.memoizedState=_,Fr=!0),w=w.queue,$x(jA.bind(null,v,w,l),[l]),w.getSnapshot!==u||P||lr!==null&&lr.memoizedState.tag&1){if(v.flags|=2048,Zu(9,wA.bind(null,v,w,_,u),void 0,null),cr===null)throw Error(n(349));(Po&30)!==0||bA(v,u,_)}return _}function bA(l,u,v){l.flags|=16384,l={getSnapshot:u,value:v},u=$n.updateQueue,u===null?(u={lastEffect:null,stores:null},$n.updateQueue=u,u.stores=[l]):(v=u.stores,v===null?u.stores=[l]:v.push(l))}function wA(l,u,v,w){u.value=v,u.getSnapshot=w,SA(u)&&NA(l)}function jA(l,u,v){return v(function(){SA(u)&&NA(l)})}function SA(l){var u=l.getSnapshot;l=l.value;try{var v=u();return!Ba(l,v)}catch{return!0}}function NA(l){var u=Gs(l,1);u!==null&&Ha(u,l,1,-1)}function CA(l){var u=xs();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ju,lastRenderedState:l},u.queue=l,l=l.dispatch=Vq.bind(null,$n,l),[u.memoizedState,l]}function Zu(l,u,v,w){return l={tag:l,create:u,destroy:v,deps:w,next:null},u=$n.updateQueue,u===null?(u={lastEffect:null,stores:null},$n.updateQueue=u,u.lastEffect=l.next=l):(v=u.lastEffect,v===null?u.lastEffect=l.next=l:(w=v.next,v.next=l,l.next=w,u.lastEffect=l)),l}function _A(){return Na().memoizedState}function Mp(l,u,v,w){var _=xs();$n.flags|=l,_.memoizedState=Zu(1|u,v,void 0,w===void 0?null:w)}function $p(l,u,v,w){var _=Na();w=w===void 0?null:w;var P=void 0;if(Qn!==null){var L=Qn.memoizedState;if(P=L.destroy,w!==null&&Tx(w,L.deps)){_.memoizedState=Zu(u,v,P,w);return}}$n.flags|=l,_.memoizedState=Zu(1|u,v,P,w)}function AA(l,u){return Mp(8390656,8,l,u)}function $x(l,u){return $p(2048,8,l,u)}function EA(l,u){return $p(4,2,l,u)}function kA(l,u){return $p(4,4,l,u)}function PA(l,u){if(typeof u=="function")return l=l(),u(l),function(){u(null)};if(u!=null)return l=l(),u.current=l,function(){u.current=null}}function TA(l,u,v){return v=v!=null?v.concat([l]):null,$p(4,4,PA.bind(null,u,l),v)}function Dx(){}function OA(l,u){var v=Na();u=u===void 0?null:u;var w=v.memoizedState;return w!==null&&u!==null&&Tx(u,w[1])?w[0]:(v.memoizedState=[l,u],l)}function RA(l,u){var v=Na();u=u===void 0?null:u;var w=v.memoizedState;return w!==null&&u!==null&&Tx(u,w[1])?w[0]:(l=l(),v.memoizedState=[l,u],l)}function IA(l,u,v){return(Po&21)===0?(l.baseState&&(l.baseState=!1,Fr=!0),l.memoizedState=v):(Ba(v,u)||(v=Zt(),$n.lanes|=v,To|=v,l.baseState=!0),u)}function Uq(l,u){var v=en;en=v!==0&&4>v?v:4,l(!0);var w=Px.transition;Px.transition={};try{l(!1),u()}finally{en=v,Px.transition=w}}function MA(){return Na().memoizedState}function Wq(l,u,v){var w=qi(l);if(v={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null},$A(l))DA(u,v);else if(v=pA(l,u,v,w),v!==null){var _=Ar();Ha(v,l,w,_),LA(v,u,w)}}function Vq(l,u,v){var w=qi(l),_={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null};if($A(l))DA(u,_);else{var P=l.alternate;if(l.lanes===0&&(P===null||P.lanes===0)&&(P=u.lastRenderedReducer,P!==null))try{var L=u.lastRenderedState,Z=P(L,v);if(_.hasEagerState=!0,_.eagerState=Z,Ba(Z,L)){var ae=u.interleaved;ae===null?(_.next=_,Nx(u)):(_.next=ae.next,ae.next=_),u.interleaved=_;return}}catch{}v=pA(l,u,_,w),v!==null&&(_=Ar(),Ha(v,l,w,_),LA(v,u,w))}}function $A(l){var u=l.alternate;return l===$n||u!==null&&u===$n}function DA(l,u){Xu=Ip=!0;var v=l.pending;v===null?u.next=u:(u.next=v.next,v.next=u),l.pending=u}function LA(l,u,v){if((v&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,v|=w,u.lanes=v,vn(l,v)}}var Dp={readContext:Sa,useCallback:wr,useContext:wr,useEffect:wr,useImperativeHandle:wr,useInsertionEffect:wr,useLayoutEffect:wr,useMemo:wr,useReducer:wr,useRef:wr,useState:wr,useDebugValue:wr,useDeferredValue:wr,useTransition:wr,useMutableSource:wr,useSyncExternalStore:wr,useId:wr,unstable_isNewReconciler:!1},Hq={readContext:Sa,useCallback:function(l,u){return xs().memoizedState=[l,u===void 0?null:u],l},useContext:Sa,useEffect:AA,useImperativeHandle:function(l,u,v){return v=v!=null?v.concat([l]):null,Mp(4194308,4,PA.bind(null,u,l),v)},useLayoutEffect:function(l,u){return Mp(4194308,4,l,u)},useInsertionEffect:function(l,u){return Mp(4,2,l,u)},useMemo:function(l,u){var v=xs();return u=u===void 0?null:u,l=l(),v.memoizedState=[l,u],l},useReducer:function(l,u,v){var w=xs();return u=v!==void 0?v(u):u,w.memoizedState=w.baseState=u,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},w.queue=l,l=l.dispatch=Wq.bind(null,$n,l),[w.memoizedState,l]},useRef:function(l){var u=xs();return l={current:l},u.memoizedState=l},useState:CA,useDebugValue:Dx,useDeferredValue:function(l){return xs().memoizedState=l},useTransition:function(){var l=CA(!1),u=l[0];return l=Uq.bind(null,l[1]),xs().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,v){var w=$n,_=xs();if(Rn){if(v===void 0)throw Error(n(407));v=v()}else{if(v=u(),cr===null)throw Error(n(349));(Po&30)!==0||bA(w,u,v)}_.memoizedState=v;var P={value:v,getSnapshot:u};return _.queue=P,AA(jA.bind(null,w,P,l),[l]),w.flags|=2048,Zu(9,wA.bind(null,w,P,v,u),void 0,null),v},useId:function(){var l=xs(),u=cr.identifierPrefix;if(Rn){var v=Ks,w=Hs;v=(w&~(1<<32-ra(w)-1)).toString(32)+v,u=":"+u+"R"+v,v=Qu++,0<v&&(u+="H"+v.toString(32)),u+=":"}else v=qq++,u=":"+u+"r"+v.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},Kq={readContext:Sa,useCallback:OA,useContext:Sa,useEffect:$x,useImperativeHandle:TA,useInsertionEffect:EA,useLayoutEffect:kA,useMemo:RA,useReducer:Ix,useRef:_A,useState:function(){return Ix(Ju)},useDebugValue:Dx,useDeferredValue:function(l){var u=Na();return IA(u,Qn.memoizedState,l)},useTransition:function(){var l=Ix(Ju)[0],u=Na().memoizedState;return[l,u]},useMutableSource:xA,useSyncExternalStore:yA,useId:MA,unstable_isNewReconciler:!1},Gq={readContext:Sa,useCallback:OA,useContext:Sa,useEffect:$x,useImperativeHandle:TA,useInsertionEffect:EA,useLayoutEffect:kA,useMemo:RA,useReducer:Mx,useRef:_A,useState:function(){return Mx(Ju)},useDebugValue:Dx,useDeferredValue:function(l){var u=Na();return Qn===null?u.memoizedState=l:IA(u,Qn.memoizedState,l)},useTransition:function(){var l=Mx(Ju)[0],u=Na().memoizedState;return[l,u]},useMutableSource:xA,useSyncExternalStore:yA,useId:MA,unstable_isNewReconciler:!1};function Ua(l,u){if(l&&l.defaultProps){u=G({},u),l=l.defaultProps;for(var v in l)u[v]===void 0&&(u[v]=l[v]);return u}return u}function Lx(l,u,v,w){u=l.memoizedState,v=v(w,u),v=v==null?u:G({},u,v),l.memoizedState=v,l.lanes===0&&(l.updateQueue.baseState=v)}var Lp={isMounted:function(l){return(l=l._reactInternals)?Un(l)===l:!1},enqueueSetState:function(l,u,v){l=l._reactInternals;var w=Ar(),_=qi(l),P=Ys(w,_);P.payload=u,v!=null&&(P.callback=v),u=Li(l,P,_),u!==null&&(Ha(u,l,_,w),Pp(u,l,_))},enqueueReplaceState:function(l,u,v){l=l._reactInternals;var w=Ar(),_=qi(l),P=Ys(w,_);P.tag=1,P.payload=u,v!=null&&(P.callback=v),u=Li(l,P,_),u!==null&&(Ha(u,l,_,w),Pp(u,l,_))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var v=Ar(),w=qi(l),_=Ys(v,w);_.tag=2,u!=null&&(_.callback=u),u=Li(l,_,w),u!==null&&(Ha(u,l,w,v),Pp(u,l,w))}};function FA(l,u,v,w,_,P,L){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,P,L):u.prototype&&u.prototype.isPureReactComponent?!Fu(v,w)||!Fu(_,P):!0}function zA(l,u,v){var w=!1,_=Mi,P=u.contextType;return typeof P=="object"&&P!==null?P=Sa(P):(_=Lr(u)?Co:br.current,w=u.contextTypes,P=(w=w!=null)?Wl(l,_):Mi),u=new u(v,P),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Lp,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=_,l.__reactInternalMemoizedMaskedChildContext=P),u}function BA(l,u,v,w){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(v,w),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(v,w),u.state!==l&&Lp.enqueueReplaceState(u,u.state,null)}function Fx(l,u,v,w){var _=l.stateNode;_.props=v,_.state=l.memoizedState,_.refs={},Cx(l);var P=u.contextType;typeof P=="object"&&P!==null?_.context=Sa(P):(P=Lr(u)?Co:br.current,_.context=Wl(l,P)),_.state=l.memoizedState,P=u.getDerivedStateFromProps,typeof P=="function"&&(Lx(l,u,P,v),_.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(u=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),u!==_.state&&Lp.enqueueReplaceState(_,_.state,null),Tp(l,v,_,w),_.state=l.memoizedState),typeof _.componentDidMount=="function"&&(l.flags|=4194308)}function Jl(l,u){try{var v="",w=u;do v+=ie(w),w=w.return;while(w);var _=v}catch(P){_=`
|
|
7
|
-
Error generating stack: `+P.message+`
|
|
8
|
-
`+P.stack}return{value:l,source:u,stack:_,digest:null}}function zx(l,u,v){return{value:l,source:null,stack:v??null,digest:u??null}}function Bx(l,u){try{console.error(u.value)}catch(v){setTimeout(function(){throw v})}}var Yq=typeof WeakMap=="function"?WeakMap:Map;function qA(l,u,v){v=Ys(-1,v),v.tag=3,v.payload={element:null};var w=u.value;return v.callback=function(){Vp||(Vp=!0,ny=w),Bx(l,u)},v}function UA(l,u,v){v=Ys(-1,v),v.tag=3;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var _=u.value;v.payload=function(){return w(_)},v.callback=function(){Bx(l,u)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(v.callback=function(){Bx(l,u),typeof w!="function"&&(zi===null?zi=new Set([this]):zi.add(this));var L=u.stack;this.componentDidCatch(u.value,{componentStack:L!==null?L:""})}),v}function WA(l,u,v){var w=l.pingCache;if(w===null){w=l.pingCache=new Yq;var _=new Set;w.set(u,_)}else _=w.get(u),_===void 0&&(_=new Set,w.set(u,_));_.has(v)||(_.add(v),l=cU.bind(null,l,u,v),u.then(l,l))}function VA(l){do{var u;if((u=l.tag===13)&&(u=l.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return l;l=l.return}while(l!==null);return null}function HA(l,u,v,w,_){return(l.mode&1)===0?(l===u?l.flags|=65536:(l.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(u=Ys(-1,1),u.tag=2,Li(v,u,1))),v.lanes|=1),l):(l.flags|=65536,l.lanes=_,l)}var Xq=E.ReactCurrentOwner,Fr=!1;function _r(l,u,v,w){u.child=l===null?fA(u,null,v,w):Gl(u,l.child,v,w)}function KA(l,u,v,w,_){v=v.render;var P=u.ref;return Xl(u,_),w=Ox(l,u,v,w,P,_),v=Rx(),l!==null&&!Fr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~_,Xs(l,u,_)):(Rn&&v&&mx(u),u.flags|=1,_r(l,u,w,_),u.child)}function GA(l,u,v,w,_){if(l===null){var P=v.type;return typeof P=="function"&&!cy(P)&&P.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(u.tag=15,u.type=P,YA(l,u,P,w,_)):(l=Qp(v.type,null,w,u,u.mode,_),l.ref=u.ref,l.return=u,u.child=l)}if(P=l.child,(l.lanes&_)===0){var L=P.memoizedProps;if(v=v.compare,v=v!==null?v:Fu,v(L,w)&&l.ref===u.ref)return Xs(l,u,_)}return u.flags|=1,l=Wi(P,w),l.ref=u.ref,l.return=u,u.child=l}function YA(l,u,v,w,_){if(l!==null){var P=l.memoizedProps;if(Fu(P,w)&&l.ref===u.ref)if(Fr=!1,u.pendingProps=w=P,(l.lanes&_)!==0)(l.flags&131072)!==0&&(Fr=!0);else return u.lanes=l.lanes,Xs(l,u,_)}return qx(l,u,v,w,_)}function XA(l,u,v){var w=u.pendingProps,_=w.children,P=l!==null?l.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},Sn(ec,oa),oa|=v;else{if((v&1073741824)===0)return l=P!==null?P.baseLanes|v:v,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,Sn(ec,oa),oa|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=P!==null?P.baseLanes:v,Sn(ec,oa),oa|=w}else P!==null?(w=P.baseLanes|v,u.memoizedState=null):w=v,Sn(ec,oa),oa|=w;return _r(l,u,_,v),u.child}function QA(l,u){var v=u.ref;(l===null&&v!==null||l!==null&&l.ref!==v)&&(u.flags|=512,u.flags|=2097152)}function qx(l,u,v,w,_){var P=Lr(v)?Co:br.current;return P=Wl(u,P),Xl(u,_),v=Ox(l,u,v,w,P,_),w=Rx(),l!==null&&!Fr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~_,Xs(l,u,_)):(Rn&&w&&mx(u),u.flags|=1,_r(l,u,v,_),u.child)}function JA(l,u,v,w,_){if(Lr(v)){var P=!0;jp(u)}else P=!1;if(Xl(u,_),u.stateNode===null)zp(l,u),zA(u,v,w),Fx(u,v,w,_),w=!0;else if(l===null){var L=u.stateNode,Z=u.memoizedProps;L.props=Z;var ae=L.context,Se=v.contextType;typeof Se=="object"&&Se!==null?Se=Sa(Se):(Se=Lr(v)?Co:br.current,Se=Wl(u,Se));var De=v.getDerivedStateFromProps,Fe=typeof De=="function"||typeof L.getSnapshotBeforeUpdate=="function";Fe||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(Z!==w||ae!==Se)&&BA(u,L,w,Se),Di=!1;var Re=u.memoizedState;L.state=Re,Tp(u,w,L,_),ae=u.memoizedState,Z!==w||Re!==ae||Dr.current||Di?(typeof De=="function"&&(Lx(u,v,De,w),ae=u.memoizedState),(Z=Di||FA(u,v,Z,w,Re,ae,Se))?(Fe||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(u.flags|=4194308)):(typeof L.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=ae),L.props=w,L.state=ae,L.context=Se,w=Z):(typeof L.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{L=u.stateNode,hA(l,u),Z=u.memoizedProps,Se=u.type===u.elementType?Z:Ua(u.type,Z),L.props=Se,Fe=u.pendingProps,Re=L.context,ae=v.contextType,typeof ae=="object"&&ae!==null?ae=Sa(ae):(ae=Lr(v)?Co:br.current,ae=Wl(u,ae));var rt=v.getDerivedStateFromProps;(De=typeof rt=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(Z!==Fe||Re!==ae)&&BA(u,L,w,ae),Di=!1,Re=u.memoizedState,L.state=Re,Tp(u,w,L,_);var pt=u.memoizedState;Z!==Fe||Re!==pt||Dr.current||Di?(typeof rt=="function"&&(Lx(u,v,rt,w),pt=u.memoizedState),(Se=Di||FA(u,v,Se,w,Re,pt,ae)||!1)?(De||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(w,pt,ae),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(w,pt,ae)),typeof L.componentDidUpdate=="function"&&(u.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof L.componentDidUpdate!="function"||Z===l.memoizedProps&&Re===l.memoizedState||(u.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||Z===l.memoizedProps&&Re===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=pt),L.props=w,L.state=pt,L.context=ae,w=Se):(typeof L.componentDidUpdate!="function"||Z===l.memoizedProps&&Re===l.memoizedState||(u.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||Z===l.memoizedProps&&Re===l.memoizedState||(u.flags|=1024),w=!1)}return Ux(l,u,v,w,P,_)}function Ux(l,u,v,w,_,P){QA(l,u);var L=(u.flags&128)!==0;if(!w&&!L)return _&&rA(u,v,!1),Xs(l,u,P);w=u.stateNode,Xq.current=u;var Z=L&&typeof v.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&L?(u.child=Gl(u,l.child,null,P),u.child=Gl(u,null,Z,P)):_r(l,u,Z,P),u.memoizedState=w.state,_&&rA(u,v,!0),u.child}function ZA(l){var u=l.stateNode;u.pendingContext?tA(l,u.pendingContext,u.pendingContext!==u.context):u.context&&tA(l,u.context,!1),_x(l,u.containerInfo)}function eE(l,u,v,w,_){return Kl(),yx(_),u.flags|=256,_r(l,u,v,w),u.child}var Wx={dehydrated:null,treeContext:null,retryLane:0};function Vx(l){return{baseLanes:l,cachePool:null,transitions:null}}function tE(l,u,v){var w=u.pendingProps,_=Mn.current,P=!1,L=(u.flags&128)!==0,Z;if((Z=L)||(Z=l!==null&&l.memoizedState===null?!1:(_&2)!==0),Z?(P=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(_|=1),Sn(Mn,_&1),l===null)return xx(u),l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((u.mode&1)===0?u.lanes=1:l.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(L=w.children,l=w.fallback,P?(w=u.mode,P=u.child,L={mode:"hidden",children:L},(w&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=L):P=Jp(L,w,0,null),l=Mo(l,w,v,null),P.return=u,l.return=u,P.sibling=l,u.child=P,u.child.memoizedState=Vx(v),u.memoizedState=Wx,l):Hx(u,L));if(_=l.memoizedState,_!==null&&(Z=_.dehydrated,Z!==null))return Qq(l,u,L,w,Z,_,v);if(P){P=w.fallback,L=u.mode,_=l.child,Z=_.sibling;var ae={mode:"hidden",children:w.children};return(L&1)===0&&u.child!==_?(w=u.child,w.childLanes=0,w.pendingProps=ae,u.deletions=null):(w=Wi(_,ae),w.subtreeFlags=_.subtreeFlags&14680064),Z!==null?P=Wi(Z,P):(P=Mo(P,L,v,null),P.flags|=2),P.return=u,w.return=u,w.sibling=P,u.child=w,w=P,P=u.child,L=l.child.memoizedState,L=L===null?Vx(v):{baseLanes:L.baseLanes|v,cachePool:null,transitions:L.transitions},P.memoizedState=L,P.childLanes=l.childLanes&~v,u.memoizedState=Wx,w}return P=l.child,l=P.sibling,w=Wi(P,{mode:"visible",children:w.children}),(u.mode&1)===0&&(w.lanes=v),w.return=u,w.sibling=null,l!==null&&(v=u.deletions,v===null?(u.deletions=[l],u.flags|=16):v.push(l)),u.child=w,u.memoizedState=null,w}function Hx(l,u){return u=Jp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function Fp(l,u,v,w){return w!==null&&yx(w),Gl(u,l.child,null,v),l=Hx(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function Qq(l,u,v,w,_,P,L){if(v)return u.flags&256?(u.flags&=-257,w=zx(Error(n(422))),Fp(l,u,L,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(P=w.fallback,_=u.mode,w=Jp({mode:"visible",children:w.children},_,0,null),P=Mo(P,_,L,null),P.flags|=2,w.return=u,P.return=u,w.sibling=P,u.child=w,(u.mode&1)!==0&&Gl(u,l.child,null,L),u.child.memoizedState=Vx(L),u.memoizedState=Wx,P);if((u.mode&1)===0)return Fp(l,u,L,null);if(_.data==="$!"){if(w=_.nextSibling&&_.nextSibling.dataset,w)var Z=w.dgst;return w=Z,P=Error(n(419)),w=zx(P,w,void 0),Fp(l,u,L,w)}if(Z=(L&l.childLanes)!==0,Fr||Z){if(w=cr,w!==null){switch(L&-L){case 4:_=2;break;case 16:_=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:_=32;break;case 536870912:_=268435456;break;default:_=0}_=(_&(w.suspendedLanes|L))!==0?0:_,_!==0&&_!==P.retryLane&&(P.retryLane=_,Gs(l,_),Ha(w,l,_,-1))}return ly(),w=zx(Error(n(421))),Fp(l,u,L,w)}return _.data==="$?"?(u.flags|=128,u.child=l.child,u=uU.bind(null,l),_._reactRetry=u,null):(l=P.treeContext,ia=Ri(_.nextSibling),sa=u,Rn=!0,qa=null,l!==null&&(wa[ja++]=Hs,wa[ja++]=Ks,wa[ja++]=_o,Hs=l.id,Ks=l.overflow,_o=u),u=Hx(u,w.children),u.flags|=4096,u)}function nE(l,u,v){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),Sx(l.return,u,v)}function Kx(l,u,v,w,_){var P=l.memoizedState;P===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:v,tailMode:_}:(P.isBackwards=u,P.rendering=null,P.renderingStartTime=0,P.last=w,P.tail=v,P.tailMode=_)}function rE(l,u,v){var w=u.pendingProps,_=w.revealOrder,P=w.tail;if(_r(l,u,w.children,v),w=Mn.current,(w&2)!==0)w=w&1|2,u.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&nE(l,v,u);else if(l.tag===19)nE(l,v,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}w&=1}if(Sn(Mn,w),(u.mode&1)===0)u.memoizedState=null;else switch(_){case"forwards":for(v=u.child,_=null;v!==null;)l=v.alternate,l!==null&&Op(l)===null&&(_=v),v=v.sibling;v=_,v===null?(_=u.child,u.child=null):(_=v.sibling,v.sibling=null),Kx(u,!1,_,v,P);break;case"backwards":for(v=null,_=u.child,u.child=null;_!==null;){if(l=_.alternate,l!==null&&Op(l)===null){u.child=_;break}l=_.sibling,_.sibling=v,v=_,_=l}Kx(u,!0,v,null,P);break;case"together":Kx(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function zp(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Xs(l,u,v){if(l!==null&&(u.dependencies=l.dependencies),To|=u.lanes,(v&u.childLanes)===0)return null;if(l!==null&&u.child!==l.child)throw Error(n(153));if(u.child!==null){for(l=u.child,v=Wi(l,l.pendingProps),u.child=v,v.return=u;l.sibling!==null;)l=l.sibling,v=v.sibling=Wi(l,l.pendingProps),v.return=u;v.sibling=null}return u.child}function Jq(l,u,v){switch(u.tag){case 3:ZA(u),Kl();break;case 5:gA(u);break;case 1:Lr(u.type)&&jp(u);break;case 4:_x(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,_=u.memoizedProps.value;Sn(Ep,w._currentValue),w._currentValue=_;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(Sn(Mn,Mn.current&1),u.flags|=128,null):(v&u.child.childLanes)!==0?tE(l,u,v):(Sn(Mn,Mn.current&1),l=Xs(l,u,v),l!==null?l.sibling:null);Sn(Mn,Mn.current&1);break;case 19:if(w=(v&u.childLanes)!==0,(l.flags&128)!==0){if(w)return rE(l,u,v);u.flags|=128}if(_=u.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Sn(Mn,Mn.current),w)break;return null;case 22:case 23:return u.lanes=0,XA(l,u,v)}return Xs(l,u,v)}var aE,Gx,sE,iE;aE=function(l,u){for(var v=u.child;v!==null;){if(v.tag===5||v.tag===6)l.appendChild(v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===u)break;for(;v.sibling===null;){if(v.return===null||v.return===u)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},Gx=function(){},sE=function(l,u,v,w){var _=l.memoizedProps;if(_!==w){l=u.stateNode,ko(gs.current);var P=null;switch(v){case"input":_=ve(l,_),w=ve(l,w),P=[];break;case"select":_=G({},_,{value:void 0}),w=G({},w,{value:void 0}),P=[];break;case"textarea":_=st(l,_),w=st(l,w),P=[];break;default:typeof _.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=yp)}Ve(v,w);var L;v=null;for(Se in _)if(!w.hasOwnProperty(Se)&&_.hasOwnProperty(Se)&&_[Se]!=null)if(Se==="style"){var Z=_[Se];for(L in Z)Z.hasOwnProperty(L)&&(v||(v={}),v[L]="")}else Se!=="dangerouslySetInnerHTML"&&Se!=="children"&&Se!=="suppressContentEditableWarning"&&Se!=="suppressHydrationWarning"&&Se!=="autoFocus"&&(s.hasOwnProperty(Se)?P||(P=[]):(P=P||[]).push(Se,null));for(Se in w){var ae=w[Se];if(Z=_?.[Se],w.hasOwnProperty(Se)&&ae!==Z&&(ae!=null||Z!=null))if(Se==="style")if(Z){for(L in Z)!Z.hasOwnProperty(L)||ae&&ae.hasOwnProperty(L)||(v||(v={}),v[L]="");for(L in ae)ae.hasOwnProperty(L)&&Z[L]!==ae[L]&&(v||(v={}),v[L]=ae[L])}else v||(P||(P=[]),P.push(Se,v)),v=ae;else Se==="dangerouslySetInnerHTML"?(ae=ae?ae.__html:void 0,Z=Z?Z.__html:void 0,ae!=null&&Z!==ae&&(P=P||[]).push(Se,ae)):Se==="children"?typeof ae!="string"&&typeof ae!="number"||(P=P||[]).push(Se,""+ae):Se!=="suppressContentEditableWarning"&&Se!=="suppressHydrationWarning"&&(s.hasOwnProperty(Se)?(ae!=null&&Se==="onScroll"&&kn("scroll",l),P||Z===ae||(P=[])):(P=P||[]).push(Se,ae))}v&&(P=P||[]).push("style",v);var Se=P;(u.updateQueue=Se)&&(u.flags|=4)}},iE=function(l,u,v,w){v!==w&&(u.flags|=4)};function ed(l,u){if(!Rn)switch(l.tailMode){case"hidden":u=l.tail;for(var v=null;u!==null;)u.alternate!==null&&(v=u),u=u.sibling;v===null?l.tail=null:v.sibling=null;break;case"collapsed":v=l.tail;for(var w=null;v!==null;)v.alternate!==null&&(w=v),v=v.sibling;w===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:w.sibling=null}}function jr(l){var u=l.alternate!==null&&l.alternate.child===l.child,v=0,w=0;if(u)for(var _=l.child;_!==null;)v|=_.lanes|_.childLanes,w|=_.subtreeFlags&14680064,w|=_.flags&14680064,_.return=l,_=_.sibling;else for(_=l.child;_!==null;)v|=_.lanes|_.childLanes,w|=_.subtreeFlags,w|=_.flags,_.return=l,_=_.sibling;return l.subtreeFlags|=w,l.childLanes=v,u}function Zq(l,u,v){var w=u.pendingProps;switch(vx(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jr(u),null;case 1:return Lr(u.type)&&wp(),jr(u),null;case 3:return w=u.stateNode,Ql(),Pn(Dr),Pn(br),kx(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(_p(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,qa!==null&&(sy(qa),qa=null))),Gx(l,u),jr(u),null;case 5:Ax(u);var _=ko(Yu.current);if(v=u.type,l!==null&&u.stateNode!=null)sE(l,u,v,w,_),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return jr(u),null}if(l=ko(gs.current),_p(u)){w=u.stateNode,v=u.type;var P=u.memoizedProps;switch(w[vs]=u,w[Wu]=P,l=(u.mode&1)!==0,v){case"dialog":kn("cancel",w),kn("close",w);break;case"iframe":case"object":case"embed":kn("load",w);break;case"video":case"audio":for(_=0;_<Bu.length;_++)kn(Bu[_],w);break;case"source":kn("error",w);break;case"img":case"image":case"link":kn("error",w),kn("load",w);break;case"details":kn("toggle",w);break;case"input":Pe(w,P),kn("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!P.multiple},kn("invalid",w);break;case"textarea":xt(w,P),kn("invalid",w)}Ve(v,P),_=null;for(var L in P)if(P.hasOwnProperty(L)){var Z=P[L];L==="children"?typeof Z=="string"?w.textContent!==Z&&(P.suppressHydrationWarning!==!0&&xp(w.textContent,Z,l),_=["children",Z]):typeof Z=="number"&&w.textContent!==""+Z&&(P.suppressHydrationWarning!==!0&&xp(w.textContent,Z,l),_=["children",""+Z]):s.hasOwnProperty(L)&&Z!=null&&L==="onScroll"&&kn("scroll",w)}switch(v){case"input":_e(w),fe(w,P,!0);break;case"textarea":_e(w),Ut(w);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(w.onclick=yp)}w=_,u.updateQueue=w,w!==null&&(u.flags|=4)}else{L=_.nodeType===9?_:_.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=xe(v)),l==="http://www.w3.org/1999/xhtml"?v==="script"?(l=L.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=L.createElement(v,{is:w.is}):(l=L.createElement(v),v==="select"&&(L=l,w.multiple?L.multiple=!0:w.size&&(L.size=w.size))):l=L.createElementNS(l,v),l[vs]=u,l[Wu]=w,aE(l,u,!1,!1),u.stateNode=l;e:{switch(L=St(v,w),v){case"dialog":kn("cancel",l),kn("close",l),_=w;break;case"iframe":case"object":case"embed":kn("load",l),_=w;break;case"video":case"audio":for(_=0;_<Bu.length;_++)kn(Bu[_],l);_=w;break;case"source":kn("error",l),_=w;break;case"img":case"image":case"link":kn("error",l),kn("load",l),_=w;break;case"details":kn("toggle",l),_=w;break;case"input":Pe(l,w),_=ve(l,w),kn("invalid",l);break;case"option":_=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},_=G({},w,{value:void 0}),kn("invalid",l);break;case"textarea":xt(l,w),_=st(l,w),kn("invalid",l);break;default:_=w}Ve(v,_),Z=_;for(P in Z)if(Z.hasOwnProperty(P)){var ae=Z[P];P==="style"?ge(l,ae):P==="dangerouslySetInnerHTML"?(ae=ae?ae.__html:void 0,ae!=null&&Te(l,ae)):P==="children"?typeof ae=="string"?(v!=="textarea"||ae!=="")&&Ie(l,ae):typeof ae=="number"&&Ie(l,""+ae):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(s.hasOwnProperty(P)?ae!=null&&P==="onScroll"&&kn("scroll",l):ae!=null&&S(l,P,ae,L))}switch(v){case"input":_e(l),fe(l,w,!1);break;case"textarea":_e(l),Ut(l);break;case"option":w.value!=null&&l.setAttribute("value",""+je(w.value));break;case"select":l.multiple=!!w.multiple,P=w.value,P!=null?et(l,!!w.multiple,P,!1):w.defaultValue!=null&&et(l,!!w.multiple,w.defaultValue,!0);break;default:typeof _.onClick=="function"&&(l.onclick=yp)}switch(v){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return jr(u),null;case 6:if(l&&u.stateNode!=null)iE(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(v=ko(Yu.current),ko(gs.current),_p(u)){if(w=u.stateNode,v=u.memoizedProps,w[vs]=u,(P=w.nodeValue!==v)&&(l=sa,l!==null))switch(l.tag){case 3:xp(w.nodeValue,v,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&xp(w.nodeValue,v,(l.mode&1)!==0)}P&&(u.flags|=4)}else w=(v.nodeType===9?v:v.ownerDocument).createTextNode(w),w[vs]=u,u.stateNode=w}return jr(u),null;case 13:if(Pn(Mn),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Rn&&ia!==null&&(u.mode&1)!==0&&(u.flags&128)===0)cA(),Kl(),u.flags|=98560,P=!1;else if(P=_p(u),w!==null&&w.dehydrated!==null){if(l===null){if(!P)throw Error(n(318));if(P=u.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(n(317));P[vs]=u}else Kl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;jr(u),P=!1}else qa!==null&&(sy(qa),qa=null),P=!0;if(!P)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=v,u):(w=w!==null,w!==(l!==null&&l.memoizedState!==null)&&w&&(u.child.flags|=8192,(u.mode&1)!==0&&(l===null||(Mn.current&1)!==0?Jn===0&&(Jn=3):ly())),u.updateQueue!==null&&(u.flags|=4),jr(u),null);case 4:return Ql(),Gx(l,u),l===null&&qu(u.stateNode.containerInfo),jr(u),null;case 10:return jx(u.type._context),jr(u),null;case 17:return Lr(u.type)&&wp(),jr(u),null;case 19:if(Pn(Mn),P=u.memoizedState,P===null)return jr(u),null;if(w=(u.flags&128)!==0,L=P.rendering,L===null)if(w)ed(P,!1);else{if(Jn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(L=Op(l),L!==null){for(u.flags|=128,ed(P,!1),w=L.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=v,v=u.child;v!==null;)P=v,l=w,P.flags&=14680066,L=P.alternate,L===null?(P.childLanes=0,P.lanes=l,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=L.childLanes,P.lanes=L.lanes,P.child=L.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=L.memoizedProps,P.memoizedState=L.memoizedState,P.updateQueue=L.updateQueue,P.type=L.type,l=L.dependencies,P.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),v=v.sibling;return Sn(Mn,Mn.current&1|2),u.child}l=l.sibling}P.tail!==null&&$e()>tc&&(u.flags|=128,w=!0,ed(P,!1),u.lanes=4194304)}else{if(!w)if(l=Op(L),l!==null){if(u.flags|=128,w=!0,v=l.updateQueue,v!==null&&(u.updateQueue=v,u.flags|=4),ed(P,!0),P.tail===null&&P.tailMode==="hidden"&&!L.alternate&&!Rn)return jr(u),null}else 2*$e()-P.renderingStartTime>tc&&v!==1073741824&&(u.flags|=128,w=!0,ed(P,!1),u.lanes=4194304);P.isBackwards?(L.sibling=u.child,u.child=L):(v=P.last,v!==null?v.sibling=L:u.child=L,P.last=L)}return P.tail!==null?(u=P.tail,P.rendering=u,P.tail=u.sibling,P.renderingStartTime=$e(),u.sibling=null,v=Mn.current,Sn(Mn,w?v&1|2:v&1),u):(jr(u),null);case 22:case 23:return oy(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(oa&1073741824)!==0&&(jr(u),u.subtreeFlags&6&&(u.flags|=8192)):jr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function eU(l,u){switch(vx(u),u.tag){case 1:return Lr(u.type)&&wp(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return Ql(),Pn(Dr),Pn(br),kx(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return Ax(u),null;case 13:if(Pn(Mn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));Kl()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return Pn(Mn),null;case 4:return Ql(),null;case 10:return jx(u.type._context),null;case 22:case 23:return oy(),null;case 24:return null;default:return null}}var Bp=!1,Sr=!1,tU=typeof WeakSet=="function"?WeakSet:Set,ct=null;function Zl(l,u){var v=l.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(w){zn(l,u,w)}else v.current=null}function Yx(l,u,v){try{v()}catch(w){zn(l,u,w)}}var oE=!1;function nU(l,u){if(ox=op,l=F_(),Zg(l)){if("selectionStart"in l)var v={start:l.selectionStart,end:l.selectionEnd};else e:{v=(v=l.ownerDocument)&&v.defaultView||window;var w=v.getSelection&&v.getSelection();if(w&&w.rangeCount!==0){v=w.anchorNode;var _=w.anchorOffset,P=w.focusNode;w=w.focusOffset;try{v.nodeType,P.nodeType}catch{v=null;break e}var L=0,Z=-1,ae=-1,Se=0,De=0,Fe=l,Re=null;t:for(;;){for(var rt;Fe!==v||_!==0&&Fe.nodeType!==3||(Z=L+_),Fe!==P||w!==0&&Fe.nodeType!==3||(ae=L+w),Fe.nodeType===3&&(L+=Fe.nodeValue.length),(rt=Fe.firstChild)!==null;)Re=Fe,Fe=rt;for(;;){if(Fe===l)break t;if(Re===v&&++Se===_&&(Z=L),Re===P&&++De===w&&(ae=L),(rt=Fe.nextSibling)!==null)break;Fe=Re,Re=Fe.parentNode}Fe=rt}v=Z===-1||ae===-1?null:{start:Z,end:ae}}else v=null}v=v||{start:0,end:0}}else v=null;for(lx={focusedElem:l,selectionRange:v},op=!1,ct=u;ct!==null;)if(u=ct,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,ct=l;else for(;ct!==null;){u=ct;try{var pt=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(pt!==null){var mt=pt.memoizedProps,Vn=pt.memoizedState,me=u.stateNode,le=me.getSnapshotBeforeUpdate(u.elementType===u.type?mt:Ua(u.type,mt),Vn);me.__reactInternalSnapshotBeforeUpdate=le}break;case 3:var be=u.stateNode.containerInfo;be.nodeType===1?be.textContent="":be.nodeType===9&&be.documentElement&&be.removeChild(be.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ue){zn(u,u.return,Ue)}if(l=u.sibling,l!==null){l.return=u.return,ct=l;break}ct=u.return}return pt=oE,oE=!1,pt}function td(l,u,v){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var _=w=w.next;do{if((_.tag&l)===l){var P=_.destroy;_.destroy=void 0,P!==void 0&&Yx(u,v,P)}_=_.next}while(_!==w)}}function qp(l,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var v=u=u.next;do{if((v.tag&l)===l){var w=v.create;v.destroy=w()}v=v.next}while(v!==u)}}function Xx(l){var u=l.ref;if(u!==null){var v=l.stateNode;l.tag,l=v,typeof u=="function"?u(l):u.current=l}}function lE(l){var u=l.alternate;u!==null&&(l.alternate=null,lE(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[vs],delete u[Wu],delete u[fx],delete u[Lq],delete u[Fq])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function cE(l){return l.tag===5||l.tag===3||l.tag===4}function uE(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||cE(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Qx(l,u,v){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?v.nodeType===8?v.parentNode.insertBefore(l,u):v.insertBefore(l,u):(v.nodeType===8?(u=v.parentNode,u.insertBefore(l,v)):(u=v,u.appendChild(l)),v=v._reactRootContainer,v!=null||u.onclick!==null||(u.onclick=yp));else if(w!==4&&(l=l.child,l!==null))for(Qx(l,u,v),l=l.sibling;l!==null;)Qx(l,u,v),l=l.sibling}function Jx(l,u,v){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?v.insertBefore(l,u):v.appendChild(l);else if(w!==4&&(l=l.child,l!==null))for(Jx(l,u,v),l=l.sibling;l!==null;)Jx(l,u,v),l=l.sibling}var hr=null,Wa=!1;function Fi(l,u,v){for(v=v.child;v!==null;)dE(l,u,v),v=v.sibling}function dE(l,u,v){if(na&&typeof na.onCommitFiberUnmount=="function")try{na.onCommitFiberUnmount(Us,v)}catch{}switch(v.tag){case 5:Sr||Zl(v,u);case 6:var w=hr,_=Wa;hr=null,Fi(l,u,v),hr=w,Wa=_,hr!==null&&(Wa?(l=hr,v=v.stateNode,l.nodeType===8?l.parentNode.removeChild(v):l.removeChild(v)):hr.removeChild(v.stateNode));break;case 18:hr!==null&&(Wa?(l=hr,v=v.stateNode,l.nodeType===8?dx(l.parentNode,v):l.nodeType===1&&dx(l,v),Ru(l)):dx(hr,v.stateNode));break;case 4:w=hr,_=Wa,hr=v.stateNode.containerInfo,Wa=!0,Fi(l,u,v),hr=w,Wa=_;break;case 0:case 11:case 14:case 15:if(!Sr&&(w=v.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){_=w=w.next;do{var P=_,L=P.destroy;P=P.tag,L!==void 0&&((P&2)!==0||(P&4)!==0)&&Yx(v,u,L),_=_.next}while(_!==w)}Fi(l,u,v);break;case 1:if(!Sr&&(Zl(v,u),w=v.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=v.memoizedProps,w.state=v.memoizedState,w.componentWillUnmount()}catch(Z){zn(v,u,Z)}Fi(l,u,v);break;case 21:Fi(l,u,v);break;case 22:v.mode&1?(Sr=(w=Sr)||v.memoizedState!==null,Fi(l,u,v),Sr=w):Fi(l,u,v);break;default:Fi(l,u,v)}}function fE(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var v=l.stateNode;v===null&&(v=l.stateNode=new tU),u.forEach(function(w){var _=dU.bind(null,l,w);v.has(w)||(v.add(w),w.then(_,_))})}}function Va(l,u){var v=u.deletions;if(v!==null)for(var w=0;w<v.length;w++){var _=v[w];try{var P=l,L=u,Z=L;e:for(;Z!==null;){switch(Z.tag){case 5:hr=Z.stateNode,Wa=!1;break e;case 3:hr=Z.stateNode.containerInfo,Wa=!0;break e;case 4:hr=Z.stateNode.containerInfo,Wa=!0;break e}Z=Z.return}if(hr===null)throw Error(n(160));dE(P,L,_),hr=null,Wa=!1;var ae=_.alternate;ae!==null&&(ae.return=null),_.return=null}catch(Se){zn(_,u,Se)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)pE(u,l),u=u.sibling}function pE(l,u){var v=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Va(u,l),ys(l),w&4){try{td(3,l,l.return),qp(3,l)}catch(mt){zn(l,l.return,mt)}try{td(5,l,l.return)}catch(mt){zn(l,l.return,mt)}}break;case 1:Va(u,l),ys(l),w&512&&v!==null&&Zl(v,v.return);break;case 5:if(Va(u,l),ys(l),w&512&&v!==null&&Zl(v,v.return),l.flags&32){var _=l.stateNode;try{Ie(_,"")}catch(mt){zn(l,l.return,mt)}}if(w&4&&(_=l.stateNode,_!=null)){var P=l.memoizedProps,L=v!==null?v.memoizedProps:P,Z=l.type,ae=l.updateQueue;if(l.updateQueue=null,ae!==null)try{Z==="input"&&P.type==="radio"&&P.name!=null&&F(_,P),St(Z,L);var Se=St(Z,P);for(L=0;L<ae.length;L+=2){var De=ae[L],Fe=ae[L+1];De==="style"?ge(_,Fe):De==="dangerouslySetInnerHTML"?Te(_,Fe):De==="children"?Ie(_,Fe):S(_,De,Fe,Se)}switch(Z){case"input":te(_,P);break;case"textarea":qt(_,P);break;case"select":var Re=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!P.multiple;var rt=P.value;rt!=null?et(_,!!P.multiple,rt,!1):Re!==!!P.multiple&&(P.defaultValue!=null?et(_,!!P.multiple,P.defaultValue,!0):et(_,!!P.multiple,P.multiple?[]:"",!1))}_[Wu]=P}catch(mt){zn(l,l.return,mt)}}break;case 6:if(Va(u,l),ys(l),w&4){if(l.stateNode===null)throw Error(n(162));_=l.stateNode,P=l.memoizedProps;try{_.nodeValue=P}catch(mt){zn(l,l.return,mt)}}break;case 3:if(Va(u,l),ys(l),w&4&&v!==null&&v.memoizedState.isDehydrated)try{Ru(u.containerInfo)}catch(mt){zn(l,l.return,mt)}break;case 4:Va(u,l),ys(l);break;case 13:Va(u,l),ys(l),_=l.child,_.flags&8192&&(P=_.memoizedState!==null,_.stateNode.isHidden=P,!P||_.alternate!==null&&_.alternate.memoizedState!==null||(ty=$e())),w&4&&fE(l);break;case 22:if(De=v!==null&&v.memoizedState!==null,l.mode&1?(Sr=(Se=Sr)||De,Va(u,l),Sr=Se):Va(u,l),ys(l),w&8192){if(Se=l.memoizedState!==null,(l.stateNode.isHidden=Se)&&!De&&(l.mode&1)!==0)for(ct=l,De=l.child;De!==null;){for(Fe=ct=De;ct!==null;){switch(Re=ct,rt=Re.child,Re.tag){case 0:case 11:case 14:case 15:td(4,Re,Re.return);break;case 1:Zl(Re,Re.return);var pt=Re.stateNode;if(typeof pt.componentWillUnmount=="function"){w=Re,v=Re.return;try{u=w,pt.props=u.memoizedProps,pt.state=u.memoizedState,pt.componentWillUnmount()}catch(mt){zn(w,v,mt)}}break;case 5:Zl(Re,Re.return);break;case 22:if(Re.memoizedState!==null){vE(Fe);continue}}rt!==null?(rt.return=Re,ct=rt):vE(Fe)}De=De.sibling}e:for(De=null,Fe=l;;){if(Fe.tag===5){if(De===null){De=Fe;try{_=Fe.stateNode,Se?(P=_.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(Z=Fe.stateNode,ae=Fe.memoizedProps.style,L=ae!=null&&ae.hasOwnProperty("display")?ae.display:null,Z.style.display=Ct("display",L))}catch(mt){zn(l,l.return,mt)}}}else if(Fe.tag===6){if(De===null)try{Fe.stateNode.nodeValue=Se?"":Fe.memoizedProps}catch(mt){zn(l,l.return,mt)}}else if((Fe.tag!==22&&Fe.tag!==23||Fe.memoizedState===null||Fe===l)&&Fe.child!==null){Fe.child.return=Fe,Fe=Fe.child;continue}if(Fe===l)break e;for(;Fe.sibling===null;){if(Fe.return===null||Fe.return===l)break e;De===Fe&&(De=null),Fe=Fe.return}De===Fe&&(De=null),Fe.sibling.return=Fe.return,Fe=Fe.sibling}}break;case 19:Va(u,l),ys(l),w&4&&fE(l);break;case 21:break;default:Va(u,l),ys(l)}}function ys(l){var u=l.flags;if(u&2){try{e:{for(var v=l.return;v!==null;){if(cE(v)){var w=v;break e}v=v.return}throw Error(n(160))}switch(w.tag){case 5:var _=w.stateNode;w.flags&32&&(Ie(_,""),w.flags&=-33);var P=uE(l);Jx(l,P,_);break;case 3:case 4:var L=w.stateNode.containerInfo,Z=uE(l);Qx(l,Z,L);break;default:throw Error(n(161))}}catch(ae){zn(l,l.return,ae)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function rU(l,u,v){ct=l,hE(l)}function hE(l,u,v){for(var w=(l.mode&1)!==0;ct!==null;){var _=ct,P=_.child;if(_.tag===22&&w){var L=_.memoizedState!==null||Bp;if(!L){var Z=_.alternate,ae=Z!==null&&Z.memoizedState!==null||Sr;Z=Bp;var Se=Sr;if(Bp=L,(Sr=ae)&&!Se)for(ct=_;ct!==null;)L=ct,ae=L.child,L.tag===22&&L.memoizedState!==null?gE(_):ae!==null?(ae.return=L,ct=ae):gE(_);for(;P!==null;)ct=P,hE(P),P=P.sibling;ct=_,Bp=Z,Sr=Se}mE(l)}else(_.subtreeFlags&8772)!==0&&P!==null?(P.return=_,ct=P):mE(l)}}function mE(l){for(;ct!==null;){var u=ct;if((u.flags&8772)!==0){var v=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:Sr||qp(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!Sr)if(v===null)w.componentDidMount();else{var _=u.elementType===u.type?v.memoizedProps:Ua(u.type,v.memoizedProps);w.componentDidUpdate(_,v.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var P=u.updateQueue;P!==null&&vA(u,P,w);break;case 3:var L=u.updateQueue;if(L!==null){if(v=null,u.child!==null)switch(u.child.tag){case 5:v=u.child.stateNode;break;case 1:v=u.child.stateNode}vA(u,L,v)}break;case 5:var Z=u.stateNode;if(v===null&&u.flags&4){v=Z;var ae=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":ae.autoFocus&&v.focus();break;case"img":ae.src&&(v.src=ae.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var Se=u.alternate;if(Se!==null){var De=Se.memoizedState;if(De!==null){var Fe=De.dehydrated;Fe!==null&&Ru(Fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Sr||u.flags&512&&Xx(u)}catch(Re){zn(u,u.return,Re)}}if(u===l){ct=null;break}if(v=u.sibling,v!==null){v.return=u.return,ct=v;break}ct=u.return}}function vE(l){for(;ct!==null;){var u=ct;if(u===l){ct=null;break}var v=u.sibling;if(v!==null){v.return=u.return,ct=v;break}ct=u.return}}function gE(l){for(;ct!==null;){var u=ct;try{switch(u.tag){case 0:case 11:case 15:var v=u.return;try{qp(4,u)}catch(ae){zn(u,v,ae)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var _=u.return;try{w.componentDidMount()}catch(ae){zn(u,_,ae)}}var P=u.return;try{Xx(u)}catch(ae){zn(u,P,ae)}break;case 5:var L=u.return;try{Xx(u)}catch(ae){zn(u,L,ae)}}}catch(ae){zn(u,u.return,ae)}if(u===l){ct=null;break}var Z=u.sibling;if(Z!==null){Z.return=u.return,ct=Z;break}ct=u.return}}var aU=Math.ceil,Up=E.ReactCurrentDispatcher,Zx=E.ReactCurrentOwner,Ca=E.ReactCurrentBatchConfig,nn=0,cr=null,Kn=null,mr=0,oa=0,ec=Ii(0),Jn=0,nd=null,To=0,Wp=0,ey=0,rd=null,zr=null,ty=0,tc=1/0,Qs=null,Vp=!1,ny=null,zi=null,Hp=!1,Bi=null,Kp=0,ad=0,ry=null,Gp=-1,Yp=0;function Ar(){return(nn&6)!==0?$e():Gp!==-1?Gp:Gp=$e()}function qi(l){return(l.mode&1)===0?1:(nn&2)!==0&&mr!==0?mr&-mr:Bq.transition!==null?(Yp===0&&(Yp=Zt()),Yp):(l=en,l!==0||(l=window.event,l=l===void 0?16:y_(l.type)),l)}function Ha(l,u,v,w){if(50<ad)throw ad=0,ry=null,Error(n(185));fn(l,v,w),((nn&2)===0||l!==cr)&&(l===cr&&((nn&2)===0&&(Wp|=v),Jn===4&&Ui(l,mr)),Br(l,w),v===1&&nn===0&&(u.mode&1)===0&&(tc=$e()+500,Sp&&$i()))}function Br(l,u){var v=l.callbackNode;vt(l,u);var w=J(l,l===cr?mr:0);if(w===0)v!==null&&Kt(v),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(v!=null&&Kt(v),u===1)l.tag===0?zq(yE.bind(null,l)):aA(yE.bind(null,l)),$q(function(){(nn&6)===0&&$i()}),v=null;else{switch(Eu(w)){case 1:v=yt;break;case 4:v=rn;break;case 16:v=ta;break;case 536870912:v=tp;break;default:v=ta}v=AE(v,xE.bind(null,l))}l.callbackPriority=u,l.callbackNode=v}}function xE(l,u){if(Gp=-1,Yp=0,(nn&6)!==0)throw Error(n(327));var v=l.callbackNode;if(nc()&&l.callbackNode!==v)return null;var w=J(l,l===cr?mr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=Xp(l,w);else{u=w;var _=nn;nn|=2;var P=wE();(cr!==l||mr!==u)&&(Qs=null,tc=$e()+500,Ro(l,u));do try{oU();break}catch(Z){bE(l,Z)}while(!0);wx(),Up.current=P,nn=_,Kn!==null?u=0:(cr=null,mr=0,u=Jn)}if(u!==0){if(u===2&&(_=Be(l),_!==0&&(w=_,u=ay(l,_))),u===1)throw v=nd,Ro(l,0),Ui(l,w),Br(l,$e()),v;if(u===6)Ui(l,w);else{if(_=l.current.alternate,(w&30)===0&&!sU(_)&&(u=Xp(l,w),u===2&&(P=Be(l),P!==0&&(w=P,u=ay(l,P))),u===1))throw v=nd,Ro(l,0),Ui(l,w),Br(l,$e()),v;switch(l.finishedWork=_,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:Io(l,zr,Qs);break;case 3:if(Ui(l,w),(w&130023424)===w&&(u=ty+500-$e(),10<u)){if(J(l,0)!==0)break;if(_=l.suspendedLanes,(_&w)!==w){Ar(),l.pingedLanes|=l.suspendedLanes&_;break}l.timeoutHandle=ux(Io.bind(null,l,zr,Qs),u);break}Io(l,zr,Qs);break;case 4:if(Ui(l,w),(w&4194240)===w)break;for(u=l.eventTimes,_=-1;0<w;){var L=31-ra(w);P=1<<L,L=u[L],L>_&&(_=L),w&=~P}if(w=_,w=$e()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*aU(w/1960))-w,10<w){l.timeoutHandle=ux(Io.bind(null,l,zr,Qs),w);break}Io(l,zr,Qs);break;case 5:Io(l,zr,Qs);break;default:throw Error(n(329))}}}return Br(l,$e()),l.callbackNode===v?xE.bind(null,l):null}function ay(l,u){var v=rd;return l.current.memoizedState.isDehydrated&&(Ro(l,u).flags|=256),l=Xp(l,u),l!==2&&(u=zr,zr=v,u!==null&&sy(u)),l}function sy(l){zr===null?zr=l:zr.push.apply(zr,l)}function sU(l){for(var u=l;;){if(u.flags&16384){var v=u.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var w=0;w<v.length;w++){var _=v[w],P=_.getSnapshot;_=_.value;try{if(!Ba(P(),_))return!1}catch{return!1}}}if(v=u.child,u.subtreeFlags&16384&&v!==null)v.return=u,u=v;else{if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Ui(l,u){for(u&=~ey,u&=~Wp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var v=31-ra(u),w=1<<v;l[v]=-1,u&=~w}}function yE(l){if((nn&6)!==0)throw Error(n(327));nc();var u=J(l,0);if((u&1)===0)return Br(l,$e()),null;var v=Xp(l,u);if(l.tag!==0&&v===2){var w=Be(l);w!==0&&(u=w,v=ay(l,w))}if(v===1)throw v=nd,Ro(l,0),Ui(l,u),Br(l,$e()),v;if(v===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,Io(l,zr,Qs),Br(l,$e()),null}function iy(l,u){var v=nn;nn|=1;try{return l(u)}finally{nn=v,nn===0&&(tc=$e()+500,Sp&&$i())}}function Oo(l){Bi!==null&&Bi.tag===0&&(nn&6)===0&&nc();var u=nn;nn|=1;var v=Ca.transition,w=en;try{if(Ca.transition=null,en=1,l)return l()}finally{en=w,Ca.transition=v,nn=u,(nn&6)===0&&$i()}}function oy(){oa=ec.current,Pn(ec)}function Ro(l,u){l.finishedWork=null,l.finishedLanes=0;var v=l.timeoutHandle;if(v!==-1&&(l.timeoutHandle=-1,Mq(v)),Kn!==null)for(v=Kn.return;v!==null;){var w=v;switch(vx(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&wp();break;case 3:Ql(),Pn(Dr),Pn(br),kx();break;case 5:Ax(w);break;case 4:Ql();break;case 13:Pn(Mn);break;case 19:Pn(Mn);break;case 10:jx(w.type._context);break;case 22:case 23:oy()}v=v.return}if(cr=l,Kn=l=Wi(l.current,null),mr=oa=u,Jn=0,nd=null,ey=Wp=To=0,zr=rd=null,Eo!==null){for(u=0;u<Eo.length;u++)if(v=Eo[u],w=v.interleaved,w!==null){v.interleaved=null;var _=w.next,P=v.pending;if(P!==null){var L=P.next;P.next=_,w.next=L}v.pending=w}Eo=null}return l}function bE(l,u){do{var v=Kn;try{if(wx(),Rp.current=Dp,Ip){for(var w=$n.memoizedState;w!==null;){var _=w.queue;_!==null&&(_.pending=null),w=w.next}Ip=!1}if(Po=0,lr=Qn=$n=null,Xu=!1,Qu=0,Zx.current=null,v===null||v.return===null){Jn=1,nd=u,Kn=null;break}e:{var P=l,L=v.return,Z=v,ae=u;if(u=mr,Z.flags|=32768,ae!==null&&typeof ae=="object"&&typeof ae.then=="function"){var Se=ae,De=Z,Fe=De.tag;if((De.mode&1)===0&&(Fe===0||Fe===11||Fe===15)){var Re=De.alternate;Re?(De.updateQueue=Re.updateQueue,De.memoizedState=Re.memoizedState,De.lanes=Re.lanes):(De.updateQueue=null,De.memoizedState=null)}var rt=VA(L);if(rt!==null){rt.flags&=-257,HA(rt,L,Z,P,u),rt.mode&1&&WA(P,Se,u),u=rt,ae=Se;var pt=u.updateQueue;if(pt===null){var mt=new Set;mt.add(ae),u.updateQueue=mt}else pt.add(ae);break e}else{if((u&1)===0){WA(P,Se,u),ly();break e}ae=Error(n(426))}}else if(Rn&&Z.mode&1){var Vn=VA(L);if(Vn!==null){(Vn.flags&65536)===0&&(Vn.flags|=256),HA(Vn,L,Z,P,u),yx(Jl(ae,Z));break e}}P=ae=Jl(ae,Z),Jn!==4&&(Jn=2),rd===null?rd=[P]:rd.push(P),P=L;do{switch(P.tag){case 3:P.flags|=65536,u&=-u,P.lanes|=u;var me=qA(P,ae,u);mA(P,me);break e;case 1:Z=ae;var le=P.type,be=P.stateNode;if((P.flags&128)===0&&(typeof le.getDerivedStateFromError=="function"||be!==null&&typeof be.componentDidCatch=="function"&&(zi===null||!zi.has(be)))){P.flags|=65536,u&=-u,P.lanes|=u;var Ue=UA(P,Z,u);mA(P,Ue);break e}}P=P.return}while(P!==null)}SE(v)}catch(gt){u=gt,Kn===v&&v!==null&&(Kn=v=v.return);continue}break}while(!0)}function wE(){var l=Up.current;return Up.current=Dp,l===null?Dp:l}function ly(){(Jn===0||Jn===3||Jn===2)&&(Jn=4),cr===null||(To&268435455)===0&&(Wp&268435455)===0||Ui(cr,mr)}function Xp(l,u){var v=nn;nn|=2;var w=wE();(cr!==l||mr!==u)&&(Qs=null,Ro(l,u));do try{iU();break}catch(_){bE(l,_)}while(!0);if(wx(),nn=v,Up.current=w,Kn!==null)throw Error(n(261));return cr=null,mr=0,Jn}function iU(){for(;Kn!==null;)jE(Kn)}function oU(){for(;Kn!==null&&!Wn();)jE(Kn)}function jE(l){var u=_E(l.alternate,l,oa);l.memoizedProps=l.pendingProps,u===null?SE(l):Kn=u,Zx.current=null}function SE(l){var u=l;do{var v=u.alternate;if(l=u.return,(u.flags&32768)===0){if(v=Zq(v,u,oa),v!==null){Kn=v;return}}else{if(v=eU(v,u),v!==null){v.flags&=32767,Kn=v;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Jn=6,Kn=null;return}}if(u=u.sibling,u!==null){Kn=u;return}Kn=u=l}while(u!==null);Jn===0&&(Jn=5)}function Io(l,u,v){var w=en,_=Ca.transition;try{Ca.transition=null,en=1,lU(l,u,v,w)}finally{Ca.transition=_,en=w}return null}function lU(l,u,v,w){do nc();while(Bi!==null);if((nn&6)!==0)throw Error(n(327));v=l.finishedWork;var _=l.finishedLanes;if(v===null)return null;if(l.finishedWork=null,l.finishedLanes=0,v===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var P=v.lanes|v.childLanes;if(yr(l,P),l===cr&&(Kn=cr=null,mr=0),(v.subtreeFlags&2064)===0&&(v.flags&2064)===0||Hp||(Hp=!0,AE(ta,function(){return nc(),null})),P=(v.flags&15990)!==0,(v.subtreeFlags&15990)!==0||P){P=Ca.transition,Ca.transition=null;var L=en;en=1;var Z=nn;nn|=4,Zx.current=null,nU(l,v),pE(v,l),Eq(lx),op=!!ox,lx=ox=null,l.current=v,rU(v),tn(),nn=Z,en=L,Ca.transition=P}else l.current=v;if(Hp&&(Hp=!1,Bi=l,Kp=_),P=l.pendingLanes,P===0&&(zi=null),Lg(v.stateNode),Br(l,$e()),u!==null)for(w=l.onRecoverableError,v=0;v<u.length;v++)_=u[v],w(_.value,{componentStack:_.stack,digest:_.digest});if(Vp)throw Vp=!1,l=ny,ny=null,l;return(Kp&1)!==0&&l.tag!==0&&nc(),P=l.pendingLanes,(P&1)!==0?l===ry?ad++:(ad=0,ry=l):ad=0,$i(),null}function nc(){if(Bi!==null){var l=Eu(Kp),u=Ca.transition,v=en;try{if(Ca.transition=null,en=16>l?16:l,Bi===null)var w=!1;else{if(l=Bi,Bi=null,Kp=0,(nn&6)!==0)throw Error(n(331));var _=nn;for(nn|=4,ct=l.current;ct!==null;){var P=ct,L=P.child;if((ct.flags&16)!==0){var Z=P.deletions;if(Z!==null){for(var ae=0;ae<Z.length;ae++){var Se=Z[ae];for(ct=Se;ct!==null;){var De=ct;switch(De.tag){case 0:case 11:case 15:td(8,De,P)}var Fe=De.child;if(Fe!==null)Fe.return=De,ct=Fe;else for(;ct!==null;){De=ct;var Re=De.sibling,rt=De.return;if(lE(De),De===Se){ct=null;break}if(Re!==null){Re.return=rt,ct=Re;break}ct=rt}}}var pt=P.alternate;if(pt!==null){var mt=pt.child;if(mt!==null){pt.child=null;do{var Vn=mt.sibling;mt.sibling=null,mt=Vn}while(mt!==null)}}ct=P}}if((P.subtreeFlags&2064)!==0&&L!==null)L.return=P,ct=L;else e:for(;ct!==null;){if(P=ct,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:td(9,P,P.return)}var me=P.sibling;if(me!==null){me.return=P.return,ct=me;break e}ct=P.return}}var le=l.current;for(ct=le;ct!==null;){L=ct;var be=L.child;if((L.subtreeFlags&2064)!==0&&be!==null)be.return=L,ct=be;else e:for(L=le;ct!==null;){if(Z=ct,(Z.flags&2048)!==0)try{switch(Z.tag){case 0:case 11:case 15:qp(9,Z)}}catch(gt){zn(Z,Z.return,gt)}if(Z===L){ct=null;break e}var Ue=Z.sibling;if(Ue!==null){Ue.return=Z.return,ct=Ue;break e}ct=Z.return}}if(nn=_,$i(),na&&typeof na.onPostCommitFiberRoot=="function")try{na.onPostCommitFiberRoot(Us,l)}catch{}w=!0}return w}finally{en=v,Ca.transition=u}}return!1}function NE(l,u,v){u=Jl(v,u),u=qA(l,u,1),l=Li(l,u,1),u=Ar(),l!==null&&(fn(l,1,u),Br(l,u))}function zn(l,u,v){if(l.tag===3)NE(l,l,v);else for(;u!==null;){if(u.tag===3){NE(u,l,v);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(zi===null||!zi.has(w))){l=Jl(v,l),l=UA(u,l,1),u=Li(u,l,1),l=Ar(),u!==null&&(fn(u,1,l),Br(u,l));break}}u=u.return}}function cU(l,u,v){var w=l.pingCache;w!==null&&w.delete(u),u=Ar(),l.pingedLanes|=l.suspendedLanes&v,cr===l&&(mr&v)===v&&(Jn===4||Jn===3&&(mr&130023424)===mr&&500>$e()-ty?Ro(l,0):ey|=v),Br(l,u)}function CE(l,u){u===0&&((l.mode&1)===0?u=1:(u=Il,Il<<=1,(Il&130023424)===0&&(Il=4194304)));var v=Ar();l=Gs(l,u),l!==null&&(fn(l,u,v),Br(l,v))}function uU(l){var u=l.memoizedState,v=0;u!==null&&(v=u.retryLane),CE(l,v)}function dU(l,u){var v=0;switch(l.tag){case 13:var w=l.stateNode,_=l.memoizedState;_!==null&&(v=_.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),CE(l,v)}var _E;_E=function(l,u,v){if(l!==null)if(l.memoizedProps!==u.pendingProps||Dr.current)Fr=!0;else{if((l.lanes&v)===0&&(u.flags&128)===0)return Fr=!1,Jq(l,u,v);Fr=(l.flags&131072)!==0}else Fr=!1,Rn&&(u.flags&1048576)!==0&&sA(u,Cp,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;zp(l,u),l=u.pendingProps;var _=Wl(u,br.current);Xl(u,v),_=Ox(null,u,w,l,_,v);var P=Rx();return u.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Lr(w)?(P=!0,jp(u)):P=!1,u.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,Cx(u),_.updater=Lp,u.stateNode=_,_._reactInternals=u,Fx(u,w,l,v),u=Ux(null,u,w,!0,P,v)):(u.tag=0,Rn&&P&&mx(u),_r(null,u,_,v),u=u.child),u;case 16:w=u.elementType;e:{switch(zp(l,u),l=u.pendingProps,_=w._init,w=_(w._payload),u.type=w,_=u.tag=pU(w),l=Ua(w,l),_){case 0:u=qx(null,u,w,l,v);break e;case 1:u=JA(null,u,w,l,v);break e;case 11:u=KA(null,u,w,l,v);break e;case 14:u=GA(null,u,w,Ua(w.type,l),v);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Ua(w,_),qx(l,u,w,_,v);case 1:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Ua(w,_),JA(l,u,w,_,v);case 3:e:{if(ZA(u),l===null)throw Error(n(387));w=u.pendingProps,P=u.memoizedState,_=P.element,hA(l,u),Tp(u,w,null,v);var L=u.memoizedState;if(w=L.element,P.isDehydrated)if(P={element:w,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},u.updateQueue.baseState=P,u.memoizedState=P,u.flags&256){_=Jl(Error(n(423)),u),u=eE(l,u,w,v,_);break e}else if(w!==_){_=Jl(Error(n(424)),u),u=eE(l,u,w,v,_);break e}else for(ia=Ri(u.stateNode.containerInfo.firstChild),sa=u,Rn=!0,qa=null,v=fA(u,null,w,v),u.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Kl(),w===_){u=Xs(l,u,v);break e}_r(l,u,w,v)}u=u.child}return u;case 5:return gA(u),l===null&&xx(u),w=u.type,_=u.pendingProps,P=l!==null?l.memoizedProps:null,L=_.children,cx(w,_)?L=null:P!==null&&cx(w,P)&&(u.flags|=32),QA(l,u),_r(l,u,L,v),u.child;case 6:return l===null&&xx(u),null;case 13:return tE(l,u,v);case 4:return _x(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=Gl(u,null,w,v):_r(l,u,w,v),u.child;case 11:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Ua(w,_),KA(l,u,w,_,v);case 7:return _r(l,u,u.pendingProps,v),u.child;case 8:return _r(l,u,u.pendingProps.children,v),u.child;case 12:return _r(l,u,u.pendingProps.children,v),u.child;case 10:e:{if(w=u.type._context,_=u.pendingProps,P=u.memoizedProps,L=_.value,Sn(Ep,w._currentValue),w._currentValue=L,P!==null)if(Ba(P.value,L)){if(P.children===_.children&&!Dr.current){u=Xs(l,u,v);break e}}else for(P=u.child,P!==null&&(P.return=u);P!==null;){var Z=P.dependencies;if(Z!==null){L=P.child;for(var ae=Z.firstContext;ae!==null;){if(ae.context===w){if(P.tag===1){ae=Ys(-1,v&-v),ae.tag=2;var Se=P.updateQueue;if(Se!==null){Se=Se.shared;var De=Se.pending;De===null?ae.next=ae:(ae.next=De.next,De.next=ae),Se.pending=ae}}P.lanes|=v,ae=P.alternate,ae!==null&&(ae.lanes|=v),Sx(P.return,v,u),Z.lanes|=v;break}ae=ae.next}}else if(P.tag===10)L=P.type===u.type?null:P.child;else if(P.tag===18){if(L=P.return,L===null)throw Error(n(341));L.lanes|=v,Z=L.alternate,Z!==null&&(Z.lanes|=v),Sx(L,v,u),L=P.sibling}else L=P.child;if(L!==null)L.return=P;else for(L=P;L!==null;){if(L===u){L=null;break}if(P=L.sibling,P!==null){P.return=L.return,L=P;break}L=L.return}P=L}_r(l,u,_.children,v),u=u.child}return u;case 9:return _=u.type,w=u.pendingProps.children,Xl(u,v),_=Sa(_),w=w(_),u.flags|=1,_r(l,u,w,v),u.child;case 14:return w=u.type,_=Ua(w,u.pendingProps),_=Ua(w.type,_),GA(l,u,w,_,v);case 15:return YA(l,u,u.type,u.pendingProps,v);case 17:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Ua(w,_),zp(l,u),u.tag=1,Lr(w)?(l=!0,jp(u)):l=!1,Xl(u,v),zA(u,w,_),Fx(u,w,_,v),Ux(null,u,w,!0,l,v);case 19:return rE(l,u,v);case 22:return XA(l,u,v)}throw Error(n(156,u.tag))};function AE(l,u){return Vt(l,u)}function fU(l,u,v,w){this.tag=l,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _a(l,u,v,w){return new fU(l,u,v,w)}function cy(l){return l=l.prototype,!(!l||!l.isReactComponent)}function pU(l){if(typeof l=="function")return cy(l)?1:0;if(l!=null){if(l=l.$$typeof,l===B)return 11;if(l===M)return 14}return 2}function Wi(l,u){var v=l.alternate;return v===null?(v=_a(l.tag,u,l.key,l.mode),v.elementType=l.elementType,v.type=l.type,v.stateNode=l.stateNode,v.alternate=l,l.alternate=v):(v.pendingProps=u,v.type=l.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=l.flags&14680064,v.childLanes=l.childLanes,v.lanes=l.lanes,v.child=l.child,v.memoizedProps=l.memoizedProps,v.memoizedState=l.memoizedState,v.updateQueue=l.updateQueue,u=l.dependencies,v.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},v.sibling=l.sibling,v.index=l.index,v.ref=l.ref,v}function Qp(l,u,v,w,_,P){var L=2;if(w=l,typeof l=="function")cy(l)&&(L=1);else if(typeof l=="string")L=5;else e:switch(l){case T:return Mo(v.children,_,P,u);case O:L=8,_|=8;break;case D:return l=_a(12,v,u,_|2),l.elementType=D,l.lanes=P,l;case X:return l=_a(13,v,u,_),l.elementType=X,l.lanes=P,l;case W:return l=_a(19,v,u,_),l.elementType=W,l.lanes=P,l;case K:return Jp(v,_,P,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case q:L=10;break e;case U:L=9;break e;case B:L=11;break e;case M:L=14;break e;case z:L=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=_a(L,v,u,_),u.elementType=l,u.type=w,u.lanes=P,u}function Mo(l,u,v,w){return l=_a(7,l,w,u),l.lanes=v,l}function Jp(l,u,v,w){return l=_a(22,l,w,u),l.elementType=K,l.lanes=v,l.stateNode={isHidden:!1},l}function uy(l,u,v){return l=_a(6,l,null,u),l.lanes=v,l}function dy(l,u,v){return u=_a(4,l.children!==null?l.children:[],l.key,u),u.lanes=v,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function hU(l,u,v,w,_){this.tag=u,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$t(0),this.expirationTimes=$t(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$t(0),this.identifierPrefix=w,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function fy(l,u,v,w,_,P,L,Z,ae){return l=new hU(l,u,v,Z,ae),u===1?(u=1,P===!0&&(u|=8)):u=0,P=_a(3,null,null,u),l.current=P,P.stateNode=l,P.memoizedState={element:w,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cx(P),l}function mU(l,u,v){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:w==null?null:""+w,children:l,containerInfo:u,implementation:v}}function EE(l){if(!l)return Mi;l=l._reactInternals;e:{if(Un(l)!==l||l.tag!==1)throw Error(n(170));var u=l;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(Lr(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(l.tag===1){var v=l.type;if(Lr(v))return nA(l,v,u)}return u}function kE(l,u,v,w,_,P,L,Z,ae){return l=fy(v,w,!0,l,_,P,L,Z,ae),l.context=EE(null),v=l.current,w=Ar(),_=qi(v),P=Ys(w,_),P.callback=u??null,Li(v,P,_),l.current.lanes=_,fn(l,_,w),Br(l,w),l}function Zp(l,u,v,w){var _=u.current,P=Ar(),L=qi(_);return v=EE(v),u.context===null?u.context=v:u.pendingContext=v,u=Ys(P,L),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=Li(_,u,L),l!==null&&(Ha(l,_,L,P),Pp(l,_,L)),L}function eh(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function PE(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var v=l.retryLane;l.retryLane=v!==0&&v<u?v:u}}function py(l,u){PE(l,u),(l=l.alternate)&&PE(l,u)}function vU(){return null}var TE=typeof reportError=="function"?reportError:function(l){console.error(l)};function hy(l){this._internalRoot=l}th.prototype.render=hy.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));Zp(l,u,null,null)},th.prototype.unmount=hy.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;Oo(function(){Zp(null,l,null,null)}),u[Ws]=null}};function th(l){this._internalRoot=l}th.prototype.unstable_scheduleHydration=function(l){if(l){var u=h_();l={blockedOn:null,target:l,priority:u};for(var v=0;v<Pi.length&&u!==0&&u<Pi[v].priority;v++);Pi.splice(v,0,l),v===0&&g_(l)}};function my(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function nh(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function OE(){}function gU(l,u,v,w,_){if(_){if(typeof w=="function"){var P=w;w=function(){var Se=eh(L);P.call(Se)}}var L=kE(u,w,l,0,null,!1,!1,"",OE);return l._reactRootContainer=L,l[Ws]=L.current,qu(l.nodeType===8?l.parentNode:l),Oo(),L}for(;_=l.lastChild;)l.removeChild(_);if(typeof w=="function"){var Z=w;w=function(){var Se=eh(ae);Z.call(Se)}}var ae=fy(l,0,!1,null,null,!1,!1,"",OE);return l._reactRootContainer=ae,l[Ws]=ae.current,qu(l.nodeType===8?l.parentNode:l),Oo(function(){Zp(u,ae,v,w)}),ae}function rh(l,u,v,w,_){var P=v._reactRootContainer;if(P){var L=P;if(typeof _=="function"){var Z=_;_=function(){var ae=eh(L);Z.call(ae)}}Zp(u,L,l,_)}else L=gU(v,u,l,_,w);return eh(L)}rp=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var v=jo(u.pendingLanes);v!==0&&(vn(u,v|1),Br(u,$e()),(nn&6)===0&&(tc=$e()+500,$i()))}break;case 13:Oo(function(){var w=Gs(l,1);if(w!==null){var _=Ar();Ha(w,l,1,_)}}),py(l,1)}},So=function(l){if(l.tag===13){var u=Gs(l,134217728);if(u!==null){var v=Ar();Ha(u,l,134217728,v)}py(l,134217728)}},ap=function(l){if(l.tag===13){var u=qi(l),v=Gs(l,u);if(v!==null){var w=Ar();Ha(v,l,u,w)}py(l,u)}},h_=function(){return en},m_=function(l,u){var v=en;try{return en=l,u()}finally{en=v}},we=function(l,u,v){switch(u){case"input":if(te(l,v),u=v.name,v.type==="radio"&&u!=null){for(v=l;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<v.length;u++){var w=v[u];if(w!==l&&w.form===l.form){var _=bp(w);if(!_)throw Error(n(90));ce(w),te(w,_)}}}break;case"textarea":qt(l,v);break;case"select":u=v.value,u!=null&&et(l,!!v.multiple,u,!1)}},zt=iy,Jt=Oo;var xU={usingClientEntryPoint:!1,Events:[Vu,ql,bp,Fn,lt,iy]},sd={findFiberByHostInstance:No,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yU={bundleType:sd.bundleType,version:sd.version,rendererPackageName:sd.rendererPackageName,rendererConfig:sd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Xe(l),l===null?null:l.stateNode},findFiberByHostInstance:sd.findFiberByHostInstance||vU,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 ah=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ah.isDisabled&&ah.supportsFiber)try{Us=ah.inject(yU),na=ah}catch{}}return qr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xU,qr.createPortal=function(l,u){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!my(u))throw Error(n(200));return mU(l,u,null,v)},qr.createRoot=function(l,u){if(!my(l))throw Error(n(299));var v=!1,w="",_=TE;return u!=null&&(u.unstable_strictMode===!0&&(v=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(_=u.onRecoverableError)),u=fy(l,1,!1,null,null,v,!1,w,_),l[Ws]=u.current,qu(l.nodeType===8?l.parentNode:l),new hy(u)},qr.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=Xe(u),l=l===null?null:l.stateNode,l},qr.flushSync=function(l){return Oo(l)},qr.hydrate=function(l,u,v){if(!nh(u))throw Error(n(200));return rh(null,l,u,!0,v)},qr.hydrateRoot=function(l,u,v){if(!my(l))throw Error(n(405));var w=v!=null&&v.hydratedSources||null,_=!1,P="",L=TE;if(v!=null&&(v.unstable_strictMode===!0&&(_=!0),v.identifierPrefix!==void 0&&(P=v.identifierPrefix),v.onRecoverableError!==void 0&&(L=v.onRecoverableError)),u=kE(u,null,l,1,v??null,_,!1,P,L),l[Ws]=u.current,qu(l),w)for(l=0;l<w.length;l++)v=w[l],_=v._getVersion,_=_(v._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[v,_]:u.mutableSourceEagerHydrationData.push(v,_);return new th(u)},qr.render=function(l,u,v){if(!nh(u))throw Error(n(200));return rh(null,l,u,!1,v)},qr.unmountComponentAtNode=function(l){if(!nh(l))throw Error(n(40));return l._reactRootContainer?(Oo(function(){rh(null,null,l,!1,function(){l._reactRootContainer=null,l[Ws]=null})}),!0):!1},qr.unstable_batchedUpdates=iy,qr.unstable_renderSubtreeIntoContainer=function(l,u,v,w){if(!nh(v))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return rh(l,u,v,!1,w)},qr.version="18.3.1-next-f1338f8080-20240426",qr}var zE;function T$(){if(zE)return xy.exports;zE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),xy.exports=AU(),xy.exports}var BE;function EU(){if(BE)return ih;BE=1;var e=T$();return ih.createRoot=e.createRoot,ih.hydrateRoot=e.hydrateRoot,ih}var kU=EU(),m=uN();const Y=hn(m),ov=wU({__proto__:null,default:Y},[m]),PU=1,TU=1e6;let wy=0;function OU(){return wy=(wy+1)%Number.MAX_SAFE_INTEGER,wy.toString()}const jy=new Map,qE=e=>{if(jy.has(e))return;const t=setTimeout(()=>{jy.delete(e),Cd({type:"REMOVE_TOAST",toastId:e})},TU);jy.set(e,t)},RU=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,PU)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?qE(n):e.toasts.forEach(r=>{qE(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Ih=[];let Mh={toasts:[]};function Cd(e){Mh=RU(Mh,e),Ih.forEach(t=>{t(Mh)})}function ke({...e}){const t=OU(),n=s=>Cd({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Cd({type:"DISMISS_TOAST",toastId:t});return Cd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function IU(){const[e,t]=m.useState(Mh);return m.useEffect(()=>(Ih.push(t),()=>{const n=Ih.indexOf(t);n>-1&&Ih.splice(n,1)}),[e]),{...e,toast:ke,dismiss:n=>Cd({type:"DISMISS_TOAST",toastId:n})}}var cu=T$();const O$=hn(cu);function Le(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function UE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ir(...e){return t=>{let n=!1;const r=e.map(s=>{const i=UE(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():UE(e[s],null)}}}}function Et(...e){return m.useCallback(Ir(...e),e)}function MU(e,t){const n=m.createContext(t),r=i=>{const{children:o,...c}=i,d=m.useMemo(()=>c,Object.values(c));return a.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function s(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function gr(e,t=[]){let n=[];function r(i,o){const c=m.createContext(o),d=n.length;n=[...n,o];const f=p=>{const{scope:g,children:x,...j}=p,y=g?.[e]?.[d]||c,b=m.useMemo(()=>j,Object.values(j));return a.jsx(y.Provider,{value:b,children:x})};f.displayName=i+"Provider";function h(p,g){const x=g?.[e]?.[d]||c,j=m.useContext(x);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const s=()=>{const i=n.map(o=>m.createContext(o));return function(c){const d=c?.[e]||i;return m.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return s.scopeName=e,[r,$U(s,...t)]}function $U(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function WE(e){const t=DU(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(FU);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function DU(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=BU(s),c=zU(i,s.props);return s.type!==m.Fragment&&(c.ref=r?Ir(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LU=Symbol("radix.slottable");function FU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LU}function zU(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function BU(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 Af(e){const t=e+"CollectionProvider",[n,r]=gr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=y=>{const{scope:b,children:N}=y,C=Y.useRef(null),S=Y.useRef(new Map).current;return a.jsx(s,{scope:b,itemMap:S,collectionRef:C,children:N})};o.displayName=t;const c=e+"CollectionSlot",d=WE(c),f=Y.forwardRef((y,b)=>{const{scope:N,children:C}=y,S=i(c,N),E=Et(b,S.collectionRef);return a.jsx(d,{ref:E,children:C})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",g=WE(h),x=Y.forwardRef((y,b)=>{const{scope:N,children:C,...S}=y,E=Y.useRef(null),A=Et(b,E),k=i(h,N);return Y.useEffect(()=>(k.itemMap.set(E,{ref:E,...S}),()=>{k.itemMap.delete(E)})),a.jsx(g,{[p]:"",ref:A,children:C})});x.displayName=h;function j(y){const b=i(e+"CollectionConsumer",y);return Y.useCallback(()=>{const C=b.collectionRef.current;if(!C)return[];const S=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(b.itemMap.values()).sort((k,T)=>S.indexOf(k.ref.current)-S.indexOf(T.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:o,Slot:f,ItemSlot:x},j,r]}function qU(e){const t=UU(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(VU);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function UU(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=KU(s),c=HU(i,s.props);return s.type!==m.Fragment&&(c.ref=r?Ir(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WU=Symbol("radix.slottable");function VU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WU}function HU(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function KU(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 GU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tt=GU.reduce((e,t)=>{const n=qU(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:o,...c}=s,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function dN(e,t){e&&cu.flushSync(()=>e.dispatchEvent(t))}function Hn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>t.current?.(...n),[])}function YU(e,t=globalThis?.document){const n=Hn(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var XU="DismissableLayer",Zj="dismissableLayer.update",QU="dismissableLayer.pointerDownOutside",JU="dismissableLayer.focusOutside",VE,R$=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wl=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=m.useContext(R$),[h,p]=m.useState(null),g=h?.ownerDocument??globalThis?.document,[,x]=m.useState({}),j=Et(t,T=>p(T)),y=Array.from(f.layers),[b]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=y.indexOf(b),C=h?y.indexOf(h):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,E=C>=N,A=e7(T=>{const O=T.target,D=[...f.branches].some(q=>q.contains(O));!E||D||(s?.(T),o?.(T),T.defaultPrevented||c?.())},g),k=t7(T=>{const O=T.target;[...f.branches].some(q=>q.contains(O))||(i?.(T),o?.(T),T.defaultPrevented||c?.())},g);return YU(T=>{C===f.layers.size-1&&(r?.(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},g),m.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(VE=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),HE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=VE)}},[h,g,n,f]),m.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),HE())},[h,f]),m.useEffect(()=>{const T=()=>x({});return document.addEventListener(Zj,T),()=>document.removeEventListener(Zj,T)},[]),a.jsx(tt.div,{...d,ref:j,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:Le(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Le(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Le(e.onPointerDownCapture,A.onPointerDownCapture)})});wl.displayName=XU;var ZU="DismissableLayerBranch",I$=m.forwardRef((e,t)=>{const n=m.useContext(R$),r=m.useRef(null),s=Et(t,r);return m.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(tt.div,{...e,ref:s})});I$.displayName=ZU;function e7(e,t=globalThis?.document){const n=Hn(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){M$(QU,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function t7(e,t=globalThis?.document){const n=Hn(e),r=m.useRef(!1);return m.useEffect(()=>{const s=i=>{i.target&&!r.current&&M$(JU,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function HE(){const e=new CustomEvent(Zj);document.dispatchEvent(e)}function M$(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?dN(s,i):s.dispatchEvent(i)}var n7=wl,r7=I$,ar=globalThis?.document?m.useLayoutEffect:()=>{},a7="Portal",jl=m.forwardRef((e,t)=>{const{container:n,...r}=e,[s,i]=m.useState(!1);ar(()=>i(!0),[]);const o=n||s&&globalThis?.document?.body;return o?O$.createPortal(a.jsx(tt.div,{...r,ref:t}),o):null});jl.displayName=a7;function s7(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Xn=e=>{const{present:t,children:n}=e,r=i7(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Et(r.ref,o7(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null};Xn.displayName="Presence";function i7(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[c,d]=s7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const f=oh(r.current);i.current=c==="mounted"?f:"none"},[c]),ar(()=>{const f=r.current,h=s.current;if(h!==e){const g=i.current,x=oh(f);e?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&g!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),ar(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=x=>{const y=oh(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&y&&(d("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},g=x=>{x.target===t&&(i.current=oh(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:m.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function oh(e){return e?.animationName||"none"}function o7(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 l7=ov[" useInsertionEffect ".trim().toString()]||ar;function ya({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,o]=c7({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:s;{const h=m.useRef(e!==void 0);m.useEffect(()=>{const p=h.current;p!==c&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${c?"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.`),h.current=c},[c,r])}const f=m.useCallback(h=>{if(c){const p=u7(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function c7({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),i=m.useRef(t);return l7(()=>{i.current=t},[t]),m.useEffect(()=>{s.current!==n&&(i.current?.(n),s.current=n)},[n,s]),[n,r,i]}function u7(e){return typeof e=="function"}var $$=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"}),d7="VisuallyHidden",lv=m.forwardRef((e,t)=>a.jsx(tt.span,{...e,ref:t,style:{...$$,...e.style}}));lv.displayName=d7;var f7=lv,fN="ToastProvider",[pN,p7,h7]=Af("Toast"),[D$]=gr("Toast",[h7]),[m7,cv]=D$(fN),L$=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=e,[c,d]=m.useState(null),[f,h]=m.useState(0),p=m.useRef(!1),g=m.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${fN}\`. Expected non-empty \`string\`.`),a.jsx(pN.Provider,{scope:t,children:a.jsx(m7,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:m.useCallback(()=>h(x=>x+1),[]),onToastRemove:m.useCallback(()=>h(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g,children:o})})};L$.displayName=fN;var F$="ToastViewport",v7=["F8"],eS="toast.viewportPause",tS="toast.viewportResume",z$=m.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=v7,label:s="Notifications ({hotkey})",...i}=e,o=cv(F$,n),c=p7(n),d=m.useRef(null),f=m.useRef(null),h=m.useRef(null),p=m.useRef(null),g=Et(t,p,o.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=o.toastCount>0;m.useEffect(()=>{const b=N=>{r.length!==0&&r.every(S=>N[S]||N.code===S)&&p.current?.focus()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),m.useEffect(()=>{const b=d.current,N=p.current;if(j&&b&&N){const C=()=>{if(!o.isClosePausedRef.current){const k=new CustomEvent(eS);N.dispatchEvent(k),o.isClosePausedRef.current=!0}},S=()=>{if(o.isClosePausedRef.current){const k=new CustomEvent(tS);N.dispatchEvent(k),o.isClosePausedRef.current=!1}},E=k=>{!b.contains(k.relatedTarget)&&S()},A=()=>{b.contains(document.activeElement)||S()};return b.addEventListener("focusin",C),b.addEventListener("focusout",E),b.addEventListener("pointermove",C),b.addEventListener("pointerleave",A),window.addEventListener("blur",C),window.addEventListener("focus",S),()=>{b.removeEventListener("focusin",C),b.removeEventListener("focusout",E),b.removeEventListener("pointermove",C),b.removeEventListener("pointerleave",A),window.removeEventListener("blur",C),window.removeEventListener("focus",S)}}},[j,o.isClosePausedRef]);const y=m.useCallback(({tabbingDirection:b})=>{const C=c().map(S=>{const E=S.ref.current,A=[E,...k7(E)];return b==="forwards"?A:A.reverse()});return(b==="forwards"?C.reverse():C).flat()},[c]);return m.useEffect(()=>{const b=p.current;if(b){const N=C=>{const S=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!S){const A=document.activeElement,k=C.shiftKey;if(C.target===b&&k){f.current?.focus();return}const D=y({tabbingDirection:k?"backwards":"forwards"}),q=D.findIndex(U=>U===A);Sy(D.slice(q+1))?C.preventDefault():k?f.current?.focus():h.current?.focus()}};return b.addEventListener("keydown",N),()=>b.removeEventListener("keydown",N)}},[c,y]),a.jsxs(r7,{ref:d,role:"region","aria-label":s.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&a.jsx(nS,{ref:f,onFocusFromOutsideViewport:()=>{const b=y({tabbingDirection:"forwards"});Sy(b)}}),a.jsx(pN.Slot,{scope:n,children:a.jsx(tt.ol,{tabIndex:-1,...i,ref:g})}),j&&a.jsx(nS,{ref:h,onFocusFromOutsideViewport:()=>{const b=y({tabbingDirection:"backwards"});Sy(b)}})]})});z$.displayName=F$;var B$="ToastFocusProxy",nS=m.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,i=cv(B$,n);return a.jsx(lv,{tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});nS.displayName=B$;var Ef="Toast",g7="toast.swipeStart",x7="toast.swipeMove",y7="toast.swipeCancel",b7="toast.swipeEnd",q$=m.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=e,[c,d]=ya({prop:r,defaultProp:s??!0,onChange:i,caller:Ef});return a.jsx(Xn,{present:n||c,children:a.jsx(S7,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:Hn(e.onPause),onResume:Hn(e.onResume),onSwipeStart:Le(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Le(e.onSwipeMove,f=>{const{x:h,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:Le(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Le(e.onSwipeEnd,f=>{const{x:h,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});q$.displayName=Ef;var[w7,j7]=D$(Ef,{onClose(){}}),S7=m.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:c,onPause:d,onResume:f,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:g,onSwipeEnd:x,...j}=e,y=cv(Ef,n),[b,N]=m.useState(null),C=Et(t,W=>N(W)),S=m.useRef(null),E=m.useRef(null),A=s||y.duration,k=m.useRef(0),T=m.useRef(A),O=m.useRef(0),{onToastAdd:D,onToastRemove:q}=y,U=Hn(()=>{b?.contains(document.activeElement)&&y.viewport?.focus(),o()}),B=m.useCallback(W=>{!W||W===1/0||(window.clearTimeout(O.current),k.current=new Date().getTime(),O.current=window.setTimeout(U,W))},[U]);m.useEffect(()=>{const W=y.viewport;if(W){const M=()=>{B(T.current),f?.()},z=()=>{const K=new Date().getTime()-k.current;T.current=T.current-K,window.clearTimeout(O.current),d?.()};return W.addEventListener(eS,z),W.addEventListener(tS,M),()=>{W.removeEventListener(eS,z),W.removeEventListener(tS,M)}}},[y.viewport,A,d,f,B]),m.useEffect(()=>{i&&!y.isClosePausedRef.current&&B(A)},[i,A,y.isClosePausedRef,B]),m.useEffect(()=>(D(),()=>q()),[D,q]);const X=m.useMemo(()=>b?Y$(b):null,[b]);return y.viewport?a.jsxs(a.Fragment,{children:[X&&a.jsx(N7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:X}),a.jsx(w7,{scope:n,onClose:U,children:cu.createPortal(a.jsx(pN.ItemSlot,{scope:n,children:a.jsx(n7,{asChild:!0,onEscapeKeyDown:Le(c,()=>{y.isFocusedToastEscapeKeyDownRef.current||U(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(tt.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,...j,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Le(e.onKeyDown,W=>{W.key==="Escape"&&(c?.(W.nativeEvent),W.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,U()))}),onPointerDown:Le(e.onPointerDown,W=>{W.button===0&&(S.current={x:W.clientX,y:W.clientY})}),onPointerMove:Le(e.onPointerMove,W=>{if(!S.current)return;const M=W.clientX-S.current.x,z=W.clientY-S.current.y,K=!!E.current,V=["left","right"].includes(y.swipeDirection),R=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,G=V?R(0,M):0,$=V?0:R(0,z),I=W.pointerType==="touch"?10:2,ee={x:G,y:$},Q={originalEvent:W,delta:ee};K?(E.current=ee,lh(x7,p,Q,{discrete:!1})):KE(ee,y.swipeDirection,I)?(E.current=ee,lh(g7,h,Q,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs(M)>I||Math.abs(z)>I)&&(S.current=null)}),onPointerUp:Le(e.onPointerUp,W=>{const M=E.current,z=W.target;if(z.hasPointerCapture(W.pointerId)&&z.releasePointerCapture(W.pointerId),E.current=null,S.current=null,M){const K=W.currentTarget,V={originalEvent:W,delta:M};KE(M,y.swipeDirection,y.swipeThreshold)?lh(b7,x,V,{discrete:!0}):lh(y7,g,V,{discrete:!0}),K.addEventListener("click",R=>R.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),N7=e=>{const{__scopeToast:t,children:n,...r}=e,s=cv(Ef,t),[i,o]=m.useState(!1),[c,d]=m.useState(!1);return A7(()=>o(!0)),m.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:a.jsx(jl,{asChild:!0,children:a.jsx(lv,{...r,children:i&&a.jsxs(a.Fragment,{children:[s.label," ",n]})})})},C7="ToastTitle",U$=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(tt.div,{...r,ref:t})});U$.displayName=C7;var _7="ToastDescription",W$=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(tt.div,{...r,ref:t})});W$.displayName=_7;var V$="ToastAction",H$=m.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?a.jsx(G$,{altText:n,asChild:!0,children:a.jsx(hN,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${V$}\`. Expected non-empty \`string\`.`),null)});H$.displayName=V$;var K$="ToastClose",hN=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=j7(K$,n);return a.jsx(G$,{asChild:!0,children:a.jsx(tt.button,{type:"button",...r,ref:t,onClick:Le(e.onClick,s.onClose)})})});hN.displayName=K$;var G$=m.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return a.jsx(tt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function Y$(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),E7(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...Y$(r))}}),t}function lh(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?dN(s,i):s.dispatchEvent(i)}var KE=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),i=r>s;return t==="left"||t==="right"?i&&r>n:!i&&s>n};function A7(e=()=>{}){const t=Hn(e);ar(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function E7(e){return e.nodeType===e.ELEMENT_NODE}function k7(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Sy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var P7=L$,X$=z$,Q$=q$,J$=U$,Z$=W$,eD=H$,tD=hN;function nD(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=nD(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Bt(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=nD(e))&&(r&&(r+=" "),r+=t);return r}const GE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,YE=Bt,Sl=(e,t)=>n=>{var r;if(t?.variants==null)return YE(e,n?.class,n?.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(f=>{const h=n?.[f],p=i?.[f];if(h===null)return null;const g=GE(h)||GE(p);return s[f][g]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,g]=h;return g===void 0||(f[p]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:g,...x}=h;return Object.entries(x).every(j=>{let[y,b]=j;return Array.isArray(b)?b.includes({...i,...c}[y]):{...i,...c}[y]===b})?[...f,p,g]:f},[]);return YE(e,o,d,n?.class,n?.className)};const T7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rD=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var O7={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"};const R7=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...c},d)=>m.createElement("svg",{ref:d,...O7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:rD("lucide",s),...c},[...o.map(([f,h])=>m.createElement(f,h)),...Array.isArray(i)?i:[i]]));const dt=(e,t)=>{const n=m.forwardRef(({className:r,...s},i)=>m.createElement(R7,{ref:i,iconNode:t,className:rD(`lucide-${T7(e)}`,r),...s}));return n.displayName=`${e}`,n};const aD=dt("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"}]]);const sD=dt("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"}]]);const nl=dt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const Rr=dt("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"}]]);const I7=dt("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"}]]);const Pc=dt("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"}]]);const Tc=dt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Qt=dt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const mN=dt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const Cs=dt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const wc=dt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const Ny=dt("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"}]]);const si=dt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const M7=dt("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"}]]);const jc=dt("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"}]]);const $7=dt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const D7=dt("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);const yi=dt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ps=dt("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"}]]);const iD=dt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const Oa=dt("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"}]]);const uv=dt("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"}]]);const qh=dt("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"}]]);const L7=dt("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"}]]);const oD=dt("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"}]]);const XE=dt("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"}]]);const lD=dt("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"}]]);const F7=dt("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"}]]);const vN=dt("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"}]]);const z7=dt("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"}]]);const B7=dt("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"}]]);const q7=dt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const rS=dt("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"}]]);const cD=dt("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"}]]);const U7=dt("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"}]]);const aS=dt("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"}]]);const W7=dt("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"}]]);const Cr=dt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const uD=dt("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"}]]);const V7=dt("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"}]]);const dD=dt("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"}]]);const mc=dt("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"}]]);const H7=dt("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const sS=dt("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"}]]);const iS=dt("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"}]]);const dv=dt("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"}]]);const ii=dt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const fi=dt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const gN=dt("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"}]]);const ba=dt("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"}]]);const K7=dt("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"}]]);const xN=dt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const G7=dt("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"}]]);const yN=dt("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"}]]);const Y7=dt("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"}]]);const Vr=dt("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"}]]);const _d=dt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const fD=dt("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"}]]);const $a=dt("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"}]]);const $h=dt("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"}]]);const X7=dt("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"}]]);const Oc=dt("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"}]]);const pD=dt("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"}]]);const ts=dt("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"}]]);const rs=dt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),bN="-",Q7=e=>{const t=Z7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(bN);return c[0]===""&&c.length!==1&&c.shift(),hD(c,t)||J7(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},hD=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?hD(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(bN);return t.validators.find(({validator:o})=>o(i))?.classGroupId},QE=/^\[(.+)\]$/,J7=e=>{if(QE.test(e)){const t=QE.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Z7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return t9(Object.entries(e.classGroups),n).forEach(([i,o])=>{oS(o,r,i,t)}),r},oS=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:JE(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(e9(s)){oS(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{oS(o,JE(t,i),n,r)})})},JE=(e,t)=>{let n=e;return t.split(bN).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},e9=e=>e.isThemeGetter,t9=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,c])=>[t+o,c])):i);return[n,s]}):e,n9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},mD="!",r9=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=c=>{const d=[];let f=0,h=0,p;for(let b=0;b<c.length;b++){let N=c[b];if(f===0){if(N===s&&(r||c.slice(b,b+i)===t)){d.push(c.slice(h,b)),h=b+i;continue}if(N==="/"){p=b;continue}}N==="["?f++:N==="]"&&f--}const g=d.length===0?c:c.substring(h),x=g.startsWith(mD),j=x?g.substring(1):g,y=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:y}};return n?c=>n({className:c,parseClassName:o}):o},a9=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},s9=e=>({cache:n9(e.cacheSize),parseClassName:r9(e),...Q7(e)}),i9=/\s+/,o9=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(i9);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{modifiers:h,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:x}=n(f);let j=!!x,y=r(j?g.substring(0,x):g);if(!y){if(!j){c=f+(c.length>0?" "+c:c);continue}if(y=r(g),!y){c=f+(c.length>0?" "+c:c);continue}j=!1}const b=a9(h).join(":"),N=p?b+mD:b,C=N+y;if(i.includes(C))continue;i.push(C);const S=s(y,j);for(let E=0;E<S.length;++E){const A=S[E];i.push(N+A)}c=f+(c.length>0?" "+c:c)}return c};function l9(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vD(t))&&(r&&(r+=" "),r+=n);return r}const vD=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vD(e[r]))&&(n&&(n+=" "),n+=t);return n};function c9(e,...t){let n,r,s,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=s9(f),r=n.cache.get,s=n.cache.set,i=c,c(d)}function c(d){const f=r(d);if(f)return f;const h=o9(d,n);return s(d,h),h}return function(){return i(l9.apply(null,arguments))}}const Tn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},gD=/^\[(?:([a-z-]+):)?(.+)\]$/i,u9=/^\d+\/\d+$/,d9=new Set(["px","full","screen"]),f9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p9=/\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$/,h9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,m9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Js=e=>Sc(e)||d9.has(e)||u9.test(e),Hi=e=>uu(e,"length",N9),Sc=e=>!!e&&!Number.isNaN(Number(e)),Cy=e=>uu(e,"number",Sc),od=e=>!!e&&Number.isInteger(Number(e)),g9=e=>e.endsWith("%")&&Sc(e.slice(0,-1)),Wt=e=>gD.test(e),Ki=e=>f9.test(e),x9=new Set(["length","size","percentage"]),y9=e=>uu(e,x9,xD),b9=e=>uu(e,"position",xD),w9=new Set(["image","url"]),j9=e=>uu(e,w9,_9),S9=e=>uu(e,"",C9),ld=()=>!0,uu=(e,t,n)=>{const r=gD.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},N9=e=>p9.test(e)&&!h9.test(e),xD=()=>!1,C9=e=>m9.test(e),_9=e=>v9.test(e),A9=()=>{const e=Tn("colors"),t=Tn("spacing"),n=Tn("blur"),r=Tn("brightness"),s=Tn("borderColor"),i=Tn("borderRadius"),o=Tn("borderSpacing"),c=Tn("borderWidth"),d=Tn("contrast"),f=Tn("grayscale"),h=Tn("hueRotate"),p=Tn("invert"),g=Tn("gap"),x=Tn("gradientColorStops"),j=Tn("gradientColorStopPositions"),y=Tn("inset"),b=Tn("margin"),N=Tn("opacity"),C=Tn("padding"),S=Tn("saturate"),E=Tn("scale"),A=Tn("sepia"),k=Tn("skew"),T=Tn("space"),O=Tn("translate"),D=()=>["auto","contain","none"],q=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",Wt,t],B=()=>[Wt,t],X=()=>["",Js,Hi],W=()=>["auto",Sc,Wt],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],R=()=>["","0",Wt],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[Sc,Wt];return{cacheSize:500,separator:":",theme:{colors:[ld],spacing:[Js,Hi],blur:["none","",Ki,Wt],brightness:$(),borderColor:[e],borderRadius:["none","","full",Ki,Wt],borderSpacing:B(),borderWidth:X(),contrast:$(),grayscale:R(),hueRotate:$(),invert:R(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[g9,Hi],inset:U(),margin:U(),opacity:$(),padding:B(),saturate:$(),scale:$(),sepia:R(),skew:$(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",Wt]}],container:["container"],columns:[{columns:[Ki]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"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"],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:[...M(),Wt]}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",od,Wt]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Wt]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",od,Wt]}],"grid-cols":[{"grid-cols":[ld]}],"col-start-end":[{col:["auto",{span:["full",od,Wt]},Wt]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[ld]}],"row-start-end":[{row:["auto",{span:[od,Wt]},Wt]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Wt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Wt]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Wt,t]}],"min-w":[{"min-w":[Wt,t,"min","max","fit"]}],"max-w":[{"max-w":[Wt,t,"none","full","min","max","fit","prose",{screen:[Ki]},Ki]}],h:[{h:[Wt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Wt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Wt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Wt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ki,Hi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Cy]}],"font-family":[{font:[ld]}],"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:["tighter","tight","normal","wide","wider","widest",Wt]}],"line-clamp":[{"line-clamp":["none",Sc,Cy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Js,Wt]}],"list-image":[{"list-image":["none",Wt]}],"list-style-type":[{list:["none","disc","decimal",Wt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Js,Hi]}],"underline-offset":[{"underline-offset":["auto",Js,Wt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Wt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Wt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),b9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",y9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},j9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:z()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Js,Wt]}],"outline-w":[{outline:[Js,Hi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[Js,Hi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ki,S9]}],"shadow-color":[{shadow:[ld]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ki,Wt]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[S]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Wt]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",Wt]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",Wt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[od,Wt]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Wt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Wt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",Wt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Js,Hi,Cy]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},E9=c9(A9);function Ce(...e){return E9(Bt(e))}const k9=P7,yD=m.forwardRef(({className:e,...t},n)=>a.jsx(X$,{ref:n,className:Ce("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}));yD.displayName=X$.displayName;const P9=Sl("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-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--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 data-[state=open]:sm: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"}}),bD=m.forwardRef(({className:e,variant:t,...n},r)=>a.jsx(Q$,{ref:r,className:Ce(P9({variant:t}),e),...n}));bD.displayName=Q$.displayName;const T9=m.forwardRef(({className:e,...t},n)=>a.jsx(eD,{ref:n,className:Ce("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 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));T9.displayName=eD.displayName;const wD=m.forwardRef(({className:e,...t},n)=>a.jsx(tD,{ref:n,className:Ce("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 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(rs,{className:"h-4 w-4"})}));wD.displayName=tD.displayName;const jD=m.forwardRef(({className:e,...t},n)=>a.jsx(J$,{ref:n,className:Ce("text-sm font-semibold",e),...t}));jD.displayName=J$.displayName;const SD=m.forwardRef(({className:e,...t},n)=>a.jsx(Z$,{ref:n,className:Ce("text-sm opacity-90",e),...t}));SD.displayName=Z$.displayName;function O9(){const{toasts:e}=IU();return a.jsxs(k9,{children:[e.map(function({id:t,title:n,description:r,action:s,...i}){return a.jsxs(bD,{...i,children:[a.jsxs("div",{className:"grid gap-1",children:[n&&a.jsx(jD,{children:n}),r&&a.jsx(SD,{children:r})]}),s,a.jsx(wD,{})]},t)}),a.jsx(yD,{})]})}var ZE=["light","dark"],R9="(prefers-color-scheme: dark)",I9=m.createContext(void 0),M9={setTheme:e=>{},themes:[]},$9=()=>{var e;return(e=m.useContext(I9))!=null?e:M9};m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:c,nonce:d})=>{let f=i==="system",h=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${c.map(j=>`'${j}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=s?ZE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",g=(j,y=!1,b=!0)=>{let N=o?o[j]:j,C=y?j+"|| ''":`'${N}'`,S="";return s&&b&&!y&&ZE.includes(j)&&(S+=`d.style.colorScheme = '${j}';`),n==="class"?y||N?S+=`c.add(${C})`:S+="null":N&&(S+=`d[s](n,${C})`),S},x=e?`!function(){${h}${g(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${R9}',m=window.matchMedia(t);if(m.media!==t||m.matches){${g("dark")}}else{${g("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${g(o?"x[e]":"e",!0)}}${f?"":"else{"+g(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${g(o?"x[e]":"e",!0)}}else{${g(i,!1,!1)};}${p}}catch(t){}}();`;return m.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:x}})});var D9=e=>{switch(e){case"success":return z9;case"info":return q9;case"warning":return B9;case"error":return U9;default:return null}},L9=Array(12).fill(0),F9=({visible:e,className:t})=>Y.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Y.createElement("div",{className:"sonner-spinner"},L9.map((n,r)=>Y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),z9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),B9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Y.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"})),q9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),U9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),W9=Y.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"},Y.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Y.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),V9=()=>{let[e,t]=Y.useState(document.hidden);return Y.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},lS=1,H9=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=>{var t;let{message:n,...r}=e,s=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:lS++,i=this.toasts.find(c=>c.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...e,id:s,title:n}),{...c,...e,id:s,dismissible:o,title:n}):c):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.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"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0,i,o=r.then(async d=>{if(i=["resolve",d],Y.isValidElement(d))s=!1,this.create({id:n,type:"default",message:d});else if(G9(d)&&!d.ok){s=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${d.status}`):t.error,h=typeof t.description=="function"?await t.description(`HTTP error! status: ${d.status}`):t.description;this.create({id:n,type:"error",message:f,description:h})}else if(t.success!==void 0){s=!1;let f=typeof t.success=="function"?await t.success(d):t.success,h=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"success",message:f,description:h})}}).catch(async d=>{if(i=["reject",d],t.error!==void 0){s=!1;let f=typeof t.error=="function"?await t.error(d):t.error,h=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"error",message:f,description:h})}}).finally(()=>{var d;s&&(this.dismiss(n),n=void 0),(d=t.finally)==null||d.call(t)}),c=()=>new Promise((d,f)=>o.then(()=>i[0]==="reject"?f(i[1]):d(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||lS++;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}},Ur=new H9,K9=(e,t)=>{let n=t?.id||lS++;return Ur.addToast({title:e,...t,id:n}),n},G9=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Y9=K9,X9=()=>Ur.toasts,Q9=()=>Ur.getActiveToasts();Object.assign(Y9,{success:Ur.success,info:Ur.info,warning:Ur.warning,error:Ur.error,custom:Ur.custom,message:Ur.message,promise:Ur.promise,dismiss:Ur.dismiss,loading:Ur.loading},{getHistory:X9,getToasts:Q9});function J9(e,{insertAt:t}={}){if(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))}J9(`: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 ch(e){return e.label!==void 0}var Z9=3,eW="32px",tW="16px",ek=4e3,nW=356,rW=14,aW=20,sW=200;function Ka(...e){return e.filter(Boolean).join(" ")}function iW(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var oW=e=>{var t,n,r,s,i,o,c,d,f,h,p;let{invert:g,toast:x,unstyled:j,interacting:y,setHeights:b,visibleToasts:N,heights:C,index:S,toasts:E,expanded:A,removeToast:k,defaultRichColors:T,closeButton:O,style:D,cancelButtonStyle:q,actionButtonStyle:U,className:B="",descriptionClassName:X="",duration:W,position:M,gap:z,loadingIcon:K,expandByDefault:V,classNames:R,icons:G,closeButtonAriaLabel:$="Close toast",pauseWhenPageIsHidden:I}=e,[ee,Q]=Y.useState(null),[ie,ue]=Y.useState(null),[re,je]=Y.useState(!1),[pe,oe]=Y.useState(!1),[_e,ce]=Y.useState(!1),[de,ve]=Y.useState(!1),[Pe,F]=Y.useState(!1),[te,fe]=Y.useState(0),[Ee,Me]=Y.useState(0),et=Y.useRef(x.duration||W||ek),st=Y.useRef(null),xt=Y.useRef(null),qt=S===0,Ut=S+1<=N,xe=x.type,Ye=x.dismissible!==!1,he=x.className||"",Te=x.descriptionClassName||"",Ie=Y.useMemo(()=>C.findIndex(lt=>lt.toastId===x.id)||0,[C,x.id]),Ot=Y.useMemo(()=>{var lt;return(lt=x.closeButton)!=null?lt:O},[x.closeButton,O]),Ht=Y.useMemo(()=>x.duration||W||ek,[x.duration,W]),Ct=Y.useRef(0),ge=Y.useRef(0),qe=Y.useRef(0),Ve=Y.useRef(null),[St,Oe]=M.split("-"),Ze=Y.useMemo(()=>C.reduce((lt,zt,Jt)=>Jt>=Ie?lt:lt+zt.height,0),[C,Ie]),we=V9(),at=x.invert||g,wt=xe==="loading";ge.current=Y.useMemo(()=>Ie*z+Ze,[Ie,Ze]),Y.useEffect(()=>{et.current=Ht},[Ht]),Y.useEffect(()=>{je(!0)},[]),Y.useEffect(()=>{let lt=xt.current;if(lt){let zt=lt.getBoundingClientRect().height;return Me(zt),b(Jt=>[{toastId:x.id,height:zt,position:x.position},...Jt]),()=>b(Jt=>Jt.filter(dn=>dn.toastId!==x.id))}},[b,x.id]),Y.useLayoutEffect(()=>{if(!re)return;let lt=xt.current,zt=lt.style.height;lt.style.height="auto";let Jt=lt.getBoundingClientRect().height;lt.style.height=zt,Me(Jt),b(dn=>dn.find(mn=>mn.toastId===x.id)?dn.map(mn=>mn.toastId===x.id?{...mn,height:Jt}:mn):[{toastId:x.id,height:Jt,position:x.position},...dn])},[re,x.title,x.description,b,x.id]);let Dt=Y.useCallback(()=>{oe(!0),fe(ge.current),b(lt=>lt.filter(zt=>zt.toastId!==x.id)),setTimeout(()=>{k(x)},sW)},[x,k,b,ge]);Y.useEffect(()=>{if(x.promise&&xe==="loading"||x.duration===1/0||x.type==="loading")return;let lt;return A||y||I&&we?(()=>{if(qe.current<Ct.current){let zt=new Date().getTime()-Ct.current;et.current=et.current-zt}qe.current=new Date().getTime()})():et.current!==1/0&&(Ct.current=new Date().getTime(),lt=setTimeout(()=>{var zt;(zt=x.onAutoClose)==null||zt.call(x,x),Dt()},et.current)),()=>clearTimeout(lt)},[A,y,x,xe,I,we,Dt]),Y.useEffect(()=>{x.delete&&Dt()},[Dt,x.delete]);function Fn(){var lt,zt,Jt;return G!=null&&G.loading?Y.createElement("div",{className:Ka(R?.loader,(lt=x?.classNames)==null?void 0:lt.loader,"sonner-loader"),"data-visible":xe==="loading"},G.loading):K?Y.createElement("div",{className:Ka(R?.loader,(zt=x?.classNames)==null?void 0:zt.loader,"sonner-loader"),"data-visible":xe==="loading"},K):Y.createElement(F9,{className:Ka(R?.loader,(Jt=x?.classNames)==null?void 0:Jt.loader),visible:xe==="loading"})}return Y.createElement("li",{tabIndex:0,ref:xt,className:Ka(B,he,R?.toast,(t=x?.classNames)==null?void 0:t.toast,R?.default,R?.[xe],(n=x?.classNames)==null?void 0:n[xe]),"data-sonner-toast":"","data-rich-colors":(r=x.richColors)!=null?r:T,"data-styled":!(x.jsx||x.unstyled||j),"data-mounted":re,"data-promise":!!x.promise,"data-swiped":Pe,"data-removed":pe,"data-visible":Ut,"data-y-position":St,"data-x-position":Oe,"data-index":S,"data-front":qt,"data-swiping":_e,"data-dismissible":Ye,"data-type":xe,"data-invert":at,"data-swipe-out":de,"data-swipe-direction":ie,"data-expanded":!!(A||V&&re),style:{"--index":S,"--toasts-before":S,"--z-index":E.length-S,"--offset":`${pe?te:ge.current}px`,"--initial-height":V?"auto":`${Ee}px`,...D,...x.style},onDragEnd:()=>{ce(!1),Q(null),Ve.current=null},onPointerDown:lt=>{wt||!Ye||(st.current=new Date,fe(ge.current),lt.target.setPointerCapture(lt.pointerId),lt.target.tagName!=="BUTTON"&&(ce(!0),Ve.current={x:lt.clientX,y:lt.clientY}))},onPointerUp:()=>{var lt,zt,Jt,dn;if(de||!Ye)return;Ve.current=null;let mn=Number(((lt=xt.current)==null?void 0:lt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xt=Number(((zt=xt.current)==null?void 0:zt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ir=new Date().getTime()-((Jt=st.current)==null?void 0:Jt.getTime()),se=ee==="x"?mn:Xt,Je=Math.abs(se)/ir;if(Math.abs(se)>=aW||Je>.11){fe(ge.current),(dn=x.onDismiss)==null||dn.call(x,x),ue(ee==="x"?mn>0?"right":"left":Xt>0?"down":"up"),Dt(),ve(!0),F(!1);return}ce(!1),Q(null)},onPointerMove:lt=>{var zt,Jt,dn,mn;if(!Ve.current||!Ye||((zt=window.getSelection())==null?void 0:zt.toString().length)>0)return;let Xt=lt.clientY-Ve.current.y,ir=lt.clientX-Ve.current.x,se=(Jt=e.swipeDirections)!=null?Jt:iW(M);!ee&&(Math.abs(ir)>1||Math.abs(Xt)>1)&&Q(Math.abs(ir)>Math.abs(Xt)?"x":"y");let Je={x:0,y:0};ee==="y"?(se.includes("top")||se.includes("bottom"))&&(se.includes("top")&&Xt<0||se.includes("bottom")&&Xt>0)&&(Je.y=Xt):ee==="x"&&(se.includes("left")||se.includes("right"))&&(se.includes("left")&&ir<0||se.includes("right")&&ir>0)&&(Je.x=ir),(Math.abs(Je.x)>0||Math.abs(Je.y)>0)&&F(!0),(dn=xt.current)==null||dn.style.setProperty("--swipe-amount-x",`${Je.x}px`),(mn=xt.current)==null||mn.style.setProperty("--swipe-amount-y",`${Je.y}px`)}},Ot&&!x.jsx?Y.createElement("button",{"aria-label":$,"data-disabled":wt,"data-close-button":!0,onClick:wt||!Ye?()=>{}:()=>{var lt;Dt(),(lt=x.onDismiss)==null||lt.call(x,x)},className:Ka(R?.closeButton,(s=x?.classNames)==null?void 0:s.closeButton)},(i=G?.close)!=null?i:W9):null,x.jsx||m.isValidElement(x.title)?x.jsx?x.jsx:typeof x.title=="function"?x.title():x.title:Y.createElement(Y.Fragment,null,xe||x.icon||x.promise?Y.createElement("div",{"data-icon":"",className:Ka(R?.icon,(o=x?.classNames)==null?void 0:o.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||Fn():null,x.type!=="loading"?x.icon||G?.[xe]||D9(xe):null):null,Y.createElement("div",{"data-content":"",className:Ka(R?.content,(c=x?.classNames)==null?void 0:c.content)},Y.createElement("div",{"data-title":"",className:Ka(R?.title,(d=x?.classNames)==null?void 0:d.title)},typeof x.title=="function"?x.title():x.title),x.description?Y.createElement("div",{"data-description":"",className:Ka(X,Te,R?.description,(f=x?.classNames)==null?void 0:f.description)},typeof x.description=="function"?x.description():x.description):null),m.isValidElement(x.cancel)?x.cancel:x.cancel&&ch(x.cancel)?Y.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||q,onClick:lt=>{var zt,Jt;ch(x.cancel)&&Ye&&((Jt=(zt=x.cancel).onClick)==null||Jt.call(zt,lt),Dt())},className:Ka(R?.cancelButton,(h=x?.classNames)==null?void 0:h.cancelButton)},x.cancel.label):null,m.isValidElement(x.action)?x.action:x.action&&ch(x.action)?Y.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||U,onClick:lt=>{var zt,Jt;ch(x.action)&&((Jt=(zt=x.action).onClick)==null||Jt.call(zt,lt),!lt.defaultPrevented&&Dt())},className:Ka(R?.actionButton,(p=x?.classNames)==null?void 0:p.actionButton)},x.action.label):null))};function tk(){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 lW(e,t){let n={};return[e,t].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",c=i?tW:eW;function d(f){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${o}-${f}`]=c:n[`${o}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}var cW=m.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:c,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:g,style:x,visibleToasts:j=Z9,toastOptions:y,dir:b=tk(),gap:N=rW,loadingIcon:C,icons:S,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:A}=e,[k,T]=Y.useState([]),O=Y.useMemo(()=>Array.from(new Set([r].concat(k.filter(I=>I.position).map(I=>I.position)))),[k,r]),[D,q]=Y.useState([]),[U,B]=Y.useState(!1),[X,W]=Y.useState(!1),[M,z]=Y.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=Y.useRef(null),V=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=Y.useRef(null),G=Y.useRef(!1),$=Y.useCallback(I=>{T(ee=>{var Q;return(Q=ee.find(ie=>ie.id===I.id))!=null&&Q.delete||Ur.dismiss(I.id),ee.filter(({id:ie})=>ie!==I.id)})},[]);return Y.useEffect(()=>Ur.subscribe(I=>{if(I.dismiss){T(ee=>ee.map(Q=>Q.id===I.id?{...Q,delete:!0}:Q));return}setTimeout(()=>{O$.flushSync(()=>{T(ee=>{let Q=ee.findIndex(ie=>ie.id===I.id);return Q!==-1?[...ee.slice(0,Q),{...ee[Q],...I},...ee.slice(Q+1)]:[I,...ee]})})})}),[]),Y.useEffect(()=>{if(h!=="system"){z(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:ee})=>{z(ee?"dark":"light")})}catch{I.addListener(({matches:Q})=>{try{z(Q?"dark":"light")}catch(ie){console.error(ie)}})}},[h]),Y.useEffect(()=>{k.length<=1&&B(!1)},[k]),Y.useEffect(()=>{let I=ee=>{var Q,ie;s.every(ue=>ee[ue]||ee.code===ue)&&(B(!0),(Q=K.current)==null||Q.focus()),ee.code==="Escape"&&(document.activeElement===K.current||(ie=K.current)!=null&&ie.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[s]),Y.useEffect(()=>{if(K.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,G.current=!1)}},[K.current]),Y.createElement("section",{ref:t,"aria-label":`${E} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((I,ee)=>{var Q;let[ie,ue]=I.split("-");return k.length?Y.createElement("ol",{key:I,dir:b==="auto"?tk():b,tabIndex:-1,ref:K,className:c,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":ie,"data-lifted":U&&k.length>1&&!i,"data-x-position":ue,style:{"--front-toast-height":`${((Q=D[0])==null?void 0:Q.height)||0}px`,"--width":`${nW}px`,"--gap":`${N}px`,...x,...lW(d,f)},onBlur:re=>{G.current&&!re.currentTarget.contains(re.relatedTarget)&&(G.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||G.current||(G.current=!0,R.current=re.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{X||B(!1)},onDragEnd:()=>B(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},k.filter(re=>!re.position&&ee===0||re.position===I).map((re,je)=>{var pe,oe;return Y.createElement(oW,{key:re.id,icons:S,index:je,toast:re,defaultRichColors:p,duration:(pe=y?.duration)!=null?pe:g,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(oe=y?.closeButton)!=null?oe:o,interacting:X,position:I,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,removeToast:$,toasts:k.filter(_e=>_e.position==re.position),heights:D.filter(_e=>_e.position==re.position),setHeights:q,expandByDefault:i,gap:N,loadingIcon:C,expanded:U,pauseWhenPageIsHidden:A,swipeDirections:e.swipeDirections})})):null}))});const uW=({...e})=>{const{theme:t="system"}=$9();return a.jsx(cW,{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})};var dW=ov[" useId ".trim().toString()]||(()=>{}),fW=0;function rr(e){const[t,n]=m.useState(dW());return ar(()=>{n(r=>r??String(fW++))},[e]),e||(t?`radix-${t}`:"")}const pW=["top","right","bottom","left"],no=Math.min,fa=Math.max,Uh=Math.round,uh=Math.floor,_s=e=>({x:e,y:e}),hW={left:"right",right:"left",bottom:"top",top:"bottom"},mW={start:"end",end:"start"};function cS(e,t,n){return fa(e,no(t,n))}function pi(e,t){return typeof e=="function"?e(t):e}function hi(e){return e.split("-")[0]}function du(e){return e.split("-")[1]}function wN(e){return e==="x"?"y":"x"}function jN(e){return e==="y"?"height":"width"}const vW=new Set(["top","bottom"]);function Ss(e){return vW.has(hi(e))?"y":"x"}function SN(e){return wN(Ss(e))}function gW(e,t,n){n===void 0&&(n=!1);const r=du(e),s=SN(e),i=jN(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Wh(o)),[o,Wh(o)]}function xW(e){const t=Wh(e);return[uS(e),t,uS(t)]}function uS(e){return e.replace(/start|end/g,t=>mW[t])}const nk=["left","right"],rk=["right","left"],yW=["top","bottom"],bW=["bottom","top"];function wW(e,t,n){switch(e){case"top":case"bottom":return n?t?rk:nk:t?nk:rk;case"left":case"right":return t?yW:bW;default:return[]}}function jW(e,t,n,r){const s=du(e);let i=wW(hi(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(uS)))),i}function Wh(e){return e.replace(/left|right|bottom|top/g,t=>hW[t])}function SW(e){return{top:0,right:0,bottom:0,left:0,...e}}function ND(e){return typeof e!="number"?SW(e):{top:e,right:e,bottom:e,left:e}}function Vh(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function ak(e,t,n){let{reference:r,floating:s}=e;const i=Ss(t),o=SN(t),c=jN(o),d=hi(t),f=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,g=r[c]/2-s[c]/2;let x;switch(d){case"top":x={x:h,y:r.y-s.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-s.width,y:p};break;default:x={x:r.x,y:r.y}}switch(du(t)){case"start":x[o]-=g*(n&&f?-1:1);break;case"end":x[o]+=g*(n&&f?-1:1);break}return x}async function NW(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:o,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:x=0}=pi(t,e),j=ND(x),b=c[g?p==="floating"?"reference":"floating":p],N=Vh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),C=p==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),E=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},A=Vh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:S,strategy:d}):C);return{top:(N.top-A.top+j.top)/E.y,bottom:(A.bottom-N.bottom+j.bottom)/E.y,left:(N.left-A.left+j.left)/E.x,right:(A.right-N.right+j.right)/E.x}}const CW=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,c=i.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:p}=ak(f,r,d),g=r,x={},j=0;for(let b=0;b<c.length;b++){var y;const{name:N,fn:C}=c[b],{x:S,y:E,data:A,reset:k}=await C({x:h,y:p,initialPlacement:r,placement:g,strategy:s,middlewareData:x,rects:f,platform:{...o,detectOverflow:(y=o.detectOverflow)!=null?y:NW},elements:{reference:e,floating:t}});h=S??h,p=E??p,x={...x,[N]:{...x[N],...A}},k&&j<=50&&(j++,typeof k=="object"&&(k.placement&&(g=k.placement),k.rects&&(f=k.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):k.rects),{x:h,y:p}=ak(f,g,d)),b=-1)}return{x:h,y:p,placement:g,strategy:s,middlewareData:x}},_W=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:c,middlewareData:d}=t,{element:f,padding:h=0}=pi(e,t)||{};if(f==null)return{};const p=ND(h),g={x:n,y:r},x=SN(s),j=jN(x),y=await o.getDimensions(f),b=x==="y",N=b?"top":"left",C=b?"bottom":"right",S=b?"clientHeight":"clientWidth",E=i.reference[j]+i.reference[x]-g[x]-i.floating[j],A=g[x]-i.reference[x],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let T=k?k[S]:0;(!T||!await(o.isElement==null?void 0:o.isElement(k)))&&(T=c.floating[S]||i.floating[j]);const O=E/2-A/2,D=T/2-y[j]/2-1,q=no(p[N],D),U=no(p[C],D),B=q,X=T-y[j]-U,W=T/2-y[j]/2+O,M=cS(B,W,X),z=!d.arrow&&du(s)!=null&&W!==M&&i.reference[j]/2-(W<B?q:U)-y[j]/2<0,K=z?W<B?W-B:W-X:0;return{[x]:g[x]+K,data:{[x]:M,centerOffset:W-M-K,...z&&{alignmentOffset:K}},reset:z}}}),AW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:y=!0,...b}=pi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const N=hi(s),C=Ss(c),S=hi(c)===c,E=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=g||(S||!y?[Wh(c)]:xW(c)),k=j!=="none";!g&&k&&A.push(...jW(c,y,j,E));const T=[c,...A],O=await d.detectOverflow(t,b),D=[];let q=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&D.push(O[N]),p){const W=gW(s,o,E);D.push(O[W[0]],O[W[1]])}if(q=[...q,{placement:s,overflows:D}],!D.every(W=>W<=0)){var U,B;const W=(((U=i.flip)==null?void 0:U.index)||0)+1,M=T[W];if(M&&(!(p==="alignment"?C!==Ss(M):!1)||q.every(V=>Ss(V.placement)===C?V.overflows[0]>0:!0)))return{data:{index:W,overflows:q},reset:{placement:M}};let z=(B=q.filter(K=>K.overflows[0]<=0).sort((K,V)=>K.overflows[1]-V.overflows[1])[0])==null?void 0:B.placement;if(!z)switch(x){case"bestFit":{var X;const K=(X=q.filter(V=>{if(k){const R=Ss(V.placement);return R===C||R==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(R=>R>0).reduce((R,G)=>R+G,0)]).sort((V,R)=>V[1]-R[1])[0])==null?void 0:X[0];K&&(z=K);break}case"initialPlacement":z=c;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function sk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ik(e){return pW.some(t=>e[t]>=0)}const EW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...i}=pi(e,t);switch(s){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=sk(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:ik(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=sk(o,n.floating);return{data:{escapedOffsets:c,escaped:ik(c)}}}default:return{}}}}},CD=new Set(["left","top"]);async function kW(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=hi(n),c=du(n),d=Ss(n)==="y",f=CD.has(o)?-1:1,h=i&&d?-1:1,p=pi(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof j=="number"&&(x=c==="end"?j*-1:j),d?{x:x*h,y:g*f}:{x:g*f,y:x*h}}const PW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:c}=t,d=await kW(t,e);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:i+d.y,data:{...d,placement:o}}}}},TW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:d={fn:N=>{let{x:C,y:S}=N;return{x:C,y:S}}},...f}=pi(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),g=Ss(hi(s)),x=wN(g);let j=h[x],y=h[g];if(o){const N=x==="y"?"top":"left",C=x==="y"?"bottom":"right",S=j+p[N],E=j-p[C];j=cS(S,j,E)}if(c){const N=g==="y"?"top":"left",C=g==="y"?"bottom":"right",S=y+p[N],E=y-p[C];y=cS(S,y,E)}const b=d.fn({...t,[x]:j,[g]:y});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[x]:o,[g]:c}}}}}},OW=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=pi(e,t),h={x:n,y:r},p=Ss(s),g=wN(p);let x=h[g],j=h[p];const y=pi(c,t),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(d){const S=g==="y"?"height":"width",E=i.reference[g]-i.floating[S]+b.mainAxis,A=i.reference[g]+i.reference[S]-b.mainAxis;x<E?x=E:x>A&&(x=A)}if(f){var N,C;const S=g==="y"?"width":"height",E=CD.has(hi(s)),A=i.reference[p]-i.floating[S]+(E&&((N=o.offset)==null?void 0:N[p])||0)+(E?0:b.crossAxis),k=i.reference[p]+i.reference[S]+(E?0:((C=o.offset)==null?void 0:C[p])||0)-(E?b.crossAxis:0);j<A?j=A:j>k&&(j=k)}return{[g]:x,[p]:j}}}},RW=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:o,elements:c}=t,{apply:d=()=>{},...f}=pi(e,t),h=await o.detectOverflow(t,f),p=hi(s),g=du(s),x=Ss(s)==="y",{width:j,height:y}=i.floating;let b,N;p==="top"||p==="bottom"?(b=p,N=g===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(N=p,b=g==="end"?"top":"bottom");const C=y-h.top-h.bottom,S=j-h.left-h.right,E=no(y-h[b],C),A=no(j-h[N],S),k=!t.middlewareData.shift;let T=E,O=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),k&&!g){const q=fa(h.left,0),U=fa(h.right,0),B=fa(h.top,0),X=fa(h.bottom,0);x?O=j-2*(q!==0||U!==0?q+U:fa(h.left,h.right)):T=y-2*(B!==0||X!==0?B+X:fa(h.top,h.bottom))}await d({...t,availableWidth:O,availableHeight:T});const D=await o.getDimensions(c.floating);return j!==D.width||y!==D.height?{reset:{rects:!0}}:{}}}};function fv(){return typeof window<"u"}function fu(e){return _D(e)?(e.nodeName||"").toLowerCase():"#document"}function va(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ms(e){var t;return(t=(_D(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _D(e){return fv()?e instanceof Node||e instanceof va(e).Node:!1}function as(e){return fv()?e instanceof Element||e instanceof va(e).Element:!1}function Ts(e){return fv()?e instanceof HTMLElement||e instanceof va(e).HTMLElement:!1}function ok(e){return!fv()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof va(e).ShadowRoot}const IW=new Set(["inline","contents"]);function kf(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ss(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!IW.has(s)}const MW=new Set(["table","td","th"]);function $W(e){return MW.has(fu(e))}const DW=[":popover-open",":modal"];function pv(e){return DW.some(t=>{try{return e.matches(t)}catch{return!1}})}const LW=["transform","translate","scale","rotate","perspective"],FW=["transform","translate","scale","rotate","perspective","filter"],zW=["paint","layout","strict","content"];function NN(e){const t=CN(),n=as(e)?ss(e):e;return LW.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||FW.some(r=>(n.willChange||"").includes(r))||zW.some(r=>(n.contain||"").includes(r))}function BW(e){let t=ro(e);for(;Ts(t)&&!Rc(t);){if(NN(t))return t;if(pv(t))return null;t=ro(t)}return null}function CN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const qW=new Set(["html","body","#document"]);function Rc(e){return qW.has(fu(e))}function ss(e){return va(e).getComputedStyle(e)}function hv(e){return as(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ro(e){if(fu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ok(e)&&e.host||Ms(e);return ok(t)?t.host:t}function AD(e){const t=ro(e);return Rc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ts(t)&&kf(t)?t:AD(t)}function Id(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=AD(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=va(s);if(i){const c=dS(o);return t.concat(o,o.visualViewport||[],kf(s)?s:[],c&&n?Id(c):[])}return t.concat(s,Id(s,[],n))}function dS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ED(e){const t=ss(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Ts(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,c=Uh(n)!==i||Uh(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function _N(e){return as(e)?e:e.contextElement}function Nc(e){const t=_N(e);if(!Ts(t))return _s(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=ED(t);let o=(i?Uh(n.width):n.width)/r,c=(i?Uh(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const UW=_s(0);function kD(e){const t=va(e);return!CN()||!t.visualViewport?UW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function WW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==va(e)?!1:t}function rl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=_N(e);let o=_s(1);t&&(r?as(r)&&(o=Nc(r)):o=Nc(e));const c=WW(i,n,r)?kD(i):_s(0);let d=(s.left+c.x)/o.x,f=(s.top+c.y)/o.y,h=s.width/o.x,p=s.height/o.y;if(i){const g=va(i),x=r&&as(r)?va(r):r;let j=g,y=dS(j);for(;y&&r&&x!==j;){const b=Nc(y),N=y.getBoundingClientRect(),C=ss(y),S=N.left+(y.clientLeft+parseFloat(C.paddingLeft))*b.x,E=N.top+(y.clientTop+parseFloat(C.paddingTop))*b.y;d*=b.x,f*=b.y,h*=b.x,p*=b.y,d+=S,f+=E,j=va(y),y=dS(j)}}return Vh({width:h,height:p,x:d,y:f})}function mv(e,t){const n=hv(e).scrollLeft;return t?t.left+n:rl(Ms(e)).left+n}function PD(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mv(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function VW(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=Ms(r),c=t?pv(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=_s(1);const h=_s(0),p=Ts(r);if((p||!p&&!i)&&((fu(r)!=="body"||kf(o))&&(d=hv(r)),Ts(r))){const x=rl(r);f=Nc(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const g=o&&!p&&!i?PD(o,d):_s(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+g.x,y:n.y*f.y-d.scrollTop*f.y+h.y+g.y}}function HW(e){return Array.from(e.getClientRects())}function KW(e){const t=Ms(e),n=hv(e),r=e.ownerDocument.body,s=fa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=fa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+mv(e);const c=-n.scrollTop;return ss(r).direction==="rtl"&&(o+=fa(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:c}}const lk=25;function GW(e,t){const n=va(e),r=Ms(e),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,c=0,d=0;if(s){i=s.width,o=s.height;const h=CN();(!h||h&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}const f=mv(r);if(f<=0){const h=r.ownerDocument,p=h.body,g=getComputedStyle(p),x=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-x);j<=lk&&(i-=j)}else f<=lk&&(i+=f);return{width:i,height:o,x:c,y:d}}const YW=new Set(["absolute","fixed"]);function XW(e,t){const n=rl(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Ts(e)?Nc(e):_s(1),o=e.clientWidth*i.x,c=e.clientHeight*i.y,d=s*i.x,f=r*i.y;return{width:o,height:c,x:d,y:f}}function ck(e,t,n){let r;if(t==="viewport")r=GW(e,n);else if(t==="document")r=KW(Ms(e));else if(as(t))r=XW(t,n);else{const s=kD(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Vh(r)}function TD(e,t){const n=ro(e);return n===t||!as(n)||Rc(n)?!1:ss(n).position==="fixed"||TD(n,t)}function QW(e,t){const n=t.get(e);if(n)return n;let r=Id(e,[],!1).filter(c=>as(c)&&fu(c)!=="body"),s=null;const i=ss(e).position==="fixed";let o=i?ro(e):e;for(;as(o)&&!Rc(o);){const c=ss(o),d=NN(o);!d&&c.position==="fixed"&&(s=null),(i?!d&&!s:!d&&c.position==="static"&&!!s&&YW.has(s.position)||kf(o)&&!d&&TD(e,o))?r=r.filter(h=>h!==o):s=c,o=ro(o)}return t.set(e,r),r}function JW(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?pv(t)?[]:QW(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=ck(t,h,s);return f.top=fa(p.top,f.top),f.right=no(p.right,f.right),f.bottom=no(p.bottom,f.bottom),f.left=fa(p.left,f.left),f},ck(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function ZW(e){const{width:t,height:n}=ED(e);return{width:t,height:n}}function eV(e,t,n){const r=Ts(t),s=Ms(t),i=n==="fixed",o=rl(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=_s(0);function f(){d.x=mv(s)}if(r||!r&&!i)if((fu(t)!=="body"||kf(s))&&(c=hv(t)),r){const x=rl(t,!0,i,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else s&&f();i&&!r&&s&&f();const h=s&&!r&&!i?PD(s,c):_s(0),p=o.left+c.scrollLeft-d.x-h.x,g=o.top+c.scrollTop-d.y-h.y;return{x:p,y:g,width:o.width,height:o.height}}function _y(e){return ss(e).position==="static"}function uk(e,t){if(!Ts(e)||ss(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ms(e)===n&&(n=n.ownerDocument.body),n}function OD(e,t){const n=va(e);if(pv(e))return n;if(!Ts(e)){let s=ro(e);for(;s&&!Rc(s);){if(as(s)&&!_y(s))return s;s=ro(s)}return n}let r=uk(e,t);for(;r&&$W(r)&&_y(r);)r=uk(r,t);return r&&Rc(r)&&_y(r)&&!NN(r)?n:r||BW(e)||n}const tV=async function(e){const t=this.getOffsetParent||OD,n=this.getDimensions,r=await n(e.floating);return{reference:eV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nV(e){return ss(e).direction==="rtl"}const rV={convertOffsetParentRelativeRectToViewportRelativeRect:VW,getDocumentElement:Ms,getClippingRect:JW,getOffsetParent:OD,getElementRects:tV,getClientRects:HW,getDimensions:ZW,getScale:Nc,isElement:as,isRTL:nV};function RD(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function aV(e,t){let n=null,r;const s=Ms(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function o(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:h,top:p,width:g,height:x}=f;if(c||t(),!g||!x)return;const j=uh(p),y=uh(s.clientWidth-(h+g)),b=uh(s.clientHeight-(p+x)),N=uh(h),S={rootMargin:-j+"px "+-y+"px "+-b+"px "+-N+"px",threshold:fa(0,no(1,d))||1};let E=!0;function A(k){const T=k[0].intersectionRatio;if(T!==d){if(!E)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!RD(f,e.getBoundingClientRect())&&o(),E=!1}try{n=new IntersectionObserver(A,{...S,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,S)}n.observe(e)}return o(!0),i}function sV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=_N(e),h=s||i?[...f?Id(f):[],...Id(t)]:[];h.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),i&&N.addEventListener("resize",n)});const p=f&&c?aV(f,n):null;let g=-1,x=null;o&&(x=new ResizeObserver(N=>{let[C]=N;C&&C.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var S;(S=x)==null||S.observe(t)})),n()}),f&&!d&&x.observe(f),x.observe(t));let j,y=d?rl(e):null;d&&b();function b(){const N=rl(e);y&&!RD(y,N)&&n(),y=N,j=requestAnimationFrame(b)}return n(),()=>{var N;h.forEach(C=>{s&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),p?.(),(N=x)==null||N.disconnect(),x=null,d&&cancelAnimationFrame(j)}}const iV=PW,oV=TW,lV=AW,cV=RW,uV=EW,dk=_W,dV=OW,fV=(e,t,n)=>{const r=new Map,s={platform:rV,...n},i={...s.platform,_c:r};return CW(e,t,{...s,platform:i})};var pV=typeof document<"u",hV=function(){},Dh=pV?m.useLayoutEffect:hV;function Hh(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,s;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(!Hh(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!Hh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ID(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fk(e,t){const n=ID(e);return Math.round(t*n)/n}function Ay(e){const t=m.useRef(e);return Dh(()=>{t.current=e}),t}function mV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[h,p]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=m.useState(r);Hh(g,r)||x(r);const[j,y]=m.useState(null),[b,N]=m.useState(null),C=m.useCallback(V=>{V!==k.current&&(k.current=V,y(V))},[]),S=m.useCallback(V=>{V!==T.current&&(T.current=V,N(V))},[]),E=i||j,A=o||b,k=m.useRef(null),T=m.useRef(null),O=m.useRef(h),D=d!=null,q=Ay(d),U=Ay(s),B=Ay(f),X=m.useCallback(()=>{if(!k.current||!T.current)return;const V={placement:t,strategy:n,middleware:g};U.current&&(V.platform=U.current),fV(k.current,T.current,V).then(R=>{const G={...R,isPositioned:B.current!==!1};W.current&&!Hh(O.current,G)&&(O.current=G,cu.flushSync(()=>{p(G)}))})},[g,t,n,U,B]);Dh(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(V=>({...V,isPositioned:!1})))},[f]);const W=m.useRef(!1);Dh(()=>(W.current=!0,()=>{W.current=!1}),[]),Dh(()=>{if(E&&(k.current=E),A&&(T.current=A),E&&A){if(q.current)return q.current(E,A,X);X()}},[E,A,X,q,D]);const M=m.useMemo(()=>({reference:k,floating:T,setReference:C,setFloating:S}),[C,S]),z=m.useMemo(()=>({reference:E,floating:A}),[E,A]),K=m.useMemo(()=>{const V={position:n,left:0,top:0};if(!z.floating)return V;const R=fk(z.floating,h.x),G=fk(z.floating,h.y);return c?{...V,transform:"translate("+R+"px, "+G+"px)",...ID(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:R,top:G}},[n,c,z.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:X,refs:M,elements:z,floatingStyles:K}),[h,X,M,z,K])}const vV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dk({element:r.current,padding:s}).fn(n):{}:r?dk({element:r,padding:s}).fn(n):{}}}},gV=(e,t)=>({...iV(e),options:[e,t]}),xV=(e,t)=>({...oV(e),options:[e,t]}),yV=(e,t)=>({...dV(e),options:[e,t]}),bV=(e,t)=>({...lV(e),options:[e,t]}),wV=(e,t)=>({...cV(e),options:[e,t]}),jV=(e,t)=>({...uV(e),options:[e,t]}),SV=(e,t)=>({...vV(e),options:[e,t]});var NV="Arrow",MD=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return a.jsx(tt.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});MD.displayName=NV;var CV=MD;function vv(e){const[t,n]=m.useState(void 0);return ar(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,c;if("borderBoxSize"in i){const d=i.borderBoxSize,f=Array.isArray(d)?d[0]:d;o=f.inlineSize,c=f.blockSize}else o=e.offsetWidth,c=e.offsetHeight;n({width:o,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var AN="Popper",[$D,fo]=gr(AN),[_V,DD]=$D(AN),LD=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return a.jsx(_V,{scope:t,anchor:r,onAnchorChange:s,children:n})};LD.displayName=AN;var FD="PopperAnchor",zD=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=DD(FD,n),o=m.useRef(null),c=Et(t,o),d=m.useRef(null);return m.useEffect(()=>{const f=d.current;d.current=r?.current||o.current,f!==d.current&&i.onAnchorChange(d.current)}),r?null:a.jsx(tt.div,{...s,ref:c})});zD.displayName=FD;var EN="PopperContent",[AV,EV]=$D(EN),BD=m.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:j,...y}=e,b=DD(EN,n),[N,C]=m.useState(null),S=Et(t,re=>C(re)),[E,A]=m.useState(null),k=vv(E),T=k?.width??0,O=k?.height??0,D=r+(i!=="center"?"-"+i:""),q=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},U=Array.isArray(f)?f:[f],B=U.length>0,X={padding:q,boundary:U.filter(PV),altBoundary:B},{refs:W,floatingStyles:M,placement:z,isPositioned:K,middlewareData:V}=mV({strategy:"fixed",placement:D,whileElementsMounted:(...re)=>sV(...re,{animationFrame:x==="always"}),elements:{reference:b.anchor},middleware:[gV({mainAxis:s+O,alignmentAxis:o}),d&&xV({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?yV():void 0,...X}),d&&bV({...X}),wV({...X,apply:({elements:re,rects:je,availableWidth:pe,availableHeight:oe})=>{const{width:_e,height:ce}=je.reference,de=re.floating.style;de.setProperty("--radix-popper-available-width",`${pe}px`),de.setProperty("--radix-popper-available-height",`${oe}px`),de.setProperty("--radix-popper-anchor-width",`${_e}px`),de.setProperty("--radix-popper-anchor-height",`${ce}px`)}}),E&&SV({element:E,padding:c}),TV({arrowWidth:T,arrowHeight:O}),g&&jV({strategy:"referenceHidden",...X})]}),[R,G]=WD(z),$=Hn(j);ar(()=>{K&&$?.()},[K,$]);const I=V.arrow?.x,ee=V.arrow?.y,Q=V.arrow?.centerOffset!==0,[ie,ue]=m.useState();return ar(()=>{N&&ue(window.getComputedStyle(N).zIndex)},[N]),a.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:K?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(AV,{scope:n,placedSide:R,onArrowChange:A,arrowX:I,arrowY:ee,shouldHideArrow:Q,children:a.jsx(tt.div,{"data-side":R,"data-align":G,...y,ref:S,style:{...y.style,animation:K?void 0:"none"}})})})});BD.displayName=EN;var qD="PopperArrow",kV={top:"bottom",right:"left",bottom:"top",left:"right"},UD=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=EV(qD,r),o=kV[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]: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:a.jsx(CV,{...s,ref:n,style:{...s.style,display:"block"}})})});UD.displayName=qD;function PV(e){return e!==null}var TV=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,o=s.arrow?.centerOffset!==0,c=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[f,h]=WD(n),p={start:"0%",center:"50%",end:"100%"}[h],g=(s.arrow?.x??0)+c/2,x=(s.arrow?.y??0)+d/2;let j="",y="";return f==="bottom"?(j=o?p:`${g}px`,y=`${-d}px`):f==="top"?(j=o?p:`${g}px`,y=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,y=o?p:`${x}px`):f==="left"&&(j=`${r.floating.width+d}px`,y=o?p:`${x}px`),{data:{x:j,y}}}});function WD(e){const[t,n="center"]=e.split("-");return[t,n]}var gv=LD,Pf=zD,xv=BD,yv=UD,OV=Symbol("radix.slottable");function RV(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=OV,t}var[bv]=gr("Tooltip",[fo]),wv=fo(),VD="TooltipProvider",IV=700,fS="tooltip.open",[MV,kN]=bv(VD),HD=e=>{const{__scopeTooltip:t,delayDuration:n=IV,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,o=m.useRef(!0),c=m.useRef(!1),d=m.useRef(0);return m.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),a.jsx(MV,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:m.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:i})};HD.displayName=VD;var Md="Tooltip",[$V,Tf]=bv(Md),KD=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=kN(Md,e.__scopeTooltip),f=wv(t),[h,p]=m.useState(null),g=rr(),x=m.useRef(0),j=o??d.disableHoverableContent,y=c??d.delayDuration,b=m.useRef(!1),[N,C]=ya({prop:r,defaultProp:s??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(fS))):d.onClose(),i?.(T)},caller:Md}),S=m.useMemo(()=>N?b.current?"delayed-open":"instant-open":"closed",[N]),E=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,b.current=!1,C(!0)},[C]),A=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,C(!1)},[C]),k=m.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{b.current=!0,C(!0),x.current=0},y)},[y,C]);return m.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),a.jsx(gv,{...f,children:a.jsx($V,{scope:t,contentId:g,open:N,stateAttribute:S,trigger:h,onTriggerChange:p,onTriggerEnter:m.useCallback(()=>{d.isOpenDelayedRef.current?k():E()},[d.isOpenDelayedRef,k,E]),onTriggerLeave:m.useCallback(()=>{j?A():(window.clearTimeout(x.current),x.current=0)},[A,j]),onOpen:E,onClose:A,disableHoverableContent:j,children:n})})};KD.displayName=Md;var pS="TooltipTrigger",GD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Tf(pS,n),i=kN(pS,n),o=wv(n),c=m.useRef(null),d=Et(t,c,s.onTriggerChange),f=m.useRef(!1),h=m.useRef(!1),p=m.useCallback(()=>f.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),a.jsx(Pf,{asChild:!0,...o,children:a.jsx(tt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:Le(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:Le(e.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:Le(e.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Le(e.onFocus,()=>{f.current||s.onOpen()}),onBlur:Le(e.onBlur,s.onClose),onClick:Le(e.onClick,s.onClose)})})});GD.displayName=pS;var PN="TooltipPortal",[DV,LV]=bv(PN,{forceMount:void 0}),YD=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=Tf(PN,t);return a.jsx(DV,{scope:t,forceMount:n,children:a.jsx(Xn,{present:n||i.open,children:a.jsx(jl,{asChild:!0,container:s,children:r})})})};YD.displayName=PN;var Ic="TooltipContent",XD=m.forwardRef((e,t)=>{const n=LV(Ic,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,o=Tf(Ic,e.__scopeTooltip);return a.jsx(Xn,{present:r||o.open,children:o.disableHoverableContent?a.jsx(QD,{side:s,...i,ref:t}):a.jsx(FV,{side:s,...i,ref:t})})}),FV=m.forwardRef((e,t)=>{const n=Tf(Ic,e.__scopeTooltip),r=kN(Ic,e.__scopeTooltip),s=m.useRef(null),i=Et(t,s),[o,c]=m.useState(null),{trigger:d,onClose:f}=n,h=s.current,{onPointerInTransitChange:p}=r,g=m.useCallback(()=>{c(null),p(!1)},[p]),x=m.useCallback((j,y)=>{const b=j.currentTarget,N={x:j.clientX,y:j.clientY},C=WV(N,b.getBoundingClientRect()),S=VV(N,C),E=HV(y.getBoundingClientRect()),A=GV([...S,...E]);c(A),p(!0)},[p]);return m.useEffect(()=>()=>g(),[g]),m.useEffect(()=>{if(d&&h){const j=b=>x(b,h),y=b=>x(b,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",y),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",y)}}},[d,h,x,g]),m.useEffect(()=>{if(o){const j=y=>{const b=y.target,N={x:y.clientX,y:y.clientY},C=d?.contains(b)||h?.contains(b),S=!KV(N,o);C?g():S&&(g(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,g]),a.jsx(QD,{...e,ref:i})}),[zV,BV]=bv(Md,{isInside:!1}),qV=RV("TooltipContent"),QD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=Tf(Ic,n),f=wv(n),{onClose:h}=d;return m.useEffect(()=>(document.addEventListener(fS,h),()=>document.removeEventListener(fS,h)),[h]),m.useEffect(()=>{if(d.trigger){const p=g=>{g.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),a.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:a.jsxs(xv,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.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:[a.jsx(qV,{children:r}),a.jsx(zV,{scope:n,isInside:!0,children:a.jsx(f7,{id:d.contentId,role:"tooltip",children:s||r})})]})})});XD.displayName=Ic;var JD="TooltipArrow",UV=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=wv(n);return BV(JD,n).isInside?null:a.jsx(yv,{...s,...r,ref:t})});UV.displayName=JD;function WV(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function VV(e,t,n=5){const 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});break}return r}function HV(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function KV(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(s=!s)}return s}function GV(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),YV(t)}function YV(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}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 XV=HD,QV=KD,JV=GD,ZV=YD,ZD=XD;const ao=XV,so=QV,io=JV,mi=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(ZV,{children:a.jsx(ZD,{ref:r,sideOffset:t,className:Ce("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})}));mi.displayName=ZD.displayName;var jv=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(){}},eH=class extends jv{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const 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(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},e5=new eH,tH={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},nH=class{#e=tH;#t=!1;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)}},hS=new nH;function rH(e){setTimeout(e,0)}var aH=typeof window>"u"||"Deno"in globalThis;function Xa(){}function sH(e,t){return typeof e=="function"?e(t):e}function iH(e){return typeof e=="number"&&e>=0&&e!==1/0}function oH(e,t){return Math.max(e+(t||0)-Date.now(),0)}function mS(e,t){return typeof e=="function"?e(t):e}function lH(e,t){return typeof e=="function"?e(t):e}function pk(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==TN(o,t.options))return!1}else if(!Dd(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||s&&s!==t.state.fetchStatus||i&&!i(t))}function hk(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if($d(t.options.mutationKey)!==$d(i))return!1}else if(!Dd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function TN(e,t){return(t?.queryKeyHashFn||$d)(e)}function $d(e){return JSON.stringify(e,(t,n)=>vS(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Dd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Dd(e[n],t[n])):!1}var cH=Object.prototype.hasOwnProperty;function t5(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=mk(e)&&mk(t);if(!r&&!(vS(e)&&vS(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),c=o.length,d=r?new Array(c):{};let f=0;for(let h=0;h<c;h++){const p=r?h:o[h],g=e[p],x=t[p];if(g===x){d[p]=g,(r?h<i:cH.call(e,p))&&f++;continue}if(g===null||x===null||typeof g!="object"||typeof x!="object"){d[p]=x;continue}const j=t5(g,x,n+1);d[p]=j,j===g&&f++}return i===c&&f===i?e:d}function mk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vS(e){if(!vk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!vk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function vk(e){return Object.prototype.toString.call(e)==="[object Object]"}function uH(e){return new Promise(t=>{hS.setTimeout(t,e)})}function dH(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?t5(e,t):t}function fH(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function pH(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ON=Symbol();function n5(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ON?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function hH(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var r5=(()=>{let e=()=>aH;return{isServer(){return e()},setIsServer(t){e=t}}})();function mH(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var vH=rH;function gH(){let e=[],t=0,n=c=>{c()},r=c=>{c()},s=vH;const i=c=>{t?e.push(c):s(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&s(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||o()}return d},batchCalls:c=>(...d)=>{i(()=>{c(...d)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{s=c}}}var kr=gH(),xH=class extends jv{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const 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(n=>{n(e)}))}isOnline(){return this.#e}},Kh=new xH;function yH(e){return Math.min(1e3*2**e,3e4)}function a5(e){return(e??"online")==="online"?Kh.isOnline():!0}var gS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function s5(e){let t=!1,n=0,r;const s=mH(),i=()=>s.status!=="pending",o=y=>{if(!i()){const b=new gS(y);g(b),e.onCancel?.(b)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>e5.isFocused()&&(e.networkMode==="always"||Kh.isOnline())&&e.canRun(),h=()=>a5(e.networkMode)&&e.canRun(),p=y=>{i()||(r?.(),s.resolve(y))},g=y=>{i()||(r?.(),s.reject(y))},x=()=>new Promise(y=>{r=b=>{(i()||f())&&y(b)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),j=()=>{if(i())return;let y;const b=n===0?e.initialPromise:void 0;try{y=b??e.fn()}catch(N){y=Promise.reject(N)}Promise.resolve(y).then(p).catch(N=>{if(i())return;const C=e.retry??(r5.isServer()?0:3),S=e.retryDelay??yH,E=typeof S=="function"?S(n,N):S,A=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,N);if(t||!A){g(N);return}n++,e.onFail?.(n,N),uH(E).then(()=>f()?void 0:x()).then(()=>{t?g(N):j()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r?.(),s),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?j():x().then(j),s)}}var i5=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iH(this.gcTime)&&(this.#e=hS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(r5.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(hS.clearTimeout(this.#e),this.#e=void 0)}};function bH(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let h=!1;const p=j=>{hH(j,()=>t.signal,()=>h=!0)},g=n5(t.options,t.fetchOptions),x=async(j,y,b)=>{if(h)return Promise.reject(t.signal.reason);if(y==null&&j.pages.length)return Promise.resolve(j);const C=(()=>{const k={client:t.client,queryKey:t.queryKey,pageParam:y,direction:b?"backward":"forward",meta:t.options.meta};return p(k),k})(),S=await g(C),{maxPages:E}=t.options,A=b?pH:fH;return{pages:A(j.pages,S,E),pageParams:A(j.pageParams,y,E)}};if(s&&i.length){const j=s==="backward",y=j?wH:gk,b={pages:i,pageParams:o},N=y(r,b);c=await x(b,N,j)}else{const j=e??i.length;do{const y=d===0?o[0]??r.initialPageParam:gk(r,c);if(d>0&&y==null)break;c=await x(c,y),d++}while(d<j)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function gk(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function wH(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var jH=class extends i5{#e;#t;#n;#a;#s;#r;#l;#i;constructor(e){super(),this.#i=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#a=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=yk(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.#r?.promise}setOptions(e){if(this.options={...this.#l,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=yk(this.options);t.data!==void 0&&(this.setState(xk(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,t){const n=dH(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#o({type:"setState",state:e})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Xa).catch(Xa):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=>lH(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ON||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>mS(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!oH(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.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.#r&&(this.#i||this.#c()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#a.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.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const n=new AbortController,r=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},s=()=>{const d=n5(this.options,t),h=(()=>{const p={client:this.#s,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#i=!1,this.options.persister?this.options.persister(d,h,this):d(h)},o=(()=>{const d={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return r(d),d})();(this.#e==="infinite"?bH(this.options.pages):this.options.behavior)?.onFetch(o,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#o({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=s5({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:d=>{d instanceof gS&&d.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(d,f)=>{this.#o({type:"failed",failureCount:d,error:f})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const d=await this.#r.start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#a.config.onSuccess?.(d,this),this.#a.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof gS){if(d.silent)return this.#r.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#o({type:"error",error:d}),this.#a.config.onError?.(d,this),this.#a.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...SH(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...xk(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),kr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function SH(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:a5(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function xk(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function yk(e){const 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 NH=class extends i5{#e;#t;#n;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||CH(),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.#a?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=s5({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(i,o)=>{this.#s({type:"failed",failureCount:i,error:o})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",s=!this.#a.canStart();try{if(r)t();else{this.#s({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#s({type:"pending",context:o,variables:e,isPaused:s})}const i=await this.#a.start();return await this.#n.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#n.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#s({type:"success",data:i}),i}catch(i){try{await this.#n.config.onError?.(i,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(i,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#s({type:"error",error:i}),i}finally{this.#n.runNext(this)}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),kr.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function CH(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _H=class extends jv{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new NH({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=dh(e);if(typeof t=="string"){const 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)){const t=dh(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=dh(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(s=>s.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=dh(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){kr.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){const t={exact:!0,...e};return this.getAll().find(n=>hk(t,n))}findAll(e={}){return this.getAll().filter(t=>hk(e,t))}notify(e){kr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return kr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Xa))))}};function dh(e){return e.options.scope?.id}var AH=class extends jv{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??TN(r,t);let i=this.get(s);return i||(i=new jH({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){kr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>pk(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>pk(e,n)):t}notify(e){kr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){kr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){kr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},EH=class{#e;#t;#n;#a;#s;#r;#l;#i;constructor(e={}){this.#e=e.queryCache||new AH,this.#t=e.mutationCache||new _H,this.#n=e.defaultOptions||{},this.#a=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#l=e5.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Kh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#l?.(),this.#l=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const 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(mS(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,o=sH(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return kr.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;kr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return kr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=kr.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Xa).catch(Xa)}invalidateQueries(e,t={}){return kr.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=kr.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Xa)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Xa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(mS(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Xa).catch(Xa)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Xa).catch(Xa)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Kh.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.#a.set($d(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{Dd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set($d(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{Dd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=TN(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===ON&&(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()}},kH=m.createContext(void 0),PH=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(kH.Provider,{value:e,children:t}));function Ld(){return Ld=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},Ld.apply(this,arguments)}var Qi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qi||(Qi={}));const bk="popstate";function TH(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:c}=r.location;return xS("",{pathname:i,search:o,hash:c},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Gh(s)}return RH(t,n,null,e)}function Dn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function RN(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function OH(){return Math.random().toString(36).substr(2,8)}function wk(e,t){return{usr:e.state,key:e.key,idx:t}}function xS(e,t,n,r){return n===void 0&&(n=null),Ld({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?pu(t):t,{state:n,key:t&&t.key||r||OH()})}function Gh(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function pu(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function RH(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,c=Qi.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(Ld({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=Qi.Pop;let b=h(),N=b==null?null:b-f;f=b,d&&d({action:c,location:y.location,delta:N})}function g(b,N){c=Qi.Push;let C=xS(y.location,b,N);f=h()+1;let S=wk(C,f),E=y.createHref(C);try{o.pushState(S,"",E)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(E)}i&&d&&d({action:c,location:y.location,delta:1})}function x(b,N){c=Qi.Replace;let C=xS(y.location,b,N);f=h();let S=wk(C,f),E=y.createHref(C);o.replaceState(S,"",E),i&&d&&d({action:c,location:y.location,delta:0})}function j(b){let N=s.location.origin!=="null"?s.location.origin:s.location.href,C=typeof b=="string"?b:Gh(b);return C=C.replace(/ $/,"%20"),Dn(N,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,N)}let y={get action(){return c},get location(){return e(s,o)},listen(b){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(bk,p),d=b,()=>{s.removeEventListener(bk,p),d=null}},createHref(b){return t(s,b)},createURL:j,encodeLocation(b){let N=j(b);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:g,replace:x,go(b){return o.go(b)}};return y}var jk;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(jk||(jk={}));function IH(e,t,n){return n===void 0&&(n="/"),MH(e,t,n)}function MH(e,t,n,r){let s=typeof t=="string"?pu(t):t,i=Mc(s.pathname||"/",n);if(i==null)return null;let o=o5(e);$H(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=KH(i);c=VH(o[d],f)}return c}function o5(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,c)=>{let d={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};d.relativePath.startsWith("/")&&(Dn(d.relativePath.startsWith(r),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(r.length));let f=Zi([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(Dn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),o5(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:UH(f,i.index),routesMeta:h})};return e.forEach((i,o)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))s(i,o);else for(let d of l5(i.path))s(i,o,d)}),t}function l5(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=l5(r.join("/")),c=[];return c.push(...o.map(d=>d===""?i:[i,d].join("/"))),s&&c.push(...o),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function $H(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:WH(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const DH=/^:[\w-]+$/,LH=3,FH=2,zH=1,BH=10,qH=-2,Sk=e=>e==="*";function UH(e,t){let n=e.split("/"),r=n.length;return n.some(Sk)&&(r+=qH),t&&(r+=FH),n.filter(s=>!Sk(s)).reduce((s,i)=>s+(DH.test(i)?LH:i===""?zH:BH),r)}function WH(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function VH(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",p=pn({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),g=d.route;if(!p)return null;Object.assign(s,p.params),o.push({params:s,pathname:Zi([i,p.pathname]),pathnameBase:JH(Zi([i,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(i=Zi([i,p.pathnameBase]))}return o}function pn(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=HH(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),c=s.slice(1);return{params:r.reduce((f,h,p)=>{let{paramName:g,isOptional:x}=h;if(g==="*"){let y=c[p]||"";o=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const j=c[p];return x&&!j?f[g]=void 0:f[g]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:o,pattern:e}}function HH(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),RN(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function KH(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return RN(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Mc(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)||"/"}const GH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,YH=e=>GH.test(e);function XH(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?pu(e):e,i;if(n)if(YH(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),RN(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=Nk(n.substring(1),"/"):i=Nk(n,t)}else i=t;return{pathname:i,search:ZH(r),hash:eK(s)}}function Nk(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Ey(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 QH(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function IN(e,t){let n=QH(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function MN(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=pu(e):(s=Ld({},e),Dn(!s.pathname||!s.pathname.includes("?"),Ey("?","pathname","search",s)),Dn(!s.pathname||!s.pathname.includes("#"),Ey("#","pathname","hash",s)),Dn(!s.search||!s.search.includes("#"),Ey("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,c;if(o==null)c=n;else{let p=t.length-1;if(!r&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),p-=1;s.pathname=g.join("/")}c=p>=0?t[p]:"/"}let d=XH(s,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Zi=e=>e.join("/").replace(/\/\/+/g,"/"),JH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ZH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,eK=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function tK(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const c5=["post","put","patch","delete"];new Set(c5);const nK=["get",...c5];new Set(nK);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)}const Sv=m.createContext(null),u5=m.createContext(null),bi=m.createContext(null),Nv=m.createContext(null),$s=m.createContext({outlet:null,matches:[],isDataRoute:!1}),d5=m.createContext(null);function rK(e,t){let{relative:n}=t===void 0?{}:t;hu()||Dn(!1);let{basename:r,navigator:s}=m.useContext(bi),{hash:i,pathname:o,search:c}=Cv(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:Zi([r,o])),s.createHref({pathname:d,search:c,hash:i})}function hu(){return m.useContext(Nv)!=null}function Ds(){return hu()||Dn(!1),m.useContext(Nv).location}function f5(e){m.useContext(bi).static||m.useLayoutEffect(e)}function La(){let{isDataRoute:e}=m.useContext($s);return e?xK():aK()}function aK(){hu()||Dn(!1);let e=m.useContext(Sv),{basename:t,future:n,navigator:r}=m.useContext(bi),{matches:s}=m.useContext($s),{pathname:i}=Ds(),o=JSON.stringify(IN(s,n.v7_relativeSplatPath)),c=m.useRef(!1);return f5(()=>{c.current=!0}),m.useCallback(function(f,h){if(h===void 0&&(h={}),!c.current)return;if(typeof f=="number"){r.go(f);return}let p=MN(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Zi([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const sK=m.createContext(null);function iK(e){let t=m.useContext($s).outlet;return t&&m.createElement(sK.Provider,{value:e},t)}function Nl(){let{matches:e}=m.useContext($s),t=e[e.length-1];return t?t.params:{}}function Cv(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(bi),{matches:s}=m.useContext($s),{pathname:i}=Ds(),o=JSON.stringify(IN(s,r.v7_relativeSplatPath));return m.useMemo(()=>MN(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function oK(e,t){return lK(e,t)}function lK(e,t,n,r){hu()||Dn(!1);let{navigator:s}=m.useContext(bi),{matches:i}=m.useContext($s),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=Ds(),h;if(t){var p;let b=typeof t=="string"?pu(t):t;d==="/"||(p=b.pathname)!=null&&p.startsWith(d)||Dn(!1),h=b}else h=f;let g=h.pathname||"/",x=g;if(d!=="/"){let b=d.replace(/^\//,"").split("/");x="/"+g.replace(/^\//,"").split("/").slice(b.length).join("/")}let j=IH(e,{pathname:x}),y=pK(j&&j.map(b=>Object.assign({},b,{params:Object.assign({},c,b.params),pathname:Zi([d,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?d:Zi([d,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,n,r);return t&&y?m.createElement(Nv.Provider,{value:{location:Fd({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Qi.Pop}},y):y}function cK(){let e=gK(),t=tK(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,null)}const uK=m.createElement(cK,null);class dK extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement($s.Provider,{value:this.props.routeContext},m.createElement(d5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function fK(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(Sv);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement($s.Provider,{value:t},r)}function pK(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,c=(s=n)==null?void 0:s.errors;if(c!=null){let h=o.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);h>=0||Dn(!1),o=o.slice(0,Math.min(o.length,h+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<o.length;h++){let p=o[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:g,errors:x}=n,j=p.route.loader&&g[p.route.id]===void 0&&(!x||x[p.route.id]===void 0);if(p.route.lazy||j){d=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,p,g)=>{let x,j=!1,y=null,b=null;n&&(x=c&&p.route.id?c[p.route.id]:void 0,y=p.route.errorElement||uK,d&&(f<0&&g===0?(yK("route-fallback"),j=!0,b=null):f===g&&(j=!0,b=p.route.hydrateFallbackElement||null)));let N=t.concat(o.slice(0,g+1)),C=()=>{let S;return x?S=y:j?S=b:p.route.Component?S=m.createElement(p.route.Component,null):p.route.element?S=p.route.element:S=h,m.createElement(fK,{match:p,routeContext:{outlet:h,matches:N,isDataRoute:n!=null},children:S})};return n&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?m.createElement(dK,{location:n.location,revalidation:n.revalidation,component:y,error:x,children:C(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):C()},null)}var p5=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(p5||{}),h5=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(h5||{});function hK(e){let t=m.useContext(Sv);return t||Dn(!1),t}function mK(e){let t=m.useContext(u5);return t||Dn(!1),t}function vK(e){let t=m.useContext($s);return t||Dn(!1),t}function m5(e){let t=vK(),n=t.matches[t.matches.length-1];return n.route.id||Dn(!1),n.route.id}function gK(){var e;let t=m.useContext(d5),n=mK(),r=m5();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function xK(){let{router:e}=hK(p5.UseNavigateStable),t=m5(h5.UseNavigateStable),n=m.useRef(!1);return f5(()=>{n.current=!0}),m.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Fd({fromRouteId:t},i)))},[e,t])}const Ck={};function yK(e,t,n){Ck[e]||(Ck[e]=!0)}function bK(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function v5(e){let{to:t,replace:n,state:r,relative:s}=e;hu()||Dn(!1);let{future:i,static:o}=m.useContext(bi),{matches:c}=m.useContext($s),{pathname:d}=Ds(),f=La(),h=MN(t,IN(c,i.v7_relativeSplatPath),d,s==="path"),p=JSON.stringify(h);return m.useEffect(()=>f(JSON.parse(p),{replace:n,state:r,relative:s}),[f,p,s,n,r]),null}function _k(e){return iK(e.context)}function gn(e){Dn(!1)}function wK(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Qi.Pop,navigator:i,static:o=!1,future:c}=e;hu()&&Dn(!1);let d=t.replace(/^\/*/,"/"),f=m.useMemo(()=>({basename:d,navigator:i,static:o,future:Fd({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=pu(r));let{pathname:h="/",search:p="",hash:g="",state:x=null,key:j="default"}=r,y=m.useMemo(()=>{let b=Mc(h,d);return b==null?null:{location:{pathname:b,search:p,hash:g,state:x,key:j},navigationType:s}},[d,h,p,g,x,j,s]);return y==null?null:m.createElement(bi.Provider,{value:f},m.createElement(Nv.Provider,{children:n,value:y}))}function jK(e){let{children:t,location:n}=e;return oK(yS(t),n)}new Promise(()=>{});function yS(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let i=[...t,s];if(r.type===m.Fragment){n.push.apply(n,yS(r.props.children,i));return}r.type!==gn&&Dn(!1),!r.props.index||!r.props.children||Dn(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=yS(r.props.children,i)),n.push(o)}),n}function Yh(){return Yh=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},Yh.apply(this,arguments)}function g5(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function SK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NK(e,t){return e.button===0&&(!t||t==="_self")&&!SK(e)}function bS(e){return e===void 0&&(e=""),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(s=>[n,s]):[[n,r]])},[]))}function CK(e,t){let n=bS(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const _K=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],AK=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],EK="6";try{window.__reactRouterVersion=EK}catch{}const kK=m.createContext({isTransitioning:!1}),PK="startTransition",Ak=ov[PK];function TK(e){let{basename:t,children:n,future:r,window:s}=e,i=m.useRef();i.current==null&&(i.current=TH({window:s,v5Compat:!0}));let o=i.current,[c,d]=m.useState({action:o.action,location:o.location}),{v7_startTransition:f}=r||{},h=m.useCallback(p=>{f&&Ak?Ak(()=>d(p)):d(p)},[d,f]);return m.useLayoutEffect(()=>o.listen(h),[o,h]),m.useEffect(()=>bK(r),[r]),m.createElement(wK,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const OK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",RK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tt=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:c,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,g=g5(t,_K),{basename:x}=m.useContext(bi),j,y=!1;if(typeof f=="string"&&RK.test(f)&&(j=f,OK))try{let S=new URL(window.location.href),E=f.startsWith("//")?new URL(S.protocol+f):new URL(f),A=Mc(E.pathname,x);E.origin===S.origin&&A!=null?f=A+E.search+E.hash:y=!0}catch{}let b=rK(f,{relative:s}),N=$K(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:s,viewTransition:p});function C(S){r&&r(S),S.defaultPrevented||N(S)}return m.createElement("a",Yh({},g,{href:j||b,onClick:y||i?r:C,ref:n,target:d}))}),IK=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:c,to:d,viewTransition:f,children:h}=t,p=g5(t,AK),g=Cv(d,{relative:p.relative}),x=Ds(),j=m.useContext(u5),{navigator:y,basename:b}=m.useContext(bi),N=j!=null&&DK(g)&&f===!0,C=y.encodeLocation?y.encodeLocation(g).pathname:g.pathname,S=x.pathname,E=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;s||(S=S.toLowerCase(),E=E?E.toLowerCase():null,C=C.toLowerCase()),E&&b&&(E=Mc(E,b)||E);const A=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let k=S===C||!o&&S.startsWith(C)&&S.charAt(A)==="/",T=E!=null&&(E===C||!o&&E.startsWith(C)&&E.charAt(C.length)==="/"),O={isActive:k,isPending:T,isTransitioning:N},D=k?r:void 0,q;typeof i=="function"?q=i(O):q=[i,k?"active":null,T?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let U=typeof c=="function"?c(O):c;return m.createElement(Tt,Yh({},p,{"aria-current":D,className:q,ref:n,style:U,to:d,viewTransition:f}),typeof h=="function"?h(O):h)});var wS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(wS||(wS={}));var Ek;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ek||(Ek={}));function MK(e){let t=m.useContext(Sv);return t||Dn(!1),t}function $K(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=La(),f=Ds(),h=Cv(e,{relative:o});return m.useCallback(p=>{if(NK(p,n)){p.preventDefault();let g=r!==void 0?r:Gh(f)===Gh(h);d(e,{replace:g,state:s,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,s,n,e,i,o,c])}function wi(e){let t=m.useRef(bS(e)),n=m.useRef(!1),r=Ds(),s=m.useMemo(()=>CK(r.search,n.current?null:t.current),[r.search]),i=La(),o=m.useCallback((c,d)=>{const f=bS(typeof c=="function"?c(s):c);n.current=!0,i("?"+f,d)},[i,s]);return[s,o]}function DK(e,t){t===void 0&&(t={});let n=m.useContext(kK);n==null&&Dn(!1);let{basename:r}=MK(wS.useViewTransitionState),s=Cv(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Mc(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Mc(n.nextLocation.pathname,r)||n.nextLocation.pathname;return pn(s.pathname,o)!=null||pn(s.pathname,i)!=null}var LK=Symbol.for("react.lazy"),Xh=ov[" use ".trim().toString()];function FK(e){return typeof e=="object"&&e!==null&&"then"in e}function x5(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===LK&&"_payload"in e&&FK(e._payload)}function _v(e){const t=zK(e),n=m.forwardRef((r,s)=>{let{children:i,...o}=r;x5(i)&&typeof Xh=="function"&&(i=Xh(i._payload));const c=m.Children.toArray(i),d=c.find(qK);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var po=_v("Slot");function zK(e){const t=m.forwardRef((n,r)=>{let{children:s,...i}=n;if(x5(s)&&typeof Xh=="function"&&(s=Xh(s._payload)),m.isValidElement(s)){const o=WK(s),c=UK(i,s.props);return s.type!==m.Fragment&&(c.ref=r?Ir(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BK=Symbol("radix.slottable");function qK(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BK}function UK(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function WK(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)}const ky=768;function VK(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ky-1}px)`),r=()=>{t(window.innerWidth<ky)};return n.addEventListener("change",r),t(window.innerWidth<ky),()=>n.removeEventListener("change",r)},[]),!!e}const $N=Sl("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none 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"}}),ne=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?po:"button";return a.jsx(o,{className:Ce($N({variant:t,size:n,className:e})),ref:i,...s})});ne.displayName="Button";const bt=m.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:Ce("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-none 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}));bt.displayName="Input";var HK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],KK=HK.reduce((e,t)=>{const n=_v(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:o,...c}=s,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),GK="Separator",kk="horizontal",YK=["horizontal","vertical"],y5=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=kk,...s}=e,i=XK(r)?r:kk,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(KK.div,{"data-orientation":i,...c,...s,ref:t})});y5.displayName=GK;function XK(e){return YK.includes(e)}var b5=y5;const w5=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(b5,{ref:s,decorative:n,orientation:t,className:Ce("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));w5.displayName=b5.displayName;var Py="focusScope.autoFocusOnMount",Ty="focusScope.autoFocusOnUnmount",Pk={bubbles:!1,cancelable:!0},QK="FocusScope",Of=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[c,d]=m.useState(null),f=Hn(s),h=Hn(i),p=m.useRef(null),g=Et(t,y=>d(y)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(S){if(x.paused||!c)return;const E=S.target;c.contains(E)?p.current=E:Yi(p.current,{select:!0})},b=function(S){if(x.paused||!c)return;const E=S.relatedTarget;E!==null&&(c.contains(E)||Yi(p.current,{select:!0}))},N=function(S){if(document.activeElement===document.body)for(const A of S)A.removedNodes.length>0&&Yi(c)};document.addEventListener("focusin",y),document.addEventListener("focusout",b);const C=new MutationObserver(N);return c&&C.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b),C.disconnect()}}},[r,c,x.paused]),m.useEffect(()=>{if(c){Ok.add(x);const y=document.activeElement;if(!c.contains(y)){const N=new CustomEvent(Py,Pk);c.addEventListener(Py,f),c.dispatchEvent(N),N.defaultPrevented||(JK(rG(j5(c)),{select:!0}),document.activeElement===y&&Yi(c))}return()=>{c.removeEventListener(Py,f),setTimeout(()=>{const N=new CustomEvent(Ty,Pk);c.addEventListener(Ty,h),c.dispatchEvent(N),N.defaultPrevented||Yi(y??document.body,{select:!0}),c.removeEventListener(Ty,h),Ok.remove(x)},0)}}},[c,f,h,x]);const j=m.useCallback(y=>{if(!n&&!r||x.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,N=document.activeElement;if(b&&N){const C=y.currentTarget,[S,E]=ZK(C);S&&E?!y.shiftKey&&N===E?(y.preventDefault(),n&&Yi(S,{select:!0})):y.shiftKey&&N===S&&(y.preventDefault(),n&&Yi(E,{select:!0})):N===C&&y.preventDefault()}},[n,r,x.paused]);return a.jsx(tt.div,{tabIndex:-1,...o,ref:g,onKeyDown:j})});Of.displayName=QK;function JK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Yi(r,{select:t}),document.activeElement!==n)return}function ZK(e){const t=j5(e),n=Tk(t,e),r=Tk(t.reverse(),e);return[n,r]}function j5(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tk(e,t){for(const n of e)if(!eG(n,{upTo:t}))return n}function eG(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 tG(e){return e instanceof HTMLInputElement&&"select"in e}function Yi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&tG(e)&&t&&e.select()}}var Ok=nG();function nG(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Rk(e,t),e.unshift(t)},remove(t){e=Rk(e,t),e[0]?.resume()}}}function Rk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rG(e){return e.filter(t=>t.tagName!=="A")}var Oy=0;function Av(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ik()),document.body.insertAdjacentElement("beforeend",e[1]??Ik()),Oy++,()=>{Oy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Oy--}},[])}function Ik(){const 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 ws=function(){return ws=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ws.apply(this,arguments)};function S5(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function aG(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Lh="right-scroll-bar-position",Fh="width-before-scroll-bar",sG="with-scroll-bars-hidden",iG="--removed-body-scroll-bar-size";function Ry(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function oG(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var lG=typeof window<"u"?m.useLayoutEffect:m.useEffect,Mk=new WeakMap;function cG(e,t){var n=oG(null,function(r){return e.forEach(function(s){return Ry(s,r)})});return lG(function(){var r=Mk.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;s.forEach(function(c){i.has(c)||Ry(c,null)}),i.forEach(function(c){s.has(c)||Ry(c,o)})}Mk.set(n,e)},[e]),n}function uG(e){return e}function dG(e,t){t===void 0&&(t=uG);var n=[],r=!1,s={read:function(){if(r)throw new 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(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(i),o=n}var d=function(){var h=o;o=[],h.forEach(i)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){o.push(h),f()},filter:function(h){return o=o.filter(h),n}}}};return s}function fG(e){e===void 0&&(e={});var t=dG(null);return t.options=ws({async:!0,ssr:!1},e),t}var N5=function(e){var t=e.sideCar,n=S5(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,ws({},n))};N5.isSideCarExport=!0;function pG(e,t){return e.useMedium(t),N5}var C5=fG(),Iy=function(){},Ev=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Iy,onWheelCapture:Iy,onTouchMoveCapture:Iy}),s=r[0],i=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,g=e.sideCar,x=e.noRelative,j=e.noIsolation,y=e.inert,b=e.allowPinchZoom,N=e.as,C=N===void 0?"div":N,S=e.gapMode,E=S5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,k=cG([n,t]),T=ws(ws({},E),s);return m.createElement(m.Fragment,null,h&&m.createElement(A,{sideCar:C5,removeScrollBar:f,shards:p,noRelative:x,noIsolation:j,inert:y,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:S}),o?m.cloneElement(m.Children.only(c),ws(ws({},T),{ref:k})):m.createElement(C,ws({},T,{className:d,ref:k}),c))});Ev.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ev.classNames={fullWidth:Fh,zeroRight:Lh};var hG=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hG();return t&&e.setAttribute("nonce",t),e}function vG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mG())&&(vG(t,n),gG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yG=function(){var e=xG();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},_5=function(){var e=yG(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},bG={left:0,top:0,right:0,gap:0},My=function(e){return parseInt(e||"",10)||0},wG=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[My(n),My(r),My(s)]},jG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return bG;var t=wG(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])}},SG=_5(),Cc="data-scroll-locked",NG=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
10
|
-
.`.concat(sG,` {
|
|
11
|
-
overflow: hidden `).concat(r,`;
|
|
12
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
13
|
-
}
|
|
14
|
-
body[`).concat(Cc,`] {
|
|
15
|
-
overflow: hidden `).concat(r,`;
|
|
16
|
-
overscroll-behavior: contain;
|
|
17
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
18
|
-
padding-left: `.concat(s,`px;
|
|
19
|
-
padding-top: `).concat(i,`px;
|
|
20
|
-
padding-right: `).concat(o,`px;
|
|
21
|
-
margin-left:0;
|
|
22
|
-
margin-top:0;
|
|
23
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
24
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.`).concat(Lh,` {
|
|
28
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(Fh,` {
|
|
32
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(Lh," .").concat(Lh,` {
|
|
36
|
-
right: 0 `).concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(Fh," .").concat(Fh,` {
|
|
40
|
-
margin-right: 0 `).concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body[`).concat(Cc,`] {
|
|
44
|
-
`).concat(iG,": ").concat(c,`px;
|
|
45
|
-
}
|
|
46
|
-
`)},$k=function(){var e=parseInt(document.body.getAttribute(Cc)||"0",10);return isFinite(e)?e:0},CG=function(){m.useEffect(function(){return document.body.setAttribute(Cc,($k()+1).toString()),function(){var e=$k()-1;e<=0?document.body.removeAttribute(Cc):document.body.setAttribute(Cc,e.toString())}},[])},_G=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;CG();var i=m.useMemo(function(){return jG(s)},[s]);return m.createElement(SG,{styles:NG(i,!t,s,n?"":"!important")})},jS=!1;if(typeof window<"u")try{var fh=Object.defineProperty({},"passive",{get:function(){return jS=!0,!0}});window.addEventListener("test",fh,fh),window.removeEventListener("test",fh,fh)}catch{jS=!1}var rc=jS?{passive:!1}:!1,AG=function(e){return e.tagName==="TEXTAREA"},A5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!AG(e)&&n[t]==="visible")},EG=function(e){return A5(e,"overflowY")},kG=function(e){return A5(e,"overflowX")},Dk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=E5(e,r);if(s){var i=k5(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},PG=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},TG=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},E5=function(e,t){return e==="v"?EG(t):kG(t)},k5=function(e,t){return e==="v"?PG(t):TG(t)},OG=function(e,t){return e==="h"&&t==="rtl"?-1:1},RG=function(e,t,n,r,s){var i=OG(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,d=t.contains(c),f=!1,h=o>0,p=0,g=0;do{if(!c)break;var x=k5(e,c),j=x[0],y=x[1],b=x[2],N=y-b-i*j;(j||N)&&E5(e,c)&&(p+=N,g+=j);var C=c.parentNode;c=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(g)<1)&&(f=!0),f},ph=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Lk=function(e){return[e.deltaX,e.deltaY]},Fk=function(e){return e&&"current"in e?e.current:e},IG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},MG=function(e){return`
|
|
47
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
-
`)},$G=0,ac=[];function DG(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState($G++)[0],i=m.useState(_5)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=aG([e.lockRef.current],(e.shards||[]).map(Fk),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=m.useCallback(function(y,b){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var N=ph(y),C=n.current,S="deltaX"in y?y.deltaX:C[0]-N[0],E="deltaY"in y?y.deltaY:C[1]-N[1],A,k=y.target,T=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in y&&T==="h"&&k.type==="range")return!1;var O=window.getSelection(),D=O&&O.anchorNode,q=D?D===k||D.contains(k):!1;if(q)return!1;var U=Dk(T,k);if(!U)return!0;if(U?A=T:(A=T==="v"?"h":"v",U=Dk(T,k)),!U)return!1;if(!r.current&&"changedTouches"in y&&(S||E)&&(r.current=A),!A)return!0;var B=r.current||A;return RG(B,b,y,B==="h"?S:E)},[]),d=m.useCallback(function(y){var b=y;if(!(!ac.length||ac[ac.length-1]!==i)){var N="deltaY"in b?Lk(b):ph(b),C=t.current.filter(function(A){return A.name===b.type&&(A.target===b.target||b.target===A.shadowParent)&&IG(A.delta,N)})[0];if(C&&C.should){b.cancelable&&b.preventDefault();return}if(!C){var S=(o.current.shards||[]).map(Fk).filter(Boolean).filter(function(A){return A.contains(b.target)}),E=S.length>0?c(b,S[0]):!o.current.noIsolation;E&&b.cancelable&&b.preventDefault()}}},[]),f=m.useCallback(function(y,b,N,C){var S={name:y,delta:b,target:N,should:C,shadowParent:LG(N)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(E){return E!==S})},1)},[]),h=m.useCallback(function(y){n.current=ph(y),r.current=void 0},[]),p=m.useCallback(function(y){f(y.type,Lk(y),y.target,c(y,e.lockRef.current))},[]),g=m.useCallback(function(y){f(y.type,ph(y),y.target,c(y,e.lockRef.current))},[]);m.useEffect(function(){return ac.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,rc),document.addEventListener("touchmove",d,rc),document.addEventListener("touchstart",h,rc),function(){ac=ac.filter(function(y){return y!==i}),document.removeEventListener("wheel",d,rc),document.removeEventListener("touchmove",d,rc),document.removeEventListener("touchstart",h,rc)}},[]);var x=e.removeScrollBar,j=e.inert;return m.createElement(m.Fragment,null,j?m.createElement(i,{styles:MG(s)}):null,x?m.createElement(_G,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function LG(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const FG=pG(C5,DG);var Rf=m.forwardRef(function(e,t){return m.createElement(Ev,ws({},e,{ref:t,sideCar:FG}))});Rf.classNames=Ev.classNames;var zG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},sc=new WeakMap,hh=new WeakMap,mh={},$y=0,P5=function(e){return e&&(e.host||P5(e.parentNode))},BG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=P5(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},qG=function(e,t,n,r){var s=BG(t,Array.isArray(e)?e:[e]);mh[n]||(mh[n]=new WeakMap);var i=mh[n],o=[],c=new Set,d=new Set(s),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};s.forEach(f);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(g){if(c.has(g))h(g);else try{var x=g.getAttribute(r),j=x!==null&&x!=="false",y=(sc.get(g)||0)+1,b=(i.get(g)||0)+1;sc.set(g,y),i.set(g,b),o.push(g),y===1&&j&&hh.set(g,!0),b===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",g,N)}})};return h(t),c.clear(),$y++,function(){o.forEach(function(p){var g=sc.get(p)-1,x=i.get(p)-1;sc.set(p,g),i.set(p,x),g||(hh.has(p)||p.removeAttribute(r),hh.delete(p)),x||p.removeAttribute(n)}),$y--,$y||(sc=new WeakMap,sc=new WeakMap,hh=new WeakMap,mh={})}},kv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=zG(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),qG(r,s,n,"aria-hidden")):function(){return null}};function UG(e){const t=WG(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(HG);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function WG(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=GG(s),c=KG(i,s.props);return s.type!==m.Fragment&&(c.ref=r?Ir(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var VG=Symbol("radix.slottable");function HG(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VG}function KG(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function GG(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 Pv="Dialog",[T5,O5]=gr(Pv),[YG,is]=T5(Pv),R5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,c=m.useRef(null),d=m.useRef(null),[f,h]=ya({prop:r,defaultProp:s??!1,onChange:i,caller:Pv});return a.jsx(YG,{scope:t,triggerRef:c,contentRef:d,contentId:rr(),titleId:rr(),descriptionId:rr(),open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};R5.displayName=Pv;var I5="DialogTrigger",M5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=is(I5,n),i=Et(t,s.triggerRef);return a.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":FN(s.open),...r,ref:i,onClick:Le(e.onClick,s.onOpenToggle)})});M5.displayName=I5;var DN="DialogPortal",[XG,$5]=T5(DN,{forceMount:void 0}),D5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=is(DN,t);return a.jsx(XG,{scope:t,forceMount:n,children:m.Children.map(r,o=>a.jsx(Xn,{present:n||i.open,children:a.jsx(jl,{asChild:!0,container:s,children:o})}))})};D5.displayName=DN;var Qh="DialogOverlay",L5=m.forwardRef((e,t)=>{const n=$5(Qh,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=is(Qh,e.__scopeDialog);return i.modal?a.jsx(Xn,{present:r||i.open,children:a.jsx(JG,{...s,ref:t})}):null});L5.displayName=Qh;var QG=UG("DialogOverlay.RemoveScroll"),JG=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=is(Qh,n);return a.jsx(Rf,{as:QG,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(tt.div,{"data-state":FN(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),al="DialogContent",F5=m.forwardRef((e,t)=>{const n=$5(al,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=is(al,e.__scopeDialog);return a.jsx(Xn,{present:r||i.open,children:i.modal?a.jsx(ZG,{...s,ref:t}):a.jsx(eY,{...s,ref:t})})});F5.displayName=al;var ZG=m.forwardRef((e,t)=>{const n=is(al,e.__scopeDialog),r=m.useRef(null),s=Et(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return kv(i)},[]),a.jsx(z5,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Le(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Le(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:Le(e.onFocusOutside,i=>i.preventDefault())})}),eY=m.forwardRef((e,t)=>{const n=is(al,e.__scopeDialog),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(z5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),z5=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,c=is(al,n),d=m.useRef(null),f=Et(t,d);return Av(),a.jsxs(a.Fragment,{children:[a.jsx(Of,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(wl,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":FN(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(nY,{titleId:c.titleId}),a.jsx(aY,{contentRef:d,descriptionId:c.descriptionId})]})]})}),LN="DialogTitle",B5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=is(LN,n);return a.jsx(tt.h2,{id:s.titleId,...r,ref:t})});B5.displayName=LN;var q5="DialogDescription",U5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=is(q5,n);return a.jsx(tt.p,{id:s.descriptionId,...r,ref:t})});U5.displayName=q5;var W5="DialogClose",V5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=is(W5,n);return a.jsx(tt.button,{type:"button",...r,ref:t,onClick:Le(e.onClick,()=>s.onOpenChange(!1))})});V5.displayName=W5;function FN(e){return e?"open":"closed"}var H5="DialogTitleWarning",[tY,K5]=MU(H5,{contentName:al,titleName:LN,docsSlug:"dialog"}),nY=({titleId:e})=>{const t=K5(H5),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
50
|
-
|
|
51
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
|
-
|
|
53
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},rY="DialogDescriptionWarning",aY=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${K5(rY).contentName}}.`;return m.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Tv=R5,sY=M5,Ov=D5,mu=L5,vu=F5,If=B5,Mf=U5,Rv=V5;const G5=Tv,iY=Ov,Y5=m.forwardRef(({className:e,...t},n)=>a.jsx(mu,{className:Ce("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}));Y5.displayName=mu.displayName;const oY=Sl("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"}}),zN=m.forwardRef(({side:e="right",className:t,children:n,...r},s)=>a.jsxs(iY,{children:[a.jsx(Y5,{}),a.jsxs(vu,{ref:s,className:Ce(oY({side:e}),t),...r,children:[n,a.jsxs(Rv,{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-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[a.jsx(rs,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zN.displayName=vu.displayName;const X5=({className:e,...t})=>a.jsx("div",{className:Ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});X5.displayName="SheetHeader";const Q5=m.forwardRef(({className:e,...t},n)=>a.jsx(If,{ref:n,className:Ce("text-lg font-semibold text-foreground",e),...t}));Q5.displayName=If.displayName;const lY=m.forwardRef(({className:e,...t},n)=>a.jsx(Mf,{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));lY.displayName=Mf.displayName;function zk({className:e,...t}){return a.jsx("div",{className:Ce("animate-pulse rounded-md bg-muted",e),...t})}const cY="sidebar:state",uY=3600*24*7,dY="16rem",fY="18rem",pY="3rem",hY="b",J5=m.createContext(null);function $f(){const e=m.useContext(J5);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Z5=m.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:i,...o},c)=>{const d=VK(),[f,h]=m.useState(!1),[p,g]=m.useState(e),x=t??p,j=m.useCallback(C=>{const S=typeof C=="function"?C(x):C;n?n(S):g(S),document.cookie=`${cY}=${S}; path=/; max-age=${uY}`},[n,x]),y=m.useCallback(()=>d?h(C=>!C):j(C=>!C),[d,j,h]);m.useEffect(()=>{const C=S=>{S.key===hY&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),y())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[y]);const b=x?"expanded":"collapsed",N=m.useMemo(()=>({state:b,open:x,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:y}),[b,x,j,d,f,h,y]);return a.jsx(J5.Provider,{value:N,children:a.jsx(ao,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":dY,"--sidebar-width-icon":pY,...s},className:Ce("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});Z5.displayName="SidebarProvider";const e3=m.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...i},o)=>{const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=$f();return n==="none"?a.jsx("div",{className:Ce("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:s}):c?a.jsx(G5,{open:f,onOpenChange:h,...i,children:a.jsx(zN,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":fY},side:e,children:a.jsx("div",{className:"flex h-full w-full flex-col",children:s})})}):a.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:Ce("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)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),a.jsx("div",{className:Ce("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-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:a.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",children:s})})]})});e3.displayName="Sidebar";const t3=m.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:s}=$f();return a.jsxs(ne,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Ce("h-7 w-7",e),onClick:i=>{t?.(i),s()},...n,children:[a.jsx(H7,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});t3.displayName="SidebarTrigger";const mY=m.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=$f();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Ce("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","[[data-side=left]_&]:cursor-w-resize [[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 group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});mY.displayName="SidebarRail";const vY=m.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:Ce("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));vY.displayName="SidebarInset";const gY=m.forwardRef(({className:e,...t},n)=>a.jsx(bt,{ref:n,"data-sidebar":"input",className:Ce("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));gY.displayName="SidebarInput";const n3=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:Ce("flex flex-col gap-2 p-2",e),...t}));n3.displayName="SidebarHeader";const r3=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:Ce("flex flex-col gap-2 p-2",e),...t}));r3.displayName="SidebarFooter";const SS=m.forwardRef(({className:e,...t},n)=>a.jsx(w5,{ref:n,"data-sidebar":"separator",className:Ce("mx-2 w-auto bg-sidebar-border",e),...t}));SS.displayName="SidebarSeparator";const a3=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:Ce("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));a3.displayName="SidebarContent";const s3=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:Ce("relative flex w-full min-w-0 flex-col p-2",e),...t}));s3.displayName="SidebarGroup";const i3=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?po:"div";return a.jsx(s,{ref:r,"data-sidebar":"group-label",className:Ce("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none 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})});i3.displayName="SidebarGroupLabel";const xY=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?po:"button";return a.jsx(s,{ref:r,"data-sidebar":"group-action",className:Ce("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none 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 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});xY.displayName="SidebarGroupAction";const o3=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:Ce("w-full text-sm",e),...t}));o3.displayName="SidebarGroupContent";const l3=m.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:Ce("flex w-full min-w-0 flex-col gap-1",e),...t}));l3.displayName="SidebarMenu";const c3=m.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Ce("group/menu-item relative",e),...t}));c3.displayName="SidebarMenuItem";const yY=Sl("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none 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"}}),u3=m.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:i,...o},c)=>{const d=e?po:"button",{isMobile:f,state:h}=$f(),p=a.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Ce(yY({variant:n,size:r}),i),...o});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(so,{children:[a.jsx(io,{asChild:!0,children:p}),a.jsx(mi,{side:"right",align:"center",hidden:h!=="collapsed"||f,...s})]})):p});u3.displayName="SidebarMenuButton";const bY=m.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const i=t?po:"button";return a.jsx(i,{ref:s,"data-sidebar":"menu-action",className:Ce("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none 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 after:md: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})});bY.displayName="SidebarMenuAction";const wY=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:Ce("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}));wY.displayName="SidebarMenuBadge";const jY=m.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const s=m.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:Ce("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&a.jsx(zk,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),a.jsx(zk,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});jY.displayName="SidebarMenuSkeleton";const SY=m.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:Ce("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}));SY.displayName="SidebarMenuSub";const NY=m.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));NY.displayName="SidebarMenuSubItem";const CY=m.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},i)=>{const o=e?po:"a";return a.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:Ce("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none 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),...s})});CY.displayName="SidebarMenuSubButton";const d3=m.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...s},i)=>a.jsx(IK,{ref:i,to:r,className:({isActive:o,isPending:c})=>Ce(e,o&&t,c&&n),...s}));d3.displayName="NavLink";function _Y({width:e=24,height:t=24,from:n="#53afba",to:r="#76fffb",...s}){const i=`grad-${m.useId().slice(1)}`;return a.jsxs("svg",{className:"inline-block",width:e,height:t,viewBox:"0 0 1648 1648",xmlns:"http://www.w3.org/2000/svg",...s,children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[a.jsx("stop",{offset:"0%",style:{stopColor:n}}),a.jsx("stop",{offset:"100%",style:{stopColor:r}})]})}),a.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(#${i})`,fillRule:"evenodd"})]})}const AY=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:cD}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:lD},{title:"Analyze MCP",url:"/tool-analysis",icon:uD},{title:"OAuth Debugger",url:"/oauth-debugger",icon:Y7}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:oD},{title:"MCP servers",url:"/libraries/servers",icon:iD},{title:"Agents",url:"/libraries/agents",icon:Rr}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:ii},{title:"Evaluation Results",url:"/results",icon:Pc},{title:"Compare Evaluations",url:"/compare",icon:vN},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:dD},{title:"Custom Reports",url:"/markdown-reports",icon:mc}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:yN},{title:"MCPLab MCP server",url:"/settings/mcp",icon:aS}]}];function EY(e={version:null}){const t=e.version??null,{state:n}=$f(),r=n==="collapsed",s=Ds(),i=m.useMemo(()=>AY,[]);return a.jsxs(e3,{collapsible:"icon",children:[a.jsx(n3,{className:`border-b border-sidebar-border py-3 ${r?"px-2":"px-4"}`,children:a.jsxs("div",{className:`flex items-center ${r?"justify-center overflow-visible":"gap-2.5 overflow-hidden"}`,children:[a.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:a.jsx(_Y,{width:22,height:22,from:"#f97316",to:"#fb923c"})}),!r&&a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"text-sm font-semibold text-sidebar-foreground",children:"MCPLab"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Evaluation Lab"})]})]})}),a.jsx(a3,{children:i.map((o,c)=>a.jsxs("div",{children:[c>0&&!r&&a.jsx(SS,{className:"my-1.5"}),a.jsxs(s3,{className:r?"px-2":"px-3 py-2",children:[!r&&a.jsx(i3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),a.jsx(o3,{children:a.jsx(l3,{children:o.items.map(d=>a.jsx(c3,{children:a.jsx(u3,{asChild:!0,isActive:d.url==="/"?s.pathname==="/":d.url==="/settings"?s.pathname==="/settings":s.pathname.startsWith(d.url),tooltip:d.title,children:a.jsxs(d3,{to:d.url,end:d.url==="/"||d.url==="/settings",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground",children:[a.jsx(d.icon,{className:"h-4 w-4"}),a.jsx("span",{children:d.title})]})})},d.title))})})]})]},o.title))}),a.jsxs(r3,{className:r?"px-2 py-2":"px-3 py-3",children:[a.jsx(SS,{className:"my-1.5"}),a.jsxs("div",{className:`flex ${r?"justify-center":"items-center justify-center gap-2"} w-full`,children:[a.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:[a.jsx(z7,{className:"h-4 w-4 shrink-0"}),!r&&a.jsx("span",{className:"text-xs text-sidebar-foreground/85",children:`v${t??"unknown"}`})]}),!r&&a.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 ",a.jsx("span",{className:"text-[#00e5ff] hover:text-[#00b8d4]",children:"Inspectr"})]})]})]})]})}const f3=m.forwardRef(({...e},t)=>a.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));f3.displayName="Breadcrumb";const p3=m.forwardRef(({className:e,...t},n)=>a.jsx("ol",{ref:n,className:Ce("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));p3.displayName="BreadcrumbList";const h3=m.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,className:Ce("inline-flex items-center gap-1.5",e),...t}));h3.displayName="BreadcrumbItem";const m3=m.forwardRef(({asChild:e,className:t,...n},r)=>{const s=e?po:"a";return a.jsx(s,{ref:r,className:Ce("transition-colors hover:text-foreground",t),...n})});m3.displayName="BreadcrumbLink";const v3=m.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Ce("font-normal text-foreground",e),...t}));v3.displayName="BreadcrumbPage";const g3=({children:e,className:t,...n})=>a.jsx("li",{role:"presentation","aria-hidden":"true",className:Ce("[&>svg]:size-3.5",t),...n,children:e??a.jsx(mN,{})});g3.displayName="BreadcrumbSeparator";function js(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function uc(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 ti(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 kY(e){const t=js();for(const n of e)uc(t,n);return ti(t)}function PY(e,t){return`${e}-${t+1}`}function TY(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 new Error(`Unsupported response assertion type in config: ${String(e?.type??"(missing type)")}`)}}function OY(e){return e.type==="required_tool"||e.type==="forbidden_tool"?null:e.type==="response_contains"?e.value?{type:"contains",value:e.value}:null:e.type==="response_not_contains"?e.value?{type:"not_contains",value:e.value}:null:e.type==="response_starts_with"?e.value?{type:"starts_with",value:e.value}:null:e.type==="response_ends_with"?e.value?{type:"ends_with",value:e.value}:null:e.type==="response_equals"?e.value?{type:"equals",value:e.value}:null:e.type==="response_regex"?e.value?{type:"regex",pattern:e.value}:null:e.type==="response_jsonpath"?e.path?.trim()?e.equals!==void 0?{type:"jsonpath",path:e.path.trim(),equals:e.equals}:{type:"jsonpath",path:e.path.trim()}: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 RY(e){const t=e.filter(i=>i.type==="required_tool").map(i=>i.value).filter(i=>typeof i=="string"&&i.length>0),n=e.filter(i=>i.type==="forbidden_tool").map(i=>i.value).filter(i=>typeof i=="string"&&i.length>0),r=e.map(i=>OY(i)).filter(i=>!!i),s=t.length>0||n.length>0?{...t.length>0?{required_tools:t}:{},...n.length>0?{forbidden_tools:n}:{}}:void 0;if(!(!s&&r.length===0))return{...s?{tool_constraints:s}:{},...r.length>0?{response_assertions:r}:{}}}function IY(e){if(e.length!==0)return e.map(t=>({name:t.name,from:"final_text",regex:t.pattern}))}function x3(e,t){const n=e.snapshotEval?{enabled:e.snapshotEval.enabled,baseline_snapshot_id:e.snapshotEval.baselineSnapshotId,baseline_source_run_id:e.snapshotEval.baselineSourceRunId,last_updated_at:e.snapshotEval.lastUpdatedAt}:void 0,r=RY(e.evalRules),s=IY(e.extractRules);return{id:e.id,name:e.name||void 0,mcp_servers:t,prompt:e.prompt,snapshot_eval:n,eval:r,extract:s}}function Bk(e){if(!("id"in e)||!e.id)return null;const t=String(e.id),n=e.auth,r={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};return{id:t,server:r}}function dc(e){const 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:[],s=new Map,i=[],o=[];for(const p of n){if("ref"in p){const b=String(p.ref||"").trim();if(!b)continue;s.set(b,b),o.push({kind:"referenced",ref:b});continue}const g=String(p.id||p.name||"").trim();if(!g)continue;const x=g;s.set(g,x);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="api_key"||p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",y={id:x,name:String(p.name||g),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.token??(p.auth.env?`\${${p.auth.env}}`:void 0):p.auth?.type==="api_key"?p.auth.value:void 0,apiKeyHeaderName:p.auth?.type==="api_key"?p.auth.header_name:void 0,oauthClientId:p.auth?.type==="oauth_authorization_code"?p.auth.client_id:void 0,oauthClientSecret:p.auth?.type==="oauth_authorization_code"?p.auth.client_secret:void 0,oauthRedirectUrl:p.auth?.type==="oauth_authorization_code"?p.auth.redirect_url:void 0,oauthScope:p.auth?.type==="oauth_authorization_code"||p.auth?.type==="oauth_client_credentials"?p.auth.scope:void 0,oauthMode:p.auth?.type==="oauth_authorization_code"?p.auth.mode:void 0,oauthAuthorizationUrl:p.auth?.type==="oauth_authorization_code"?p.auth.authorization_url:void 0,oauthTokenEndpoint:p.auth?.type==="oauth_authorization_code"?p.auth.token_url:void 0,oauthTokenUrl:p.auth?.type==="oauth_client_credentials"?p.auth.token_url:void 0,oauthClientIdEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_id_env:void 0,oauthClientSecretEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_secret_env:void 0,oauthAudience:p.auth?.type==="oauth_client_credentials"?p.auth.audience:void 0};i.push(y),o.push({kind:"inline",server:y})}const c=[],d=[];for(const p of r){if("ref"in p){const b=String(p.ref||"").trim();if(!b)continue;d.push({kind:"referenced",ref:b});continue}const g=String(p.id||p.name||"").trim();if(!g)continue;const x=g,j=p.provider==="azure_openai"?"azure":p.provider,y={id:x,name:String(p.name||g),provider:j,model:p.model,temperature:p.temperature??0,maxTokens:p.max_tokens??2048,maxTurns:p.max_turns,systemPrompt:p.system};c.push(y),d.push({kind:"inline",agent:y})}const f=[],h=[];return e.config.scenarios.forEach((p,g)=>{if("ref"in p){const y=String(p.ref||"").trim();if(!y)return;const b=p.mcp_servers,N=Array.isArray(b)?b.flatMap(C=>{if("ref"in C&&C.ref)return[{kind:"referenced",ref:String(C.ref)}];const S=Bk(C);return S?[{kind:"inline",server:S.server}]:[]}):void 0;h.push({kind:"referenced",ref:y,...N?{mcpServers:N}:{}});return}const x=[];for(const y of p.eval?.tool_constraints?.required_tools??[])x.push({type:"required_tool",value:y});for(const y of p.eval?.tool_constraints?.forbidden_tools??[])x.push({type:"forbidden_tool",value:y});for(const y of p.eval?.response_assertions??[])x.push(TY(y));const j={id:p.id||PY("scn",g),name:p.name||p.id||`Scenario ${g+1}`,serverIds:(()=>{if((p.servers??[]).length>0)return p.servers.map(b=>s.get(b)??b).filter(Boolean);const y=p.mcp_servers;return Array.isArray(y)?y.flatMap(b=>{if("ref"in b&&b.ref)return[String(b.ref)];const N=Bk(b);if(N){const C=N.id;return s.has(C)||(s.set(C,C),i.push(N.server),o.push({kind:"inline",server:i[i.length-1]})),[C]}return[]}):[]})(),prompt:p.prompt,snapshotEval:p.snapshot_eval?{enabled:p.snapshot_eval.enabled,baselineSnapshotId:p.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:p.snapshot_eval.baseline_source_run_id,lastUpdatedAt:p.snapshot_eval.last_updated_at}:void 0,evalRules:x,extractRules:(p.extract??[]).map(y=>({name:y.name,pattern:y.regex}))};f.push(j),h.push({kind:"inline",scenario:j})}),{id:e.id,name:t||e.name,configName:t,description:e.path,...e.relativePath?{relativePath:e.relativePath}:{},...e.suitePath!==void 0?{suitePath:e.suitePath}:{},loadError:e.error,loadWarnings:e.warnings,servers:i,serverEntries:o,agents:c,agentEntries:d,scenarios:f,scenarioEntries:h,runDefaults:e.config.run_defaults?.selected_agents&&e.config.run_defaults.selected_agents.length>0?{selectedAgentNames:[...e.config.run_defaults.selected_agents]}:void 0,snapshotEval:e.config.snapshot_eval?{enabled:e.config.snapshot_eval.enabled,mode:e.config.snapshot_eval.mode,baselineSnapshotId:e.config.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:e.config.snapshot_eval.baseline_source_run_id,lastUpdatedAt:e.config.snapshot_eval.last_updated_at}:void 0,createdAt:e.mtime,updatedAt:e.mtime,sourcePath:e.path}}function MY(e){const t={id:"library",name:"library",path:"library",mtime:new Date(0).toISOString(),config:{servers:Object.entries(e.servers).map(([r,s])=>({id:r,name:s.name||r,transport:s.transport,url:s.url,auth:s.auth})),agents:Object.entries(e.agents).map(([r,s])=>({id:r,name:s.name||r,provider:s.provider,model:s.model,temperature:s.temperature,max_tokens:s.max_tokens,max_turns:s.max_turns,system:s.system})),scenarios:e.scenarios}},n=dc(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function qk(e){const t=new Map,n=x=>{const j=x.id,y=x.authValue?.trim()??"",b=x.apiKeyHeaderName?.trim()??"",N=x.authType==="bearer"?(()=>{if(!y)throw new Error(`Server '${j}' is missing bearer token value`);return{type:"bearer",token:y}})():x.authType==="api-key"&&!x.oauthTokenUrl?{type:"api_key",...b?{header_name:b}:{},value:(()=>{if(!y)throw new Error(`Server '${j}' is missing API key value`);return y})()}:x.authType==="api-key"?{type:"oauth_client_credentials",token_url:x.oauthTokenUrl||"",client_id_env:x.oauthClientIdEnv||"",client_secret_env:x.oauthClientSecretEnv||"",...x.oauthScope?{scope:x.oauthScope}:{},...x.oauthAudience?{audience:x.oauthAudience}:{}}:x.authType==="oauth2"?{type:"oauth_authorization_code",...x.oauthMode==="dcr"?{mode:"dcr"}:{},...x.oauthMode!=="dcr"&&x.oauthClientId?{client_id:x.oauthClientId}:{},...x.oauthClientSecret?{client_secret:x.oauthClientSecret}:{},...x.oauthRedirectUrl?{redirect_url:x.oauthRedirectUrl}:{},...x.oauthScope?{scope:x.oauthScope}:{},...x.oauthAuthorizationUrl?{authorization_url:x.oauthAuthorizationUrl}:{},...x.oauthTokenEndpoint?{token_url:x.oauthTokenEndpoint}:{}}:void 0;return{id:j,...x.name&&x.name!==j?{name:x.name}:{},transport:"http",url:x.url||"http://localhost:3000/mcp",...N!==void 0?{auth:N}:{}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(x=>({kind:"inline",server:x}))],s=new Set,i=new Map,o=r.flatMap(x=>{if(x.kind==="referenced"){const y=String(x.ref||"").trim();return!y||s.has(y)?[]:(s.add(y),t.set(y,y),[{ref:y}])}const j=n(x.server);return t.set(x.server.id,j.id),i.set(j.id,j),[j]}),c=x=>{const j=x.id;return{id:j,...x.name&&x.name!==j?{name:x.name}:{},provider:x.provider==="azure"?"azure_openai":x.provider==="anthropic"?"anthropic":"openai",model:x.model,temperature:x.temperature,max_tokens:x.maxTokens,max_turns:x.maxTurns,system:x.systemPrompt}},d=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(x=>({kind:"inline",agent:x}))],f=new Set,h=d.flatMap(x=>{if(x.kind==="referenced"){const j=String(x.ref||"").trim();return!j||f.has(j)?[]:(f.add(j),[{ref:j}])}return[c(x.agent)]}),p=x=>{const j=x.serverIds.length>0?x.serverIds.map(y=>{const b=t.get(y)??y;return i.get(b)??{ref:b}}):void 0;return x3(x,j)},g=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(x=>x.kind==="referenced"?{ref:x.ref,...Array.isArray(x.mcpServers)?{mcp_servers:x.mcpServers.map(j=>j.kind==="referenced"?{ref:j.ref}:n(j.server))}:{}}:p(x.scenario)):[...e.scenarios.map(x=>p(x))];return{name:e.configName?.trim()||void 0,servers:o,agents:h,scenarios:g,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0,snapshot_eval:e.snapshotEval?{enabled:e.snapshotEval.enabled,mode:e.snapshotEval.mode,baseline_snapshot_id:e.snapshotEval.baselineSnapshotId,baseline_source_run_id:e.snapshotEval.baselineSourceRunId,last_updated_at:e.snapshotEval.lastUpdatedAt}:void 0}}function $Y(e){const t=Object.fromEntries((e.servers??[]).map(r=>[r.id,(()=>{const s=r.authValue?.trim()??"",i=r.apiKeyHeaderName?.trim()??"";return{...r.name&&r.name!==r.id?{name:r.name}:{},transport:"http",url:r.url||"http://localhost:3000/mcp",auth:r.authType==="bearer"?(()=>{if(!s)throw new Error(`Server '${r.id}' is missing bearer token value`);return{type:"bearer",token:s}})():r.authType==="api-key"&&!r.oauthTokenUrl?{type:"api_key",...i?{header_name:i}:{},value:(()=>{if(!s)throw new Error(`Server '${r.id}' is missing API key value`);return s})()}:r.authType==="api-key"?{type:"oauth_client_credentials",token_url:r.oauthTokenUrl||"",client_id_env:r.oauthClientIdEnv||"",client_secret_env:r.oauthClientSecretEnv||"",...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAudience?{audience:r.oauthAudience}:{}}:r.authType==="oauth2"?{type:"oauth_authorization_code",...r.oauthMode==="dcr"?{mode:"dcr"}:{},...r.oauthMode!=="dcr"&&r.oauthClientId?{client_id:r.oauthClientId}:{},...r.oauthClientSecret?{client_secret:r.oauthClientSecret}:{},...r.oauthRedirectUrl?{redirect_url:r.oauthRedirectUrl}:{},...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAuthorizationUrl?{authorization_url:r.oauthAuthorizationUrl}:{},...r.oauthTokenEndpoint?{token_url:r.oauthTokenEndpoint}:{}}:void 0}})()])),n=Object.fromEntries(e.agents.map(r=>[r.id,{...r.name&&r.name!==r.id?{name:r.name}:{},provider:r.provider==="azure"?"azure_openai":r.provider==="anthropic"?"anthropic":"openai",model:r.model,temperature:r.temperature,max_tokens:r.maxTokens,max_turns:r.maxTurns,system:r.systemPrompt}]));return{servers:t,agents:n,scenarios:e.scenarios.map(r=>x3(r,r.serverIds.length>0?r.serverIds.map(s=>({ref:s})):void 0))}}function DY(e,t){if(e)return`${e}::${t??""}`}function vh(e){return e.type==="text"}function y3(e,t){if(!t)return e.tool_calls.map((s,i)=>({name:s,arguments:{},duration:e.tool_durations_ms[i]??0,timestamp:new Date().toISOString()}));const n=[],r=new Map;for(const s of t.messages)for(const i of s.content)i.type==="tool_use"?n.push({id:i.id,name:i.name,input:i.input??{},ts:s.ts}):i.type==="tool_result"&&r.set(i.tool_use_id,{durationMs:i.duration_ms,tsEnd:i.ts_end});return n.map((s,i)=>{const o=r.get(s.id);return{name:s.name,arguments:s.input,duration:o?.durationMs??e.tool_durations_ms[i]??0,timestamp:o?.tsEnd??s.ts??new Date().toISOString()}})}function b3(e,t){const n=[];if(!e)return n;let r;const s=e.messages??[];for(let i=0;i<s.length;i+=1){const o=s[i];if(o.role==="user"){const c=o.content.filter(vh);for(const d of c)n.push({id:`user_prompt-${n.length}`,kind:"user_prompt",text:d.text,timestamp:o.ts});continue}if(o.role==="assistant"){const c=o.content.filter(h=>h.type==="tool_use");for(const h of o.content)h.type==="text"&&(n.push({id:`assistant_thought-${n.length}`,kind:"assistant_thought",text:h.text,timestamp:o.ts}),r=n.length-1);const d=s[i+1],f=d?.role==="tool";if(c.length>0&&f){const h=new Map,p=[];for(const g of d.content)g.type==="tool_result"&&(g.tool_use_id?h.set(g.tool_use_id,g):p.push(g));for(const g of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:Uk(g.input??{}),toolName:g.name,timestamp:o.ts,estimatedTokens:g.estimated_tokens?{inputTokens:g.estimated_tokens.input,outputTokens:g.estimated_tokens.output,totalTokens:g.estimated_tokens.total}:void 0,estimatedTokenMethod:g.estimated_tokens?.method});const x=h.get(g.id);if(!x)continue;const j=x.content.filter(vh).map(y=>y.text).join(`
|
|
54
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:j,toolName:x.name,ok:!x.is_error,durationMs:x.duration_ms,timestamp:x.ts_end??d.ts,estimatedTokens:x.estimated_tokens?{inputTokens:x.estimated_tokens.input,outputTokens:x.estimated_tokens.output,totalTokens:x.estimated_tokens.total}:void 0,estimatedTokenMethod:x.estimated_tokens?.method}),h.delete(g.id)}for(const g of[...h.values(),...p]){const x=g.content.filter(vh).map(j=>j.text).join(`
|
|
55
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:x,toolName:g.name,ok:!g.is_error,durationMs:g.duration_ms,timestamp:g.ts_end??d.ts,estimatedTokens:g.estimated_tokens?{inputTokens:g.estimated_tokens.input,outputTokens:g.estimated_tokens.output,totalTokens:g.estimated_tokens.total}:void 0,estimatedTokenMethod:g.estimated_tokens?.method})}i+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:Uk(h.input??{}),toolName:h.name,timestamp:o.ts,estimatedTokens:h.estimated_tokens?{inputTokens:h.estimated_tokens.input,outputTokens:h.estimated_tokens.output,totalTokens:h.estimated_tokens.total}:void 0,estimatedTokenMethod:h.estimated_tokens?.method});continue}if(o.role==="tool")for(const c of o.content){if(c.type!=="tool_result")continue;const d=c.content.filter(vh).map(f=>f.text).join(`
|
|
56
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:d,toolName:c.name,ok:!c.is_error,durationMs:c.duration_ms,timestamp:c.ts_end??o.ts,estimatedTokens:c.estimated_tokens?{inputTokens:c.estimated_tokens.input,outputTokens:c.estimated_tokens.output,totalTokens:c.estimated_tokens.total}:void 0,estimatedTokenMethod:c.estimated_tokens?.method})}}return typeof r=="number"&&n[r]&&(n[r]={...n[r],kind:"assistant_final"}),n}function Uk(e){try{return JSON.stringify(e)}catch{return String(e)}}function Wk(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 Dy(e,t){if(typeof e!="number"||t<=0)return new Array(t).fill(void 0);const n=Math.floor(e/t),r=e%t;return Array.from({length:t},(s,i)=>n+(i<r?1:0))}function w3(e){const t=js(),n=js(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(const i of e.messages??[]){if(i.role!=="assistant")continue;Wk(t,i.usage);const o=i.content.filter(p=>p.type==="tool_use");if(o.length===0)continue;if(o.every(p=>!!p.estimated_tokens)){for(const p of o){const g=p.estimated_tokens;n.input+=g.input,n.hasInput=!0,n.output+=g.output,n.hasOutput=!0,n.total+=g.total,n.hasTotal=!0;const x=r.get(p.name)??js();x.input+=g.input,x.hasInput=!0,x.output+=g.output,x.hasOutput=!0,x.total+=g.total,x.hasTotal=!0,r.set(p.name,x)}continue}Wk(n,i.usage);const d=Dy(i.usage?.input_tokens,o.length),f=Dy(i.usage?.output_tokens,o.length),h=Dy(i.usage?.total_tokens,o.length);for(let p=0;p<o.length;p+=1){const g=o[p].name,x=r.get(g)??js(),j=d[p],y=f[p],b=h[p];typeof j=="number"&&(x.input+=j,x.hasInput=!0),typeof y=="number"&&(x.output+=y,x.hasOutput=!0),typeof b=="number"&&(x.total+=b,x.hasTotal=!0),r.set(g,x)}}const s={};for(const[i,o]of Array.from(r.entries()).sort((c,d)=>c[0].localeCompare(d[0]))){const c=ti(o);c&&(s[i]=c)}return{assistant:ti(t),tool:ti(n),perTool:s}}function Vk(e,t=[]){const n=new Map;for(const o of t){const c=DY(o.scenario_id,o.agent);if(!c)continue;const d=n.get(c)??[];d.push(o),n.set(c,d)}const r=e.scenarios.map(o=>{const c=n.get(`${o.scenario_id}::${o.agent}`)??[],d=new Map;for(const b of c)d.set(b.run_index,b);const f=o.runs.map((b,N)=>{const C=d.get(b.run_index)??c[N],S=w3(C);return{runIndex:b.run_index,passed:b.pass,toolCalls:y3(b,C),assistantTokenUsage:S.assistant,toolTokenUsage:S.tool,toolTokenUsageByTool:S.perTool,finalAnswer:b.final_text,conversation:b3(C),duration:b.tool_durations_ms.reduce((E,A)=>E+A,0),extractedValues:Object.fromEntries(Object.entries(b.extracted).map(([E,A])=>[E,String(A??"")])),failureReasons:b.failures}}),h=js(),p=js(),g=new Map;for(const b of f){uc(h,b.assistantTokenUsage),uc(p,b.toolTokenUsage);for(const[N,C]of Object.entries(b.toolTokenUsageByTool??{})){const S=g.get(N)??js();uc(S,C),g.set(N,S)}}const x={};for(const[b,N]of Array.from(g.entries()).sort((C,S)=>C[0].localeCompare(S[0]))){const C=ti(N);C&&(x[b]=C)}const j=f.length===0?0:Math.round(f.reduce((b,N)=>b+N.duration,0)/f.length),y=f.length===0?0:f.reduce((b,N)=>b+N.toolCalls.length,0)/f.length;return{scenarioId:o.scenario_id,scenarioName:o.scenario_name||o.scenario_id,agentId:o.agent,agentName:o.agent,provider:o.provider,model:o.model,runs:f,passRate:o.pass_rate,avgToolCalls:y,avgDuration:j,assistantTokenUsage:ti(h),toolTokenUsage:ti(p),toolTokenUsageByTool:x}}),s=js(),i=js();for(const o of r)uc(s,o.assistantTokenUsage),uc(i,o.toolTokenUsage);return{id:e.metadata.run_id,configId:"",configHash:e.metadata.config_hash,configPath:e.metadata.config_path,configName:e.metadata.config_name,timestamp:e.metadata.timestamp,runNote:e.metadata.run_note,mcpServerVersions:e.metadata.mcp_server_versions??{},scenarios:r,assistantTokenUsage:ti(s),toolTokenUsage:ti(i),overallPassRate: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),snapshotEval:e.metadata.snapshot_eval?{applied:e.metadata.snapshot_eval.applied,mode:e.metadata.snapshot_eval.mode,baselineSnapshotId:e.metadata.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:e.metadata.snapshot_eval.baseline_source_run_id,overallScore:e.metadata.snapshot_eval.overall_score,status:e.metadata.snapshot_eval.status,impactedScenarios:e.metadata.snapshot_eval.impacted_scenarios}:void 0}}function LY(e,t){const n=w3(t??void 0);return{runIndex:e.run_index,passed:e.pass,toolCalls:y3(e,t??void 0),assistantTokenUsage:n.assistant,toolTokenUsage:n.tool,toolTokenUsageByTool:n.perTool,finalAnswer:e.final_text,conversation:b3(t??void 0),duration:e.tool_durations_ms.reduce((r,s)=>r+s,0),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([r,s])=>[r,String(s??"")])),failureReasons:e.failures}}function FY(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const Yo=FY();class BN extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function ht(e,t){const n=await fetch(`${Yo}${e}`,{...t,headers:{"content-type":"application/json",...t?.headers||{}}});if(!n.ok){const r=await n.text();throw new BN(n.status,`Request failed (${n.status}): ${r}`)}return await n.json()}async function zY(e,t){const n=await fetch(`${Yo}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new BN(n.status,`Request failed (${n.status}): ${r}`)}return n.text()}function Hk(e,t){const n=new EventSource(`${Yo}${e}`),r=e.replace(/\/events$/,""),s=["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"];let i=!1;const o=()=>{i||(i=!0,n.close())},c=d=>{if(!i&&!(typeof d.data!="string"||!d.data))try{const f=JSON.parse(d.data);f.type==="session_finished"&&o(),t(f)}catch{}};for(const d of s)n.addEventListener(d,c);return n.onerror=()=>{if(!i){if(n.readyState===2){o();return}fetch(`${Yo}${r}`,{method:"GET",cache:"no-store",headers:{accept:"application/json"}}).then(d=>{(d.status===404||d.status===410)&&o()}).catch(()=>{})}},()=>o()}const nt={health:()=>ht("/api/health"),getSettings:()=>ht("/api/settings"),updateSettings:e=>ht("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>ht("/api/evals"),createConfig:(e,t)=>ht("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>ht(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>ht(`/api/evals/${e}`,{method:"DELETE"}),listRuns:e=>{const t=new URLSearchParams;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)));const n=t.size>0?`?${t.toString()}`:"";return ht(`/api/runs${n}`)},listMarkdownReports:()=>ht("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>ht(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>ht(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>ht(`/api/runs/${e}`),deleteRun:e=>ht(`/api/runs/${e}`,{method:"DELETE"}),updateRunNote:(e,t)=>ht(`/api/runs/${encodeURIComponent(e)}/note`,{method:"PATCH",body:JSON.stringify({runNote:t??""})}).then(()=>{}),getRunTrace:e=>ht(`/api/runs/${e}/trace`),listSnapshots:()=>ht("/api/snapshots"),createSnapshotFromRun:(e,t)=>ht("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>ht(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>ht(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),applyResultAssistantReport:e=>ht(`/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)=>ht("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify(e),signal:t}),getResultAssistantSession:e=>ht(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t,n)=>ht(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t}),signal:n}),approveResultAssistantToolCall:(e,t,n)=>ht(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>ht(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>ht(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),subscribeResultAssistantSessionEvents:(e,t)=>Hk(`/api/result-assistant/sessions/${e}/events`,t),generateSnapshotEvalBaseline:(e,t,n)=>ht("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>ht(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>ht("/api/libraries"),saveLibraries:e=>ht("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>ht("/api/runs",{method:"POST",body:JSON.stringify(e)}),runScenarioPreview:e=>ht("/api/runs/preview",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>ht(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:(e,t)=>ht("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e),signal:t}),getScenarioAssistantSession:e=>ht(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t,n)=>ht(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t}),signal:n}),approveScenarioAssistantToolCall:(e,t)=>ht(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>ht(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>ht(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>ht(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),subscribeScenarioAssistantSessionEvents:(e,t)=>Hk(`/api/scenario-assistant/sessions/${e}/events`,t),discoverToolsForAnalysis:e=>ht("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>ht("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>ht(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>ht(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${Yo}/api/tool-analysis/jobs/${e}/events`);let r=!1;const s=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error")&&s()}catch{}};return n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),s())},()=>s()},listToolAnalysisResults:()=>ht("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>ht(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>ht(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>ht("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>ht(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>ht(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${Yo}/api/oauth-debugger/sessions/${e}/events`);let r=!1;const s=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error"||c.type==="stopped")&&s()}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(o=>n.addEventListener(o,i)),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),s())},()=>s()},submitOAuthDebuggerManualCallback:(e,t)=>ht(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>ht(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?ht(`/api/oauth-debugger/sessions/${e}/export?format=json`):zY(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),createOAuthRuntimeSession:e=>ht("/api/oauth-runtime/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthRuntimeSession:e=>ht(`/api/oauth-runtime/sessions/${e}`),getOAuthRuntimeSessionToken:e=>ht(`/api/oauth-runtime/sessions/${e}/token`),submitOAuthRuntimeCallback:(e,t)=>ht(`/api/oauth-runtime/sessions/${e}/callback`,{method:"POST",body:JSON.stringify(t)}),cancelOAuthRuntimeSession:e=>ht(`/api/oauth-runtime/sessions/${e}/cancel`,{method:"POST",body:JSON.stringify({})}),ensureOAuthServers:e=>ht("/api/oauth-runtime/servers/ensure",{method:"POST",body:JSON.stringify(e)}),stopRun:e=>ht(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>ht("/api/runs/queue"),removeQueuedRun:e=>ht(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),resumeQueue:()=>ht("/api/runs/queue/resume",{method:"POST"}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${Yo}/api/runs/jobs/${e}/events`);let r=!1;const s=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error")&&s()}catch{}};return n.addEventListener("queued",i),n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.addEventListener("oauth_required",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),s())},()=>{s()}}};function BY(e){if(e.sourcePath){const t=e.sourcePath.split("/");return t[t.length-1].replace(/\.(yaml|yml)$/i,"")}return e.name||`config-${Date.now()}`}function qY(e){return e||`config-${Date.now()}`}const UY={async health(){return nt.health()},async listConfigs(){return(await nt.listConfigs()).map(dc)},async createConfig(e){const t=await nt.createConfig(BY(e),qk(e));return dc(t)},async updateConfig(e){const t=await nt.updateConfig(e.id,qk(e),qY(e.name));return dc(t)},async deleteConfig(e){await nt.deleteConfig(e)},async listResults(e){const n=(await nt.listRuns(e)).map(async r=>{const[{results:s},i]=await Promise.all([nt.getRun(r.runId),nt.getRunTrace(r.runId)]);return Vk(s,i.records)});return Promise.all(n)},async getResult(e){try{const[{results:t},n]=await Promise.all([nt.getRun(e),nt.getRunTrace(e)]);return Vk(t,n.records)}catch{return}},async deleteResult(e){await nt.deleteRun(e)},async updateRunNote(e,t){await nt.updateRunNote(e,t)},async listMarkdownReports(){return nt.listMarkdownReports()},async getMarkdownReport(e){return nt.getMarkdownReport(e)},async deleteMarkdownReport(e){await nt.deleteMarkdownReport(e)},async startRun(e){return nt.startRun(e)},async runScenarioPreview(e){const t=await nt.runScenarioPreview(e),n=t.scenario.run;if(!n)throw new Error("Preview run did not return a run result");return{runId:t.runId,scenarioId:t.scenario.scenarioId,agentName:t.scenario.agent,run:LY(n,t.scenario.traceRecord)}},async stopRun(e){await nt.stopRun(e)},async getRunQueue(){return nt.getRunQueue()},async removeQueuedRun(e){await nt.removeQueuedRun(e)},async resumeQueue(){return nt.resumeQueue()},subscribeRunJob(e,t){return nt.subscribeRunJob(e,t)},async listSnapshots(){return nt.listSnapshots()},async createSnapshotFromRun(e,t){return nt.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await nt.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return nt.compareSnapshot(e,t)},async applyResultAssistantReport(e){return nt.applyResultAssistantReport(e)},async createResultAssistantSession(e,t){return nt.createResultAssistantSession(e,t)},async getResultAssistantSession(e){return nt.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t,n){return nt.sendResultAssistantMessage(e,t,n)},async approveResultAssistantToolCall(e,t,n){return nt.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return nt.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await nt.closeResultAssistantSession(e)},subscribeResultAssistantSessionEvents(e,t){return nt.subscribeResultAssistantSessionEvents(e,t)},async generateSnapshotEvalBaseline(e,t,n){const r=await nt.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:dc(r.config)}},async updateSnapshotPolicy(e,t){const n=await nt.updateSnapshotPolicy(e,t);return dc(n)},async getLibraries(){const e=await nt.getLibraries();return MY(e)},async saveLibraries(e){await nt.saveLibraries($Y(e))},async listProviderModels(e){return nt.listProviderModels(e)},async getWorkspaceSettings(){return nt.getSettings()},async updateWorkspaceSettings(e){return nt.updateSettings(e)},async createScenarioAssistantSession(e,t){return nt.createScenarioAssistantSession(e,t)},async getScenarioAssistantSession(e){return nt.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t,n){return nt.sendScenarioAssistantMessage(e,t,n)},async approveScenarioAssistantToolCall(e,t){return nt.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return nt.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return nt.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await nt.closeScenarioAssistantSession(e)},subscribeScenarioAssistantSessionEvents(e,t){return nt.subscribeScenarioAssistantSessionEvents(e,t)},async discoverToolsForAnalysis(e){return nt.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return nt.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return nt.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return nt.getToolAnalysisResult(e)},async stopToolAnalysis(e){return nt.stopToolAnalysis(e)},async listToolAnalysisResults(){return nt.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return nt.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await nt.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return nt.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return nt.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return nt.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return nt.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return nt.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return nt.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return nt.exportOAuthDebuggerSession(e,t)},async createOAuthRuntimeSession(e){return nt.createOAuthRuntimeSession(e)},async getOAuthRuntimeSession(e){return nt.getOAuthRuntimeSession(e)},async getOAuthRuntimeSessionToken(e){return nt.getOAuthRuntimeSessionToken(e)},async submitOAuthRuntimeCallback(e,t){return nt.submitOAuthRuntimeCallback(e,t)},async cancelOAuthRuntimeSession(e){return nt.cancelOAuthRuntimeSession(e)},async ensureOAuthServers(e){return nt.ensureOAuthServers(e)}},j3=m.createContext(null);function WY({children:e}){const t="workspace",[n,r]=m.useState("checking"),[s,i]=m.useState(null);m.useEffect(()=>{r("checking"),nt.health().then(c=>{r("connected"),i(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),i(null)})},[t]);const o=m.useMemo(()=>UY,[]);return a.jsx(j3.Provider,{value:{mode:t,connection:n,version:s,source:o},children:e})}function Ln(){const e=m.useContext(j3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const VY=(e,t)=>{if(e==="/")return[{label:"Dashboard"}];const n=[{label:"Dashboard",to:"/"}];if(pn("/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(pn("/mcp-evaluations/:id",e))return n.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),n;if(pn("/mcp-evaluations",e))return n.push({label:"MCP Evaluations"}),n;if(pn("/settings/mcp",e))return n.push({label:"Settings",to:"/settings"},{label:"MCP Connection"}),n;if(pn("/settings",e))return n.push({label:"Settings"}),n;if(pn("/tool-analysis",e))return n.push({label:"Analyze MCP Tools"}),n;if(pn("/tool-analysis-results/:id",e)){const r=pn("/tool-analysis-results/:id",e);return n.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:r?.params.id??"Report"}),n}if(pn("/tool-analysis-results",e))return n.push({label:"Tool Analysis Results"}),n;if(pn("/markdown-reports/view",e))return n.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),n;if(pn("/markdown-reports",e))return n.push({label:"Markdown Reports"}),n;if(pn("/oauth-debugger",e))return n.push({label:"OAuth Debugger"}),n;if(pn("/results/:id",e))return n.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),n;if(pn("/results",e))return n.push({label:"Evaluation Results"}),n;if(pn("/run",e))return n.push({label:"Run Evaluation"}),n;if(pn("/libraries/servers/:serverId",e)){const r=pn("/libraries/servers/:serverId",e),s=r?.params.serverId?decodeURIComponent(r.params.serverId):"Server";return n.push({label:"Libraries",to:"/libraries/servers"},{label:"MCP servers",to:"/libraries/servers"},{label:s==="new"?"New Server":s}),n}if(pn("/libraries/servers",e))return n.push({label:"Libraries",to:"/libraries/servers"},{label:"MCP servers"}),n;if(pn("/libraries/agents/:agentName",e)){const r=pn("/libraries/agents/:agentName",e),s=r?.params.agentName?decodeURIComponent(r.params.agentName):"Agent";return n.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents",to:"/libraries/agents"},{label:s==="new"?"New Agent":s}),n}if(pn("/libraries/agents",e))return n.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),n;if(pn("/libraries/test-cases/:testCaseId",e)){const r=pn("/libraries/test-cases/:testCaseId",e),s=r?.params.testCaseId?decodeURIComponent(r.params.testCaseId):"Test Case";return n.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases",to:"/libraries/test-cases"},{label:s}),n}if(pn("/libraries/test-cases",e))return n.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),n;if(pn("/compare/results",e))return n.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),n;if(pn("/compare",e)){const s=new URLSearchParams(t).get("mode")==="within-run"?"Agents":"Runs";return n.push({label:"Compare Evaluations",to:"/compare"},{label:s}),n}return n};function HY(){const e=Ds(),t=new URLSearchParams(e.search).get("embed")==="1",n=VY(e.pathname,e.search),{connection:r,version:s}=Ln();return t?a.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:a.jsx(_k,{})}):a.jsx(Z5,{children:a.jsxs("div",{className:"flex min-h-screen w-full",children:[a.jsx(EY,{version:s}),a.jsxs("div",{className:"flex flex-1 flex-col",children:[a.jsxs("header",{className:"flex h-12 items-center gap-2 border-b bg-card px-4",children:[a.jsx(t3,{}),a.jsx(f3,{children:a.jsx(p3,{children:n.map((i,o)=>{const c=o===n.length-1;return a.jsxs(m.Fragment,{children:[a.jsx(h3,{children:i.to&&!c?a.jsx(m3,{asChild:!0,children:a.jsx(Tt,{to:i.to,children:i.label})}):a.jsx(v3,{children:i.label})}),!c&&a.jsx(g3,{})]},`${i.label}-${o}`)})})}),a.jsx("div",{className:"ml-auto flex items-center gap-2",children:a.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border px-2.5 py-1",children:[a.jsx("span",{className:`h-2 w-2 rounded-full ${r==="connected"?"bg-emerald-500":r==="checking"?"bg-amber-400":"bg-rose-500"}`,"aria-hidden":"true"}),a.jsx("span",{className:`text-xs ${r==="connected"?"text-emerald-700":r==="checking"?"text-muted-foreground":"text-destructive"}`,children:r})]})})]}),a.jsx("main",{className:"flex-1 overflow-auto p-6",children:a.jsx(_k,{})})]})]})})}const S3=m.createContext(null);function KY({children:e}){const{source:t}=Ln(),[n,r]=m.useState([]),[s,i]=m.useState(!0),o=m.useCallback(async()=>{i(!0);try{const g=await t.listConfigs();r(g)}finally{i(!1)}},[t]);m.useEffect(()=>{o()},[o]);const c=m.useCallback(g=>n.find(x=>x.id===g),[n]),d=m.useCallback(async g=>{const x=await t.createConfig(g);return r(j=>[...j,x]),x},[t]),f=m.useCallback(async(g,x)=>{const j=await t.updateConfig({...x,id:g});return r(y=>y.map(b=>b.id===g?j:b)),j},[t]),h=m.useCallback(async g=>{await t.deleteConfig(g),r(x=>x.filter(j=>j.id!==g))},[t]),p=m.useCallback(async g=>{const x=n.find(b=>b.id===g);if(!x)throw new Error("Config not found");const j={...structuredClone(x),id:`cfg-${Date.now()}`,name:`${x.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},y=await t.createConfig(j);return r(b=>[...b,y]),y},[n,t]);return a.jsx(S3.Provider,{value:{configs:n,loading:s,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:o},children:e})}function Df(){const e=m.useContext(S3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const N3=m.createContext(null);function GY({children:e}){const{source:t}=Ln(),[n,r]=m.useState({servers:[],agents:[],scenarios:[]}),[s,i]=m.useState(!0),o=m.useCallback(async()=>{i(!0);try{const f=await t.getLibraries();r(f)}finally{i(!1)}},[t]);m.useEffect(()=>{o()},[t]),m.useEffect(()=>{const f=()=>{o()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=m.useCallback(async f=>{r(f),await t.saveLibraries(f)},[t]),d=m.useMemo(()=>({...n,loading:s,setServers:async f=>c({...n,servers:f}),setAgents:async f=>c({...n,agents:f}),setScenarios:async f=>c({...n,scenarios:f}),reload:o}),[n,s,o,c]);return a.jsx(N3.Provider,{value:d,children:e})}function os(){const e=m.useContext(N3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const Ke=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Ce("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ke.displayName="Card";const Rt=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Ce("flex flex-col space-y-1.5 p-6",e),...t}));Rt.displayName="CardHeader";const It=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:Ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));It.displayName="CardTitle";const Hr=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));Hr.displayName="CardDescription";const Ge=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Ce("p-6 pt-0",e),...t}));Ge.displayName="CardContent";const YY=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Ce("flex items-center p-6 pt-0",e),...t}));YY.displayName="CardFooter";const Kr=m.forwardRef(({className:e,containerClassName:t,...n},r)=>a.jsx("div",{className:Ce("relative w-full overflow-auto",t),children:a.jsx("table",{ref:r,className:Ce("w-full caption-bottom text-sm",e),...n})}));Kr.displayName="Table";const Gr=m.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:Ce("[&_tr]:border-b",e),...t}));Gr.displayName="TableHeader";const Yr=m.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:Ce("[&_tr:last-child]:border-0",e),...t}));Yr.displayName="TableBody";const XY=m.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:Ce("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));XY.displayName="TableFooter";const Gt=m.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:Ce("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Gt.displayName="TableRow";const it=m.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:Ce("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));it.displayName="TableHead";const We=m.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:Ce("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));We.displayName="TableCell";const QY=m.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:Ce("mt-4 text-sm text-muted-foreground",e),...t}));QY.displayName="TableCaption";function bs({title:e,value:t,subtitle:n,icon:r,trend:s}){return a.jsx(Ke,{children:a.jsx(Ge,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e}),a.jsx("p",{className:"text-2xl font-bold",children:t}),n&&a.jsxs("p",{className:`text-xs ${s==="up"?"text-success":s==="down"?"text-destructive":"text-muted-foreground"}`,children:[s==="up"&&"↑ ",s==="down"&&"↓ ",n]})]}),a.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:a.jsx(r,{className:"h-4 w-4 text-primary"})})]})})})}const JY=Sl("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none 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"}}),He=m.forwardRef(({className:e,variant:t,asChild:n,...r},s)=>{const i=n?po:"div";return a.jsx(i,{ref:s,className:Ce(JY({variant:t}),e),...r})});He.displayName="Badge";function ni({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return a.jsxs(He,{variant:r,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 Ly,Kk;function Zr(){if(Kk)return Ly;Kk=1;var e=Array.isArray;return Ly=e,Ly}var Fy,Gk;function C3(){if(Gk)return Fy;Gk=1;var e=typeof sh=="object"&&sh&&sh.Object===Object&&sh;return Fy=e,Fy}var zy,Yk;function Ls(){if(Yk)return zy;Yk=1;var e=C3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return zy=n,zy}var By,Xk;function Lf(){if(Xk)return By;Xk=1;var e=Ls(),t=e.Symbol;return By=t,By}var qy,Qk;function ZY(){if(Qk)return qy;Qk=1;var e=Lf(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function i(o){var c=n.call(o,s),d=o[s];try{o[s]=void 0;var f=!0}catch{}var h=r.call(o);return f&&(c?o[s]=d:delete o[s]),h}return qy=i,qy}var Uy,Jk;function eX(){if(Jk)return Uy;Jk=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Uy=n,Uy}var Wy,Zk;function ji(){if(Zk)return Wy;Zk=1;var e=Lf(),t=ZY(),n=eX(),r="[object Null]",s="[object Undefined]",i=e?e.toStringTag:void 0;function o(c){return c==null?c===void 0?s:r:i&&i in Object(c)?t(c):n(c)}return Wy=o,Wy}var Vy,eP;function Si(){if(eP)return Vy;eP=1;function e(t){return t!=null&&typeof t=="object"}return Vy=e,Vy}var Hy,tP;function gu(){if(tP)return Hy;tP=1;var e=ji(),t=Si(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return Hy=r,Hy}var Ky,nP;function qN(){if(nP)return Ky;nP=1;var e=Zr(),t=gu(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(i,o){if(e(i))return!1;var c=typeof i;return c=="number"||c=="symbol"||c=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||o!=null&&i in Object(o)}return Ky=s,Ky}var Gy,rP;function ho(){if(rP)return Gy;rP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Gy=e,Gy}var Yy,aP;function UN(){if(aP)return Yy;aP=1;var e=ji(),t=ho(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",i="[object Proxy]";function o(c){if(!t(c))return!1;var d=e(c);return d==r||d==s||d==n||d==i}return Yy=o,Yy}var Xy,sP;function tX(){if(sP)return Xy;sP=1;var e=Ls(),t=e["__core-js_shared__"];return Xy=t,Xy}var Qy,iP;function nX(){if(iP)return Qy;iP=1;var e=tX(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return Qy=n,Qy}var Jy,oP;function _3(){if(oP)return Jy;oP=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Jy=n,Jy}var Zy,lP;function rX(){if(lP)return Zy;lP=1;var e=UN(),t=nX(),n=ho(),r=_3(),s=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,d=o.toString,f=c.hasOwnProperty,h=RegExp("^"+d.call(f).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var x=e(g)?h:i;return x.test(r(g))}return Zy=p,Zy}var eb,cP;function aX(){if(cP)return eb;cP=1;function e(t,n){return t?.[n]}return eb=e,eb}var tb,uP;function Cl(){if(uP)return tb;uP=1;var e=rX(),t=aX();function n(r,s){var i=t(r,s);return e(i)?i:void 0}return tb=n,tb}var nb,dP;function Iv(){if(dP)return nb;dP=1;var e=Cl(),t=e(Object,"create");return nb=t,nb}var rb,fP;function sX(){if(fP)return rb;fP=1;var e=Iv();function t(){this.__data__=e?e(null):{},this.size=0}return rb=t,rb}var ab,pP;function iX(){if(pP)return ab;pP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return ab=e,ab}var sb,hP;function oX(){if(hP)return sb;hP=1;var e=Iv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(i){var o=this.__data__;if(e){var c=o[i];return c===t?void 0:c}return r.call(o,i)?o[i]:void 0}return sb=s,sb}var ib,mP;function lX(){if(mP)return ib;mP=1;var e=Iv(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var i=this.__data__;return e?i[s]!==void 0:n.call(i,s)}return ib=r,ib}var ob,vP;function cX(){if(vP)return ob;vP=1;var e=Iv(),t="__lodash_hash_undefined__";function n(r,s){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&s===void 0?t:s,this}return ob=n,ob}var lb,gP;function uX(){if(gP)return lb;gP=1;var e=sX(),t=iX(),n=oX(),r=lX(),s=cX();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=s,lb=i,lb}var cb,xP;function dX(){if(xP)return cb;xP=1;function e(){this.__data__=[],this.size=0}return cb=e,cb}var ub,yP;function WN(){if(yP)return ub;yP=1;function e(t,n){return t===n||t!==t&&n!==n}return ub=e,ub}var db,bP;function Mv(){if(bP)return db;bP=1;var e=WN();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return db=t,db}var fb,wP;function fX(){if(wP)return fb;wP=1;var e=Mv(),t=Array.prototype,n=t.splice;function r(s){var i=this.__data__,o=e(i,s);if(o<0)return!1;var c=i.length-1;return o==c?i.pop():n.call(i,o,1),--this.size,!0}return fb=r,fb}var pb,jP;function pX(){if(jP)return pb;jP=1;var e=Mv();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return pb=t,pb}var hb,SP;function hX(){if(SP)return hb;SP=1;var e=Mv();function t(n){return e(this.__data__,n)>-1}return hb=t,hb}var mb,NP;function mX(){if(NP)return mb;NP=1;var e=Mv();function t(n,r){var s=this.__data__,i=e(s,n);return i<0?(++this.size,s.push([n,r])):s[i][1]=r,this}return mb=t,mb}var vb,CP;function $v(){if(CP)return vb;CP=1;var e=dX(),t=fX(),n=pX(),r=hX(),s=mX();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=s,vb=i,vb}var gb,_P;function VN(){if(_P)return gb;_P=1;var e=Cl(),t=Ls(),n=e(t,"Map");return gb=n,gb}var xb,AP;function vX(){if(AP)return xb;AP=1;var e=uX(),t=$v(),n=VN();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return xb=r,xb}var yb,EP;function gX(){if(EP)return yb;EP=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return yb=e,yb}var bb,kP;function Dv(){if(kP)return bb;kP=1;var e=gX();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return bb=t,bb}var wb,PP;function xX(){if(PP)return wb;PP=1;var e=Dv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return wb=t,wb}var jb,TP;function yX(){if(TP)return jb;TP=1;var e=Dv();function t(n){return e(this,n).get(n)}return jb=t,jb}var Sb,OP;function bX(){if(OP)return Sb;OP=1;var e=Dv();function t(n){return e(this,n).has(n)}return Sb=t,Sb}var Nb,RP;function wX(){if(RP)return Nb;RP=1;var e=Dv();function t(n,r){var s=e(this,n),i=s.size;return s.set(n,r),this.size+=s.size==i?0:1,this}return Nb=t,Nb}var Cb,IP;function HN(){if(IP)return Cb;IP=1;var e=vX(),t=xX(),n=yX(),r=bX(),s=wX();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=s,Cb=i,Cb}var _b,MP;function A3(){if(MP)return _b;MP=1;var e=HN(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var i=function(){var o=arguments,c=s?s.apply(this,o):o[0],d=i.cache;if(d.has(c))return d.get(c);var f=r.apply(this,o);return i.cache=d.set(c,f)||d,f};return i.cache=new(n.Cache||e),i}return n.Cache=e,_b=n,_b}var Ab,$P;function jX(){if($P)return Ab;$P=1;var e=A3(),t=500;function n(r){var s=e(r,function(o){return i.size===t&&i.clear(),o}),i=s.cache;return s}return Ab=n,Ab}var Eb,DP;function SX(){if(DP)return Eb;DP=1;var e=jX(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var i=[];return s.charCodeAt(0)===46&&i.push(""),s.replace(t,function(o,c,d,f){i.push(d?f.replace(n,"$1"):c||o)}),i});return Eb=r,Eb}var kb,LP;function KN(){if(LP)return kb;LP=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,i=Array(s);++r<s;)i[r]=n(t[r],r,t);return i}return kb=e,kb}var Pb,FP;function NX(){if(FP)return Pb;FP=1;var e=Lf(),t=KN(),n=Zr(),r=gu(),s=e?e.prototype:void 0,i=s?s.toString:void 0;function o(c){if(typeof c=="string")return c;if(n(c))return t(c,o)+"";if(r(c))return i?i.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return Pb=o,Pb}var Tb,zP;function E3(){if(zP)return Tb;zP=1;var e=NX();function t(n){return n==null?"":e(n)}return Tb=t,Tb}var Ob,BP;function k3(){if(BP)return Ob;BP=1;var e=Zr(),t=qN(),n=SX(),r=E3();function s(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return Ob=s,Ob}var Rb,qP;function Lv(){if(qP)return Rb;qP=1;var e=gu();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Rb=t,Rb}var Ib,UP;function GN(){if(UP)return Ib;UP=1;var e=k3(),t=Lv();function n(r,s){s=e(s,r);for(var i=0,o=s.length;r!=null&&i<o;)r=r[t(s[i++])];return i&&i==o?r:void 0}return Ib=n,Ib}var Mb,WP;function P3(){if(WP)return Mb;WP=1;var e=GN();function t(n,r,s){var i=n==null?void 0:e(n,r);return i===void 0?s:i}return Mb=t,Mb}var CX=P3();const ga=hn(CX);var $b,VP;function _X(){if(VP)return $b;VP=1;function e(t){return t==null}return $b=e,$b}var AX=_X();const Ft=hn(AX);var Db,HP;function EX(){if(HP)return Db;HP=1;var e=ji(),t=Zr(),n=Si(),r="[object String]";function s(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return Db=s,Db}var kX=EX();const sl=hn(kX);var PX=UN();const Lt=hn(PX);var TX=ho();const xu=hn(TX);var Lb={exports:{}},cn={};var KP;function OX(){if(KP)return cn;KP=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function y(b){if(typeof b=="object"&&b!==null){var N=b.$$typeof;switch(N){case e:switch(b=b.type,b){case n:case s:case r:case f:case h:return b;default:switch(b=b&&b.$$typeof,b){case c:case o:case d:case g:case p:case i:return b;default:return N}}case t:return N}}}return cn.ContextConsumer=o,cn.ContextProvider=i,cn.Element=e,cn.ForwardRef=d,cn.Fragment=n,cn.Lazy=g,cn.Memo=p,cn.Portal=t,cn.Profiler=s,cn.StrictMode=r,cn.Suspense=f,cn.SuspenseList=h,cn.isAsyncMode=function(){return!1},cn.isConcurrentMode=function(){return!1},cn.isContextConsumer=function(b){return y(b)===o},cn.isContextProvider=function(b){return y(b)===i},cn.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},cn.isForwardRef=function(b){return y(b)===d},cn.isFragment=function(b){return y(b)===n},cn.isLazy=function(b){return y(b)===g},cn.isMemo=function(b){return y(b)===p},cn.isPortal=function(b){return y(b)===t},cn.isProfiler=function(b){return y(b)===s},cn.isStrictMode=function(b){return y(b)===r},cn.isSuspense=function(b){return y(b)===f},cn.isSuspenseList=function(b){return y(b)===h},cn.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===s||b===r||b===f||b===h||b===x||typeof b=="object"&&b!==null&&(b.$$typeof===g||b.$$typeof===p||b.$$typeof===i||b.$$typeof===o||b.$$typeof===d||b.$$typeof===j||b.getModuleId!==void 0)},cn.typeOf=y,cn}var GP;function RX(){return GP||(GP=1,Lb.exports=OX()),Lb.exports}var IX=RX(),Fb,YP;function T3(){if(YP)return Fb;YP=1;var e=ji(),t=Si(),n="[object Number]";function r(s){return typeof s=="number"||t(s)&&e(s)==n}return Fb=r,Fb}var zb,XP;function MX(){if(XP)return zb;XP=1;var e=T3();function t(n){return e(n)&&n!=+n}return zb=t,zb}var $X=MX();const Ff=hn($X);var DX=T3();const LX=hn(DX);var Pr=function(t){return t===0?0:t>0?1:-1},Vo=function(t){return sl(t)&&t.indexOf("%")===t.length-1},Qe=function(t){return LX(t)&&!Ff(t)},FX=function(t){return Ft(t)},nr=function(t){return Qe(t)||sl(t)},zX=0,yu=function(t){var n=++zX;return"".concat(t||"").concat(n)},Tr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Qe(t)&&!sl(t))return r;var i;if(Vo(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return Ff(i)&&(i=r),s&&i>n&&(i=n),i},fc=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},BX=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},s=0;s<n;s++)if(!r[t[s]])r[t[s]]=!0;else return!0;return!1},pa=function(t,n){return Qe(t)&&Qe(n)?function(r){return t+r*(n-t)}:function(){return n}};function Jh(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):ga(r,t))===n})}var qX=function(t,n){return Qe(t)&&Qe(n)?t-n:sl(t)&&sl(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function _c(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}function NS(e){"@babel/helpers - typeof";return NS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},NS(e)}var UX=["viewBox","children"],WX=["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"],QP=["points","pathLength"],Bb={svg:UX,polygon:QP,polyline:QP},YN=["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"],Zh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(m.isValidElement(t)&&(r=t.props),!xu(r))return null;var s={};return Object.keys(r).forEach(function(i){YN.includes(i)&&(s[i]=n||function(o){return r[i](r,o)})}),s},VX=function(t,n,r){return function(s){return t(n,r,s),null}},il=function(t,n,r){if(!xu(t)||NS(t)!=="object")return null;var s=null;return Object.keys(t).forEach(function(i){var o=t[i];YN.includes(i)&&typeof o=="function"&&(s||(s={}),s[i]=VX(o,n,r))}),s},HX=["children"],KX=["children"];function JP(e,t){if(e==null)return{};var n=GX(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(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}function CS(e){"@babel/helpers - typeof";return CS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},CS(e)}var ZP={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"},oi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},eT=null,qb=null,XN=function e(t){if(t===eT&&Array.isArray(qb))return qb;var n=[];return m.Children.forEach(t,function(r){Ft(r)||(IX.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),qb=n,eT=t,n};function xa(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return oi(s)}):r=[oi(t)],XN(e).forEach(function(s){var i=ga(s,"type.displayName")||ga(s,"type.name");r.indexOf(i)!==-1&&n.push(s)}),n}function da(e,t){var n=xa(e,t);return n&&n[0]}var tT=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!Qe(r)||r<=0||!Qe(s)||s<=0)},YX=["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"],XX=function(t){return t&&t.type&&sl(t.type)&&YX.indexOf(t.type)>=0},QX=function(t){return t&&CS(t)==="object"&&"clipDot"in t},JX=function(t,n,r,s){var i,o=(i=Bb?.[s])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!Lt(t)&&(s&&o.includes(n)||WX.includes(n))||r&&YN.includes(n)},kt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(m.isValidElement(t)&&(s=t.props),!xu(s))return null;var i={};return Object.keys(s).forEach(function(o){var c;JX((c=s)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=s[o])}),i},_S=function e(t,n){if(t===n)return!0;var r=m.Children.count(t);if(r!==m.Children.count(n))return!1;if(r===0)return!0;if(r===1)return nT(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var s=0;s<r;s++){var i=t[s],o=n[s];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!nT(i,o))return!1}return!0},nT=function(t,n){if(Ft(t)&&Ft(n))return!0;if(!Ft(t)&&!Ft(n)){var r=t.props||{},s=r.children,i=JP(r,HX),o=n.props||{},c=o.children,d=JP(o,KX);return s&&c?_c(i,d)&&_S(s,c):!s&&!c?_c(i,d):!1}return!1},rT=function(t,n){var r=[],s={};return XN(t).forEach(function(i,o){if(XX(i))r.push(i);else if(i){var c=oi(i.type),d=n[c]||{},f=d.handler,h=d.once;if(f&&(!h||!s[c])){var p=f(i,c,o);r.push(p),s[c]=!0}}}),r},ZX=function(t){var n=t&&t.type;return n&&ZP[n]?ZP[n]:null},eQ=function(t,n){return XN(n).indexOf(t)},tQ=["children","width","height","viewBox","className","style","title","desc"];function AS(){return AS=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},AS.apply(this,arguments)}function nQ(e,t){if(e==null)return{};var n=rQ(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rQ(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 ES(e){var t=e.children,n=e.width,r=e.height,s=e.viewBox,i=e.className,o=e.style,c=e.title,d=e.desc,f=nQ(e,tQ),h=s||{width:n,height:r,x:0,y:0},p=Bt("recharts-surface",i);return Y.createElement("svg",AS({},kt(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),Y.createElement("title",null,c),Y.createElement("desc",null,d),t)}var aQ=["children","className"];function kS(){return kS=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},kS.apply(this,arguments)}function sQ(e,t){if(e==null)return{};var n=iQ(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function iQ(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 sn=Y.forwardRef(function(e,t){var n=e.children,r=e.className,s=sQ(e,aQ),i=Bt("recharts-layer",r);return Y.createElement("g",kS({className:i},kt(s,!0),{ref:t}),n)}),li=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i<r;i++)s[i-2]=arguments[i]},Ub,aT;function oQ(){if(aT)return Ub;aT=1;function e(t,n,r){var s=-1,i=t.length;n<0&&(n=-n>i?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var o=Array(i);++s<i;)o[s]=t[s+n];return o}return Ub=e,Ub}var Wb,sT;function lQ(){if(sT)return Wb;sT=1;var e=oQ();function t(n,r,s){var i=n.length;return s=s===void 0?i:s,!r&&s>=i?n:e(n,r,s)}return Wb=t,Wb}var Vb,iT;function O3(){if(iT)return Vb;iT=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,i="\\ufe0e\\ufe0f",o="\\u200d",c=RegExp("["+o+e+s+i+"]");function d(f){return c.test(f)}return Vb=d,Vb}var Hb,oT;function cQ(){if(oT)return Hb;oT=1;function e(t){return t.split("")}return Hb=e,Hb}var Kb,lT;function uQ(){if(lT)return Kb;lT=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,i="\\ufe0e\\ufe0f",o="["+e+"]",c="["+s+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+d+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",j=f+"?",y="["+i+"]?",b="(?:"+x+"(?:"+[h,p,g].join("|")+")"+y+j+")*",N=y+j+b,C="(?:"+[h+c+"?",c,p,g,o].join("|")+")",S=RegExp(d+"(?="+d+")|"+C+N,"g");function E(A){return A.match(S)||[]}return Kb=E,Kb}var Gb,cT;function dQ(){if(cT)return Gb;cT=1;var e=cQ(),t=O3(),n=uQ();function r(s){return t(s)?n(s):e(s)}return Gb=r,Gb}var Yb,uT;function fQ(){if(uT)return Yb;uT=1;var e=lQ(),t=O3(),n=dQ(),r=E3();function s(i){return function(o){o=r(o);var c=t(o)?n(o):void 0,d=c?c[0]:o.charAt(0),f=c?e(c,1).join(""):o.slice(1);return d[i]()+f}}return Yb=s,Yb}var Xb,dT;function pQ(){if(dT)return Xb;dT=1;var e=fQ(),t=e("toUpperCase");return Xb=t,Xb}var hQ=pQ();const Fv=hn(hQ);function Cn(e){return function(){return e}}const R3=Math.cos,em=Math.sin,ls=Math.sqrt,tm=Math.PI,zv=2*tm,PS=Math.PI,TS=2*PS,qo=1e-6,mQ=TS-qo;function I3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function vQ(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return I3;const n=10**t;return function(r){this._+=r[0];for(let s=1,i=r.length;s<i;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}class gQ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?I3:vQ(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,s){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+s}`}bezierCurveTo(t,n,r,s,i,o){this._append`C${+t},${+n},${+r},${+s},${this._x1=+i},${this._y1=+o}`}arcTo(t,n,r,s,i){if(t=+t,n=+n,r=+r,s=+s,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,c=this._y1,d=r-t,f=s-n,h=o-t,p=c-n,g=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>qo)if(!(Math.abs(p*d-f*h)>qo)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-o,j=s-c,y=d*d+f*f,b=x*x+j*j,N=Math.sqrt(y),C=Math.sqrt(g),S=i*Math.tan((PS-Math.acos((y+g-b)/(2*N*C)))/2),E=S/C,A=S/N;Math.abs(E-1)>qo&&this._append`L${t+E*h},${n+E*p}`,this._append`A${i},${i},0,0,${+(p*x>h*j)},${this._x1=t+A*d},${this._y1=n+A*f}`}}arc(t,n,r,s,i,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(s),d=r*Math.sin(s),f=t+c,h=n+d,p=1^o,g=o?s-i:i-s;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>qo||Math.abs(this._y1-h)>qo)&&this._append`L${f},${h}`,r&&(g<0&&(g=g%TS+TS),g>mQ?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:g>qo&&this._append`A${r},${r},0,${+(g>=PS)},${p},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function QN(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new gQ(t)}function JN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function M3(e){this._context=e}M3.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);break}}};function Bv(e){return new M3(e)}function $3(e){return e[0]}function D3(e){return e[1]}function L3(e,t){var n=Cn(!0),r=null,s=Bv,i=null,o=QN(c);e=typeof e=="function"?e:e===void 0?$3:Cn(e),t=typeof t=="function"?t:t===void 0?D3:Cn(t);function c(d){var f,h=(d=JN(d)).length,p,g=!1,x;for(r==null&&(i=s(x=o())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===g&&((g=!g)?i.lineStart():i.lineEnd()),g&&i.point(+e(p,f,d),+t(p,f,d));if(x)return i=null,x+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:Cn(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:Cn(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Cn(!!d),c):n},c.curve=function(d){return arguments.length?(s=d,r!=null&&(i=s(r)),c):s},c.context=function(d){return arguments.length?(d==null?r=i=null:i=s(r=d),c):r},c}function gh(e,t,n){var r=null,s=Cn(!0),i=null,o=Bv,c=null,d=QN(f);e=typeof e=="function"?e:e===void 0?$3:Cn(+e),t=typeof t=="function"?t:Cn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?D3:Cn(+n);function f(p){var g,x,j,y=(p=JN(p)).length,b,N=!1,C,S=new Array(y),E=new Array(y);for(i==null&&(c=o(C=d())),g=0;g<=y;++g){if(!(g<y&&s(b=p[g],g,p))===N)if(N=!N)x=g,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=g-1;j>=x;--j)c.point(S[j],E[j]);c.lineEnd(),c.areaEnd()}N&&(S[g]=+e(b,g,p),E[g]=+t(b,g,p),c.point(r?+r(b,g,p):S[g],n?+n(b,g,p):E[g]))}if(C)return c=null,C+""||null}function h(){return L3().defined(s).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:Cn(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Cn(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Cn(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:Cn(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Cn(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Cn(+p),f):n},f.lineX0=f.lineY0=function(){return h().x(e).y(t)},f.lineY1=function(){return h().x(e).y(n)},f.lineX1=function(){return h().x(r).y(t)},f.defined=function(p){return arguments.length?(s=typeof p=="function"?p:Cn(!!p),f):s},f.curve=function(p){return arguments.length?(o=p,i!=null&&(c=o(i)),f):o},f.context=function(p){return arguments.length?(p==null?i=c=null:c=o(i=p),f):i},f}class F3{constructor(t,n){this._context=t,this._x=n}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(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function xQ(e){return new F3(e,!0)}function yQ(e){return new F3(e,!1)}const ZN={draw(e,t){const n=ls(t/tm);e.moveTo(n,0),e.arc(0,0,n,0,zv)}},bQ={draw(e,t){const n=ls(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()}},z3=ls(1/3),wQ=z3*2,jQ={draw(e,t){const n=ls(t/wQ),r=n*z3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},SQ={draw(e,t){const n=ls(t),r=-n/2;e.rect(r,r,n,n)}},NQ=.8908130915292852,B3=em(tm/10)/em(7*tm/10),CQ=em(zv/10)*B3,_Q=-R3(zv/10)*B3,AQ={draw(e,t){const n=ls(t*NQ),r=CQ*n,s=_Q*n;e.moveTo(0,-n),e.lineTo(r,s);for(let i=1;i<5;++i){const o=zv*i/5,c=R3(o),d=em(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*s,d*r+c*s)}e.closePath()}},Qb=ls(3),EQ={draw(e,t){const n=-ls(t/(Qb*3));e.moveTo(0,n*2),e.lineTo(-Qb*n,-n),e.lineTo(Qb*n,-n),e.closePath()}},Aa=-.5,Ea=ls(3)/2,OS=1/ls(12),kQ=(OS/2+1)*3,PQ={draw(e,t){const n=ls(t/kQ),r=n/2,s=n*OS,i=r,o=n*OS+n,c=-i,d=o;e.moveTo(r,s),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(Aa*r-Ea*s,Ea*r+Aa*s),e.lineTo(Aa*i-Ea*o,Ea*i+Aa*o),e.lineTo(Aa*c-Ea*d,Ea*c+Aa*d),e.lineTo(Aa*r+Ea*s,Aa*s-Ea*r),e.lineTo(Aa*i+Ea*o,Aa*o-Ea*i),e.lineTo(Aa*c+Ea*d,Aa*d-Ea*c),e.closePath()}};function TQ(e,t){let n=null,r=QN(s);e=typeof e=="function"?e:Cn(e||ZN),t=typeof t=="function"?t:Cn(t===void 0?64:+t);function s(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return s.type=function(i){return arguments.length?(e=typeof i=="function"?i:Cn(i),s):e},s.size=function(i){return arguments.length?(t=typeof i=="function"?i:Cn(+i),s):t},s.context=function(i){return arguments.length?(n=i??null,s):n},s}function nm(){}function rm(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 q3(e){this._context=e}q3.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:rm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(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:rm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OQ(e){return new q3(e)}function U3(e){this._context=e}U3.prototype={areaStart:nm,areaEnd:nm,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);break}}},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:rm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function RQ(e){return new U3(e)}function W3(e){this._context=e}W3.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:rm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function IQ(e){return new W3(e)}function V3(e){this._context=e}V3.prototype={areaStart:nm,areaEnd:nm,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 MQ(e){return new V3(e)}function fT(e){return e<0?-1:1}function pT(e,t,n){var r=e._x1-e._x0,s=t-e._x1,i=(e._y1-e._y0)/(r||s<0&&-0),o=(n-e._y1)/(s||r<0&&-0),c=(i*s+o*r)/(r+s);return(fT(i)+fT(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function hT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Jb(e,t,n){var r=e._x0,s=e._y0,i=e._x1,o=e._y1,c=(i-r)/3;e._context.bezierCurveTo(r+c,s+c*t,i-c,o-c*n,i,o)}function am(e){this._context=e}am.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:Jb(this,this._t0,hT(this,this._t0));break}(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,Jb(this,hT(this,n=pT(this,e,t)),n);break;default:Jb(this,this._t0,n=pT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function H3(e){this._context=new K3(e)}(H3.prototype=Object.create(am.prototype)).point=function(e,t){am.prototype.point.call(this,t,e)};function K3(e){this._context=e}K3.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,s,i){this._context.bezierCurveTo(t,e,r,n,i,s)}};function $Q(e){return new am(e)}function DQ(e){return new H3(e)}function G3(e){this._context=e}G3.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=mT(e),s=mT(t),i=0,o=1;o<n;++i,++o)this._context.bezierCurveTo(r[0][i],s[0][i],r[1][i],s[1][i],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 mT(e){var t,n=e.length-1,r,s=new Array(n),i=new Array(n),o=new Array(n);for(s[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)s[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=s[t]/i[t-1],i[t]-=r,o[t]-=r*o[t-1];for(s[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)s[t]=(o[t]-s[t+1])/i[t];for(i[n-1]=(e[n]+s[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-s[t+1];return[s,i]}function LQ(e){return new G3(e)}function qv(e,t){this._context=e,this._t=t}qv.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)}break}}this._x=e,this._y=t}};function FQ(e){return new qv(e,.5)}function zQ(e){return new qv(e,0)}function BQ(e){return new qv(e,1)}function $c(e,t){if((o=e.length)>1)for(var n=1,r,s,i=e[t[0]],o,c=i.length;n<o;++n)for(s=i,i=e[t[n]],r=0;r<c;++r)i[r][1]+=i[r][0]=isNaN(s[r][1])?s[r][0]:s[r][1]}function RS(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function qQ(e,t){return e[t]}function UQ(e){const t=[];return t.key=e,t}function WQ(){var e=Cn([]),t=RS,n=$c,r=qQ;function s(i){var o=Array.from(e.apply(this,arguments),UQ),c,d=o.length,f=-1,h;for(const p of i)for(c=0,++f;c<d;++c)(o[c][f]=[0,+r(p,o[c].key,f,i)]).data=p;for(c=0,h=JN(t(o));c<d;++c)o[h[c]].index=c;return n(o,h),o}return s.keys=function(i){return arguments.length?(e=typeof i=="function"?i:Cn(Array.from(i)),s):e},s.value=function(i){return arguments.length?(r=typeof i=="function"?i:Cn(+i),s):r},s.order=function(i){return arguments.length?(t=i==null?RS:typeof i=="function"?i:Cn(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(n=i??$c,s):n},s}function VQ(e,t){if((r=e.length)>0){for(var n,r,s=0,i=e[0].length,o;s<i;++s){for(o=n=0;n<r;++n)o+=e[n][s][1]||0;if(o)for(n=0;n<r;++n)e[n][s][1]/=o}$c(e,t)}}function HQ(e,t){if((s=e.length)>0){for(var n=0,r=e[t[0]],s,i=r.length;n<i;++n){for(var o=0,c=0;o<s;++o)c+=e[o][n][1]||0;r[n][1]+=r[n][0]=-c/2}$c(e,t)}}function KQ(e,t){if(!(!((o=e.length)>0)||!((i=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,i,o;r<i;++r){for(var c=0,d=0,f=0;c<o;++c){for(var h=e[t[c]],p=h[r][1]||0,g=h[r-1][1]||0,x=(p-g)/2,j=0;j<c;++j){var y=e[t[j]],b=y[r][1]||0,N=y[r-1][1]||0;x+=b-N}d+=p,f+=x*p}s[r-1][1]+=s[r-1][0]=n,d&&(n-=f/d)}s[r-1][1]+=s[r-1][0]=n,$c(e,t)}}function zd(e){"@babel/helpers - typeof";return zd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zd(e)}var GQ=["type","size","sizeType"];function IS(){return IS=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},IS.apply(this,arguments)}function vT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).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?vT(Object(n),!0).forEach(function(r){YQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}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=QQ(e,"string");return zd(t)=="symbol"?t:t+""}function QQ(e,t){if(zd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function JQ(e,t){if(e==null)return{};var n=ZQ(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ZQ(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 Y3={symbolCircle:ZN,symbolCross:bQ,symbolDiamond:jQ,symbolSquare:SQ,symbolStar:AQ,symbolTriangle:EQ,symbolWye:PQ},eJ=Math.PI/180,tJ=function(t){var n="symbol".concat(Fv(t));return Y3[n]||ZN},nJ=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var s=18*eJ;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},rJ=function(t,n){Y3["symbol".concat(Fv(t))]=n},eC=function(t){var n=t.type,r=n===void 0?"circle":n,s=t.size,i=s===void 0?64:s,o=t.sizeType,c=o===void 0?"area":o,d=JQ(t,GQ),f=gT(gT({},d),{},{type:r,size:i,sizeType:c}),h=function(){var b=tJ(r),N=TQ().type(b).size(nJ(i,c,r));return N()},p=f.className,g=f.cx,x=f.cy,j=kt(f,!0);return g===+g&&x===+x&&i===+i?Y.createElement("path",IS({},j,{className:Bt("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(x,")"),d:h()})):null};eC.registerSymbol=rJ;function Dc(e){"@babel/helpers - typeof";return Dc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dc(e)}function MS(){return MS=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},MS.apply(this,arguments)}function xT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function aJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xT(Object(n),!0).forEach(function(r){Bd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iJ(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,Q3(r.key),r)}}function oJ(e,t,n){return t&&iJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lJ(e,t,n){return t=sm(t),cJ(e,X3()?Reflect.construct(t,n||[],sm(e).constructor):t.apply(e,n))}function cJ(e,t){if(t&&(Dc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uJ(e)}function uJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(X3=function(){return!!e})()}function sm(e){return sm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sm(e)}function dJ(e,t){if(typeof t!="function"&&t!==null)throw new 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&&$S(e,t)}function $S(e,t){return $S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},$S(e,t)}function Bd(e,t,n){return t=Q3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q3(e){var t=fJ(e,"string");return Dc(t)=="symbol"?t:t+""}function fJ(e,t){if(Dc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ka=32,tC=(function(e){function t(){return sJ(this,t),lJ(this,t,arguments)}return dJ(t,e),oJ(t,[{key:"renderIcon",value:function(r){var s=this.props.inactiveColor,i=ka/2,o=ka/6,c=ka/3,d=r.inactive?s:r.color;if(r.type==="plainline")return Y.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:ka,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return Y.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(i,"h").concat(c,`
|
|
57
|
-
A`).concat(o,",").concat(o,",0,1,1,").concat(2*c,",").concat(i,`
|
|
58
|
-
H`).concat(ka,"M").concat(2*c,",").concat(i,`
|
|
59
|
-
A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(i),className:"recharts-legend-icon"});if(r.type==="rect")return Y.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(ka/8,"h").concat(ka,"v").concat(ka*3/4,"h").concat(-ka,"z"),className:"recharts-legend-icon"});if(Y.isValidElement(r.legendIcon)){var f=aJ({},r);return delete f.legendIcon,Y.cloneElement(r.legendIcon,f)}return Y.createElement(eC,{fill:d,cx:i,cy:i,size:ka,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,s=this.props,i=s.payload,o=s.iconSize,c=s.layout,d=s.formatter,f=s.inactiveColor,h={x:0,y:0,width:ka,height:ka},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},g={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(x,j){var y=x.formatter||d,b=Bt(Bd(Bd({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",x.inactive));if(x.type==="none")return null;var N=Lt(x.value)?null:x.value;li(!Lt(x.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var C=x.inactive?f:x.color;return Y.createElement("li",MS({className:b,style:p,key:"legend-item-".concat(j)},il(r.props,x,j)),Y.createElement(ES,{width:o,height:o,viewBox:h,style:g},r.renderIcon(x)),Y.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},y?y(N,x,j):N))})}},{key:"render",value:function(){var r=this.props,s=r.payload,i=r.layout,o=r.align;if(!s||!s.length)return null;var c={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return Y.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(m.PureComponent);Bd(tC,"displayName","Legend");Bd(tC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Zb,yT;function pJ(){if(yT)return Zb;yT=1;var e=$v();function t(){this.__data__=new e,this.size=0}return Zb=t,Zb}var e0,bT;function hJ(){if(bT)return e0;bT=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return e0=e,e0}var t0,wT;function mJ(){if(wT)return t0;wT=1;function e(t){return this.__data__.get(t)}return t0=e,t0}var n0,jT;function vJ(){if(jT)return n0;jT=1;function e(t){return this.__data__.has(t)}return n0=e,n0}var r0,ST;function gJ(){if(ST)return r0;ST=1;var e=$v(),t=VN(),n=HN(),r=200;function s(i,o){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!t||d.length<r-1)return d.push([i,o]),this.size=++c.size,this;c=this.__data__=new n(d)}return c.set(i,o),this.size=c.size,this}return r0=s,r0}var a0,NT;function J3(){if(NT)return a0;NT=1;var e=$v(),t=pJ(),n=hJ(),r=mJ(),s=vJ(),i=gJ();function o(c){var d=this.__data__=new e(c);this.size=d.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=s,o.prototype.set=i,a0=o,a0}var s0,CT;function xJ(){if(CT)return s0;CT=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return s0=t,s0}var i0,_T;function yJ(){if(_T)return i0;_T=1;function e(t){return this.__data__.has(t)}return i0=e,i0}var o0,AT;function Z3(){if(AT)return o0;AT=1;var e=HN(),t=xJ(),n=yJ();function r(s){var i=-1,o=s==null?0:s.length;for(this.__data__=new e;++i<o;)this.add(s[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,o0=r,o0}var l0,ET;function eL(){if(ET)return l0;ET=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(n(t[r],r,t))return!0;return!1}return l0=e,l0}var c0,kT;function tL(){if(kT)return c0;kT=1;function e(t,n){return t.has(n)}return c0=e,c0}var u0,PT;function nL(){if(PT)return u0;PT=1;var e=Z3(),t=eL(),n=tL(),r=1,s=2;function i(o,c,d,f,h,p){var g=d&r,x=o.length,j=c.length;if(x!=j&&!(g&&j>x))return!1;var y=p.get(o),b=p.get(c);if(y&&b)return y==c&&b==o;var N=-1,C=!0,S=d&s?new e:void 0;for(p.set(o,c),p.set(c,o);++N<x;){var E=o[N],A=c[N];if(f)var k=g?f(A,E,N,c,o,p):f(E,A,N,o,c,p);if(k!==void 0){if(k)continue;C=!1;break}if(S){if(!t(c,function(T,O){if(!n(S,O)&&(E===T||h(E,T,d,f,p)))return S.push(O)})){C=!1;break}}else if(!(E===A||h(E,A,d,f,p))){C=!1;break}}return p.delete(o),p.delete(c),C}return u0=i,u0}var d0,TT;function bJ(){if(TT)return d0;TT=1;var e=Ls(),t=e.Uint8Array;return d0=t,d0}var f0,OT;function wJ(){if(OT)return f0;OT=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,i){r[++n]=[i,s]}),r}return f0=e,f0}var p0,RT;function nC(){if(RT)return p0;RT=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return p0=e,p0}var h0,IT;function jJ(){if(IT)return h0;IT=1;var e=Lf(),t=bJ(),n=WN(),r=nL(),s=wJ(),i=nC(),o=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",g="[object Number]",x="[object RegExp]",j="[object Set]",y="[object String]",b="[object Symbol]",N="[object ArrayBuffer]",C="[object DataView]",S=e?e.prototype:void 0,E=S?S.valueOf:void 0;function A(k,T,O,D,q,U,B){switch(O){case C:if(k.byteLength!=T.byteLength||k.byteOffset!=T.byteOffset)return!1;k=k.buffer,T=T.buffer;case N:return!(k.byteLength!=T.byteLength||!U(new t(k),new t(T)));case d:case f:case g:return n(+k,+T);case h:return k.name==T.name&&k.message==T.message;case x:case y:return k==T+"";case p:var X=s;case j:var W=D&o;if(X||(X=i),k.size!=T.size&&!W)return!1;var M=B.get(k);if(M)return M==T;D|=c,B.set(k,T);var z=r(X(k),X(T),D,q,U,B);return B.delete(k),z;case b:if(E)return E.call(k)==E.call(T)}return!1}return h0=A,h0}var m0,MT;function rL(){if(MT)return m0;MT=1;function e(t,n){for(var r=-1,s=n.length,i=t.length;++r<s;)t[i+r]=n[r];return t}return m0=e,m0}var v0,$T;function SJ(){if($T)return v0;$T=1;var e=rL(),t=Zr();function n(r,s,i){var o=s(r);return t(r)?o:e(o,i(r))}return v0=n,v0}var g0,DT;function NJ(){if(DT)return g0;DT=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,i=0,o=[];++r<s;){var c=t[r];n(c,r,t)&&(o[i++]=c)}return o}return g0=e,g0}var x0,LT;function CJ(){if(LT)return x0;LT=1;function e(){return[]}return x0=e,x0}var y0,FT;function _J(){if(FT)return y0;FT=1;var e=NJ(),t=CJ(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,i=s?function(o){return o==null?[]:(o=Object(o),e(s(o),function(c){return r.call(o,c)}))}:t;return y0=i,y0}var b0,zT;function AJ(){if(zT)return b0;zT=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return b0=e,b0}var w0,BT;function EJ(){if(BT)return w0;BT=1;var e=ji(),t=Si(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return w0=r,w0}var j0,qT;function rC(){if(qT)return j0;qT=1;var e=EJ(),t=Si(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,i=e((function(){return arguments})())?e:function(o){return t(o)&&r.call(o,"callee")&&!s.call(o,"callee")};return j0=i,j0}var bd={exports:{}},S0,UT;function kJ(){if(UT)return S0;UT=1;function e(){return!1}return S0=e,S0}bd.exports;var WT;function aL(){return WT||(WT=1,(function(e,t){var n=Ls(),r=kJ(),s=t&&!t.nodeType&&t,i=s&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===s,c=o?n.Buffer:void 0,d=c?c.isBuffer:void 0,f=d||r;e.exports=f})(bd,bd.exports)),bd.exports}var N0,VT;function aC(){if(VT)return N0;VT=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var i=typeof r;return s=s??e,!!s&&(i=="number"||i!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return N0=n,N0}var C0,HT;function sC(){if(HT)return C0;HT=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return C0=t,C0}var _0,KT;function PJ(){if(KT)return _0;KT=1;var e=ji(),t=sC(),n=Si(),r="[object Arguments]",s="[object Array]",i="[object Boolean]",o="[object Date]",c="[object Error]",d="[object Function]",f="[object Map]",h="[object Number]",p="[object Object]",g="[object RegExp]",x="[object Set]",j="[object String]",y="[object WeakMap]",b="[object ArrayBuffer]",N="[object DataView]",C="[object Float32Array]",S="[object Float64Array]",E="[object Int8Array]",A="[object Int16Array]",k="[object Int32Array]",T="[object Uint8Array]",O="[object Uint8ClampedArray]",D="[object Uint16Array]",q="[object Uint32Array]",U={};U[C]=U[S]=U[E]=U[A]=U[k]=U[T]=U[O]=U[D]=U[q]=!0,U[r]=U[s]=U[b]=U[i]=U[N]=U[o]=U[c]=U[d]=U[f]=U[h]=U[p]=U[g]=U[x]=U[j]=U[y]=!1;function B(X){return n(X)&&t(X.length)&&!!U[e(X)]}return _0=B,_0}var A0,GT;function sL(){if(GT)return A0;GT=1;function e(t){return function(n){return t(n)}}return A0=e,A0}var wd={exports:{}};wd.exports;var YT;function TJ(){return YT||(YT=1,(function(e,t){var n=C3(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===r,o=i&&n.process,c=(function(){try{var d=s&&s.require&&s.require("util").types;return d||o&&o.binding&&o.binding("util")}catch{}})();e.exports=c})(wd,wd.exports)),wd.exports}var E0,XT;function iL(){if(XT)return E0;XT=1;var e=PJ(),t=sL(),n=TJ(),r=n&&n.isTypedArray,s=r?t(r):e;return E0=s,E0}var k0,QT;function OJ(){if(QT)return k0;QT=1;var e=AJ(),t=rC(),n=Zr(),r=aL(),s=aC(),i=iL(),o=Object.prototype,c=o.hasOwnProperty;function d(f,h){var p=n(f),g=!p&&t(f),x=!p&&!g&&r(f),j=!p&&!g&&!x&&i(f),y=p||g||x||j,b=y?e(f.length,String):[],N=b.length;for(var C in f)(h||c.call(f,C))&&!(y&&(C=="length"||x&&(C=="offset"||C=="parent")||j&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||s(C,N)))&&b.push(C);return b}return k0=d,k0}var P0,JT;function RJ(){if(JT)return P0;JT=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return P0=t,P0}var T0,ZT;function oL(){if(ZT)return T0;ZT=1;function e(t,n){return function(r){return t(n(r))}}return T0=e,T0}var O0,eO;function IJ(){if(eO)return O0;eO=1;var e=oL(),t=e(Object.keys,Object);return O0=t,O0}var R0,tO;function MJ(){if(tO)return R0;tO=1;var e=RJ(),t=IJ(),n=Object.prototype,r=n.hasOwnProperty;function s(i){if(!e(i))return t(i);var o=[];for(var c in Object(i))r.call(i,c)&&c!="constructor"&&o.push(c);return o}return R0=s,R0}var I0,nO;function zf(){if(nO)return I0;nO=1;var e=UN(),t=sC();function n(r){return r!=null&&t(r.length)&&!e(r)}return I0=n,I0}var M0,rO;function Uv(){if(rO)return M0;rO=1;var e=OJ(),t=MJ(),n=zf();function r(s){return n(s)?e(s):t(s)}return M0=r,M0}var $0,aO;function $J(){if(aO)return $0;aO=1;var e=SJ(),t=_J(),n=Uv();function r(s){return e(s,n,t)}return $0=r,$0}var D0,sO;function DJ(){if(sO)return D0;sO=1;var e=$J(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(i,o,c,d,f,h){var p=c&t,g=e(i),x=g.length,j=e(o),y=j.length;if(x!=y&&!p)return!1;for(var b=x;b--;){var N=g[b];if(!(p?N in o:r.call(o,N)))return!1}var C=h.get(i),S=h.get(o);if(C&&S)return C==o&&S==i;var E=!0;h.set(i,o),h.set(o,i);for(var A=p;++b<x;){N=g[b];var k=i[N],T=o[N];if(d)var O=p?d(T,k,N,o,i,h):d(k,T,N,i,o,h);if(!(O===void 0?k===T||f(k,T,c,d,h):O)){E=!1;break}A||(A=N=="constructor")}if(E&&!A){var D=i.constructor,q=o.constructor;D!=q&&"constructor"in i&&"constructor"in o&&!(typeof D=="function"&&D instanceof D&&typeof q=="function"&&q instanceof q)&&(E=!1)}return h.delete(i),h.delete(o),E}return D0=s,D0}var L0,iO;function LJ(){if(iO)return L0;iO=1;var e=Cl(),t=Ls(),n=e(t,"DataView");return L0=n,L0}var F0,oO;function FJ(){if(oO)return F0;oO=1;var e=Cl(),t=Ls(),n=e(t,"Promise");return F0=n,F0}var z0,lO;function lL(){if(lO)return z0;lO=1;var e=Cl(),t=Ls(),n=e(t,"Set");return z0=n,z0}var B0,cO;function zJ(){if(cO)return B0;cO=1;var e=Cl(),t=Ls(),n=e(t,"WeakMap");return B0=n,B0}var q0,uO;function BJ(){if(uO)return q0;uO=1;var e=LJ(),t=VN(),n=FJ(),r=lL(),s=zJ(),i=ji(),o=_3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",g="[object DataView]",x=o(e),j=o(t),y=o(n),b=o(r),N=o(s),C=i;return(e&&C(new e(new ArrayBuffer(1)))!=g||t&&C(new t)!=c||n&&C(n.resolve())!=f||r&&C(new r)!=h||s&&C(new s)!=p)&&(C=function(S){var E=i(S),A=E==d?S.constructor:void 0,k=A?o(A):"";if(k)switch(k){case x:return g;case j:return c;case y:return f;case b:return h;case N:return p}return E}),q0=C,q0}var U0,dO;function qJ(){if(dO)return U0;dO=1;var e=J3(),t=nL(),n=jJ(),r=DJ(),s=BJ(),i=Zr(),o=aL(),c=iL(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",g=Object.prototype,x=g.hasOwnProperty;function j(y,b,N,C,S,E){var A=i(y),k=i(b),T=A?h:s(y),O=k?h:s(b);T=T==f?p:T,O=O==f?p:O;var D=T==p,q=O==p,U=T==O;if(U&&o(y)){if(!o(b))return!1;A=!0,D=!1}if(U&&!D)return E||(E=new e),A||c(y)?t(y,b,N,C,S,E):n(y,b,T,N,C,S,E);if(!(N&d)){var B=D&&x.call(y,"__wrapped__"),X=q&&x.call(b,"__wrapped__");if(B||X){var W=B?y.value():y,M=X?b.value():b;return E||(E=new e),S(W,M,N,C,E)}}return U?(E||(E=new e),r(y,b,N,C,S,E)):!1}return U0=j,U0}var W0,fO;function iC(){if(fO)return W0;fO=1;var e=qJ(),t=Si();function n(r,s,i,o,c){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,i,o,n,c)}return W0=n,W0}var V0,pO;function UJ(){if(pO)return V0;pO=1;var e=J3(),t=iC(),n=1,r=2;function s(i,o,c,d){var f=c.length,h=f,p=!d;if(i==null)return!h;for(i=Object(i);f--;){var g=c[f];if(p&&g[2]?g[1]!==i[g[0]]:!(g[0]in i))return!1}for(;++f<h;){g=c[f];var x=g[0],j=i[x],y=g[1];if(p&&g[2]){if(j===void 0&&!(x in i))return!1}else{var b=new e;if(d)var N=d(j,y,x,i,o,b);if(!(N===void 0?t(y,j,n|r,d,b):N))return!1}}return!0}return V0=s,V0}var H0,hO;function cL(){if(hO)return H0;hO=1;var e=ho();function t(n){return n===n&&!e(n)}return H0=t,H0}var K0,mO;function WJ(){if(mO)return K0;mO=1;var e=cL(),t=Uv();function n(r){for(var s=t(r),i=s.length;i--;){var o=s[i],c=r[o];s[i]=[o,c,e(c)]}return s}return K0=n,K0}var G0,vO;function uL(){if(vO)return G0;vO=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return G0=e,G0}var Y0,gO;function VJ(){if(gO)return Y0;gO=1;var e=UJ(),t=WJ(),n=uL();function r(s){var i=t(s);return i.length==1&&i[0][2]?n(i[0][0],i[0][1]):function(o){return o===s||e(o,s,i)}}return Y0=r,Y0}var X0,xO;function HJ(){if(xO)return X0;xO=1;function e(t,n){return t!=null&&n in Object(t)}return X0=e,X0}var Q0,yO;function KJ(){if(yO)return Q0;yO=1;var e=k3(),t=rC(),n=Zr(),r=aC(),s=sC(),i=Lv();function o(c,d,f){d=e(d,c);for(var h=-1,p=d.length,g=!1;++h<p;){var x=i(d[h]);if(!(g=c!=null&&f(c,x)))break;c=c[x]}return g||++h!=p?g:(p=c==null?0:c.length,!!p&&s(p)&&r(x,p)&&(n(c)||t(c)))}return Q0=o,Q0}var J0,bO;function GJ(){if(bO)return J0;bO=1;var e=HJ(),t=KJ();function n(r,s){return r!=null&&t(r,s,e)}return J0=n,J0}var Z0,wO;function YJ(){if(wO)return Z0;wO=1;var e=iC(),t=P3(),n=GJ(),r=qN(),s=cL(),i=uL(),o=Lv(),c=1,d=2;function f(h,p){return r(h)&&s(p)?i(o(h),p):function(g){var x=t(g,h);return x===void 0&&x===p?n(g,h):e(p,x,c|d)}}return Z0=f,Z0}var ew,jO;function bu(){if(jO)return ew;jO=1;function e(t){return t}return ew=e,ew}var tw,SO;function XJ(){if(SO)return tw;SO=1;function e(t){return function(n){return n?.[t]}}return tw=e,tw}var nw,NO;function QJ(){if(NO)return nw;NO=1;var e=GN();function t(n){return function(r){return e(r,n)}}return nw=t,nw}var rw,CO;function JJ(){if(CO)return rw;CO=1;var e=XJ(),t=QJ(),n=qN(),r=Lv();function s(i){return n(i)?e(r(i)):t(i)}return rw=s,rw}var aw,_O;function Fs(){if(_O)return aw;_O=1;var e=VJ(),t=YJ(),n=bu(),r=Zr(),s=JJ();function i(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):s(o)}return aw=i,aw}var sw,AO;function dL(){if(AO)return sw;AO=1;function e(t,n,r,s){for(var i=t.length,o=r+(s?1:-1);s?o--:++o<i;)if(n(t[o],o,t))return o;return-1}return sw=e,sw}var iw,EO;function ZJ(){if(EO)return iw;EO=1;function e(t){return t!==t}return iw=e,iw}var ow,kO;function eZ(){if(kO)return ow;kO=1;function e(t,n,r){for(var s=r-1,i=t.length;++s<i;)if(t[s]===n)return s;return-1}return ow=e,ow}var lw,PO;function tZ(){if(PO)return lw;PO=1;var e=dL(),t=ZJ(),n=eZ();function r(s,i,o){return i===i?n(s,i,o):e(s,t,o)}return lw=r,lw}var cw,TO;function nZ(){if(TO)return cw;TO=1;var e=tZ();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return cw=t,cw}var uw,OO;function rZ(){if(OO)return uw;OO=1;function e(t,n,r){for(var s=-1,i=t==null?0:t.length;++s<i;)if(r(n,t[s]))return!0;return!1}return uw=e,uw}var dw,RO;function aZ(){if(RO)return dw;RO=1;function e(){}return dw=e,dw}var fw,IO;function sZ(){if(IO)return fw;IO=1;var e=lL(),t=aZ(),n=nC(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return fw=s,fw}var pw,MO;function iZ(){if(MO)return pw;MO=1;var e=Z3(),t=nZ(),n=rZ(),r=tL(),s=sZ(),i=nC(),o=200;function c(d,f,h){var p=-1,g=t,x=d.length,j=!0,y=[],b=y;if(h)j=!1,g=n;else if(x>=o){var N=f?null:s(d);if(N)return i(N);j=!1,g=r,b=new e}else b=f?[]:y;e:for(;++p<x;){var C=d[p],S=f?f(C):C;if(C=h||C!==0?C:0,j&&S===S){for(var E=b.length;E--;)if(b[E]===S)continue e;f&&b.push(S),y.push(C)}else g(b,S,h)||(b!==y&&b.push(S),y.push(C))}return y}return pw=c,pw}var hw,$O;function oZ(){if($O)return hw;$O=1;var e=Fs(),t=iZ();function n(r,s){return r&&r.length?t(r,e(s,2)):[]}return hw=n,hw}var lZ=oZ();const DO=hn(lZ);function fL(e,t,n){return t===!0?DO(e,n):Lt(t)?DO(e,t):e}function Lc(e){"@babel/helpers - typeof";return Lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lc(e)}var cZ=["ref"];function LO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Zs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LO(Object(n),!0).forEach(function(r){Wv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FO(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,hL(r.key),r)}}function dZ(e,t,n){return t&&FO(e.prototype,t),n&&FO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fZ(e,t,n){return t=im(t),pZ(e,pL()?Reflect.construct(t,n||[],im(e).constructor):t.apply(e,n))}function pZ(e,t){if(t&&(Lc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hZ(e)}function hZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pL=function(){return!!e})()}function im(e){return im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},im(e)}function mZ(e,t){if(typeof t!="function"&&t!==null)throw new 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&&DS(e,t)}function DS(e,t){return DS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},DS(e,t)}function Wv(e,t,n){return t=hL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hL(e){var t=vZ(e,"string");return Lc(t)=="symbol"?t:t+""}function vZ(e,t){if(Lc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function gZ(e,t){if(e==null)return{};var n=xZ(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xZ(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 yZ(e){return e.value}function bZ(e,t){if(Y.isValidElement(e))return Y.cloneElement(e,t);if(typeof e=="function")return Y.createElement(e,t);t.ref;var n=gZ(t,cZ);return Y.createElement(tC,n)}var zO=1,Xo=(function(e){function t(){var n;uZ(this,t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=fZ(this,t,[].concat(s)),Wv(n,"lastBoundingBox",{width:-1,height:-1}),n}return mZ(t,e),dZ(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,s=this.getBBox();s?(Math.abs(s.width-this.lastBoundingBox.width)>zO||Math.abs(s.height-this.lastBoundingBox.height)>zO)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,r&&r(s)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Zs({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var s=this.props,i=s.layout,o=s.align,c=s.verticalAlign,d=s.margin,f=s.chartWidth,h=s.chartHeight,p,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var x=this.getBBoxSnapshot();p={left:((f||0)-x.width)/2}}else p=o==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var j=this.getBBoxSnapshot();g={top:((h||0)-j.height)/2}}else g=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Zs(Zs({},p),g)}},{key:"render",value:function(){var r=this,s=this.props,i=s.content,o=s.width,c=s.height,d=s.wrapperStyle,f=s.payloadUniqBy,h=s.payload,p=Zs(Zs({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return Y.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(x){r.wrapperNode=x}},bZ(i,Zs(Zs({},this.props),{},{payload:fL(h,f,yZ)})))}}],[{key:"getWithHeight",value:function(r,s){var i=Zs(Zs({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&Qe(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||s}:null}}])})(m.PureComponent);Wv(Xo,"displayName","Legend");Wv(Xo,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var mw,BO;function wZ(){if(BO)return mw;BO=1;var e=Lf(),t=rC(),n=Zr(),r=e?e.isConcatSpreadable:void 0;function s(i){return n(i)||t(i)||!!(r&&i&&i[r])}return mw=s,mw}var vw,qO;function mL(){if(qO)return vw;qO=1;var e=rL(),t=wZ();function n(r,s,i,o,c){var d=-1,f=r.length;for(i||(i=t),c||(c=[]);++d<f;){var h=r[d];s>0&&i(h)?s>1?n(h,s-1,i,o,c):e(c,h):o||(c[c.length]=h)}return c}return vw=n,vw}var gw,UO;function jZ(){if(UO)return gw;UO=1;function e(t){return function(n,r,s){for(var i=-1,o=Object(n),c=s(n),d=c.length;d--;){var f=c[t?d:++i];if(r(o[f],f,o)===!1)break}return n}}return gw=e,gw}var xw,WO;function SZ(){if(WO)return xw;WO=1;var e=jZ(),t=e();return xw=t,xw}var yw,VO;function vL(){if(VO)return yw;VO=1;var e=SZ(),t=Uv();function n(r,s){return r&&e(r,s,t)}return yw=n,yw}var bw,HO;function NZ(){if(HO)return bw;HO=1;var e=zf();function t(n,r){return function(s,i){if(s==null)return s;if(!e(s))return n(s,i);for(var o=s.length,c=r?o:-1,d=Object(s);(r?c--:++c<o)&&i(d[c],c,d)!==!1;);return s}}return bw=t,bw}var ww,KO;function oC(){if(KO)return ww;KO=1;var e=vL(),t=NZ(),n=t(e);return ww=n,ww}var jw,GO;function gL(){if(GO)return jw;GO=1;var e=oC(),t=zf();function n(r,s){var i=-1,o=t(r)?Array(r.length):[];return e(r,function(c,d,f){o[++i]=s(c,d,f)}),o}return jw=n,jw}var Sw,YO;function CZ(){if(YO)return Sw;YO=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return Sw=e,Sw}var Nw,XO;function _Z(){if(XO)return Nw;XO=1;var e=gu();function t(n,r){if(n!==r){var s=n!==void 0,i=n===null,o=n===n,c=e(n),d=r!==void 0,f=r===null,h=r===r,p=e(r);if(!f&&!p&&!c&&n>r||c&&d&&h&&!f&&!p||i&&d&&h||!s&&h||!o)return 1;if(!i&&!c&&!p&&n<r||p&&s&&o&&!i&&!c||f&&s&&o||!d&&o||!h)return-1}return 0}return Nw=t,Nw}var Cw,QO;function AZ(){if(QO)return Cw;QO=1;var e=_Z();function t(n,r,s){for(var i=-1,o=n.criteria,c=r.criteria,d=o.length,f=s.length;++i<d;){var h=e(o[i],c[i]);if(h){if(i>=f)return h;var p=s[i];return h*(p=="desc"?-1:1)}}return n.index-r.index}return Cw=t,Cw}var _w,JO;function EZ(){if(JO)return _w;JO=1;var e=KN(),t=GN(),n=Fs(),r=gL(),s=CZ(),i=sL(),o=AZ(),c=bu(),d=Zr();function f(h,p,g){p.length?p=e(p,function(y){return d(y)?function(b){return t(b,y.length===1?y[0]:y)}:y}):p=[c];var x=-1;p=e(p,i(n));var j=r(h,function(y,b,N){var C=e(p,function(S){return S(y)});return{criteria:C,index:++x,value:y}});return s(j,function(y,b){return o(y,b,g)})}return _w=f,_w}var Aw,ZO;function kZ(){if(ZO)return Aw;ZO=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return Aw=e,Aw}var Ew,eR;function PZ(){if(eR)return Ew;eR=1;var e=kZ(),t=Math.max;function n(r,s,i){return s=t(s===void 0?r.length-1:s,0),function(){for(var o=arguments,c=-1,d=t(o.length-s,0),f=Array(d);++c<d;)f[c]=o[s+c];c=-1;for(var h=Array(s+1);++c<s;)h[c]=o[c];return h[s]=i(f),e(r,this,h)}}return Ew=n,Ew}var kw,tR;function TZ(){if(tR)return kw;tR=1;function e(t){return function(){return t}}return kw=e,kw}var Pw,nR;function xL(){if(nR)return Pw;nR=1;var e=Cl(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Pw=t,Pw}var Tw,rR;function OZ(){if(rR)return Tw;rR=1;var e=TZ(),t=xL(),n=bu(),r=t?function(s,i){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return Tw=r,Tw}var Ow,aR;function RZ(){if(aR)return Ow;aR=1;var e=800,t=16,n=Date.now;function r(s){var i=0,o=0;return function(){var c=n(),d=t-(c-o);if(o=c,d>0){if(++i>=e)return arguments[0]}else i=0;return s.apply(void 0,arguments)}}return Ow=r,Ow}var Rw,sR;function IZ(){if(sR)return Rw;sR=1;var e=OZ(),t=RZ(),n=t(e);return Rw=n,Rw}var Iw,iR;function MZ(){if(iR)return Iw;iR=1;var e=bu(),t=PZ(),n=IZ();function r(s,i){return n(t(s,i,e),s+"")}return Iw=r,Iw}var Mw,oR;function Vv(){if(oR)return Mw;oR=1;var e=WN(),t=zf(),n=aC(),r=ho();function s(i,o,c){if(!r(c))return!1;var d=typeof o;return(d=="number"?t(c)&&n(o,c.length):d=="string"&&o in c)?e(c[o],i):!1}return Mw=s,Mw}var $w,lR;function $Z(){if(lR)return $w;lR=1;var e=mL(),t=EZ(),n=MZ(),r=Vv(),s=n(function(i,o){if(i==null)return[];var c=o.length;return c>1&&r(i,o[0],o[1])?o=[]:c>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(i,e(o,1),[])});return $w=s,$w}var DZ=$Z();const lC=hn(DZ);function qd(e){"@babel/helpers - typeof";return qd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qd(e)}function LS(){return LS=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},LS.apply(this,arguments)}function LZ(e,t){return qZ(e)||BZ(e,t)||zZ(e,t)||FZ()}function FZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
60
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zZ(e,t){if(e){if(typeof e=="string")return cR(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 cR(e,t)}}function cR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function qZ(e){if(Array.isArray(e))return e}function uR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Dw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uR(Object(n),!0).forEach(function(r){UZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UZ(e,t,n){return t=WZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WZ(e){var t=VZ(e,"string");return qd(t)=="symbol"?t:t+""}function VZ(e,t){if(qd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function HZ(e){return Array.isArray(e)&&nr(e[0])&&nr(e[1])?e.join(" ~ "):e}var KZ=function(t){var n=t.separator,r=n===void 0?" : ":n,s=t.contentStyle,i=s===void 0?{}:s,o=t.itemStyle,c=o===void 0?{}:o,d=t.labelStyle,f=d===void 0?{}:d,h=t.payload,p=t.formatter,g=t.itemSorter,x=t.wrapperClassName,j=t.labelClassName,y=t.label,b=t.labelFormatter,N=t.accessibilityLayer,C=N===void 0?!1:N,S=function(){if(h&&h.length){var B={padding:0,margin:0},X=(g?lC(h,g):h).map(function(W,M){if(W.type==="none")return null;var z=Dw({display:"block",paddingTop:4,paddingBottom:4,color:W.color||"#000"},c),K=W.formatter||p||HZ,V=W.value,R=W.name,G=V,$=R;if(K&&G!=null&&$!=null){var I=K(V,R,W,M,h);if(Array.isArray(I)){var ee=LZ(I,2);G=ee[0],$=ee[1]}else G=I}return Y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(M),style:z},nr($)?Y.createElement("span",{className:"recharts-tooltip-item-name"},$):null,nr($)?Y.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,Y.createElement("span",{className:"recharts-tooltip-item-value"},G),Y.createElement("span",{className:"recharts-tooltip-item-unit"},W.unit||""))});return Y.createElement("ul",{className:"recharts-tooltip-item-list",style:B},X)}return null},E=Dw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),A=Dw({margin:0},f),k=!Ft(y),T=k?y:"",O=Bt("recharts-default-tooltip",x),D=Bt("recharts-tooltip-label",j);k&&b&&h!==void 0&&h!==null&&(T=b(y,h));var q=C?{role:"status","aria-live":"assertive"}:{};return Y.createElement("div",LS({className:O,style:E},q),Y.createElement("p",{className:D,style:A},Y.isValidElement(T)?T:"".concat(T)),S())};function Ud(e){"@babel/helpers - typeof";return Ud=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ud(e)}function xh(e,t,n){return t=GZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GZ(e){var t=YZ(e,"string");return Ud(t)=="symbol"?t:t+""}function YZ(e,t){if(Ud(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ud(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cd="recharts-tooltip-wrapper",XZ={visibility:"hidden"};function QZ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Bt(cd,xh(xh(xh(xh({},"".concat(cd,"-right"),Qe(n)&&t&&Qe(t.x)&&n>=t.x),"".concat(cd,"-left"),Qe(n)&&t&&Qe(t.x)&&n<t.x),"".concat(cd,"-bottom"),Qe(r)&&t&&Qe(t.y)&&r>=t.y),"".concat(cd,"-top"),Qe(r)&&t&&Qe(t.y)&&r<t.y))}function dR(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,s=e.offsetTopLeft,i=e.position,o=e.reverseDirection,c=e.tooltipDimension,d=e.viewBox,f=e.viewBoxDimension;if(i&&Qe(i[r]))return i[r];var h=n[r]-c-s,p=n[r]+s;if(t[r])return o[r]?h:p;if(o[r]){var g=h,x=d[r];return g<x?Math.max(p,d[r]):Math.max(h,d[r])}var j=p+c,y=d[r]+f;return j>y?Math.max(h,d[r]):Math.max(p,d[r])}function JZ(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function ZZ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,s=e.position,i=e.reverseDirection,o=e.tooltipBox,c=e.useTranslate3d,d=e.viewBox,f,h,p;return o.height>0&&o.width>0&&n?(h=dR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=dR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=JZ({translateX:h,translateY:p,useTranslate3d:c})):f=XZ,{cssProperties:f,cssClasses:QZ({translateX:h,translateY:p,coordinate:n})}}function Fc(e){"@babel/helpers - typeof";return Fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fc(e)}function fR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function pR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fR(Object(n),!0).forEach(function(r){zS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tee(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,bL(r.key),r)}}function nee(e,t,n){return t&&tee(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ree(e,t,n){return t=om(t),aee(e,yL()?Reflect.construct(t,n||[],om(e).constructor):t.apply(e,n))}function aee(e,t){if(t&&(Fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return see(e)}function see(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yL=function(){return!!e})()}function om(e){return om=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},om(e)}function iee(e,t){if(typeof t!="function"&&t!==null)throw new 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&&FS(e,t)}function FS(e,t){return FS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},FS(e,t)}function zS(e,t,n){return t=bL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bL(e){var t=oee(e,"string");return Fc(t)=="symbol"?t:t+""}function oee(e,t){if(Fc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var hR=1,lee=(function(e){function t(){var n;eee(this,t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=ree(this,t,[].concat(s)),zS(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),zS(n,"handleKeyDown",function(o){if(o.key==="Escape"){var c,d,f,h;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(c=(d=n.props.coordinate)===null||d===void 0?void 0:d.x)!==null&&c!==void 0?c:0,y:(f=(h=n.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&f!==void 0?f:0}})}}),n}return iee(t,e),nee(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>hR||Math.abs(r.height-this.state.lastBoundingBox.height)>hR)&&this.setState({lastBoundingBox:{width:r.width,height:r.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(){var r,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,s=this.props,i=s.active,o=s.allowEscapeViewBox,c=s.animationDuration,d=s.animationEasing,f=s.children,h=s.coordinate,p=s.hasPayload,g=s.isAnimationActive,x=s.offset,j=s.position,y=s.reverseDirection,b=s.useTranslate3d,N=s.viewBox,C=s.wrapperStyle,S=ZZ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:x,position:j,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:N}),E=S.cssClasses,A=S.cssProperties,k=pR(pR({transition:g&&i?"transform ".concat(c,"ms ").concat(d):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},C);return Y.createElement("div",{tabIndex:-1,className:E,style:k,ref:function(O){r.wrapperNode=O}},f)}}])})(m.PureComponent),cee=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},_l={isSsr:cee()};function zc(e){"@babel/helpers - typeof";return zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(e)}function mR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function vR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mR(Object(n),!0).forEach(function(r){cC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dee(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,jL(r.key),r)}}function fee(e,t,n){return t&&dee(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pee(e,t,n){return t=lm(t),hee(e,wL()?Reflect.construct(t,n||[],lm(e).constructor):t.apply(e,n))}function hee(e,t){if(t&&(zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mee(e)}function mee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wL=function(){return!!e})()}function lm(e){return lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lm(e)}function vee(e,t){if(typeof t!="function"&&t!==null)throw new 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&&BS(e,t)}function BS(e,t){return BS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},BS(e,t)}function cC(e,t,n){return t=jL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jL(e){var t=gee(e,"string");return zc(t)=="symbol"?t:t+""}function gee(e,t){if(zc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function xee(e){return e.dataKey}function yee(e,t){return Y.isValidElement(e)?Y.cloneElement(e,t):typeof e=="function"?Y.createElement(e,t):Y.createElement(KZ,t)}var Wr=(function(e){function t(){return uee(this,t),pee(this,t,arguments)}return vee(t,e),fee(t,[{key:"render",value:function(){var r=this,s=this.props,i=s.active,o=s.allowEscapeViewBox,c=s.animationDuration,d=s.animationEasing,f=s.content,h=s.coordinate,p=s.filterNull,g=s.isAnimationActive,x=s.offset,j=s.payload,y=s.payloadUniqBy,b=s.position,N=s.reverseDirection,C=s.useTranslate3d,S=s.viewBox,E=s.wrapperStyle,A=j??[];p&&A.length&&(A=fL(j.filter(function(T){return T.value!=null&&(T.hide!==!0||r.props.includeHidden)}),y,xee));var k=A.length>0;return Y.createElement(lee,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:g,active:i,coordinate:h,hasPayload:k,offset:x,position:b,reverseDirection:N,useTranslate3d:C,viewBox:S,wrapperStyle:E},yee(f,vR(vR({},this.props),{},{payload:A})))}}])})(m.PureComponent);cC(Wr,"displayName","Tooltip");cC(Wr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!_l.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 Lw,gR;function bee(){if(gR)return Lw;gR=1;var e=Ls(),t=function(){return e.Date.now()};return Lw=t,Lw}var Fw,xR;function wee(){if(xR)return Fw;xR=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Fw=t,Fw}var zw,yR;function jee(){if(yR)return zw;yR=1;var e=wee(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return zw=n,zw}var Bw,bR;function SL(){if(bR)return Bw;bR=1;var e=jee(),t=ho(),n=gu(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var h=typeof f.valueOf=="function"?f.valueOf():f;f=t(h)?h+"":h}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=i.test(f);return p||o.test(f)?c(f.slice(2),p?2:8):s.test(f)?r:+f}return Bw=d,Bw}var qw,wR;function See(){if(wR)return qw;wR=1;var e=ho(),t=bee(),n=SL(),r="Expected a function",s=Math.max,i=Math.min;function o(c,d,f){var h,p,g,x,j,y,b=0,N=!1,C=!1,S=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(N=!!f.leading,C="maxWait"in f,g=C?s(n(f.maxWait)||0,d):g,S="trailing"in f?!!f.trailing:S);function E(X){var W=h,M=p;return h=p=void 0,b=X,x=c.apply(M,W),x}function A(X){return b=X,j=setTimeout(O,d),N?E(X):x}function k(X){var W=X-y,M=X-b,z=d-W;return C?i(z,g-M):z}function T(X){var W=X-y,M=X-b;return y===void 0||W>=d||W<0||C&&M>=g}function O(){var X=t();if(T(X))return D(X);j=setTimeout(O,k(X))}function D(X){return j=void 0,S&&h?E(X):(h=p=void 0,x)}function q(){j!==void 0&&clearTimeout(j),b=0,h=y=p=j=void 0}function U(){return j===void 0?x:D(t())}function B(){var X=t(),W=T(X);if(h=arguments,p=this,y=X,W){if(j===void 0)return A(y);if(C)return clearTimeout(j),j=setTimeout(O,d),E(y)}return j===void 0&&(j=setTimeout(O,d)),x}return B.cancel=q,B.flush=U,B}return qw=o,qw}var Uw,jR;function Nee(){if(jR)return Uw;jR=1;var e=See(),t=ho(),n="Expected a function";function r(s,i,o){var c=!0,d=!0;if(typeof s!="function")throw new TypeError(n);return t(o)&&(c="leading"in o?!!o.leading:c,d="trailing"in o?!!o.trailing:d),e(s,i,{leading:c,maxWait:i,trailing:d})}return Uw=r,Uw}var Cee=Nee();const NL=hn(Cee);function Wd(e){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wd(e)}function SR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function yh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SR(Object(n),!0).forEach(function(r){_ee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ee(e,t,n){return t=Aee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aee(e){var t=Eee(e,"string");return Wd(t)=="symbol"?t:t+""}function Eee(e,t){if(Wd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kee(e,t){return Ree(e)||Oee(e,t)||Tee(e,t)||Pee()}function Pee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
61
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tee(e,t){if(e){if(typeof e=="string")return NR(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 NR(e,t)}}function NR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Oee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function Ree(e){if(Array.isArray(e))return e}var cm=m.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,s=r===void 0?{width:-1,height:-1}:r,i=e.width,o=i===void 0?"100%":i,c=e.height,d=c===void 0?"100%":c,f=e.minWidth,h=f===void 0?0:f,p=e.minHeight,g=e.maxHeight,x=e.children,j=e.debounce,y=j===void 0?0:j,b=e.id,N=e.className,C=e.onResize,S=e.style,E=S===void 0?{}:S,A=m.useRef(null),k=m.useRef();k.current=C,m.useImperativeHandle(t,function(){return Object.defineProperty(A.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),A.current},configurable:!0})});var T=m.useState({containerWidth:s.width,containerHeight:s.height}),O=kee(T,2),D=O[0],q=O[1],U=m.useCallback(function(X,W){q(function(M){var z=Math.round(X),K=Math.round(W);return M.containerWidth===z&&M.containerHeight===K?M:{containerWidth:z,containerHeight:K}})},[]);m.useEffect(function(){var X=function(R){var G,$=R[0].contentRect,I=$.width,ee=$.height;U(I,ee),(G=k.current)===null||G===void 0||G.call(k,I,ee)};y>0&&(X=NL(X,y,{trailing:!0,leading:!1}));var W=new ResizeObserver(X),M=A.current.getBoundingClientRect(),z=M.width,K=M.height;return U(z,K),W.observe(A.current),function(){W.disconnect()}},[U,y]);var B=m.useMemo(function(){var X=D.containerWidth,W=D.containerHeight;if(X<0||W<0)return null;li(Vo(o)||Vo(d),`The width(%s) and height(%s) are both fixed numbers,
|
|
62
|
-
maybe you don't need to use a ResponsiveContainer.`,o,d),li(!n||n>0,"The aspect(%s) must be greater than zero.",n);var M=Vo(o)?X:o,z=Vo(d)?W:d;n&&n>0&&(M?z=M/n:z&&(M=z*n),g&&z>g&&(z=g)),li(M>0||z>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
63
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
64
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
65
|
-
height and width.`,M,z,o,d,h,p,n);var K=!Array.isArray(x)&&oi(x.type).endsWith("Chart");return Y.Children.map(x,function(V){return Y.isValidElement(V)?m.cloneElement(V,yh({width:M,height:z},K?{style:yh({height:"100%",width:"100%",maxHeight:z,maxWidth:M},V.props.style)}:{})):V})},[n,x,d,g,p,h,D,o]);return Y.createElement("div",{id:b?"".concat(b):void 0,className:Bt("recharts-responsive-container",N),style:yh(yh({},E),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:g}),ref:A},B)}),Hv=function(t){return null};Hv.displayName="Cell";function Vd(e){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(e)}function CR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function qS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CR(Object(n),!0).forEach(function(r){Iee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iee(e,t,n){return t=Mee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mee(e){var t=$ee(e,"string");return Vd(t)=="symbol"?t:t+""}function $ee(e,t){if(Vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ic={widthCache:{},cacheCount:0},Dee=2e3,Lee={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},_R="recharts_measurement_span";function Fee(e){var t=qS({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Ad=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||_l.isSsr)return{width:0,height:0};var r=Fee(n),s=JSON.stringify({text:t,copyStyle:r});if(ic.widthCache[s])return ic.widthCache[s];try{var i=document.getElementById(_R);i||(i=document.createElement("span"),i.setAttribute("id",_R),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=qS(qS({},Lee),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return ic.widthCache[s]=d,++ic.cacheCount>Dee&&(ic.cacheCount=0,ic.widthCache={}),d}catch{return{width:0,height:0}}},zee=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Hd(e){"@babel/helpers - typeof";return Hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hd(e)}function um(e,t){return Wee(e)||Uee(e,t)||qee(e,t)||Bee()}function Bee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
66
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qee(e,t){if(e){if(typeof e=="string")return AR(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 AR(e,t)}}function AR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Uee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function Wee(e){if(Array.isArray(e))return e}function Vee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ER(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,Kee(r.key),r)}}function Hee(e,t,n){return t&&ER(e.prototype,t),n&&ER(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kee(e){var t=Gee(e,"string");return Hd(t)=="symbol"?t:t+""}function Gee(e,t){if(Hd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var kR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,PR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Yee=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Xee=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,CL={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Qee=Object.keys(CL),vc="NaN";function Jee(e,t){return e*CL[t]}var bh=(function(){function e(t,n){Vee(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!Yee.test(n)&&(this.num=NaN,this.unit=""),Qee.includes(n)&&(this.num=Jee(t,n),this.unit="px")}return Hee(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,s=(r=Xee.exec(n))!==null&&r!==void 0?r:[],i=um(s,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function _L(e){if(e.includes(vc))return vc;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=kR.exec(t))!==null&&n!==void 0?n:[],s=um(r,4),i=s[1],o=s[2],c=s[3],d=bh.parse(i??""),f=bh.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return vc;t=t.replace(kR,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,g=(p=PR.exec(t))!==null&&p!==void 0?p:[],x=um(g,4),j=x[1],y=x[2],b=x[3],N=bh.parse(j??""),C=bh.parse(b??""),S=y==="+"?N.add(C):N.subtract(C);if(S.isNaN())return vc;t=t.replace(PR,S.toString())}return t}var TR=/\(([^()]*)\)/;function Zee(e){for(var t=e;t.includes("(");){var n=TR.exec(t),r=um(n,2),s=r[1];t=t.replace(TR,_L(s))}return t}function ete(e){var t=e.replace(/\s+/g,"");return t=Zee(t),t=_L(t),t}function tte(e){try{return ete(e)}catch{return vc}}function Ww(e){var t=tte(e.slice(5,-1));return t===vc?"":t}var nte=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],rte=["dx","dy","angle","className","breakAll"];function US(){return US=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},US.apply(this,arguments)}function OR(e,t){if(e==null)return{};var n=ate(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ate(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 RR(e,t){return lte(e)||ote(e,t)||ite(e,t)||ste()}function ste(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
67
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ite(e,t){if(e){if(typeof e=="string")return IR(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 IR(e,t)}}function IR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ote(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function lte(e){if(Array.isArray(e))return e}var AL=/[ \f\n\r\t\v\u2028\u2029]+/,EL=function(t){var n=t.children,r=t.breakAll,s=t.style;try{var i=[];Ft(n)||(r?i=n.toString().split(""):i=n.toString().split(AL));var o=i.map(function(d){return{word:d,width:Ad(d,s).width}}),c=r?0:Ad(" ",s).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},cte=function(t,n,r,s,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=Qe(o),p=c,g=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return M.reduce(function(z,K){var V=K.word,R=K.width,G=z[z.length-1];if(G&&(s==null||i||G.width+R+r<Number(s)))G.words.push(V),G.width+=R+r;else{var $={words:[V],width:R};z.push($)}return z},[])},x=g(n),j=function(M){return M.reduce(function(z,K){return z.width>K.width?z:K})};if(!h)return x;for(var y="…",b=function(M){var z=p.slice(0,M),K=EL({breakAll:f,style:d,children:z+y}).wordsWithComputedWidth,V=g(K),R=V.length>o||j(V).width>Number(s);return[R,V]},N=0,C=p.length-1,S=0,E;N<=C&&S<=p.length-1;){var A=Math.floor((N+C)/2),k=A-1,T=b(k),O=RR(T,2),D=O[0],q=O[1],U=b(A),B=RR(U,1),X=B[0];if(!D&&!X&&(N=A+1),D&&X&&(C=A-1),!D&&X){E=q;break}S++}return E||x},MR=function(t){var n=Ft(t)?[]:t.toString().split(AL);return[{words:n}]},ute=function(t){var n=t.width,r=t.scaleToFit,s=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!_l.isSsr){var d,f,h=EL({breakAll:o,children:s,style:i});if(h){var p=h.wordsWithComputedWidth,g=h.spaceWidth;d=p,f=g}else return MR(s);return cte({breakAll:o,children:s,maxLines:c,style:i},d,f,n,r)}return MR(s)},$R="#808080",ol=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,i=s===void 0?0:s,o=t.lineHeight,c=o===void 0?"1em":o,d=t.capHeight,f=d===void 0?"0.71em":d,h=t.scaleToFit,p=h===void 0?!1:h,g=t.textAnchor,x=g===void 0?"start":g,j=t.verticalAnchor,y=j===void 0?"end":j,b=t.fill,N=b===void 0?$R:b,C=OR(t,nte),S=m.useMemo(function(){return ute({breakAll:C.breakAll,children:C.children,maxLines:C.maxLines,scaleToFit:p,style:C.style,width:C.width})},[C.breakAll,C.children,C.maxLines,p,C.style,C.width]),E=C.dx,A=C.dy,k=C.angle,T=C.className,O=C.breakAll,D=OR(C,rte);if(!nr(r)||!nr(i))return null;var q=r+(Qe(E)?E:0),U=i+(Qe(A)?A:0),B;switch(y){case"start":B=Ww("calc(".concat(f,")"));break;case"middle":B=Ww("calc(".concat((S.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:B=Ww("calc(".concat(S.length-1," * -").concat(c,")"));break}var X=[];if(p){var W=S[0].width,M=C.width;X.push("scale(".concat((Qe(M)?M/W:1)/W,")"))}return k&&X.push("rotate(".concat(k,", ").concat(q,", ").concat(U,")")),X.length&&(D.transform=X.join(" ")),Y.createElement("text",US({},kt(D,!0),{x:q,y:U,className:Bt("recharts-text",T),textAnchor:x,fill:N.includes("url")?$R:N}),S.map(function(z,K){var V=z.words.join(O?"":" ");return Y.createElement("tspan",{x:q,dy:K===0?B:c,key:"".concat(V,"-").concat(K)},V)}))};function eo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function dte(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function uC(e){let t,n,r;e.length!==2?(t=eo,n=(c,d)=>eo(e(c),d),r=(c,d)=>e(c)-d):(t=e===eo||e===dte?e:fte,n=e,r=e);function s(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<0?f=p+1:h=p}while(f<h)}return f}function i(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<=0?f=p+1:h=p}while(f<h)}return f}function o(c,d,f=0,h=c.length){const p=s(c,d,f,h-1);return p>f&&r(c[p-1],d)>-r(c[p],d)?p-1:p}return{left:s,center:o,right:i}}function fte(){return 0}function kL(e){return e===null?NaN:+e}function*pte(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const hte=uC(eo),Bf=hte.right;uC(kL).center;class DR extends Map{constructor(t,n=gte){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(LR(this,t))}has(t){return super.has(LR(this,t))}set(t,n){return super.set(mte(this,t),n)}delete(t){return super.delete(vte(this,t))}}function LR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function mte({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function vte({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function gte(e){return e!==null&&typeof e=="object"?e.valueOf():e}function xte(e=eo){if(e===eo)return PL;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function PL(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const yte=Math.sqrt(50),bte=Math.sqrt(10),wte=Math.sqrt(2);function dm(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),i=r/Math.pow(10,s),o=i>=yte?10:i>=bte?5:i>=wte?2:1;let c,d,f;return s<0?(f=Math.pow(10,-s)/o,c=Math.round(e*f),d=Math.round(t*f),c/f<e&&++c,d/f>t&&--d,f=-f):(f=Math.pow(10,s)*o,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?dm(e,t,n*2):[c,d,f]}function WS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[s,i,o]=r?dm(t,e,n):dm(e,t,n);if(!(i>=s))return[];const c=i-s+1,d=new Array(c);if(r)if(o<0)for(let f=0;f<c;++f)d[f]=(i-f)/-o;else for(let f=0;f<c;++f)d[f]=(i-f)*o;else if(o<0)for(let f=0;f<c;++f)d[f]=(s+f)/-o;else for(let f=0;f<c;++f)d[f]=(s+f)*o;return d}function VS(e,t,n){return t=+t,e=+e,n=+n,dm(e,t,n)[2]}function HS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,s=r?VS(t,e,n):VS(e,t,n);return(r?-1:1)*(s<0?1/-s:s)}function FR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function zR(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function TL(e,t,n=0,r=1/0,s){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(s=s===void 0?PL:xte(s);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,h=Math.log(d),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),x=Math.max(n,Math.floor(t-f*p/d+g)),j=Math.min(r,Math.floor(t+(d-f)*p/d+g));TL(e,t,x,j,s)}const i=e[t];let o=n,c=r;for(ud(e,n,t),s(e[r],i)>0&&ud(e,n,r);o<c;){for(ud(e,o,c),++o,--c;s(e[o],i)<0;)++o;for(;s(e[c],i)>0;)--c}s(e[n],i)===0?ud(e,n,c):(++c,ud(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function ud(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function jte(e,t,n){if(e=Float64Array.from(pte(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return zR(e);if(t>=1)return FR(e);var r,s=(r-1)*t,i=Math.floor(s),o=FR(TL(e,i).subarray(0,i+1)),c=zR(e.subarray(i+1));return o+(c-o)*(s-i)}}function Ste(e,t,n=kL){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,s=(r-1)*t,i=Math.floor(s),o=+n(e[i],i,e),c=+n(e[i+1],i+1,e);return o+(c-o)*(s-i)}}function Nte(e,t,n){e=+e,t=+t,n=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+n;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(s);++r<s;)i[r]=e+r*n;return i}function Fa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ni(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);break}}return this}const KS=Symbol("implicit");function dC(){var e=new DR,t=[],n=[],r=KS;function s(i){let o=e.get(i);if(o===void 0){if(r!==KS)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return s.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new DR;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(i){return arguments.length?(n=Array.from(i),s):n.slice()},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return dC(t,n).unknown(r)},Fa.apply(s,arguments),s}function Kd(){var e=dC().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,i,o,c=!1,d=0,f=0,h=.5;delete e.unknown;function p(){var g=t().length,x=s<r,j=x?s:r,y=x?r:s;i=(y-j)/Math.max(1,g-d+f*2),c&&(i=Math.floor(i)),j+=(y-j-i*(g-d))*h,o=i*(1-d),c&&(j=Math.round(j),o=Math.round(o));var b=Nte(g).map(function(N){return j+i*N});return n(x?b.reverse():b)}return e.domain=function(g){return arguments.length?(t(g),p()):t()},e.range=function(g){return arguments.length?([r,s]=g,r=+r,s=+s,p()):[r,s]},e.rangeRound=function(g){return[r,s]=g,r=+r,s=+s,c=!0,p()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(g){return arguments.length?(c=!!g,p()):c},e.padding=function(g){return arguments.length?(d=Math.min(1,f=+g),p()):d},e.paddingInner=function(g){return arguments.length?(d=Math.min(1,g),p()):d},e.paddingOuter=function(g){return arguments.length?(f=+g,p()):f},e.align=function(g){return arguments.length?(h=Math.max(0,Math.min(1,g)),p()):h},e.copy=function(){return Kd(t(),[r,s]).round(c).paddingInner(d).paddingOuter(f).align(h)},Fa.apply(p(),arguments)}function OL(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return OL(t())},e}function Ed(){return OL(Kd.apply(null,arguments).paddingInner(1))}function fC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function RL(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function qf(){}var Gd=.7,fm=1/Gd,Ac="\\s*([+-]?\\d+)\\s*",Yd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",As="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Cte=/^#([0-9a-f]{3,8})$/,_te=new RegExp(`^rgb\\(${Ac},${Ac},${Ac}\\)$`),Ate=new RegExp(`^rgb\\(${As},${As},${As}\\)$`),Ete=new RegExp(`^rgba\\(${Ac},${Ac},${Ac},${Yd}\\)$`),kte=new RegExp(`^rgba\\(${As},${As},${As},${Yd}\\)$`),Pte=new RegExp(`^hsl\\(${Yd},${As},${As}\\)$`),Tte=new RegExp(`^hsla\\(${Yd},${As},${As},${Yd}\\)$`),BR={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};fC(qf,Xd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qR,formatHex:qR,formatHex8:Ote,formatHsl:Rte,formatRgb:UR,toString:UR});function qR(){return this.rgb().formatHex()}function Ote(){return this.rgb().formatHex8()}function Rte(){return IL(this).formatHsl()}function UR(){return this.rgb().formatRgb()}function Xd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Cte.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?WR(t):n===3?new Xr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?wh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?wh(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=_te.exec(e))?new Xr(t[1],t[2],t[3],1):(t=Ate.exec(e))?new Xr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ete.exec(e))?wh(t[1],t[2],t[3],t[4]):(t=kte.exec(e))?wh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Pte.exec(e))?KR(t[1],t[2]/100,t[3]/100,1):(t=Tte.exec(e))?KR(t[1],t[2]/100,t[3]/100,t[4]):BR.hasOwnProperty(e)?WR(BR[e]):e==="transparent"?new Xr(NaN,NaN,NaN,0):null}function WR(e){return new Xr(e>>16&255,e>>8&255,e&255,1)}function wh(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xr(e,t,n,r)}function Ite(e){return e instanceof qf||(e=Xd(e)),e?(e=e.rgb(),new Xr(e.r,e.g,e.b,e.opacity)):new Xr}function GS(e,t,n,r){return arguments.length===1?Ite(e):new Xr(e,t,n,r??1)}function Xr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}fC(Xr,GS,RL(qf,{brighter(e){return e=e==null?fm:Math.pow(fm,e),new Xr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Gd:Math.pow(Gd,e),new Xr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xr(Qo(this.r),Qo(this.g),Qo(this.b),pm(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:VR,formatHex:VR,formatHex8:Mte,formatRgb:HR,toString:HR}));function VR(){return`#${Ho(this.r)}${Ho(this.g)}${Ho(this.b)}`}function Mte(){return`#${Ho(this.r)}${Ho(this.g)}${Ho(this.b)}${Ho((isNaN(this.opacity)?1:this.opacity)*255)}`}function HR(){const e=pm(this.opacity);return`${e===1?"rgb(":"rgba("}${Qo(this.r)}, ${Qo(this.g)}, ${Qo(this.b)}${e===1?")":`, ${e})`}`}function pm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ho(e){return e=Qo(e),(e<16?"0":"")+e.toString(16)}function KR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ns(e,t,n,r)}function IL(e){if(e instanceof ns)return new ns(e.h,e.s,e.l,e.opacity);if(e instanceof qf||(e=Xd(e)),!e)return new ns;if(e instanceof ns)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,c=i-s,d=(i+s)/2;return c?(t===i?o=(n-r)/c+(n<r)*6:n===i?o=(r-t)/c+2:o=(t-n)/c+4,c/=d<.5?i+s:2-i-s,o*=60):c=d>0&&d<1?0:o,new ns(o,c,d,e.opacity)}function $te(e,t,n,r){return arguments.length===1?IL(e):new ns(e,t,n,r??1)}function ns(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}fC(ns,$te,RL(qf,{brighter(e){return e=e==null?fm:Math.pow(fm,e),new ns(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Gd:Math.pow(Gd,e),new ns(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,s=2*n-r;return new Xr(Vw(e>=240?e-240:e+120,s,r),Vw(e,s,r),Vw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new ns(GR(this.h),jh(this.s),jh(this.l),pm(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(){const e=pm(this.opacity);return`${e===1?"hsl(":"hsla("}${GR(this.h)}, ${jh(this.s)*100}%, ${jh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function GR(e){return e=(e||0)%360,e<0?e+360:e}function jh(e){return Math.max(0,Math.min(1,e||0))}function Vw(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const pC=e=>()=>e;function Dte(e,t){return function(n){return e+n*t}}function Lte(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Fte(e){return(e=+e)==1?ML:function(t,n){return n-t?Lte(t,n,e):pC(isNaN(t)?n:t)}}function ML(e,t){var n=t-e;return n?Dte(e,n):pC(isNaN(e)?t:e)}const YR=(function e(t){var n=Fte(t);function r(s,i){var o=n((s=GS(s)).r,(i=GS(i)).r),c=n(s.g,i.g),d=n(s.b,i.b),f=ML(s.opacity,i.opacity);return function(h){return s.r=o(h),s.g=c(h),s.b=d(h),s.opacity=f(h),s+""}}return r.gamma=e,r})(1);function zte(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(i){for(s=0;s<n;++s)r[s]=e[s]*(1-i)+t[s]*i;return r}}function Bte(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function qte(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)s[o]=wu(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(c){for(o=0;o<r;++o)i[o]=s[o](c);return i}}function Ute(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function hm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Wte(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=wu(e[s],t[s]):r[s]=t[s];return function(i){for(s in n)r[s]=n[s](i);return r}}var YS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Hw=new RegExp(YS.source,"g");function Vte(e){return function(){return e}}function Hte(e){return function(t){return e(t)+""}}function Kte(e,t){var n=YS.lastIndex=Hw.lastIndex=0,r,s,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=YS.exec(e))&&(s=Hw.exec(t));)(i=s.index)>n&&(i=t.slice(n,i),c[o]?c[o]+=i:c[++o]=i),(r=r[0])===(s=s[0])?c[o]?c[o]+=s:c[++o]=s:(c[++o]=null,d.push({i:o,x:hm(r,s)})),n=Hw.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?Hte(d[0].x):Vte(t):(t=d.length,function(f){for(var h=0,p;h<t;++h)c[(p=d[h]).i]=p.x(f);return c.join("")})}function wu(e,t){var n=typeof t,r;return t==null||n==="boolean"?pC(t):(n==="number"?hm:n==="string"?(r=Xd(t))?(t=r,YR):Kte:t instanceof Xd?YR:t instanceof Date?Ute:Bte(t)?zte:Array.isArray(t)?qte:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Wte:hm)(e,t)}function hC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Gte(e,t){t===void 0&&(t=e,e=wu);for(var n=0,r=t.length-1,s=t[0],i=new Array(r<0?0:r);n<r;)i[n]=e(s,s=t[++n]);return function(o){var c=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return i[c](o-c)}}function Yte(e){return function(){return e}}function mm(e){return+e}var XR=[0,1];function Or(e){return e}function XS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Yte(isNaN(t)?NaN:.5)}function Xte(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Qte(e,t,n){var r=e[0],s=e[1],i=t[0],o=t[1];return s<r?(r=XS(s,r),i=n(o,i)):(r=XS(r,s),i=n(i,o)),function(c){return i(r(c))}}function Jte(e,t,n){var r=Math.min(e.length,t.length)-1,s=new Array(r),i=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)s[o]=XS(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=Bf(e,c,1,r)-1;return i[d](s[d](c))}}function Uf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Kv(){var e=XR,t=XR,n=wu,r,s,i,o=Or,c,d,f;function h(){var g=Math.min(e.length,t.length);return o!==Or&&(o=Xte(e[0],e[g-1])),c=g>2?Jte:Qte,d=f=null,p}function p(g){return g==null||isNaN(g=+g)?i:(d||(d=c(e.map(r),t,n)))(r(o(g)))}return p.invert=function(g){return o(s((f||(f=c(t,e.map(r),hm)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,mm),h()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),h()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=hC,h()},p.clamp=function(g){return arguments.length?(o=g?!0:Or,h()):o!==Or},p.interpolate=function(g){return arguments.length?(n=g,h()):n},p.unknown=function(g){return arguments.length?(i=g,p):i},function(g,x){return r=g,s=x,h()}}function mC(){return Kv()(Or,Or)}function Zte(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function vm(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 Bc(e){return e=vm(Math.abs(e)),e?e[1]:NaN}function ene(e,t){return function(n,r){for(var s=n.length,i=[],o=0,c=e[0],d=0;s>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),i.push(n.substring(s-=c,s+c)),!((d+=c+1)>r));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function tne(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var nne=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Qd(e){if(!(t=nne.exec(e)))throw new Error("invalid format: "+e);var t;return new vC({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]})}Qd.prototype=vC.prototype;function vC(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+""}vC.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 rne(e){e:for(var t=e.length,n=1,r=-1,s;n<t;++n)switch(e[n]){case".":r=s=n;break;case"0":r===0&&(r=n),s=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var gm;function ane(e,t){var n=vm(e,t);if(!n)return gm=void 0,e.toPrecision(t);var r=n[0],s=n[1],i=s-(gm=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+vm(e,Math.max(0,t+i-1))[0]}function QR(e,t){var n=vm(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const JR={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Zte,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)=>QR(e*100,t),r:QR,s:ane,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ZR(e){return e}var e2=Array.prototype.map,t2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function sne(e){var t=e.grouping===void 0||e.thousands===void 0?ZR:ene(e2.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?ZR:tne(e2.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p,g){p=Qd(p);var x=p.fill,j=p.align,y=p.sign,b=p.symbol,N=p.zero,C=p.width,S=p.comma,E=p.precision,A=p.trim,k=p.type;k==="n"?(S=!0,k="g"):JR[k]||(E===void 0&&(E=12),A=!0,k="g"),(N||x==="0"&&j==="=")&&(N=!0,x="0",j="=");var T=(g&&g.prefix!==void 0?g.prefix:"")+(b==="$"?n:b==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():""),O=(b==="$"?r:/[%p]/.test(k)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),D=JR[k],q=/[defgprs%]/.test(k);E=E===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function U(B){var X=T,W=O,M,z,K;if(k==="c")W=D(B)+W,B="";else{B=+B;var V=B<0||1/B<0;if(B=isNaN(B)?d:D(Math.abs(B),E),A&&(B=rne(B)),V&&+B==0&&y!=="+"&&(V=!1),X=(V?y==="("?y:c:y==="-"||y==="("?"":y)+X,W=(k==="s"&&!isNaN(B)&&gm!==void 0?t2[8+gm/3]:"")+W+(V&&y==="("?")":""),q){for(M=-1,z=B.length;++M<z;)if(K=B.charCodeAt(M),48>K||K>57){W=(K===46?s+B.slice(M+1):B.slice(M))+W,B=B.slice(0,M);break}}}S&&!N&&(B=t(B,1/0));var R=X.length+B.length+W.length,G=R<C?new Array(C-R+1).join(x):"";switch(S&&N&&(B=t(G+B,G.length?C-W.length:1/0),G=""),j){case"<":B=X+B+W+G;break;case"=":B=X+G+B+W;break;case"^":B=G.slice(0,R=G.length>>1)+X+B+W+G.slice(R);break;default:B=G+X+B+W;break}return i(B)}return U.toString=function(){return p+""},U}function h(p,g){var x=Math.max(-8,Math.min(8,Math.floor(Bc(g)/3)))*3,j=Math.pow(10,-x),y=f((p=Qd(p),p.type="f",p),{suffix:t2[8+x/3]});return function(b){return y(j*b)}}return{format:f,formatPrefix:h}}var Sh,gC,$L;ine({thousands:",",grouping:[3],currency:["$",""]});function ine(e){return Sh=sne(e),gC=Sh.format,$L=Sh.formatPrefix,Sh}function one(e){return Math.max(0,-Bc(Math.abs(e)))}function lne(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Bc(t)/3)))*3-Bc(Math.abs(e)))}function cne(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Bc(t)-Bc(e))+1}function DL(e,t,n,r){var s=HS(e,t,n),i;switch(r=Qd(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=lne(s,o))&&(r.precision=i),$L(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=cne(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=one(s))&&(r.precision=i-(r.type==="%")*2);break}}return gC(r)}function mo(e){var t=e.domain;return e.ticks=function(n){var r=t();return WS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return DL(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,i=r.length-1,o=r[s],c=r[i],d,f,h=10;for(c<o&&(f=o,o=c,c=f,f=s,s=i,i=f);h-- >0;){if(f=VS(o,c,n),f===d)return r[s]=o,r[i]=c,t(r);if(f>0)o=Math.floor(o/f)*f,c=Math.ceil(c/f)*f;else if(f<0)o=Math.ceil(o*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function xm(){var e=mC();return e.copy=function(){return Uf(e,xm())},Fa.apply(e,arguments),mo(e)}function LL(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,mm),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return LL(e).unknown(t)},e=arguments.length?Array.from(e,mm):[0,1],mo(n)}function FL(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],i=e[r],o;return i<s&&(o=n,n=r,r=o,o=s,s=i,i=o),e[n]=t.floor(s),e[r]=t.ceil(i),e}function n2(e){return Math.log(e)}function r2(e){return Math.exp(e)}function une(e){return-Math.log(-e)}function dne(e){return-Math.exp(-e)}function fne(e){return isFinite(e)?+("1e"+e):e<0?0:e}function pne(e){return e===10?fne:e===Math.E?Math.exp:t=>Math.pow(e,t)}function hne(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 a2(e){return(t,n)=>-e(-t,n)}function xC(e){const t=e(n2,r2),n=t.domain;let r=10,s,i;function o(){return s=hne(r),i=pne(r),n()[0]<0?(s=a2(s),i=a2(i),e(une,dne)):e(n2,r2),t}return t.base=function(c){return arguments.length?(r=+c,o()):r},t.domain=function(c){return arguments.length?(n(c),o()):n()},t.ticks=c=>{const d=n();let f=d[0],h=d[d.length-1];const p=h<f;p&&([f,h]=[h,f]);let g=s(f),x=s(h),j,y;const b=c==null?10:+c;let N=[];if(!(r%1)&&x-g<b){if(g=Math.floor(g),x=Math.ceil(x),f>0){for(;g<=x;++g)for(j=1;j<r;++j)if(y=g<0?j/i(-g):j*i(g),!(y<f)){if(y>h)break;N.push(y)}}else for(;g<=x;++g)for(j=r-1;j>=1;--j)if(y=g>0?j/i(-g):j*i(g),!(y<f)){if(y>h)break;N.push(y)}N.length*2<b&&(N=WS(f,h,b))}else N=WS(g,x,Math.min(x-g,b)).map(i);return p?N.reverse():N},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Qd(d)).precision==null&&(d.trim=!0),d=gC(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return h=>{let p=h/i(Math.round(s(h)));return p*r<r-.5&&(p*=r),p<=f?d(h):""}},t.nice=()=>n(FL(n(),{floor:c=>i(Math.floor(s(c))),ceil:c=>i(Math.ceil(s(c)))})),t}function zL(){const e=xC(Kv()).domain([1,10]);return e.copy=()=>Uf(e,zL()).base(e.base()),Fa.apply(e,arguments),e}function s2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function i2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function yC(e){var t=1,n=e(s2(t),i2(t));return n.constant=function(r){return arguments.length?e(s2(t=+r),i2(t)):t},mo(n)}function BL(){var e=yC(Kv());return e.copy=function(){return Uf(e,BL()).constant(e.constant())},Fa.apply(e,arguments)}function o2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function mne(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function vne(e){return e<0?-e*e:e*e}function bC(e){var t=e(Or,Or),n=1;function r(){return n===1?e(Or,Or):n===.5?e(mne,vne):e(o2(n),o2(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},mo(t)}function wC(){var e=bC(Kv());return e.copy=function(){return Uf(e,wC()).exponent(e.exponent())},Fa.apply(e,arguments),e}function gne(){return wC.apply(null,arguments).exponent(.5)}function l2(e){return Math.sign(e)*e*e}function xne(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function qL(){var e=mC(),t=[0,1],n=!1,r;function s(i){var o=xne(e(i));return isNaN(o)?r:n?Math.round(o):o}return s.invert=function(i){return e.invert(l2(i))},s.domain=function(i){return arguments.length?(e.domain(i),s):e.domain()},s.range=function(i){return arguments.length?(e.range((t=Array.from(i,mm)).map(l2)),s):t.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(n=!!i,s):n},s.clamp=function(i){return arguments.length?(e.clamp(i),s):e.clamp()},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return qL(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Fa.apply(s,arguments),mo(s)}function UL(){var e=[],t=[],n=[],r;function s(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=Ste(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[Bf(n,o)]}return i.invertExtent=function(o){var c=t.indexOf(o);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let c of o)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(eo),s()},i.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return UL().domain(e).range(t).unknown(r)},Fa.apply(i,arguments)}function WL(){var e=0,t=1,n=1,r=[.5],s=[0,1],i;function o(d){return d!=null&&d<=d?s[Bf(r,d,0,n)]:i}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},o.range=function(d){return arguments.length?(n=(s=Array.from(d)).length-1,c()):s.slice()},o.invertExtent=function(d){var f=s.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(i=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return WL().domain([e,t]).range(s).unknown(i)},Fa.apply(mo(o),arguments)}function VL(){var e=[.5],t=[0,1],n,r=1;function s(i){return i!=null&&i<=i?t[Bf(e,i,0,r)]:n}return s.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return VL().domain(e).range(t).unknown(n)},Fa.apply(s,arguments)}const Kw=new Date,Gw=new Date;function sr(e,t,n,r){function s(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(e(i=new Date(+i)),i),s.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),s.round=i=>{const o=s(i),c=s.ceil(i);return i-o<c-i?o:c},s.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),s.range=(i,o,c)=>{const d=[];if(i=s.ceil(i),c=c==null?1:Math.floor(c),!(i<o)||!(c>0))return d;let f;do d.push(f=new Date(+i)),t(i,c),e(i);while(f<i&&i<o);return d},s.filter=i=>sr(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;t(o,-1),!i(o););else for(;--c>=0;)for(;t(o,1),!i(o););}),n&&(s.count=(i,o)=>(Kw.setTime(+i),Gw.setTime(+o),e(Kw),e(Gw),Math.floor(n(Kw,Gw))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(r?o=>r(o)%i===0:o=>s.count(0,o)%i===0):s)),s}const ym=sr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ym.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?sr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ym);ym.range;const ri=1e3,Ra=ri*60,ai=Ra*60,vi=ai*24,jC=vi*7,c2=vi*30,Yw=vi*365,Ko=sr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ri)},(e,t)=>(t-e)/ri,e=>e.getUTCSeconds());Ko.range;const SC=sr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ri)},(e,t)=>{e.setTime(+e+t*Ra)},(e,t)=>(t-e)/Ra,e=>e.getMinutes());SC.range;const NC=sr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ra)},(e,t)=>(t-e)/Ra,e=>e.getUTCMinutes());NC.range;const CC=sr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ri-e.getMinutes()*Ra)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getHours());CC.range;const _C=sr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getUTCHours());_C.range;const Wf=sr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ra)/vi,e=>e.getDate()-1);Wf.range;const Gv=sr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/vi,e=>e.getUTCDate()-1);Gv.range;const HL=sr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/vi,e=>Math.floor(e/vi));HL.range;function Al(e){return sr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ra)/jC)}const Yv=Al(0),bm=Al(1),yne=Al(2),bne=Al(3),qc=Al(4),wne=Al(5),jne=Al(6);Yv.range;bm.range;yne.range;bne.range;qc.range;wne.range;jne.range;function El(e){return sr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/jC)}const Xv=El(0),wm=El(1),Sne=El(2),Nne=El(3),Uc=El(4),Cne=El(5),_ne=El(6);Xv.range;wm.range;Sne.range;Nne.range;Uc.range;Cne.range;_ne.range;const AC=sr(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());AC.range;const EC=sr(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());EC.range;const gi=sr(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());gi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sr(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)});gi.range;const xi=sr(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());xi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sr(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)});xi.range;function KL(e,t,n,r,s,i){const o=[[Ko,1,ri],[Ko,5,5*ri],[Ko,15,15*ri],[Ko,30,30*ri],[i,1,Ra],[i,5,5*Ra],[i,15,15*Ra],[i,30,30*Ra],[s,1,ai],[s,3,3*ai],[s,6,6*ai],[s,12,12*ai],[r,1,vi],[r,2,2*vi],[n,1,jC],[t,1,c2],[t,3,3*c2],[e,1,Yw]];function c(f,h,p){const g=h<f;g&&([f,h]=[h,f]);const x=p&&typeof p.range=="function"?p:d(f,h,p),j=x?x.range(f,+h+1):[];return g?j.reverse():j}function d(f,h,p){const g=Math.abs(h-f)/p,x=uC(([,,b])=>b).right(o,g);if(x===o.length)return e.every(HS(f/Yw,h/Yw,p));if(x===0)return ym.every(Math.max(HS(f,h,p),1));const[j,y]=o[g/o[x-1][2]<o[x][2]/g?x-1:x];return j.every(y)}return[c,d]}const[Ane,Ene]=KL(xi,EC,Xv,HL,_C,NC),[kne,Pne]=KL(gi,AC,Yv,Wf,CC,SC);function Xw(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 Qw(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 dd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Tne(e){var t=e.dateTime,n=e.date,r=e.time,s=e.periods,i=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,f=fd(s),h=pd(s),p=fd(i),g=pd(i),x=fd(o),j=pd(o),y=fd(c),b=pd(c),N=fd(d),C=pd(d),S={a:K,A:V,b:R,B:G,c:null,d:m2,e:m2,f:ere,g:ure,G:fre,H:Qne,I:Jne,j:Zne,L:GL,m:tre,M:nre,p:$,q:I,Q:x2,s:y2,S:rre,u:are,U:sre,V:ire,w:ore,W:lre,x:null,X:null,y:cre,Y:dre,Z:pre,"%":g2},E={a:ee,A:Q,b:ie,B:ue,c:null,d:v2,e:v2,f:gre,g:Are,G:kre,H:hre,I:mre,j:vre,L:XL,m:xre,M:yre,p:re,q:je,Q:x2,s:y2,S:bre,u:wre,U:jre,V:Sre,w:Nre,W:Cre,x:null,X:null,y:_re,Y:Ere,Z:Pre,"%":g2},A={a:q,A:U,b:B,B:X,c:W,d:p2,e:p2,f:Kne,g:f2,G:d2,H:h2,I:h2,j:Une,L:Hne,m:qne,M:Wne,p:D,q:Bne,Q:Yne,s:Xne,S:Vne,u:$ne,U:Dne,V:Lne,w:Mne,W:Fne,x:M,X:z,y:f2,Y:d2,Z:zne,"%":Gne};S.x=k(n,S),S.X=k(r,S),S.c=k(t,S),E.x=k(n,E),E.X=k(r,E),E.c=k(t,E);function k(pe,oe){return function(_e){var ce=[],de=-1,ve=0,Pe=pe.length,F,te,fe;for(_e instanceof Date||(_e=new Date(+_e));++de<Pe;)pe.charCodeAt(de)===37&&(ce.push(pe.slice(ve,de)),(te=u2[F=pe.charAt(++de)])!=null?F=pe.charAt(++de):te=F==="e"?" ":"0",(fe=oe[F])&&(F=fe(_e,te)),ce.push(F),ve=de+1);return ce.push(pe.slice(ve,de)),ce.join("")}}function T(pe,oe){return function(_e){var ce=dd(1900,void 0,1),de=O(ce,pe,_e+="",0),ve,Pe;if(de!=_e.length)return null;if("Q"in ce)return new Date(ce.Q);if("s"in ce)return new Date(ce.s*1e3+("L"in ce?ce.L:0));if(oe&&!("Z"in ce)&&(ce.Z=0),"p"in ce&&(ce.H=ce.H%12+ce.p*12),ce.m===void 0&&(ce.m="q"in ce?ce.q:0),"V"in ce){if(ce.V<1||ce.V>53)return null;"w"in ce||(ce.w=1),"Z"in ce?(ve=Qw(dd(ce.y,0,1)),Pe=ve.getUTCDay(),ve=Pe>4||Pe===0?wm.ceil(ve):wm(ve),ve=Gv.offset(ve,(ce.V-1)*7),ce.y=ve.getUTCFullYear(),ce.m=ve.getUTCMonth(),ce.d=ve.getUTCDate()+(ce.w+6)%7):(ve=Xw(dd(ce.y,0,1)),Pe=ve.getDay(),ve=Pe>4||Pe===0?bm.ceil(ve):bm(ve),ve=Wf.offset(ve,(ce.V-1)*7),ce.y=ve.getFullYear(),ce.m=ve.getMonth(),ce.d=ve.getDate()+(ce.w+6)%7)}else("W"in ce||"U"in ce)&&("w"in ce||(ce.w="u"in ce?ce.u%7:"W"in ce?1:0),Pe="Z"in ce?Qw(dd(ce.y,0,1)).getUTCDay():Xw(dd(ce.y,0,1)).getDay(),ce.m=0,ce.d="W"in ce?(ce.w+6)%7+ce.W*7-(Pe+5)%7:ce.w+ce.U*7-(Pe+6)%7);return"Z"in ce?(ce.H+=ce.Z/100|0,ce.M+=ce.Z%100,Qw(ce)):Xw(ce)}}function O(pe,oe,_e,ce){for(var de=0,ve=oe.length,Pe=_e.length,F,te;de<ve;){if(ce>=Pe)return-1;if(F=oe.charCodeAt(de++),F===37){if(F=oe.charAt(de++),te=A[F in u2?oe.charAt(de++):F],!te||(ce=te(pe,_e,ce))<0)return-1}else if(F!=_e.charCodeAt(ce++))return-1}return ce}function D(pe,oe,_e){var ce=f.exec(oe.slice(_e));return ce?(pe.p=h.get(ce[0].toLowerCase()),_e+ce[0].length):-1}function q(pe,oe,_e){var ce=x.exec(oe.slice(_e));return ce?(pe.w=j.get(ce[0].toLowerCase()),_e+ce[0].length):-1}function U(pe,oe,_e){var ce=p.exec(oe.slice(_e));return ce?(pe.w=g.get(ce[0].toLowerCase()),_e+ce[0].length):-1}function B(pe,oe,_e){var ce=N.exec(oe.slice(_e));return ce?(pe.m=C.get(ce[0].toLowerCase()),_e+ce[0].length):-1}function X(pe,oe,_e){var ce=y.exec(oe.slice(_e));return ce?(pe.m=b.get(ce[0].toLowerCase()),_e+ce[0].length):-1}function W(pe,oe,_e){return O(pe,t,oe,_e)}function M(pe,oe,_e){return O(pe,n,oe,_e)}function z(pe,oe,_e){return O(pe,r,oe,_e)}function K(pe){return o[pe.getDay()]}function V(pe){return i[pe.getDay()]}function R(pe){return d[pe.getMonth()]}function G(pe){return c[pe.getMonth()]}function $(pe){return s[+(pe.getHours()>=12)]}function I(pe){return 1+~~(pe.getMonth()/3)}function ee(pe){return o[pe.getUTCDay()]}function Q(pe){return i[pe.getUTCDay()]}function ie(pe){return d[pe.getUTCMonth()]}function ue(pe){return c[pe.getUTCMonth()]}function re(pe){return s[+(pe.getUTCHours()>=12)]}function je(pe){return 1+~~(pe.getUTCMonth()/3)}return{format:function(pe){var oe=k(pe+="",S);return oe.toString=function(){return pe},oe},parse:function(pe){var oe=T(pe+="",!1);return oe.toString=function(){return pe},oe},utcFormat:function(pe){var oe=k(pe+="",E);return oe.toString=function(){return pe},oe},utcParse:function(pe){var oe=T(pe+="",!0);return oe.toString=function(){return pe},oe}}}var u2={"-":"",_:" ",0:"0"},pr=/^\s*\d+/,One=/^%/,Rne=/[\\^$*+?|[\]().{}]/g;function on(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",i=s.length;return r+(i<n?new Array(n-i+1).join(t)+s:s)}function Ine(e){return e.replace(Rne,"\\$&")}function fd(e){return new RegExp("^(?:"+e.map(Ine).join("|")+")","i")}function pd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Mne(e,t,n){var r=pr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function $ne(e,t,n){var r=pr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Dne(e,t,n){var r=pr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Lne(e,t,n){var r=pr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Fne(e,t,n){var r=pr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function d2(e,t,n){var r=pr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function f2(e,t,n){var r=pr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function zne(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 Bne(e,t,n){var r=pr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function qne(e,t,n){var r=pr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function p2(e,t,n){var r=pr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Une(e,t,n){var r=pr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function h2(e,t,n){var r=pr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Wne(e,t,n){var r=pr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Vne(e,t,n){var r=pr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Hne(e,t,n){var r=pr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Kne(e,t,n){var r=pr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Gne(e,t,n){var r=One.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Yne(e,t,n){var r=pr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Xne(e,t,n){var r=pr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function m2(e,t){return on(e.getDate(),t,2)}function Qne(e,t){return on(e.getHours(),t,2)}function Jne(e,t){return on(e.getHours()%12||12,t,2)}function Zne(e,t){return on(1+Wf.count(gi(e),e),t,3)}function GL(e,t){return on(e.getMilliseconds(),t,3)}function ere(e,t){return GL(e,t)+"000"}function tre(e,t){return on(e.getMonth()+1,t,2)}function nre(e,t){return on(e.getMinutes(),t,2)}function rre(e,t){return on(e.getSeconds(),t,2)}function are(e){var t=e.getDay();return t===0?7:t}function sre(e,t){return on(Yv.count(gi(e)-1,e),t,2)}function YL(e){var t=e.getDay();return t>=4||t===0?qc(e):qc.ceil(e)}function ire(e,t){return e=YL(e),on(qc.count(gi(e),e)+(gi(e).getDay()===4),t,2)}function ore(e){return e.getDay()}function lre(e,t){return on(bm.count(gi(e)-1,e),t,2)}function cre(e,t){return on(e.getFullYear()%100,t,2)}function ure(e,t){return e=YL(e),on(e.getFullYear()%100,t,2)}function dre(e,t){return on(e.getFullYear()%1e4,t,4)}function fre(e,t){var n=e.getDay();return e=n>=4||n===0?qc(e):qc.ceil(e),on(e.getFullYear()%1e4,t,4)}function pre(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+on(t/60|0,"0",2)+on(t%60,"0",2)}function v2(e,t){return on(e.getUTCDate(),t,2)}function hre(e,t){return on(e.getUTCHours(),t,2)}function mre(e,t){return on(e.getUTCHours()%12||12,t,2)}function vre(e,t){return on(1+Gv.count(xi(e),e),t,3)}function XL(e,t){return on(e.getUTCMilliseconds(),t,3)}function gre(e,t){return XL(e,t)+"000"}function xre(e,t){return on(e.getUTCMonth()+1,t,2)}function yre(e,t){return on(e.getUTCMinutes(),t,2)}function bre(e,t){return on(e.getUTCSeconds(),t,2)}function wre(e){var t=e.getUTCDay();return t===0?7:t}function jre(e,t){return on(Xv.count(xi(e)-1,e),t,2)}function QL(e){var t=e.getUTCDay();return t>=4||t===0?Uc(e):Uc.ceil(e)}function Sre(e,t){return e=QL(e),on(Uc.count(xi(e),e)+(xi(e).getUTCDay()===4),t,2)}function Nre(e){return e.getUTCDay()}function Cre(e,t){return on(wm.count(xi(e)-1,e),t,2)}function _re(e,t){return on(e.getUTCFullYear()%100,t,2)}function Are(e,t){return e=QL(e),on(e.getUTCFullYear()%100,t,2)}function Ere(e,t){return on(e.getUTCFullYear()%1e4,t,4)}function kre(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Uc(e):Uc.ceil(e),on(e.getUTCFullYear()%1e4,t,4)}function Pre(){return"+0000"}function g2(){return"%"}function x2(e){return+e}function y2(e){return Math.floor(+e/1e3)}var oc,JL,ZL;Tre({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 Tre(e){return oc=Tne(e),JL=oc.format,oc.parse,ZL=oc.utcFormat,oc.utcParse,oc}function Ore(e){return new Date(e)}function Rre(e){return e instanceof Date?+e:+new Date(+e)}function kC(e,t,n,r,s,i,o,c,d,f){var h=mC(),p=h.invert,g=h.domain,x=f(".%L"),j=f(":%S"),y=f("%I:%M"),b=f("%I %p"),N=f("%a %d"),C=f("%b %d"),S=f("%B"),E=f("%Y");function A(k){return(d(k)<k?x:c(k)<k?j:o(k)<k?y:i(k)<k?b:r(k)<k?s(k)<k?N:C:n(k)<k?S:E)(k)}return h.invert=function(k){return new Date(p(k))},h.domain=function(k){return arguments.length?g(Array.from(k,Rre)):g().map(Ore)},h.ticks=function(k){var T=g();return e(T[0],T[T.length-1],k??10)},h.tickFormat=function(k,T){return T==null?A:f(T)},h.nice=function(k){var T=g();return(!k||typeof k.range!="function")&&(k=t(T[0],T[T.length-1],k??10)),k?g(FL(T,k)):h},h.copy=function(){return Uf(h,kC(e,t,n,r,s,i,o,c,d,f))},h}function Ire(){return Fa.apply(kC(kne,Pne,gi,AC,Yv,Wf,CC,SC,Ko,JL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Mre(){return Fa.apply(kC(Ane,Ene,xi,EC,Xv,Gv,_C,NC,Ko,ZL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Qv(){var e=0,t=1,n,r,s,i,o=Or,c=!1,d;function f(p){return p==null||isNaN(p=+p)?d:o(s===0?.5:(p=(i(p)-n)*s,c?Math.max(0,Math.min(1,p)):p))}f.domain=function(p){return arguments.length?([e,t]=p,n=i(e=+e),r=i(t=+t),s=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(p){return arguments.length?(c=!!p,f):c},f.interpolator=function(p){return arguments.length?(o=p,f):o};function h(p){return function(g){var x,j;return arguments.length?([x,j]=g,o=p(x,j),f):[o(0),o(1)]}}return f.range=h(wu),f.rangeRound=h(hC),f.unknown=function(p){return arguments.length?(d=p,f):d},function(p){return i=p,n=p(e),r=p(t),s=n===r?0:1/(r-n),f}}function vo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function e4(){var e=mo(Qv()(Or));return e.copy=function(){return vo(e,e4())},Ni.apply(e,arguments)}function t4(){var e=xC(Qv()).domain([1,10]);return e.copy=function(){return vo(e,t4()).base(e.base())},Ni.apply(e,arguments)}function n4(){var e=yC(Qv());return e.copy=function(){return vo(e,n4()).constant(e.constant())},Ni.apply(e,arguments)}function PC(){var e=bC(Qv());return e.copy=function(){return vo(e,PC()).exponent(e.exponent())},Ni.apply(e,arguments)}function $re(){return PC.apply(null,arguments).exponent(.5)}function r4(){var e=[],t=Or;function n(r){if(r!=null&&!isNaN(r=+r))return t((Bf(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let s of r)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(eo),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,s)=>t(s/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(s,i)=>jte(e,i/r))},n.copy=function(){return r4(t).domain(e)},Ni.apply(n,arguments)}function Jv(){var e=0,t=.5,n=1,r=1,s,i,o,c,d,f=Or,h,p=!1,g;function x(y){return isNaN(y=+y)?g:(y=.5+((y=+h(y))-i)*(r*y<r*i?c:d),f(p?Math.max(0,Math.min(1,y)):y))}x.domain=function(y){return arguments.length?([e,t,n]=y,s=h(e=+e),i=h(t=+t),o=h(n=+n),c=s===i?0:.5/(i-s),d=i===o?0:.5/(o-i),r=i<s?-1:1,x):[e,t,n]},x.clamp=function(y){return arguments.length?(p=!!y,x):p},x.interpolator=function(y){return arguments.length?(f=y,x):f};function j(y){return function(b){var N,C,S;return arguments.length?([N,C,S]=b,f=Gte(y,[N,C,S]),x):[f(0),f(.5),f(1)]}}return x.range=j(wu),x.rangeRound=j(hC),x.unknown=function(y){return arguments.length?(g=y,x):g},function(y){return h=y,s=y(e),i=y(t),o=y(n),c=s===i?0:.5/(i-s),d=i===o?0:.5/(o-i),r=i<s?-1:1,x}}function a4(){var e=mo(Jv()(Or));return e.copy=function(){return vo(e,a4())},Ni.apply(e,arguments)}function s4(){var e=xC(Jv()).domain([.1,1,10]);return e.copy=function(){return vo(e,s4()).base(e.base())},Ni.apply(e,arguments)}function i4(){var e=yC(Jv());return e.copy=function(){return vo(e,i4()).constant(e.constant())},Ni.apply(e,arguments)}function TC(){var e=bC(Jv());return e.copy=function(){return vo(e,TC()).exponent(e.exponent())},Ni.apply(e,arguments)}function Dre(){return TC.apply(null,arguments).exponent(.5)}const b2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Kd,scaleDiverging:a4,scaleDivergingLog:s4,scaleDivergingPow:TC,scaleDivergingSqrt:Dre,scaleDivergingSymlog:i4,scaleIdentity:LL,scaleImplicit:KS,scaleLinear:xm,scaleLog:zL,scaleOrdinal:dC,scalePoint:Ed,scalePow:wC,scaleQuantile:UL,scaleQuantize:WL,scaleRadial:qL,scaleSequential:e4,scaleSequentialLog:t4,scaleSequentialPow:PC,scaleSequentialQuantile:r4,scaleSequentialSqrt:$re,scaleSequentialSymlog:n4,scaleSqrt:gne,scaleSymlog:BL,scaleThreshold:VL,scaleTime:Ire,scaleUtc:Mre,tickFormat:DL},Symbol.toStringTag,{value:"Module"}));var Jw,w2;function Zv(){if(w2)return Jw;w2=1;var e=gu();function t(n,r,s){for(var i=-1,o=n.length;++i<o;){var c=n[i],d=r(c);if(d!=null&&(f===void 0?d===d&&!e(d):s(d,f)))var f=d,h=c}return h}return Jw=t,Jw}var Zw,j2;function o4(){if(j2)return Zw;j2=1;function e(t,n){return t>n}return Zw=e,Zw}var ej,S2;function Lre(){if(S2)return ej;S2=1;var e=Zv(),t=o4(),n=bu();function r(s){return s&&s.length?e(s,n,t):void 0}return ej=r,ej}var Fre=Lre();const eg=hn(Fre);var tj,N2;function l4(){if(N2)return tj;N2=1;function e(t,n){return t<n}return tj=e,tj}var nj,C2;function zre(){if(C2)return nj;C2=1;var e=Zv(),t=l4(),n=bu();function r(s){return s&&s.length?e(s,n,t):void 0}return nj=r,nj}var Bre=zre();const tg=hn(Bre);var rj,_2;function qre(){if(_2)return rj;_2=1;var e=KN(),t=Fs(),n=gL(),r=Zr();function s(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return rj=s,rj}var aj,A2;function Ure(){if(A2)return aj;A2=1;var e=mL(),t=qre();function n(r,s){return e(t(r,s),1)}return aj=n,aj}var Wre=Ure();const Vre=hn(Wre);var sj,E2;function Hre(){if(E2)return sj;E2=1;var e=iC();function t(n,r){return e(n,r)}return sj=t,sj}var Kre=Hre();const Vf=hn(Kre);var ju=1e9,Gre={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},RC,In=!0,Da="[DecimalError] ",Jo=Da+"Invalid argument: ",OC=Da+"Exponent out of range: ",Su=Math.floor,Uo=Math.pow,Yre=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ha,dr=1e7,On=7,c4=9007199254740991,jm=Su(c4/On),ut={};ut.absoluteValue=ut.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ut.comparedTo=ut.cmp=function(e){var t,n,r,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(r=i.d.length,s=e.d.length,t=0,n=r<s?r:s;t<n;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return r===s?0:r>s^i.s<0?1:-1};ut.decimalPlaces=ut.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*On;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ut.dividedBy=ut.div=function(e){return ci(this,new this.constructor(e))};ut.dividedToIntegerBy=ut.idiv=function(e){var t=this,n=t.constructor;return jn(ci(t,new n(e),0,1),n.precision)};ut.equals=ut.eq=function(e){return!this.cmp(e)};ut.exponent=function(){return Yn(this)};ut.greaterThan=ut.gt=function(e){return this.cmp(e)>0};ut.greaterThanOrEqualTo=ut.gte=function(e){return this.cmp(e)>=0};ut.isInteger=ut.isint=function(){return this.e>this.d.length-2};ut.isNegative=ut.isneg=function(){return this.s<0};ut.isPositive=ut.ispos=function(){return this.s>0};ut.isZero=function(){return this.s===0};ut.lessThan=ut.lt=function(e){return this.cmp(e)<0};ut.lessThanOrEqualTo=ut.lte=function(e){return this.cmp(e)<1};ut.logarithm=ut.log=function(e){var t,n=this,r=n.constructor,s=r.precision,i=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ha))throw Error(Da+"NaN");if(n.s<1)throw Error(Da+(n.s?"NaN":"-Infinity"));return n.eq(ha)?new r(0):(In=!1,t=ci(Jd(n,i),Jd(e,i),i),In=!0,jn(t,s))};ut.minus=ut.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?f4(t,e):u4(t,(e.s=-e.s,e))};ut.modulo=ut.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(Da+"NaN");return n.s?(In=!1,t=ci(n,e,0,1).times(e),In=!0,n.minus(t)):jn(new r(n),s)};ut.naturalExponential=ut.exp=function(){return d4(this)};ut.naturalLogarithm=ut.ln=function(){return Jd(this)};ut.negated=ut.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ut.plus=ut.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?u4(t,e):f4(t,(e.s=-e.s,e))};ut.precision=ut.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Jo+e);if(t=Yn(s)+1,r=s.d.length-1,n=r*On+1,r=s.d[r],r){for(;r%10==0;r/=10)n--;for(r=s.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ut.squareRoot=ut.sqrt=function(){var e,t,n,r,s,i,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(Da+"NaN")}for(e=Yn(c),In=!1,s=Math.sqrt(+c),s==0||s==1/0?(t=Ns(c.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=Su((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(s.toString()),n=d.precision,s=o=n+3;;)if(i=r,r=i.plus(ci(c,i,o+2)).times(.5),Ns(i.d).slice(0,o)===(t=Ns(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(jn(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return In=!0,jn(r,n)};ut.times=ut.mul=function(e){var t,n,r,s,i,o,c,d,f,h=this,p=h.constructor,g=h.d,x=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,n=h.e+e.e,d=g.length,f=x.length,d<f&&(i=g,g=x,x=i,o=d,d=f,f=o),i=[],o=d+f,r=o;r--;)i.push(0);for(r=f;--r>=0;){for(t=0,s=d+r;s>r;)c=i[s]+x[r]*g[s-r-1]+t,i[s--]=c%dr|0,t=c/dr|0;i[s]=(i[s]+t)%dr|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,In?jn(e,p.precision):e};ut.toDecimalPlaces=ut.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Os(e,0,ju),t===void 0?t=r.rounding:Os(t,0,8),jn(n,e+Yn(n)+1,t))};ut.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=ll(r,!0):(Os(e,0,ju),t===void 0?t=s.rounding:Os(t,0,8),r=jn(new s(r),e+1,t),n=ll(r,!0,e+1)),n};ut.toFixed=function(e,t){var n,r,s=this,i=s.constructor;return e===void 0?ll(s):(Os(e,0,ju),t===void 0?t=i.rounding:Os(t,0,8),r=jn(new i(s),e+Yn(s)+1,t),n=ll(r.abs(),!1,e+Yn(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};ut.toInteger=ut.toint=function(){var e=this,t=e.constructor;return jn(new t(e),Yn(e)+1,t.rounding)};ut.toNumber=function(){return+this};ut.toPower=ut.pow=function(e){var t,n,r,s,i,o,c=this,d=c.constructor,f=12,h=+(e=new d(e));if(!e.s)return new d(ha);if(c=new d(c),!c.s){if(e.s<1)throw Error(Da+"Infinity");return c}if(c.eq(ha))return c;if(r=d.precision,e.eq(ha))return jn(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=c4){for(s=new d(ha),t=Math.ceil(r/On+4),In=!1;n%2&&(s=s.times(c),P2(s.d,t)),n=Su(n/2),n!==0;)c=c.times(c),P2(c.d,t);return In=!0,e.s<0?new d(ha).div(s):jn(s,r)}}else if(i<0)throw Error(Da+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,In=!1,s=e.times(Jd(c,r+f)),In=!0,s=d4(s),s.s=i,s};ut.toPrecision=function(e,t){var n,r,s=this,i=s.constructor;return e===void 0?(n=Yn(s),r=ll(s,n<=i.toExpNeg||n>=i.toExpPos)):(Os(e,1,ju),t===void 0?t=i.rounding:Os(t,0,8),s=jn(new i(s),e,t),n=Yn(s),r=ll(s,e<=n||n<=i.toExpNeg,e)),r};ut.toSignificantDigits=ut.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Os(e,1,ju),t===void 0?t=r.rounding:Os(t,0,8)),jn(new r(n),e,t)};ut.toString=ut.valueOf=ut.val=ut.toJSON=ut[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Yn(e),n=e.constructor;return ll(e,t<=n.toExpNeg||t>=n.toExpPos)};function u4(e,t){var n,r,s,i,o,c,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),In?jn(t,p):t;if(d=e.d,f=t.d,o=e.e,s=t.e,d=d.slice(),i=o-s,i){for(i<0?(r=d,i=-i,c=f.length):(r=f,s=o,c=d.length),o=Math.ceil(p/On),c=o>c?o+1:c+1,i>c&&(i=c,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(c=d.length,i=f.length,c-i<0&&(i=c,r=f,f=d,d=r),n=0;i;)n=(d[--i]=d[i]+f[i]+n)/dr|0,d[i]%=dr;for(n&&(d.unshift(n),++s),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=s,In?jn(t,p):t}function Os(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Jo+e)}function Ns(e){var t,n,r,s=e.length-1,i="",o=e[0];if(s>0){for(i+=o,t=1;t<s;t++)r=e[t]+"",n=On-r.length,n&&(i+=Xi(n)),i+=r;o=e[t],r=o+"",n=On-r.length,n&&(i+=Xi(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var ci=(function(){function e(r,s){var i,o=0,c=r.length;for(r=r.slice();c--;)i=r[c]*s+o,r[c]=i%dr|0,o=i/dr|0;return o&&r.unshift(o),r}function t(r,s,i,o){var c,d;if(i!=o)d=i>o?1:-1;else for(c=d=0;c<i;c++)if(r[c]!=s[c]){d=r[c]>s[c]?1:-1;break}return d}function n(r,s,i){for(var o=0;i--;)r[i]-=o,o=r[i]<s[i]?1:0,r[i]=o*dr+r[i]-s[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,s,i,o){var c,d,f,h,p,g,x,j,y,b,N,C,S,E,A,k,T,O,D=r.constructor,q=r.s==s.s?1:-1,U=r.d,B=s.d;if(!r.s)return new D(r);if(!s.s)throw Error(Da+"Division by zero");for(d=r.e-s.e,T=B.length,A=U.length,x=new D(q),j=x.d=[],f=0;B[f]==(U[f]||0);)++f;if(B[f]>(U[f]||0)&&--d,i==null?C=i=D.precision:o?C=i+(Yn(r)-Yn(s))+1:C=i,C<0)return new D(0);if(C=C/On+2|0,f=0,T==1)for(h=0,B=B[0],C++;(f<A||h)&&C--;f++)S=h*dr+(U[f]||0),j[f]=S/B|0,h=S%B|0;else{for(h=dr/(B[0]+1)|0,h>1&&(B=e(B,h),U=e(U,h),T=B.length,A=U.length),E=T,y=U.slice(0,T),b=y.length;b<T;)y[b++]=0;O=B.slice(),O.unshift(0),k=B[0],B[1]>=dr/2&&++k;do h=0,c=t(B,y,T,b),c<0?(N=y[0],T!=b&&(N=N*dr+(y[1]||0)),h=N/k|0,h>1?(h>=dr&&(h=dr-1),p=e(B,h),g=p.length,b=y.length,c=t(p,y,g,b),c==1&&(h--,n(p,T<g?O:B,g))):(h==0&&(c=h=1),p=B.slice()),g=p.length,g<b&&p.unshift(0),n(y,p,b),c==-1&&(b=y.length,c=t(B,y,T,b),c<1&&(h++,n(y,T<b?O:B,b))),b=y.length):c===0&&(h++,y=[0]),j[f++]=h,c&&y[0]?y[b++]=U[E]||0:(y=[U[E]],b=1);while((E++<A||y[0]!==void 0)&&C--)}return j[0]||j.shift(),x.e=d,jn(x,o?i+Yn(x)+1:i)}})();function d4(e,t){var n,r,s,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if(Yn(e)>16)throw Error(OC+Yn(e));if(!e.s)return new h(ha);for(In=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(Uo(2,f))/Math.LN10*2+5|0,c+=r,n=s=i=new h(ha),h.precision=c;;){if(s=jn(s.times(e),c),n=n.times(++d),o=i.plus(ci(s,n,c)),Ns(o.d).slice(0,c)===Ns(i.d).slice(0,c)){for(;f--;)i=jn(i.times(i),c);return h.precision=p,t==null?(In=!0,jn(i,p)):i}i=o}}function Yn(e){for(var t=e.e*On,n=e.d[0];n>=10;n/=10)t++;return t}function ij(e,t,n){if(t>e.LN10.sd())throw In=!0,n&&(e.precision=n),Error(Da+"LN10 precision limit exceeded");return jn(new e(e.LN10),t)}function Xi(e){for(var t="";e--;)t+="0";return t}function Jd(e,t){var n,r,s,i,o,c,d,f,h,p=1,g=10,x=e,j=x.d,y=x.constructor,b=y.precision;if(x.s<1)throw Error(Da+(x.s?"NaN":"-Infinity"));if(x.eq(ha))return new y(0);if(t==null?(In=!1,f=b):f=t,x.eq(10))return t==null&&(In=!0),ij(y,f);if(f+=g,y.precision=f,n=Ns(j),r=n.charAt(0),i=Yn(x),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=Ns(x.d),r=n.charAt(0),p++;i=Yn(x),r>1?(x=new y("0."+n),i++):x=new y(r+"."+n.slice(1))}else return d=ij(y,f+2,b).times(i+""),x=Jd(new y(r+"."+n.slice(1)),f-g).plus(d),y.precision=b,t==null?(In=!0,jn(x,b)):x;for(c=o=x=ci(x.minus(ha),x.plus(ha),f),h=jn(x.times(x),f),s=3;;){if(o=jn(o.times(h),f),d=c.plus(ci(o,new y(s),f)),Ns(d.d).slice(0,f)===Ns(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(ij(y,f+2,b).times(i+""))),c=ci(c,new y(p),f),y.precision=b,t==null?(In=!0,jn(c,b)):c;c=d,s+=2}}function k2(e,t){var n,r,s;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(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(r,s),t){if(s-=r,n=n-r-1,e.e=Su(n/On),e.d=[],r=(n+1)%On,n<0&&(r+=On),r<s){for(r&&e.d.push(+t.slice(0,r)),s-=On;r<s;)e.d.push(+t.slice(r,r+=On));t=t.slice(r),r=On-t.length}else r-=s;for(;r--;)t+="0";if(e.d.push(+t),In&&(e.e>jm||e.e<-jm))throw Error(OC+n)}else e.s=0,e.e=0,e.d=[0];return e}function jn(e,t,n){var r,s,i,o,c,d,f,h,p=e.d;for(o=1,i=p[0];i>=10;i/=10)o++;if(r=t-o,r<0)r+=On,s=t,f=p[h=0];else{if(h=Math.ceil((r+1)/On),i=p.length,h>=i)return e;for(f=i=p[h],o=1;i>=10;i/=10)o++;r%=On,s=r-On+o}if(n!==void 0&&(i=Uo(10,o-s-1),c=f/i%10|0,d=t<0||p[h+1]!==void 0||f%i,d=n<4?(c||d)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||d||n==6&&(r>0?s>0?f/Uo(10,o-s):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=Yn(e),p.length=1,t=t-i-1,p[0]=Uo(10,(On-t%On)%On),e.e=Su(-t/On)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=h,i=1,h--):(p.length=h+1,i=Uo(10,On-r),p[h]=s>0?(f/Uo(10,o-s)%Uo(10,s)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==dr&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=dr)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(In&&(e.e>jm||e.e<-jm))throw Error(OC+Yn(e));return e}function f4(e,t){var n,r,s,i,o,c,d,f,h,p,g=e.constructor,x=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),In?jn(t,x):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(h=o<0,h?(n=d,o=-o,c=p.length):(n=p,r=f,c=d.length),s=Math.max(Math.ceil(x/On),c)+2,o>s&&(o=s,n.length=1),n.reverse(),s=o;s--;)n.push(0);n.reverse()}else{for(s=d.length,c=p.length,h=s<c,h&&(c=s),s=0;s<c;s++)if(d[s]!=p[s]){h=d[s]<p[s];break}o=0}for(h&&(n=d,d=p,p=n,t.s=-t.s),c=d.length,s=p.length-c;s>0;--s)d[c++]=0;for(s=p.length;s>o;){if(d[--s]<p[s]){for(i=s;i&&d[--i]===0;)d[i]=dr-1;--d[i],d[s]+=dr}d[s]-=p[s]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,In?jn(t,x):t):new g(0)}function ll(e,t,n){var r,s=Yn(e),i=Ns(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Xi(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Xi(-s-1)+i,n&&(r=n-o)>0&&(i+=Xi(r))):s>=o?(i+=Xi(s+1-o),n&&(r=n-s-1)>0&&(i=i+"."+Xi(r))):((r=s+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(s+1===o&&(i+="."),i+=Xi(r))),e.s<0?"-"+i:i}function P2(e,t){if(e.length>t)return e.length=t,!0}function p4(e){var t,n,r;function s(i){var o=this;if(!(o instanceof s))return new s(i);if(o.constructor=s,i instanceof s){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Jo+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return k2(o,i.toString())}else if(typeof i!="string")throw Error(Jo+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Yre.test(i))k2(o,i);else throw Error(Jo+i)}if(s.prototype=ut,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=p4,s.config=s.set=Xre,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 s.config(e),s}function Xre(e){if(!e||typeof e!="object")throw Error(Da+"Object expected");var t,n,r,s=["precision",1,ju,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((r=e[n=s[t]])!==void 0)if(Su(r)===r&&r>=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(Jo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Jo+n+": "+r);return this}var RC=p4(Gre);ha=new RC(1);const xn=RC;function Qre(e){return tae(e)||eae(e)||Zre(e)||Jre()}function Jre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
68
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zre(e,t){if(e){if(typeof e=="string")return QS(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 QS(e,t)}}function eae(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function tae(e){if(Array.isArray(e))return QS(e)}function QS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var nae=function(t){return t},h4={},m4=function(t){return t===h4},T2=function(t){return function n(){return arguments.length===0||arguments.length===1&&m4(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},rae=function e(t,n){return t===1?n:T2(function(){for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];var o=s.filter(function(c){return c!==h4}).length;return o>=t?n.apply(void 0,s):e(t-o,T2(function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var h=s.map(function(p){return m4(p)?d.shift():p});return n.apply(void 0,Qre(h).concat(d))}))})},ng=function(t){return rae(t.length,t)},JS=function(t,n){for(var r=[],s=t;s<n;++s)r[s-t]=s;return r},aae=ng(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),sae=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return nae;var s=n.reverse(),i=s[0],o=s.slice(1);return function(){return o.reduce(function(c,d){return d(c)},i.apply(void 0,arguments))}},ZS=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},v4=function(t){var n=null,r=null;return function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];return n&&i.every(function(c,d){return c===n[d]})||(n=i,r=t.apply(void 0,i)),r}};function iae(e){var t;return e===0?t=1:t=Math.floor(new xn(e).abs().log(10).toNumber())+1,t}function oae(e,t,n){for(var r=new xn(e),s=0,i=[];r.lt(t)&&s<1e5;)i.push(r.toNumber()),r=r.add(n),s++;return i}var lae=ng(function(e,t,n){var r=+e,s=+t;return r+n*(s-r)}),cae=ng(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),uae=ng(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const rg={rangeStep:oae,getDigitCount:iae,interpolateNumber:lae,uninterpolateNumber:cae,uninterpolateTruncation:uae};function e1(e){return pae(e)||fae(e)||g4(e)||dae()}function dae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
69
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fae(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function pae(e){if(Array.isArray(e))return t1(e)}function Zd(e,t){return vae(e)||mae(e,t)||g4(e,t)||hae()}function hae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
70
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g4(e,t){if(e){if(typeof e=="string")return t1(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 t1(e,t)}}function t1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mae(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!1,i=void 0;try{for(var o=e[Symbol.iterator](),c;!(r=(c=o.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(d){s=!0,i=d}finally{try{!r&&o.return!=null&&o.return()}finally{if(s)throw i}}return n}}function vae(e){if(Array.isArray(e))return e}function x4(e){var t=Zd(e,2),n=t[0],r=t[1],s=n,i=r;return n>r&&(s=r,i=n),[s,i]}function y4(e,t,n){if(e.lte(0))return new xn(0);var r=rg.getDigitCount(e.toNumber()),s=new xn(10).pow(r),i=e.div(s),o=r!==1?.05:.1,c=new xn(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(s);return t?d:new xn(Math.ceil(d))}function gae(e,t,n){var r=1,s=new xn(e);if(!s.isint()&&n){var i=Math.abs(e);i<1?(r=new xn(10).pow(rg.getDigitCount(e)-1),s=new xn(Math.floor(s.div(r).toNumber())).mul(r)):i>1&&(s=new xn(Math.floor(e)))}else e===0?s=new xn(Math.floor((t-1)/2)):n||(s=new xn(Math.floor(e)));var o=Math.floor((t-1)/2),c=sae(aae(function(d){return s.add(new xn(d-o).mul(r)).toNumber()}),JS);return c(0,t)}function b4(e,t,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new xn(0),tickMin:new xn(0),tickMax:new xn(0)};var i=y4(new xn(t).sub(e).div(n-1),r,s),o;e<=0&&t>=0?o=new xn(0):(o=new xn(e).add(t).div(2),o=o.sub(new xn(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new xn(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?b4(e,t,n,r,s+1):(f<n&&(d=t>0?d+(n-f):d,c=t>0?c:c+(n-f)),{step:i,tickMin:o.sub(new xn(c).mul(i)),tickMax:o.add(new xn(d).mul(i))})}function xae(e){var t=Zd(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),c=x4([n,r]),d=Zd(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(e1(JS(0,s-1).map(function(){return 1/0}))):[].concat(e1(JS(0,s-1).map(function(){return-1/0})),[h]);return n>r?ZS(p):p}if(f===h)return gae(f,s,i);var g=b4(f,h,o,i),x=g.step,j=g.tickMin,y=g.tickMax,b=rg.rangeStep(j,y.add(new xn(.1).mul(x)),x);return n>r?ZS(b):b}function yae(e,t){var n=Zd(e,2),r=n[0],s=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=x4([r,s]),c=Zd(o,2),d=c[0],f=c[1];if(d===-1/0||f===1/0)return[r,s];if(d===f)return[d];var h=Math.max(t,2),p=y4(new xn(f).sub(d).div(h-1),i,0),g=[].concat(e1(rg.rangeStep(new xn(d),new xn(f).sub(new xn(.99).mul(p)),p)),[f]);return r>s?ZS(g):g}var bae=v4(xae),wae=v4(yae),jae="Invariant failed";function cl(e,t){throw new Error(jae)}var Sae=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Wc(e){"@babel/helpers - typeof";return Wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wc(e)}function Sm(){return Sm=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},Sm.apply(this,arguments)}function Nae(e,t){return Eae(e)||Aae(e,t)||_ae(e,t)||Cae()}function Cae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
71
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ae(e,t){if(e){if(typeof e=="string")return O2(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 O2(e,t)}}function O2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Aae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function Eae(e){if(Array.isArray(e))return e}function kae(e,t){if(e==null)return{};var n=Pae(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pae(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 Tae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oae(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,S4(r.key),r)}}function Rae(e,t,n){return t&&Oae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Iae(e,t,n){return t=Nm(t),Mae(e,w4()?Reflect.construct(t,n||[],Nm(e).constructor):t.apply(e,n))}function Mae(e,t){if(t&&(Wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $ae(e)}function $ae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w4=function(){return!!e})()}function Nm(e){return Nm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nm(e)}function Dae(e,t){if(typeof t!="function"&&t!==null)throw new 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&&n1(e,t)}function n1(e,t){return n1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},n1(e,t)}function j4(e,t,n){return t=S4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S4(e){var t=Lae(e,"string");return Wc(t)=="symbol"?t:t+""}function Lae(e,t){if(Wc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Hf=(function(e){function t(){return Tae(this,t),Iae(this,t,arguments)}return Dae(t,e),Rae(t,[{key:"render",value:function(){var r=this.props,s=r.offset,i=r.layout,o=r.width,c=r.dataKey,d=r.data,f=r.dataPointFormatter,h=r.xAxis,p=r.yAxis,g=kae(r,Sae),x=kt(g,!1);this.props.direction==="x"&&h.type!=="number"&&cl();var j=d.map(function(y){var b=f(y,c),N=b.x,C=b.y,S=b.value,E=b.errorVal;if(!E)return null;var A=[],k,T;if(Array.isArray(E)){var O=Nae(E,2);k=O[0],T=O[1]}else k=T=E;if(i==="vertical"){var D=h.scale,q=C+s,U=q+o,B=q-o,X=D(S-k),W=D(S+T);A.push({x1:W,y1:U,x2:W,y2:B}),A.push({x1:X,y1:q,x2:W,y2:q}),A.push({x1:X,y1:U,x2:X,y2:B})}else if(i==="horizontal"){var M=p.scale,z=N+s,K=z-o,V=z+o,R=M(S-k),G=M(S+T);A.push({x1:K,y1:G,x2:V,y2:G}),A.push({x1:z,y1:R,x2:z,y2:G}),A.push({x1:K,y1:R,x2:V,y2:R})}return Y.createElement(sn,Sm({className:"recharts-errorBar",key:"bar-".concat(A.map(function($){return"".concat($.x1,"-").concat($.x2,"-").concat($.y1,"-").concat($.y2)}))},x),A.map(function($){return Y.createElement("line",Sm({},$,{key:"line-".concat($.x1,"-").concat($.x2,"-").concat($.y1,"-").concat($.y2)}))}))});return Y.createElement(sn,{className:"recharts-errorBars"},j)}}])})(Y.Component);j4(Hf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});j4(Hf,"displayName","ErrorBar");function ef(e){"@babel/helpers - typeof";return ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ef(e)}function R2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function $o(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R2(Object(n),!0).forEach(function(r){Fae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fae(e,t,n){return t=zae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zae(e){var t=Bae(e,"string");return ef(t)=="symbol"?t:t+""}function Bae(e,t){if(ef(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ef(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var N4=function(t){var n=t.children,r=t.formattedGraphicalItems,s=t.legendWidth,i=t.legendContent,o=da(n,Xo);if(!o)return null;var c=Xo.defaultProps,d=c!==void 0?$o($o({},c),o.props):{},f;return o.props&&o.props.payload?f=o.props&&o.props.payload:i==="children"?f=(r||[]).reduce(function(h,p){var g=p.item,x=p.props,j=x.sectors||x.data||[];return h.concat(j.map(function(y){return{type:o.props.iconType||g.props.legendType,value:y.name,color:y.fill,payload:y}}))},[]):f=(r||[]).map(function(h){var p=h.item,g=p.type.defaultProps,x=g!==void 0?$o($o({},g),p.props):{},j=x.dataKey,y=x.name,b=x.legendType,N=x.hide;return{inactive:N,dataKey:j,type:d.iconType||b||"square",color:IC(p),value:y||j,payload:x}}),$o($o($o({},d),Xo.getWithHeight(o,s)),{},{payload:f,item:o})};function tf(e){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tf(e)}function I2(e){return Vae(e)||Wae(e)||Uae(e)||qae()}function qae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
72
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uae(e,t){if(e){if(typeof e=="string")return r1(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 r1(e,t)}}function Wae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vae(e){if(Array.isArray(e))return r1(e)}function r1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M2(Object(n),!0).forEach(function(r){Ec(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ec(e,t,n){return t=Hae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hae(e){var t=Kae(e,"string");return tf(t)=="symbol"?t:t+""}function Kae(e,t){if(tf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tr(e,t,n){return Ft(e)||Ft(t)?n:nr(t)?ga(e,t,n):Lt(t)?t(e):n}function kd(e,t,n,r){var s=Vre(e,function(c){return tr(c,t)});if(n==="number"){var i=s.filter(function(c){return Qe(c)||parseFloat(c)});return i.length?[tg(i),eg(i)]:[1/0,-1/0]}var o=r?s.filter(function(c){return!Ft(c)}):s;return o.map(function(c){return nr(c)||c instanceof Date?c:""})}var Gae=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,c=(n=r?.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var d=i.range,f=0;f<c;f++){var h=f>0?s[f-1].coordinate:s[c-1].coordinate,p=s[f].coordinate,g=f>=c-1?s[0].coordinate:s[f+1].coordinate,x=void 0;if(Pr(p-h)!==Pr(g-p)){var j=[];if(Pr(g-p)===Pr(d[1]-d[0])){x=g;var y=p+d[1]-d[0];j[0]=Math.min(y,(y+h)/2),j[1]=Math.max(y,(y+h)/2)}else{x=h;var b=g+d[1]-d[0];j[0]=Math.min(p,(b+p)/2),j[1]=Math.max(p,(b+p)/2)}var N=[Math.min(p,(x+p)/2),Math.max(p,(x+p)/2)];if(t>N[0]&&t<=N[1]||t>=j[0]&&t<=j[1]){o=s[f].index;break}}else{var C=Math.min(h,g),S=Math.max(h,g);if(t>(C+p)/2&&t<=(S+p)/2){o=s[f].index;break}}}else for(var E=0;E<c;E++)if(E===0&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E>0&&E<c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E===c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2){o=r[E].index;break}return o},IC=function(t){var n,r=t,s=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Bn(Bn({},t.type.defaultProps),t.props):t.props,o=i.stroke,c=i.fill,d;switch(s){case"Line":d=o;break;case"Area":case"Radar":d=o&&o!=="none"?o:c;break;default:d=c;break}return d},Yae=function(t){var n=t.barSize,r=t.totalSize,s=t.stackGroups,i=s===void 0?{}:s;if(!i)return{};for(var o={},c=Object.keys(i),d=0,f=c.length;d<f;d++)for(var h=i[c[d]].stackGroups,p=Object.keys(h),g=0,x=p.length;g<x;g++){var j=h[p[g]],y=j.items,b=j.cateAxisId,N=y.filter(function(T){return oi(T.type).indexOf("Bar")>=0});if(N&&N.length){var C=N[0].type.defaultProps,S=C!==void 0?Bn(Bn({},C),N[0].props):N[0].props,E=S.barSize,A=S[b];o[A]||(o[A]=[]);var k=Ft(E)?n:E;o[A].push({item:N[0],stackList:N.slice(1),barSize:Ft(k)?void 0:Tr(k,r,0)})}}return o},Xae=function(t){var n=t.barGap,r=t.barCategoryGap,s=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,c=t.maxBarSize,d=o.length;if(d<1)return null;var f=Tr(n,s,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var g=!1,x=s/d,j=o.reduce(function(E,A){return E+A.barSize||0},0);j+=(d-1)*f,j>=s&&(j-=(d-1)*f,f=0),j>=s&&x>0&&(g=!0,x*=.9,j=d*x);var y=(s-j)/2>>0,b={offset:y-f,size:0};h=o.reduce(function(E,A){var k={item:A.item,position:{offset:b.offset+b.size+f,size:g?x:A.barSize}},T=[].concat(I2(E),[k]);return b=T[T.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(O){T.push({item:O,position:b})}),T},p)}else{var N=Tr(r,s,0,!0);s-2*N-(d-1)*f<=0&&(f=0);var C=(s-2*N-(d-1)*f)/d;C>1&&(C>>=0);var S=c===+c?Math.min(C,c):C;h=o.reduce(function(E,A,k){var T=[].concat(I2(E),[{item:A.item,position:{offset:N+(C+f)*k+(C-S)/2,size:S}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(O){T.push({item:O,position:T[T.length-1].position})}),T},p)}return h},Qae=function(t,n,r,s){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=N4({children:i,legendWidth:d});if(f){var h=s||{},p=h.width,g=h.height,x=f.align,j=f.verticalAlign,y=f.layout;if((y==="vertical"||y==="horizontal"&&j==="middle")&&x!=="center"&&Qe(t[x]))return Bn(Bn({},t),{},Ec({},x,t[x]+(p||0)));if((y==="horizontal"||y==="vertical"&&x==="center")&&j!=="middle"&&Qe(t[j]))return Bn(Bn({},t),{},Ec({},j,t[j]+(g||0)))}return t},Jae=function(t,n,r){return Ft(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},C4=function(t,n,r,s,i){var o=n.props.children,c=xa(o,Hf).filter(function(f){return Jae(s,i,f.props.direction)});if(c&&c.length){var d=c.map(function(f){return f.props.dataKey});return t.reduce(function(f,h){var p=tr(h,r);if(Ft(p))return f;var g=Array.isArray(p)?[tg(p),eg(p)]:[p,p],x=d.reduce(function(j,y){var b=tr(h,y,0),N=g[0]-Math.abs(Array.isArray(b)?b[0]:b),C=g[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(N,j[0]),Math.max(C,j[1])]},[1/0,-1/0]);return[Math.min(x[0],f[0]),Math.max(x[1],f[1])]},[1/0,-1/0])}return null},Zae=function(t,n,r,s,i){var o=n.map(function(c){return C4(t,c,r,i,s)}).filter(function(c){return!Ft(c)});return o&&o.length?o.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]):null},_4=function(t,n,r,s,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&C4(t,d,f,s)||kd(t,f,r,i)});if(r==="number")return o.reduce(function(d,f){return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);var c={};return o.reduce(function(d,f){for(var h=0,p=f.length;h<p;h++)c[f[h]]||(c[f[h]]=!0,d.push(f[h]));return d},[])},A4=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Go=function(t,n,r){if(!t)return null;var s=t.scale,i=t.duplicateDomain,o=t.type,c=t.range,d=t.realScaleType==="scaleBand"?s.bandwidth()/2:2,f=(n||r)&&o==="category"&&s.bandwidth?s.bandwidth()/d:0;if(f=t.axisType==="angleAxis"&&c?.length>=2?Pr(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var g=i?i.indexOf(p):p;return{coordinate:s(g)+f,value:p,offset:f}});return h.filter(function(p){return!Ff(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,g){return{coordinate:s(p)+f,value:p,index:g,offset:f}}):s.ticks&&!r?s.ticks(t.tickCount).map(function(p){return{coordinate:s(p)+f,value:p,offset:f}}):s.domain().map(function(p,g){return{coordinate:s(p)+f,value:i?i[p]:p,index:g,offset:f}})},oj=new WeakMap,Nh=function(t,n){if(typeof n!="function")return t;oj.has(t)||oj.set(t,new WeakMap);var r=oj.get(t);if(r.has(n))return r.get(n);var s=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,s),s},E4=function(t,n,r){var s=t.scale,i=t.type,o=t.layout,c=t.axisType;if(s==="auto")return o==="radial"&&c==="radiusAxis"?{scale:Kd(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:xm(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Ed(),realScaleType:"point"}:i==="category"?{scale:Kd(),realScaleType:"band"}:{scale:xm(),realScaleType:"linear"};if(sl(s)){var d="scale".concat(Fv(s));return{scale:(b2[d]||Ed)(),realScaleType:b2[d]?d:"point"}}return Lt(s)?{scale:s}:{scale:Ed(),realScaleType:"point"}},$2=1e-4,k4=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,s=t.range(),i=Math.min(s[0],s[1])-$2,o=Math.max(s[0],s[1])+$2,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},ese=function(t,n){if(!t)return null;for(var r=0,s=t.length;r<s;r++)if(t[r].item===n)return t[r].position;return null},tse=function(t,n){if(!n||n.length!==2||!Qe(n[0])||!Qe(n[1]))return t;var r=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]),i=[t[0],t[1]];return(!Qe(t[0])||t[0]<r)&&(i[0]=r),(!Qe(t[1])||t[1]>s)&&(i[1]=s),i[0]>s&&(i[0]=s),i[1]<r&&(i[1]=r),i},nse=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var i=0,o=0,c=0;c<n;++c){var d=Ff(t[c][r][1])?t[c][r][0]:t[c][r][1];d>=0?(t[c][r][0]=i,t[c][r][1]=i+d,i=t[c][r][1]):(t[c][r][0]=o,t[c][r][1]=o+d,o=t[c][r][1])}},rse=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var i=0,o=0;o<n;++o){var c=Ff(t[o][r][1])?t[o][r][0]:t[o][r][1];c>=0?(t[o][r][0]=i,t[o][r][1]=i+c,i=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},ase={sign:nse,expand:VQ,none:$c,silhouette:HQ,wiggle:KQ,positive:rse},sse=function(t,n,r){var s=n.map(function(c){return c.props.dataKey}),i=ase[r],o=WQ().keys(s).value(function(c,d){return+tr(c,d,0)}).order(RS).offset(i);return o(t)},ise=function(t,n,r,s,i,o){if(!t)return null;var c=o?n.reverse():n,d={},f=c.reduce(function(p,g){var x,j=(x=g.type)!==null&&x!==void 0&&x.defaultProps?Bn(Bn({},g.type.defaultProps),g.props):g.props,y=j.stackId,b=j.hide;if(b)return p;var N=j[r],C=p[N]||{hasStack:!1,stackGroups:{}};if(nr(y)){var S=C.stackGroups[y]||{numericAxisId:r,cateAxisId:s,items:[]};S.items.push(g),C.hasStack=!0,C.stackGroups[y]=S}else C.stackGroups[yu("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[g]};return Bn(Bn({},p),{},Ec({},N,C))},d),h={};return Object.keys(f).reduce(function(p,g){var x=f[g];if(x.hasStack){var j={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(y,b){var N=x.stackGroups[b];return Bn(Bn({},y),{},Ec({},b,{numericAxisId:r,cateAxisId:s,items:N.items,stackedData:sse(t,N.items,i)}))},j)}return Bn(Bn({},p),{},Ec({},g,x))},h)},P4=function(t,n){var r=n.realScaleType,s=n.type,i=n.tickCount,o=n.originalDomain,c=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var f=t.domain();if(!f.length)return null;var h=bae(f,i,c);return t.domain([tg(h),eg(h)]),{niceTicks:h}}if(i&&s==="number"){var p=t.domain(),g=wae(p,i,c);return{niceTicks:g}}return null};function D2(e){var t=e.axis,n=e.ticks,r=e.bandSize,s=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ft(s[t.dataKey])){var c=Jh(n,"value",s[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=tr(s,Ft(o)?t.dataKey:o);return Ft(d)?null:t.scale(d)}var L2=function(t){var n=t.axis,r=t.ticks,s=t.offset,i=t.bandSize,o=t.entry,c=t.index;if(n.type==="category")return r[c]?r[c].coordinate+s:null;var d=tr(o,n.dataKey,n.domain[c]);return Ft(d)?null:n.scale(d)-i/2+s},ose=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var s=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return s<=0&&i>=0?0:i<0?i:s}return r[0]},lse=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Bn(Bn({},t.type.defaultProps),t.props):t.props,i=s.stackId;if(nr(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},cse=function(t){return t.reduce(function(n,r){return[tg(r.concat([n[0]]).filter(Qe)),eg(r.concat([n[1]]).filter(Qe))]},[1/0,-1/0])},T4=function(t,n,r){return Object.keys(t).reduce(function(s,i){var o=t[i],c=o.stackedData,d=c.reduce(function(f,h){var p=cse(h.slice(n,r+1));return[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],s[0]),Math.max(d[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},F2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,z2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,a1=function(t,n,r){if(Lt(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(Qe(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(F2.test(t[0])){var i=+F2.exec(t[0])[1];s[0]=n[0]-i}else Lt(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(Qe(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if(z2.test(t[1])){var o=+z2.exec(t[1])[1];s[1]=n[1]+o}else Lt(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},Cm=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!r||s>0)return s}if(t&&n&&n.length>=2){for(var i=lC(n,function(p){return p.coordinate}),o=1/0,c=1,d=i.length;c<d;c++){var f=i[c],h=i[c-1];o=Math.min((f.coordinate||0)-(h.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},B2=function(t,n,r){return!t||!t.length||Vf(t,ga(r,"type.defaultProps.domain"))?n:t},O4=function(t,n){var r=t.type.defaultProps?Bn(Bn({},t.type.defaultProps),t.props):t.props,s=r.dataKey,i=r.name,o=r.unit,c=r.formatter,d=r.tooltipType,f=r.chartType,h=r.hide;return Bn(Bn({},kt(t,!1)),{},{dataKey:s,unit:o,formatter:c,name:i||s,color:IC(t),value:tr(n,s),type:d,payload:n,chartType:f,hide:h})};function nf(e){"@babel/helpers - typeof";return nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nf(e)}function q2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ei(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q2(Object(n),!0).forEach(function(r){R4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function R4(e,t,n){return t=use(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function use(e){var t=dse(e,"string");return nf(t)=="symbol"?t:t+""}function dse(e,t){if(nf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fse(e,t){return vse(e)||mse(e,t)||hse(e,t)||pse()}function pse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
73
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hse(e,t){if(e){if(typeof e=="string")return U2(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 U2(e,t)}}function U2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mse(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function vse(e){if(Array.isArray(e))return e}var _m=Math.PI/180,gse=function(t){return t*180/Math.PI},En=function(t,n,r,s){return{x:t+Math.cos(-_m*s)*r,y:n+Math.sin(-_m*s)*r}},I4=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},xse=function(t,n,r,s,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=Tr(t.cx,o,o/2),p=Tr(t.cy,c,c/2),g=I4(o,c,r),x=Tr(t.innerRadius,g,0),j=Tr(t.outerRadius,g,g*.8),y=Object.keys(n);return y.reduce(function(b,N){var C=n[N],S=C.domain,E=C.reversed,A;if(Ft(C.range))s==="angleAxis"?A=[d,f]:s==="radiusAxis"&&(A=[x,j]),E&&(A=[A[1],A[0]]);else{A=C.range;var k=A,T=fse(k,2);d=T[0],f=T[1]}var O=E4(C,i),D=O.realScaleType,q=O.scale;q.domain(S).range(A),k4(q);var U=P4(q,ei(ei({},C),{},{realScaleType:D})),B=ei(ei(ei({},C),U),{},{range:A,radius:j,realScaleType:D,scale:q,cx:h,cy:p,innerRadius:x,outerRadius:j,startAngle:d,endAngle:f});return ei(ei({},b),{},R4({},N,B))},{})},yse=function(t,n){var r=t.x,s=t.y,i=n.x,o=n.y;return Math.sqrt(Math.pow(r-i,2)+Math.pow(s-o,2))},bse=function(t,n){var r=t.x,s=t.y,i=n.cx,o=n.cy,c=yse({x:r,y:s},{x:i,y:o});if(c<=0)return{radius:c};var d=(r-i)/c,f=Math.acos(d);return s>o&&(f=2*Math.PI-f),{radius:c,angle:gse(f),angleInRadian:f}},wse=function(t){var n=t.startAngle,r=t.endAngle,s=Math.floor(n/360),i=Math.floor(r/360),o=Math.min(s,i);return{startAngle:n-o*360,endAngle:r-o*360}},jse=function(t,n){var r=n.startAngle,s=n.endAngle,i=Math.floor(r/360),o=Math.floor(s/360),c=Math.min(i,o);return t+c*360},W2=function(t,n){var r=t.x,s=t.y,i=bse({x:r,y:s},n),o=i.radius,c=i.angle,d=n.innerRadius,f=n.outerRadius;if(o<d||o>f)return!1;if(o===0)return!0;var h=wse(n),p=h.startAngle,g=h.endAngle,x=c,j;if(p<=g){for(;x>g;)x-=360;for(;x<p;)x+=360;j=x>=p&&x<=g}else{for(;x>p;)x-=360;for(;x<g;)x+=360;j=x>=g&&x<=p}return j?ei(ei({},n),{},{radius:o,angle:jse(x,n)}):null},M4=function(t){return!m.isValidElement(t)&&!Lt(t)&&typeof t!="boolean"?t.className:""};function rf(e){"@babel/helpers - typeof";return rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rf(e)}var Sse=["offset"];function Nse(e){return Ese(e)||Ase(e)||_se(e)||Cse()}function Cse(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
74
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _se(e,t){if(e){if(typeof e=="string")return s1(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 s1(e,t)}}function Ase(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ese(e){if(Array.isArray(e))return s1(e)}function s1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kse(e,t){if(e==null)return{};var n=Pse(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pse(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 V2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function er(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V2(Object(n),!0).forEach(function(r){Tse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tse(e,t,n){return t=Ose(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ose(e){var t=Rse(e,"string");return rf(t)=="symbol"?t:t+""}function Rse(e,t){if(rf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function af(){return af=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},af.apply(this,arguments)}var Ise=function(t){var n=t.value,r=t.formatter,s=Ft(t.children)?n:t.children;return Lt(r)?r(s):s},Mse=function(t,n){var r=Pr(n-t),s=Math.min(Math.abs(n-t),360);return r*s},$se=function(t,n,r){var s=t.position,i=t.viewBox,o=t.offset,c=t.className,d=i,f=d.cx,h=d.cy,p=d.innerRadius,g=d.outerRadius,x=d.startAngle,j=d.endAngle,y=d.clockWise,b=(p+g)/2,N=Mse(x,j),C=N>=0?1:-1,S,E;s==="insideStart"?(S=x+C*o,E=y):s==="insideEnd"?(S=j-C*o,E=!y):s==="end"&&(S=j+C*o,E=y),E=N<=0?E:!E;var A=En(f,h,b,S),k=En(f,h,b,S+(E?1:-1)*359),T="M".concat(A.x,",").concat(A.y,`
|
|
75
|
-
A`).concat(b,",").concat(b,",0,1,").concat(E?0:1,`,
|
|
76
|
-
`).concat(k.x,",").concat(k.y),O=Ft(t.id)?yu("recharts-radial-line-"):t.id;return Y.createElement("text",af({},r,{dominantBaseline:"central",className:Bt("recharts-radial-bar-label",c)}),Y.createElement("defs",null,Y.createElement("path",{id:O,d:T})),Y.createElement("textPath",{xlinkHref:"#".concat(O)},n))},Dse=function(t){var n=t.viewBox,r=t.offset,s=t.position,i=n,o=i.cx,c=i.cy,d=i.innerRadius,f=i.outerRadius,h=i.startAngle,p=i.endAngle,g=(h+p)/2;if(s==="outside"){var x=En(o,c,f+r,g),j=x.x,y=x.y;return{x:j,y,textAnchor:j>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var b=(d+f)/2,N=En(o,c,b,g),C=N.x,S=N.y;return{x:C,y:S,textAnchor:"middle",verticalAnchor:"middle"}},Lse=function(t){var n=t.viewBox,r=t.parentViewBox,s=t.offset,i=t.position,o=n,c=o.x,d=o.y,f=o.width,h=o.height,p=h>=0?1:-1,g=p*s,x=p>0?"end":"start",j=p>0?"start":"end",y=f>=0?1:-1,b=y*s,N=y>0?"end":"start",C=y>0?"start":"end";if(i==="top"){var S={x:c+f/2,y:d-p*s,textAnchor:"middle",verticalAnchor:x};return er(er({},S),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var E={x:c+f/2,y:d+h+g,textAnchor:"middle",verticalAnchor:j};return er(er({},E),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(i==="left"){var A={x:c-b,y:d+h/2,textAnchor:N,verticalAnchor:"middle"};return er(er({},A),r?{width:Math.max(A.x-r.x,0),height:h}:{})}if(i==="right"){var k={x:c+f+b,y:d+h/2,textAnchor:C,verticalAnchor:"middle"};return er(er({},k),r?{width:Math.max(r.x+r.width-k.x,0),height:h}:{})}var T=r?{width:f,height:h}:{};return i==="insideLeft"?er({x:c+b,y:d+h/2,textAnchor:C,verticalAnchor:"middle"},T):i==="insideRight"?er({x:c+f-b,y:d+h/2,textAnchor:N,verticalAnchor:"middle"},T):i==="insideTop"?er({x:c+f/2,y:d+g,textAnchor:"middle",verticalAnchor:j},T):i==="insideBottom"?er({x:c+f/2,y:d+h-g,textAnchor:"middle",verticalAnchor:x},T):i==="insideTopLeft"?er({x:c+b,y:d+g,textAnchor:C,verticalAnchor:j},T):i==="insideTopRight"?er({x:c+f-b,y:d+g,textAnchor:N,verticalAnchor:j},T):i==="insideBottomLeft"?er({x:c+b,y:d+h-g,textAnchor:C,verticalAnchor:x},T):i==="insideBottomRight"?er({x:c+f-b,y:d+h-g,textAnchor:N,verticalAnchor:x},T):xu(i)&&(Qe(i.x)||Vo(i.x))&&(Qe(i.y)||Vo(i.y))?er({x:c+Tr(i.x,f),y:d+Tr(i.y,h),textAnchor:"end",verticalAnchor:"end"},T):er({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},T)},Fse=function(t){return"cx"in t&&Qe(t.cx)};function fr(e){var t=e.offset,n=t===void 0?5:t,r=kse(e,Sse),s=er({offset:n},r),i=s.viewBox,o=s.position,c=s.value,d=s.children,f=s.content,h=s.className,p=h===void 0?"":h,g=s.textBreakAll;if(!i||Ft(c)&&Ft(d)&&!m.isValidElement(f)&&!Lt(f))return null;if(m.isValidElement(f))return m.cloneElement(f,s);var x;if(Lt(f)){if(x=m.createElement(f,s),m.isValidElement(x))return x}else x=Ise(s);var j=Fse(i),y=kt(s,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return $se(s,x,y);var b=j?Dse(s):Lse(s);return Y.createElement(ol,af({className:Bt("recharts-label",p)},y,b,{breakAll:g}),x)}fr.displayName="Label";var $4=function(t){var n=t.cx,r=t.cy,s=t.angle,i=t.startAngle,o=t.endAngle,c=t.r,d=t.radius,f=t.innerRadius,h=t.outerRadius,p=t.x,g=t.y,x=t.top,j=t.left,y=t.width,b=t.height,N=t.clockWise,C=t.labelViewBox;if(C)return C;if(Qe(y)&&Qe(b)){if(Qe(p)&&Qe(g))return{x:p,y:g,width:y,height:b};if(Qe(x)&&Qe(j))return{x,y:j,width:y,height:b}}return Qe(p)&&Qe(g)?{x:p,y:g,width:0,height:0}:Qe(n)&&Qe(r)?{cx:n,cy:r,startAngle:i||s||0,endAngle:o||s||0,innerRadius:f||0,outerRadius:h||d||c||0,clockWise:N}:t.viewBox?t.viewBox:{}},zse=function(t,n){return t?t===!0?Y.createElement(fr,{key:"label-implicit",viewBox:n}):nr(t)?Y.createElement(fr,{key:"label-implicit",viewBox:n,value:t}):m.isValidElement(t)?t.type===fr?m.cloneElement(t,{key:"label-implicit",viewBox:n}):Y.createElement(fr,{key:"label-implicit",content:t,viewBox:n}):Lt(t)?Y.createElement(fr,{key:"label-implicit",content:t,viewBox:n}):xu(t)?Y.createElement(fr,af({viewBox:n},t,{key:"label-implicit"})):null:null},Bse=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var s=t.children,i=$4(t),o=xa(s,fr).map(function(d,f){return m.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=zse(t.label,n||i);return[c].concat(Nse(o))};fr.parseViewBox=$4;fr.renderCallByParent=Bse;var lj,H2;function qse(){if(H2)return lj;H2=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return lj=e,lj}var Use=qse();const Wse=hn(Use);function sf(e){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sf(e)}var Vse=["valueAccessor"],Hse=["data","dataKey","clockWise","id","textBreakAll"];function Kse(e){return Qse(e)||Xse(e)||Yse(e)||Gse()}function Gse(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
77
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yse(e,t){if(e){if(typeof e=="string")return i1(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 i1(e,t)}}function Xse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qse(e){if(Array.isArray(e))return i1(e)}function i1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Am(){return Am=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},Am.apply(this,arguments)}function K2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function G2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K2(Object(n),!0).forEach(function(r){Jse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jse(e,t,n){return t=Zse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zse(e){var t=eie(e,"string");return sf(t)=="symbol"?t:t+""}function eie(e,t){if(sf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y2(e,t){if(e==null)return{};var n=tie(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tie(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 nie=function(t){return Array.isArray(t.value)?Wse(t.value):t.value};function ui(e){var t=e.valueAccessor,n=t===void 0?nie:t,r=Y2(e,Vse),s=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=Y2(r,Hse);return!s||!s.length?null:Y.createElement(sn,{className:"recharts-label-list"},s.map(function(h,p){var g=Ft(i)?n(h,p):tr(h&&h.payload,i),x=Ft(c)?{}:{id:"".concat(c,"-").concat(p)};return Y.createElement(fr,Am({},kt(h,!0),f,x,{parentViewBox:h.parentViewBox,value:g,textBreakAll:d,viewBox:fr.parseViewBox(Ft(o)?h:G2(G2({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}ui.displayName="LabelList";function rie(e,t){return e?e===!0?Y.createElement(ui,{key:"labelList-implicit",data:t}):Y.isValidElement(e)||Lt(e)?Y.createElement(ui,{key:"labelList-implicit",data:t,content:e}):xu(e)?Y.createElement(ui,Am({data:t},e,{key:"labelList-implicit"})):null:null}function aie(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,s=xa(r,ui).map(function(o,c){return m.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return s;var i=rie(e.label,t);return[i].concat(Kse(s))}ui.renderCallByParent=aie;function of(e){"@babel/helpers - typeof";return of=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},of(e)}function o1(){return o1=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},o1.apply(this,arguments)}function X2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Q2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?X2(Object(n),!0).forEach(function(r){sie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sie(e,t,n){return t=iie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iie(e){var t=oie(e,"string");return of(t)=="symbol"?t:t+""}function oie(e,t){if(of(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(of(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lie=function(t,n){var r=Pr(n-t),s=Math.min(Math.abs(n-t),359.999);return r*s},Ch=function(t){var n=t.cx,r=t.cy,s=t.radius,i=t.angle,o=t.sign,c=t.isExternal,d=t.cornerRadius,f=t.cornerIsExternal,h=d*(c?1:-1)+s,p=Math.asin(d/h)/_m,g=f?i:i+o*p,x=En(n,r,h,g),j=En(n,r,s,g),y=f?i-o*p:i,b=En(n,r,h*Math.cos(p*_m),y);return{center:x,circleTangency:j,lineTangency:b,theta:p}},D4=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=lie(o,c),f=o+d,h=En(n,r,i,o),p=En(n,r,i,f),g="M ".concat(h.x,",").concat(h.y,`
|
|
78
|
-
A `).concat(i,",").concat(i,`,0,
|
|
79
|
-
`).concat(+(Math.abs(d)>180),",").concat(+(o>f),`,
|
|
80
|
-
`).concat(p.x,",").concat(p.y,`
|
|
81
|
-
`);if(s>0){var x=En(n,r,s,o),j=En(n,r,s,f);g+="L ".concat(j.x,",").concat(j.y,`
|
|
82
|
-
A `).concat(s,",").concat(s,`,0,
|
|
83
|
-
`).concat(+(Math.abs(d)>180),",").concat(+(o<=f),`,
|
|
84
|
-
`).concat(x.x,",").concat(x.y," Z")}else g+="L ".concat(n,",").concat(r," Z");return g},cie=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,c=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,h=t.endAngle,p=Pr(h-f),g=Ch({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),x=g.circleTangency,j=g.lineTangency,y=g.theta,b=Ch({cx:n,cy:r,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),N=b.circleTangency,C=b.lineTangency,S=b.theta,E=d?Math.abs(f-h):Math.abs(f-h)-y-S;if(E<0)return c?"M ".concat(j.x,",").concat(j.y,`
|
|
85
|
-
a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
|
|
86
|
-
a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
|
|
87
|
-
`):D4({cx:n,cy:r,innerRadius:s,outerRadius:i,startAngle:f,endAngle:h});var A="M ".concat(j.x,",").concat(j.y,`
|
|
88
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(x.x,",").concat(x.y,`
|
|
89
|
-
A`).concat(i,",").concat(i,",0,").concat(+(E>180),",").concat(+(p<0),",").concat(N.x,",").concat(N.y,`
|
|
90
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(C.x,",").concat(C.y,`
|
|
91
|
-
`);if(s>0){var k=Ch({cx:n,cy:r,radius:s,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),T=k.circleTangency,O=k.lineTangency,D=k.theta,q=Ch({cx:n,cy:r,radius:s,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),U=q.circleTangency,B=q.lineTangency,X=q.theta,W=d?Math.abs(f-h):Math.abs(f-h)-D-X;if(W<0&&o===0)return"".concat(A,"L").concat(n,",").concat(r,"Z");A+="L".concat(B.x,",").concat(B.y,`
|
|
92
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(U.x,",").concat(U.y,`
|
|
93
|
-
A`).concat(s,",").concat(s,",0,").concat(+(W>180),",").concat(+(p>0),",").concat(T.x,",").concat(T.y,`
|
|
94
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(O.x,",").concat(O.y,"Z")}else A+="L".concat(n,",").concat(r,"Z");return A},uie={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},L4=function(t){var n=Q2(Q2({},uie),t),r=n.cx,s=n.cy,i=n.innerRadius,o=n.outerRadius,c=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,h=n.startAngle,p=n.endAngle,g=n.className;if(o<i||h===p)return null;var x=Bt("recharts-sector",g),j=o-i,y=Tr(c,j,0,!0),b;return y>0&&Math.abs(h-p)<360?b=cie({cx:r,cy:s,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):b=D4({cx:r,cy:s,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),Y.createElement("path",o1({},kt(n,!0),{className:x,d:b,role:"img"}))};function lf(e){"@babel/helpers - typeof";return lf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lf(e)}function l1(){return l1=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},l1.apply(this,arguments)}function J2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Z2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J2(Object(n),!0).forEach(function(r){die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function die(e,t,n){return t=fie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fie(e){var t=pie(e,"string");return lf(t)=="symbol"?t:t+""}function pie(e,t){if(lf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eI={curveBasisClosed:RQ,curveBasisOpen:IQ,curveBasis:OQ,curveBumpX:xQ,curveBumpY:yQ,curveLinearClosed:MQ,curveLinear:Bv,curveMonotoneX:$Q,curveMonotoneY:DQ,curveNatural:LQ,curveStep:FQ,curveStepAfter:BQ,curveStepBefore:zQ},_h=function(t){return t.x===+t.x&&t.y===+t.y},hd=function(t){return t.x},md=function(t){return t.y},hie=function(t,n){if(Lt(t))return t;var r="curve".concat(Fv(t));return(r==="curveMonotone"||r==="curveBump")&&n?eI["".concat(r).concat(n==="vertical"?"Y":"X")]:eI[r]||Bv},mie=function(t){var n=t.type,r=n===void 0?"linear":n,s=t.points,i=s===void 0?[]:s,o=t.baseLine,c=t.layout,d=t.connectNulls,f=d===void 0?!1:d,h=hie(r,c),p=f?i.filter(function(y){return _h(y)}):i,g;if(Array.isArray(o)){var x=f?o.filter(function(y){return _h(y)}):o,j=p.map(function(y,b){return Z2(Z2({},y),{},{base:x[b]})});return c==="vertical"?g=gh().y(md).x1(hd).x0(function(y){return y.base.x}):g=gh().x(hd).y1(md).y0(function(y){return y.base.y}),g.defined(_h).curve(h),g(j)}return c==="vertical"&&Qe(o)?g=gh().y(md).x1(hd).x0(o):Qe(o)?g=gh().x(hd).y1(md).y0(o):g=L3().x(hd).y(md),g.defined(_h).curve(h),g(p)},Em=function(t){var n=t.className,r=t.points,s=t.path,i=t.pathRef;if((!r||!r.length)&&!s)return null;var o=r&&r.length?mie(t):s;return m.createElement("path",l1({},kt(t,!1),Zh(t),{className:Bt("recharts-curve",n),d:o,ref:i}))},cj={exports:{}},uj,tI;function vie(){if(tI)return uj;tI=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return uj=e,uj}var dj,nI;function gie(){if(nI)return dj;nI=1;var e=vie();function t(){}function n(){}return n.resetWarningCache=t,dj=function(){function r(o,c,d,f,h,p){if(p!==e){var g=new 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 g.name="Invariant Violation",g}}r.isRequired=r;function s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},dj}var rI;function xie(){return rI||(rI=1,cj.exports=gie()()),cj.exports}var yie=xie();const un=hn(yie),{getOwnPropertyNames:bie,getOwnPropertySymbols:wie}=Object,{hasOwnProperty:jie}=Object.prototype;function fj(e,t){return function(r,s,i){return e(r,s,i)&&t(r,s,i)}}function Ah(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);const{cache:i}=s,o=i.get(n),c=i.get(r);if(o&&c)return o===r&&c===n;i.set(n,r),i.set(r,n);const d=e(n,r,s);return i.delete(n),i.delete(r),d}}function Sie(e){return e?.[Symbol.toStringTag]}function aI(e){return bie(e).concat(wie(e))}const Nie=Object.hasOwn||((e,t)=>jie.call(e,t));function kl(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Cie="__v",_ie="__o",Aie="_owner",{getOwnPropertyDescriptor:sI,keys:iI}=Object;function Eie(e,t){return e.byteLength===t.byteLength&&km(new Uint8Array(e),new Uint8Array(t))}function kie(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 Pie(e,t){return e.byteLength===t.byteLength&&km(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Tie(e,t){return kl(e.getTime(),t.getTime())}function Oie(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Rie(e,t){return e===t}function oI(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=new Array(r),i=e.entries();let o,c,d=0;for(;(o=i.next())&&!o.done;){const f=t.entries();let h=!1,p=0;for(;(c=f.next())&&!c.done;){if(s[p]){p++;continue}const g=o.value,x=c.value;if(n.equals(g[0],x[0],d,p,e,t,n)&&n.equals(g[1],x[1],g[0],x[0],e,t,n)){h=s[p]=!0;break}p++}if(!h)return!1;d++}return!0}const Iie=kl;function Mie(e,t,n){const r=iI(e);let s=r.length;if(iI(t).length!==s)return!1;for(;s-- >0;)if(!F4(e,t,n,r[s]))return!1;return!0}function vd(e,t,n){const r=aI(e);let s=r.length;if(aI(t).length!==s)return!1;let i,o,c;for(;s-- >0;)if(i=r[s],!F4(e,t,n,i)||(o=sI(e,i),c=sI(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function $ie(e,t){return kl(e.valueOf(),t.valueOf())}function Die(e,t){return e.source===t.source&&e.flags===t.flags}function lI(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=new Array(r),i=e.values();let o,c;for(;(o=i.next())&&!o.done;){const d=t.values();let f=!1,h=0;for(;(c=d.next())&&!c.done;){if(!s[h]&&n.equals(o.value,c.value,o.value,c.value,e,t,n)){f=s[h]=!0;break}h++}if(!f)return!1}return!0}function km(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 Lie(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 F4(e,t,n,r){return(r===Aie||r===_ie||r===Cie)&&(e.$$typeof||t.$$typeof)?!0:Nie(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Fie="[object ArrayBuffer]",zie="[object Arguments]",Bie="[object Boolean]",qie="[object DataView]",Uie="[object Date]",Wie="[object Error]",Vie="[object Map]",Hie="[object Number]",Kie="[object Object]",Gie="[object RegExp]",Yie="[object Set]",Xie="[object String]",Qie={"[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},Jie="[object URL]",Zie=Object.prototype.toString;function eoe({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:f,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:g,areUrlsEqual:x,unknownTagComparators:j}){return function(b,N,C){if(b===N)return!0;if(b==null||N==null)return!1;const S=typeof b;if(S!==typeof N)return!1;if(S!=="object")return S==="number"?c(b,N,C):S==="function"?i(b,N,C):!1;const E=b.constructor;if(E!==N.constructor)return!1;if(E===Object)return d(b,N,C);if(Array.isArray(b))return t(b,N,C);if(E===Date)return r(b,N,C);if(E===RegExp)return h(b,N,C);if(E===Map)return o(b,N,C);if(E===Set)return p(b,N,C);const A=Zie.call(b);if(A===Uie)return r(b,N,C);if(A===Gie)return h(b,N,C);if(A===Vie)return o(b,N,C);if(A===Yie)return p(b,N,C);if(A===Kie)return typeof b.then!="function"&&typeof N.then!="function"&&d(b,N,C);if(A===Jie)return x(b,N,C);if(A===Wie)return s(b,N,C);if(A===zie)return d(b,N,C);if(Qie[A])return g(b,N,C);if(A===Fie)return e(b,N,C);if(A===qie)return n(b,N,C);if(A===Bie||A===Hie||A===Xie)return f(b,N,C);if(j){let k=j[A];if(!k){const T=Sie(b);T&&(k=j[T])}if(k)return k(b,N,C)}return!1}}function toe({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Eie,areArraysEqual:n?vd:kie,areDataViewsEqual:Pie,areDatesEqual:Tie,areErrorsEqual:Oie,areFunctionsEqual:Rie,areMapsEqual:n?fj(oI,vd):oI,areNumbersEqual:Iie,areObjectsEqual:n?vd:Mie,arePrimitiveWrappersEqual:$ie,areRegExpsEqual:Die,areSetsEqual:n?fj(lI,vd):lI,areTypedArraysEqual:n?fj(km,vd):km,areUrlsEqual:Lie,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const s=Ah(r.areArraysEqual),i=Ah(r.areMapsEqual),o=Ah(r.areObjectsEqual),c=Ah(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function noe(e){return function(t,n,r,s,i,o,c){return e(t,n,c)}}function roe({circular:e,comparator:t,createState:n,equals:r,strict:s}){if(n)return function(c,d){const{cache:f=e?new WeakMap:void 0,meta:h}=n();return t(c,d,{cache:f,equals:r,meta:h,strict:s})};if(e)return function(c,d){return t(c,d,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(c,d){return t(c,d,i)}}const aoe=go();go({strict:!0});go({circular:!0});go({circular:!0,strict:!0});go({createInternalComparator:()=>kl});go({strict:!0,createInternalComparator:()=>kl});go({circular:!0,createInternalComparator:()=>kl});go({circular:!0,createInternalComparator:()=>kl,strict:!0});function go(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:s=!1}=e,i=toe(e),o=eoe(i),c=n?n(o):noe(o);return roe({circular:t,comparator:o,createState:r,equals:c,strict:s})}function soe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function cI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function s(i){n<0&&(n=i),i-n>t?(e(i),n=-1):soe(s)};requestAnimationFrame(r)}function c1(e){"@babel/helpers - typeof";return c1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c1(e)}function ioe(e){return uoe(e)||coe(e)||loe(e)||ooe()}function ooe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
95
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function loe(e,t){if(e){if(typeof e=="string")return uI(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 uI(e,t)}}function uI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function coe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uoe(e){if(Array.isArray(e))return e}function doe(){var e={},t=function(){return null},n=!1,r=function s(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var o=i,c=ioe(o),d=c[0],f=c.slice(1);if(typeof d=="number"){cI(s.bind(null,f),d);return}s(d),cI(s.bind(null,f));return}c1(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){n=!0},start:function(i){n=!1,r(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function cf(e){"@babel/helpers - typeof";return cf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cf(e)}function dI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function fI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dI(Object(n),!0).forEach(function(r){z4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function z4(e,t,n){return t=foe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function foe(e){var t=poe(e,"string");return cf(t)==="symbol"?t:String(t)}function poe(e,t){if(cf(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cf(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hoe=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,s){return r.filter(function(i){return s.includes(i)})})},moe=function(t){return t},voe=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Pd=function(t,n){return Object.keys(n).reduce(function(r,s){return fI(fI({},r),{},z4({},s,t(s,n[s])))},{})},pI=function(t,n,r){return t.map(function(s){return"".concat(voe(s)," ").concat(n,"ms ").concat(r)}).join(",")};function goe(e,t){return boe(e)||yoe(e,t)||B4(e,t)||xoe()}function xoe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
96
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yoe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function boe(e){if(Array.isArray(e))return e}function woe(e){return Noe(e)||Soe(e)||B4(e)||joe()}function joe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
97
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B4(e,t){if(e){if(typeof e=="string")return u1(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 u1(e,t)}}function Soe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Noe(e){if(Array.isArray(e))return u1(e)}function u1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Pm=1e-4,q4=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},U4=function(t,n){return t.map(function(r,s){return r*Math.pow(n,s)}).reduce(function(r,s){return r+s})},hI=function(t,n){return function(r){var s=q4(t,n);return U4(s,r)}},Coe=function(t,n){return function(r){var s=q4(t,n),i=[].concat(woe(s.map(function(o,c){return o*c}).slice(1)),[0]);return U4(i,r)}},mI=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0],i=n[1],o=n[2],c=n[3];if(n.length===1)switch(n[0]){case"linear":s=0,i=0,o=1,c=1;break;case"ease":s=.25,i=.1,o=.25,c=1;break;case"ease-in":s=.42,i=0,o=1,c=1;break;case"ease-out":s=.42,i=0,o=.58,c=1;break;case"ease-in-out":s=0,i=0,o=.58,c=1;break;default:{var d=n[0].split("(");if(d[0]==="cubic-bezier"&&d[1].split(")")[0].split(",").length===4){var f=d[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),h=goe(f,4);s=h[0],i=h[1],o=h[2],c=h[3]}}}var p=hI(s,o),g=hI(i,c),x=Coe(s,o),j=function(N){return N>1?1:N<0?0:N},y=function(N){for(var C=N>1?1:N,S=C,E=0;E<8;++E){var A=p(S)-C,k=x(S);if(Math.abs(A-C)<Pm||k<Pm)return g(S);S=j(S-A/k)}return g(S)};return y.isStepper=!1,y},_oe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,s=t.damping,i=s===void 0?8:s,o=t.dt,c=o===void 0?17:o,d=function(h,p,g){var x=-(h-p)*r,j=g*i,y=g+(x-j)*c/1e3,b=g*c/1e3+h;return Math.abs(b-p)<Pm&&Math.abs(y)<Pm?[p,0]:[b,y]};return d.isStepper=!0,d.dt=c,d},Aoe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0];if(typeof s=="string")switch(s){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return mI(s);case"spring":return _oe();default:if(s.split("(")[0]==="cubic-bezier")return mI(s)}return typeof s=="function"?s:null};function uf(e){"@babel/helpers - typeof";return uf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uf(e)}function vI(e){return Poe(e)||koe(e)||W4(e)||Eoe()}function Eoe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
98
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function koe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Poe(e){if(Array.isArray(e))return f1(e)}function gI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function vr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gI(Object(n),!0).forEach(function(r){d1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function d1(e,t,n){return t=Toe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Toe(e){var t=Ooe(e,"string");return uf(t)==="symbol"?t:String(t)}function Ooe(e,t){if(uf(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uf(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Roe(e,t){return $oe(e)||Moe(e,t)||W4(e,t)||Ioe()}function Ioe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
99
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W4(e,t){if(e){if(typeof e=="string")return f1(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 f1(e,t)}}function f1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Moe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function $oe(e){if(Array.isArray(e))return e}var Tm=function(t,n,r){return t+(n-t)*r},p1=function(t){var n=t.from,r=t.to;return n!==r},Doe=function e(t,n,r){var s=Pd(function(i,o){if(p1(o)){var c=t(o.from,o.to,o.velocity),d=Roe(c,2),f=d[0],h=d[1];return vr(vr({},o),{},{from:f,velocity:h})}return o},n);return r<1?Pd(function(i,o){return p1(o)?vr(vr({},o),{},{velocity:Tm(o.velocity,s[i].velocity,r),from:Tm(o.from,s[i].from,r)}):o},n):e(t,s,r-1)};const Loe=(function(e,t,n,r,s){var i=hoe(e,t),o=i.reduce(function(b,N){return vr(vr({},b),{},d1({},N,[e[N],t[N]]))},{}),c=i.reduce(function(b,N){return vr(vr({},b),{},d1({},N,{from:e[N],velocity:0,to:t[N]}))},{}),d=-1,f,h,p=function(){return null},g=function(){return Pd(function(N,C){return C.from},c)},x=function(){return!Object.values(c).filter(p1).length},j=function(N){f||(f=N);var C=N-f,S=C/n.dt;c=Doe(n,c,S),s(vr(vr(vr({},e),t),g())),f=N,x()||(d=requestAnimationFrame(p))},y=function(N){h||(h=N);var C=(N-h)/r,S=Pd(function(A,k){return Tm.apply(void 0,vI(k).concat([n(C)]))},o);if(s(vr(vr(vr({},e),t),S)),C<1)d=requestAnimationFrame(p);else{var E=Pd(function(A,k){return Tm.apply(void 0,vI(k).concat([n(1)]))},o);s(vr(vr(vr({},e),t),E))}};return p=n.isStepper?j:y,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function Vc(e){"@babel/helpers - typeof";return Vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vc(e)}var Foe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function zoe(e,t){if(e==null)return{};var n=Boe(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Boe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function pj(e){return Voe(e)||Woe(e)||Uoe(e)||qoe()}function qoe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
100
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uoe(e,t){if(e){if(typeof e=="string")return h1(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 h1(e,t)}}function Woe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Voe(e){if(Array.isArray(e))return h1(e)}function h1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ga(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xI(Object(n),!0).forEach(function(r){jd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jd(e,t,n){return t=V4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hoe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Koe(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,V4(r.key),r)}}function Goe(e,t,n){return t&&Koe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function V4(e){var t=Yoe(e,"string");return Vc(t)==="symbol"?t:String(t)}function Yoe(e,t){if(Vc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xoe(e,t){if(typeof t!="function"&&t!==null)throw new 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&&m1(e,t)}function m1(e,t){return m1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},m1(e,t)}function Qoe(e){var t=Joe();return function(){var r=Om(e),s;if(t){var i=Om(this).constructor;s=Reflect.construct(r,arguments,i)}else s=r.apply(this,arguments);return v1(this,s)}}function v1(e,t){if(t&&(Vc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return g1(e)}function g1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Joe(){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 Om(e){return Om=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Om(e)}var Rs=(function(e){Xoe(n,e);var t=Qoe(n);function n(r,s){var i;Hoe(this,n),i=t.call(this,r,s);var o=i.props,c=o.isActive,d=o.attributeName,f=o.from,h=o.to,p=o.steps,g=o.children,x=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(g1(i)),i.changeStyle=i.changeStyle.bind(g1(i)),!c||x<=0)return i.state={style:{}},typeof g=="function"&&(i.state={style:h}),v1(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof g=="function")return i.state={style:f},v1(i);i.state={style:d?jd({},d,f):f}}else i.state={style:{}};return i}return Goe(n,[{key:"componentDidMount",value:function(){var s=this.props,i=s.isActive,o=s.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var i=this.props,o=i.isActive,c=i.canBegin,d=i.attributeName,f=i.shouldReAnimate,h=i.to,p=i.from,g=this.state.style;if(c){if(!o){var x={style:d?jd({},d,h):h};this.state&&g&&(d&&g[d]!==h||!d&&g!==h)&&this.setState(x);return}if(!(aoe(s.to,h)&&s.canBegin&&s.isActive)){var j=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=j||f?p:s.to;if(this.state&&g){var b={style:d?jd({},d,y):y};(d&&g[d]!==y||!d&&g!==y)&&this.setState(b)}this.runAnimation(Ga(Ga({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var i=this,o=s.from,c=s.to,d=s.duration,f=s.easing,h=s.begin,p=s.onAnimationEnd,g=s.onAnimationStart,x=Loe(o,c,Aoe(f),d,this.changeStyle),j=function(){i.stopJSAnimation=x()};this.manager.start([g,h,j,d,p])}},{key:"runStepAnimation",value:function(s){var i=this,o=s.steps,c=s.begin,d=s.onAnimationStart,f=o[0],h=f.style,p=f.duration,g=p===void 0?0:p,x=function(y,b,N){if(N===0)return y;var C=b.duration,S=b.easing,E=S===void 0?"ease":S,A=b.style,k=b.properties,T=b.onAnimationEnd,O=N>0?o[N-1]:b,D=k||Object.keys(A);if(typeof E=="function"||E==="spring")return[].concat(pj(y),[i.runJSAnimation.bind(i,{from:O.style,to:A,duration:C,easing:E}),C]);var q=pI(D,C,E),U=Ga(Ga(Ga({},O.style),A),{},{transition:q});return[].concat(pj(y),[U,C,T]).filter(moe)};return this.manager.start([d].concat(pj(o.reduce(x,[h,Math.max(g,c)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=doe());var i=s.begin,o=s.duration,c=s.attributeName,d=s.to,f=s.easing,h=s.onAnimationStart,p=s.onAnimationEnd,g=s.steps,x=s.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof x=="function"||f==="spring"){this.runJSAnimation(s);return}if(g.length>1){this.runStepAnimation(s);return}var y=c?jd({},c,d):d,b=pI(Object.keys(y),o,f);j.start([h,i,Ga(Ga({},y),{},{transition:b}),o,p])}},{key:"render",value:function(){var s=this.props,i=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var c=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var d=zoe(s,Foe),f=m.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!c||f===0||o<=0)return i;var p=function(x){var j=x.props,y=j.style,b=y===void 0?{}:y,N=j.className,C=m.cloneElement(x,Ga(Ga({},d),{},{style:Ga(Ga({},b),h),className:N}));return C};return f===1?p(m.Children.only(i)):Y.createElement("div",null,m.Children.map(i,function(g){return p(g)}))}}]),n})(m.PureComponent);Rs.displayName="Animate";Rs.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Rs.propTypes={from:un.oneOfType([un.object,un.string]),to:un.oneOfType([un.object,un.string]),attributeName:un.string,duration:un.number,begin:un.number,easing:un.oneOfType([un.string,un.func]),steps:un.arrayOf(un.shape({duration:un.number.isRequired,style:un.object.isRequired,easing:un.oneOfType([un.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),un.func]),properties:un.arrayOf("string"),onAnimationEnd:un.func})),children:un.oneOfType([un.node,un.func]),isActive:un.bool,canBegin:un.bool,onAnimationEnd:un.func,shouldReAnimate:un.bool,onAnimationStart:un.func,onAnimationReStart:un.func};function df(e){"@babel/helpers - typeof";return df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},df(e)}function Rm(){return Rm=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},Rm.apply(this,arguments)}function Zoe(e,t){return rle(e)||nle(e,t)||tle(e,t)||ele()}function ele(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
101
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tle(e,t){if(e){if(typeof e=="string")return yI(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 yI(e,t)}}function yI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function rle(e){if(Array.isArray(e))return e}function bI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function wI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bI(Object(n),!0).forEach(function(r){ale(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ale(e,t,n){return t=sle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sle(e){var t=ile(e,"string");return df(t)=="symbol"?t:t+""}function ile(e,t){if(df(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(df(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jI=function(t,n,r,s,i){var o=Math.min(Math.abs(r)/2,Math.abs(s)/2),c=s>=0?1:-1,d=r>=0?1:-1,f=s>=0&&r>=0||s<0&&r<0?1:0,h;if(o>0&&i instanceof Array){for(var p=[0,0,0,0],g=0,x=4;g<x;g++)p[g]=i[g]>o?o:i[g];h="M".concat(t,",").concat(n+c*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),h+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`,
|
|
102
|
-
`).concat(t+r,",").concat(n+c*p[1])),h+="L ".concat(t+r,",").concat(n+s-c*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(f,`,
|
|
103
|
-
`).concat(t+r-d*p[2],",").concat(n+s)),h+="L ".concat(t+d*p[3],",").concat(n+s),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`,
|
|
104
|
-
`).concat(t,",").concat(n+s-c*p[3])),h+="Z"}else if(o>0&&i===+i&&i>0){var j=Math.min(o,i);h="M ".concat(t,",").concat(n+c*j,`
|
|
105
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+d*j,",").concat(n,`
|
|
106
|
-
L `).concat(t+r-d*j,",").concat(n,`
|
|
107
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r,",").concat(n+c*j,`
|
|
108
|
-
L `).concat(t+r,",").concat(n+s-c*j,`
|
|
109
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+s,`
|
|
110
|
-
L `).concat(t+d*j,",").concat(n+s,`
|
|
111
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+s-c*j," Z")}else h="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(s," h ").concat(-r," Z");return h},ole=function(t,n){if(!t||!n)return!1;var r=t.x,s=t.y,i=n.x,o=n.y,c=n.width,d=n.height;if(Math.abs(c)>0&&Math.abs(d)>0){var f=Math.min(i,i+c),h=Math.max(i,i+c),p=Math.min(o,o+d),g=Math.max(o,o+d);return r>=f&&r<=h&&s>=p&&s<=g}return!1},lle={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},MC=function(t){var n=wI(wI({},lle),t),r=m.useRef(),s=m.useState(-1),i=Zoe(s,2),o=i[0],c=i[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var E=r.current.getTotalLength();E&&c(E)}catch{}},[]);var d=n.x,f=n.y,h=n.width,p=n.height,g=n.radius,x=n.className,j=n.animationEasing,y=n.animationDuration,b=n.animationBegin,N=n.isAnimationActive,C=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var S=Bt("recharts-rectangle",x);return C?Y.createElement(Rs,{canBegin:o>0,from:{width:h,height:p,x:d,y:f},to:{width:h,height:p,x:d,y:f},duration:y,animationEasing:j,isActive:C},function(E){var A=E.width,k=E.height,T=E.x,O=E.y;return Y.createElement(Rs,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:y,isActive:N,easing:j},Y.createElement("path",Rm({},kt(n,!0),{className:S,d:jI(T,O,A,k,g),ref:r})))}):Y.createElement("path",Rm({},kt(n,!0),{className:S,d:jI(d,f,h,p,g)}))},cle=["points","className","baseLinePoints","connectNulls"];function gc(){return gc=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},gc.apply(this,arguments)}function ule(e,t){if(e==null)return{};var n=dle(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dle(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 SI(e){return mle(e)||hle(e)||ple(e)||fle()}function fle(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
112
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ple(e,t){if(e){if(typeof e=="string")return x1(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 x1(e,t)}}function hle(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mle(e){if(Array.isArray(e))return x1(e)}function x1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var NI=function(t){return t&&t.x===+t.x&&t.y===+t.y},vle=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){NI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),NI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Td=function(t,n){var r=vle(t);n&&(r=[r.reduce(function(i,o){return[].concat(SI(i),SI(o))},[])]);var s=r.map(function(i){return i.reduce(function(o,c,d){return"".concat(o).concat(d===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(s,"Z"):s},gle=function(t,n,r){var s=Td(t,r);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(Td(n.reverse(),r).slice(1))},xle=function(t){var n=t.points,r=t.className,s=t.baseLinePoints,i=t.connectNulls,o=ule(t,cle);if(!n||!n.length)return null;var c=Bt("recharts-polygon",r);if(s&&s.length){var d=o.stroke&&o.stroke!=="none",f=gle(n,s,i);return Y.createElement("g",{className:c},Y.createElement("path",gc({},kt(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?Y.createElement("path",gc({},kt(o,!0),{fill:"none",d:Td(n,i)})):null,d?Y.createElement("path",gc({},kt(o,!0),{fill:"none",d:Td(s,i)})):null)}var h=Td(n,i);return Y.createElement("path",gc({},kt(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function y1(){return y1=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},y1.apply(this,arguments)}var ag=function(t){var n=t.cx,r=t.cy,s=t.r,i=t.className,o=Bt("recharts-dot",i);return n===+n&&r===+r&&s===+s?m.createElement("circle",y1({},kt(t,!1),Zh(t),{className:o,cx:n,cy:r,r:s})):null};function ff(e){"@babel/helpers - typeof";return ff=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ff(e)}var yle=["x","y","top","left","width","height","className"];function b1(){return b1=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},b1.apply(this,arguments)}function CI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ble(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CI(Object(n),!0).forEach(function(r){wle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wle(e,t,n){return t=jle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jle(e){var t=Sle(e,"string");return ff(t)=="symbol"?t:t+""}function Sle(e,t){if(ff(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ff(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nle(e,t){if(e==null)return{};var n=Cle(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cle(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 _le=function(t,n,r,s,i,o){return"M".concat(t,",").concat(i,"v").concat(s,"M").concat(o,",").concat(n,"h").concat(r)},Ale=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,i=s===void 0?0:s,o=t.top,c=o===void 0?0:o,d=t.left,f=d===void 0?0:d,h=t.width,p=h===void 0?0:h,g=t.height,x=g===void 0?0:g,j=t.className,y=Nle(t,yle),b=ble({x:r,y:i,top:c,left:f,width:p,height:x},y);return!Qe(r)||!Qe(i)||!Qe(p)||!Qe(x)||!Qe(c)||!Qe(f)?null:Y.createElement("path",b1({},kt(b,!0),{className:Bt("recharts-cross",j),d:_le(r,i,p,x,c,f)}))},hj,_I;function Ele(){if(_I)return hj;_I=1;var e=Zv(),t=o4(),n=Fs();function r(s,i){return s&&s.length?e(s,n(i,2),t):void 0}return hj=r,hj}var kle=Ele();const Ple=hn(kle);var mj,AI;function Tle(){if(AI)return mj;AI=1;var e=Zv(),t=Fs(),n=l4();function r(s,i){return s&&s.length?e(s,t(i,2),n):void 0}return mj=r,mj}var Ole=Tle();const Rle=hn(Ole);var Ile=["cx","cy","angle","ticks","axisLine"],Mle=["ticks","tick","angle","tickFormatter","stroke"];function Hc(e){"@babel/helpers - typeof";return Hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hc(e)}function Od(){return Od=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},Od.apply(this,arguments)}function EI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Do(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EI(Object(n),!0).forEach(function(r){sg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kI(e,t){if(e==null)return{};var n=$le(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $le(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 Dle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PI(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,K4(r.key),r)}}function Lle(e,t,n){return t&&PI(e.prototype,t),n&&PI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fle(e,t,n){return t=Im(t),zle(e,H4()?Reflect.construct(t,n||[],Im(e).constructor):t.apply(e,n))}function zle(e,t){if(t&&(Hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ble(e)}function Ble(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(H4=function(){return!!e})()}function Im(e){return Im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Im(e)}function qle(e,t){if(typeof t!="function"&&t!==null)throw new 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&&w1(e,t)}function w1(e,t){return w1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},w1(e,t)}function sg(e,t,n){return t=K4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K4(e){var t=Ule(e,"string");return Hc(t)=="symbol"?t:t+""}function Ule(e,t){if(Hc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ig=(function(e){function t(){return Dle(this,t),Fle(this,t,arguments)}return qle(t,e),Lle(t,[{key:"getTickValueCoord",value:function(r){var s=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return En(c,d,s,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,s;switch(r){case"left":s="end";break;case"right":s="start";break;default:s="middle";break}return s}},{key:"getViewBox",value:function(){var r=this.props,s=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=Ple(c,function(h){return h.coordinate||0}),f=Rle(c,function(h){return h.coordinate||0});return{cx:s,cy:i,startAngle:o,endAngle:o,innerRadius:f.coordinate||0,outerRadius:d.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=r.axisLine,f=kI(r,Ile),h=c.reduce(function(j,y){return[Math.min(j[0],y.coordinate),Math.max(j[1],y.coordinate)]},[1/0,-1/0]),p=En(s,i,h[0],o),g=En(s,i,h[1],o),x=Do(Do(Do({},kt(f,!1)),{},{fill:"none"},kt(d,!1)),{},{x1:p.x,y1:p.y,x2:g.x,y2:g.y});return Y.createElement("line",Od({className:"recharts-polar-radius-axis-line"},x))}},{key:"renderTicks",value:function(){var r=this,s=this.props,i=s.ticks,o=s.tick,c=s.angle,d=s.tickFormatter,f=s.stroke,h=kI(s,Mle),p=this.getTickTextAnchor(),g=kt(h,!1),x=kt(o,!1),j=i.map(function(y,b){var N=r.getTickValueCoord(y),C=Do(Do(Do(Do({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(N.x,", ").concat(N.y,")")},g),{},{stroke:"none",fill:f},x),{},{index:b},N),{},{payload:y});return Y.createElement(sn,Od({className:Bt("recharts-polar-radius-axis-tick",M4(o)),key:"tick-".concat(y.coordinate)},il(r.props,y,b)),t.renderTickItem(o,C,d?d(y.value,b):y.value))});return Y.createElement(sn,{className:"recharts-polar-radius-axis-ticks"},j)}},{key:"render",value:function(){var r=this.props,s=r.ticks,i=r.axisLine,o=r.tick;return!s||!s.length?null:Y.createElement(sn,{className:Bt("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),fr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,s,i){var o;return Y.isValidElement(r)?o=Y.cloneElement(r,s):Lt(r)?o=r(s):o=Y.createElement(ol,Od({},s,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(m.PureComponent);sg(ig,"displayName","PolarRadiusAxis");sg(ig,"axisType","radiusAxis");sg(ig,"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 Kc(e){"@babel/helpers - typeof";return Kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kc(e)}function Wo(){return Wo=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},Wo.apply(this,arguments)}function TI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Lo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TI(Object(n),!0).forEach(function(r){og(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OI(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,Y4(r.key),r)}}function Vle(e,t,n){return t&&OI(e.prototype,t),n&&OI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hle(e,t,n){return t=Mm(t),Kle(e,G4()?Reflect.construct(t,n||[],Mm(e).constructor):t.apply(e,n))}function Kle(e,t){if(t&&(Kc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gle(e)}function Gle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G4=function(){return!!e})()}function Mm(e){return Mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mm(e)}function Yle(e,t){if(typeof t!="function"&&t!==null)throw new 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&&j1(e,t)}function j1(e,t){return j1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},j1(e,t)}function og(e,t,n){return t=Y4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y4(e){var t=Xle(e,"string");return Kc(t)=="symbol"?t:t+""}function Xle(e,t){if(Kc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qle=Math.PI/180,RI=1e-5,lg=(function(e){function t(){return Wle(this,t),Hle(this,t,arguments)}return Yle(t,e),Vle(t,[{key:"getTickLineCoord",value:function(r){var s=this.props,i=s.cx,o=s.cy,c=s.radius,d=s.orientation,f=s.tickSize,h=f||8,p=En(i,o,c,r.coordinate),g=En(i,o,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:g.x,y2:g.y}}},{key:"getTickTextAnchor",value:function(r){var s=this.props.orientation,i=Math.cos(-r.coordinate*Qle),o;return i>RI?o=s==="outer"?"start":"end":i<-RI?o=s==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,i=r.cy,o=r.radius,c=r.axisLine,d=r.axisLineType,f=Lo(Lo({},kt(this.props,!1)),{},{fill:"none"},kt(c,!1));if(d==="circle")return Y.createElement(ag,Wo({className:"recharts-polar-angle-axis-line"},f,{cx:s,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(g){return En(s,i,o,g.coordinate)});return Y.createElement(xle,Wo({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,s=this.props,i=s.ticks,o=s.tick,c=s.tickLine,d=s.tickFormatter,f=s.stroke,h=kt(this.props,!1),p=kt(o,!1),g=Lo(Lo({},h),{},{fill:"none"},kt(c,!1)),x=i.map(function(j,y){var b=r.getTickLineCoord(j),N=r.getTickTextAnchor(j),C=Lo(Lo(Lo({textAnchor:N},h),{},{stroke:"none",fill:f},p),{},{index:y,payload:j,x:b.x2,y:b.y2});return Y.createElement(sn,Wo({className:Bt("recharts-polar-angle-axis-tick",M4(o)),key:"tick-".concat(j.coordinate)},il(r.props,j,y)),c&&Y.createElement("line",Wo({className:"recharts-polar-angle-axis-tick-line"},g,b)),o&&t.renderTickItem(o,C,d?d(j.value,y):j.value))});return Y.createElement(sn,{className:"recharts-polar-angle-axis-ticks"},x)}},{key:"render",value:function(){var r=this.props,s=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!s||!s.length?null:Y.createElement(sn,{className:Bt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,s,i){var o;return Y.isValidElement(r)?o=Y.cloneElement(r,s):Lt(r)?o=r(s):o=Y.createElement(ol,Wo({},s,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(m.PureComponent);og(lg,"displayName","PolarAngleAxis");og(lg,"axisType","angleAxis");og(lg,"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 vj,II;function Jle(){if(II)return vj;II=1;var e=oL(),t=e(Object.getPrototypeOf,Object);return vj=t,vj}var gj,MI;function Zle(){if(MI)return gj;MI=1;var e=ji(),t=Jle(),n=Si(),r="[object Object]",s=Function.prototype,i=Object.prototype,o=s.toString,c=i.hasOwnProperty,d=o.call(Object);function f(h){if(!n(h)||e(h)!=r)return!1;var p=t(h);if(p===null)return!0;var g=c.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&o.call(g)==d}return gj=f,gj}var ece=Zle();const tce=hn(ece);var xj,$I;function nce(){if($I)return xj;$I=1;var e=ji(),t=Si(),n="[object Boolean]";function r(s){return s===!0||s===!1||t(s)&&e(s)==n}return xj=r,xj}var rce=nce();const ace=hn(rce);function pf(e){"@babel/helpers - typeof";return pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pf(e)}function $m(){return $m=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},$m.apply(this,arguments)}function sce(e,t){return cce(e)||lce(e,t)||oce(e,t)||ice()}function ice(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
113
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oce(e,t){if(e){if(typeof e=="string")return DI(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 DI(e,t)}}function DI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function cce(e){if(Array.isArray(e))return e}function LI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function FI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LI(Object(n),!0).forEach(function(r){uce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uce(e,t,n){return t=dce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dce(e){var t=fce(e,"string");return pf(t)=="symbol"?t:t+""}function fce(e,t){if(pf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zI=function(t,n,r,s,i){var o=r-s,c;return c="M ".concat(t,",").concat(n),c+="L ".concat(t+r,",").concat(n),c+="L ".concat(t+r-o/2,",").concat(n+i),c+="L ".concat(t+r-o/2-s,",").concat(n+i),c+="L ".concat(t,",").concat(n," Z"),c},pce={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},hce=function(t){var n=FI(FI({},pce),t),r=m.useRef(),s=m.useState(-1),i=sce(s,2),o=i[0],c=i[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&c(S)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,g=n.height,x=n.className,j=n.animationEasing,y=n.animationDuration,b=n.animationBegin,N=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||g!==+g||h===0&&p===0||g===0)return null;var C=Bt("recharts-trapezoid",x);return N?Y.createElement(Rs,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:g,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:g,x:d,y:f},duration:y,animationEasing:j,isActive:N},function(S){var E=S.upperWidth,A=S.lowerWidth,k=S.height,T=S.x,O=S.y;return Y.createElement(Rs,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:y,easing:j},Y.createElement("path",$m({},kt(n,!0),{className:C,d:zI(T,O,E,A,k),ref:r})))}):Y.createElement("g",null,Y.createElement("path",$m({},kt(n,!0),{className:C,d:zI(d,f,h,p,g)})))},mce=["option","shapeType","propTransformer","activeClassName","isActive"];function hf(e){"@babel/helpers - typeof";return hf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hf(e)}function vce(e,t){if(e==null)return{};var n=gce(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gce(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 BI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Dm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BI(Object(n),!0).forEach(function(r){xce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xce(e,t,n){return t=yce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yce(e){var t=bce(e,"string");return hf(t)=="symbol"?t:t+""}function bce(e,t){if(hf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wce(e,t){return Dm(Dm({},t),e)}function jce(e,t){return e==="symbols"}function qI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return Y.createElement(MC,n);case"trapezoid":return Y.createElement(hce,n);case"sector":return Y.createElement(L4,n);case"symbols":if(jce(t))return Y.createElement(eC,n);break;default:return null}}function Sce(e){return m.isValidElement(e)?e.props:e}function X4(e){var t=e.option,n=e.shapeType,r=e.propTransformer,s=r===void 0?wce:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=vce(e,mce),f;if(m.isValidElement(t))f=m.cloneElement(t,Dm(Dm({},d),Sce(t)));else if(Lt(t))f=t(d);else if(tce(t)&&!ace(t)){var h=s(t,d);f=Y.createElement(qI,{shapeType:n,elementProps:h})}else{var p=d;f=Y.createElement(qI,{shapeType:n,elementProps:p})}return c?Y.createElement(sn,{className:o},f):f}function cg(e,t){return t!=null&&"trapezoids"in e.props}function ug(e,t){return t!=null&&"sectors"in e.props}function mf(e,t){return t!=null&&"points"in e.props}function Nce(e,t){var n,r,s=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,i=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return s&&i}function Cce(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function _ce(e,t){var n=e.x===t.x,r=e.y===t.y,s=e.z===t.z;return n&&r&&s}function Ace(e,t){var n;return cg(e,t)?n=Nce:ug(e,t)?n=Cce:mf(e,t)&&(n=_ce),n}function Ece(e,t){var n;return cg(e,t)?n="trapezoids":ug(e,t)?n="sectors":mf(e,t)&&(n="points"),n}function kce(e,t){if(cg(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(ug(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return mf(e,t)?t.payload:{}}function Pce(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,s=Ece(n,t),i=kce(n,t),o=r.filter(function(d,f){var h=Vf(i,d),p=n.props[s].filter(function(j){var y=Ace(n,t);return y(j,t)}),g=n.props[s].indexOf(p[p.length-1]),x=f===g;return h&&x}),c=r.indexOf(o[o.length-1]);return c}var zh;function Gc(e){"@babel/helpers - typeof";return Gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gc(e)}function xc(){return xc=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},xc.apply(this,arguments)}function UI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UI(Object(n),!0).forEach(function(r){Ta(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WI(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,J4(r.key),r)}}function Oce(e,t,n){return t&&WI(e.prototype,t),n&&WI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rce(e,t,n){return t=Lm(t),Ice(e,Q4()?Reflect.construct(t,n||[],Lm(e).constructor):t.apply(e,n))}function Ice(e,t){if(t&&(Gc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mce(e)}function Mce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q4=function(){return!!e})()}function Lm(e){return Lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lm(e)}function $ce(e,t){if(typeof t!="function"&&t!==null)throw new 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&&S1(e,t)}function S1(e,t){return S1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},S1(e,t)}function Ta(e,t,n){return t=J4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J4(e){var t=Dce(e,"string");return Gc(t)=="symbol"?t:t+""}function Dce(e,t){if(Gc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ci=(function(e){function t(n){var r;return Tce(this,t),r=Rce(this,t,[n]),Ta(r,"pieRef",null),Ta(r,"sectorRefs",[]),Ta(r,"id",yu("recharts-pie-")),Ta(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Lt(s)&&s()}),Ta(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Lt(s)&&s()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return $ce(t,e),Oce(t,[{key:"isActiveIndex",value:function(r){var s=this.props.activeIndex;return Array.isArray(s)?s.indexOf(r)!==-1:r===s}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,c=i.labelLine,d=i.dataKey,f=i.valueKey,h=kt(this.props,!1),p=kt(o,!1),g=kt(c,!1),x=o&&o.offsetRadius||20,j=r.map(function(y,b){var N=(y.startAngle+y.endAngle)/2,C=En(y.cx,y.cy,y.outerRadius+x,N),S=Nn(Nn(Nn(Nn({},h),y),{},{stroke:"none"},p),{},{index:b,textAnchor:t.getTextAnchor(C.x,y.cx)},C),E=Nn(Nn(Nn(Nn({},h),y),{},{fill:"none",stroke:y.fill},g),{},{index:b,points:[En(y.cx,y.cy,y.outerRadius,N),C]}),A=d;return Ft(d)&&Ft(f)?A="value":Ft(d)&&(A=f),Y.createElement(sn,{key:"label-".concat(y.startAngle,"-").concat(y.endAngle,"-").concat(y.midAngle,"-").concat(b)},c&&t.renderLabelLineItem(c,E,"line"),t.renderLabelItem(o,S,tr(y,A)))});return Y.createElement(sn,{className:"recharts-pie-labels"},j)}},{key:"renderSectorsStatically",value:function(r){var s=this,i=this.props,o=i.activeShape,c=i.blendStroke,d=i.inactiveShape;return r.map(function(f,h){if(f?.startAngle===0&&f?.endAngle===0&&r.length!==1)return null;var p=s.isActiveIndex(h),g=d&&s.hasActiveIndex()?d:null,x=p?o:g,j=Nn(Nn({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return Y.createElement(sn,xc({ref:function(b){b&&!s.sectorRefs.includes(b)&&s.sectorRefs.push(b)},tabIndex:-1,className:"recharts-pie-sector"},il(s.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),Y.createElement(X4,xc({option:x,isActive:p,shapeType:"sector"},j)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,s=this.props,i=s.sectors,o=s.isAnimationActive,c=s.animationBegin,d=s.animationDuration,f=s.animationEasing,h=s.animationId,p=this.state,g=p.prevSectors,x=p.prevIsAnimationActive;return Y.createElement(Rs,{begin:c,duration:d,isActive:o,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(x),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(j){var y=j.t,b=[],N=i&&i[0],C=N.startAngle;return i.forEach(function(S,E){var A=g&&g[E],k=E>0?ga(S,"paddingAngle",0):0;if(A){var T=pa(A.endAngle-A.startAngle,S.endAngle-S.startAngle),O=Nn(Nn({},S),{},{startAngle:C+k,endAngle:C+T(y)+k});b.push(O),C=O.endAngle}else{var D=S.endAngle,q=S.startAngle,U=pa(0,D-q),B=U(y),X=Nn(Nn({},S),{},{startAngle:C+k,endAngle:C+B+k});b.push(X),C=X.endAngle}}),Y.createElement(sn,null,r.renderSectorsStatically(b))})}},{key:"attachKeyboardHandlers",value:function(r){var s=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[o].focus(),s.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[c].focus(),s.setState({sectorToFocus:c});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,s=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&s&&s.length&&(!o||!Vf(o,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,s=this.props,i=s.hide,o=s.sectors,c=s.className,d=s.label,f=s.cx,h=s.cy,p=s.innerRadius,g=s.outerRadius,x=s.isAnimationActive,j=this.state.isAnimationFinished;if(i||!o||!o.length||!Qe(f)||!Qe(h)||!Qe(p)||!Qe(g))return null;var y=Bt("recharts-pie",c);return Y.createElement(sn,{tabIndex:this.props.rootTabIndex,className:y,ref:function(N){r.pieRef=N}},this.renderSectors(),d&&this.renderLabels(o),fr.renderCallByParent(this.props,null,!1),(!x||j)&&ui.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return s.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:r.sectors!==s.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,s){return r>s?"start":r<s?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,s,i){if(Y.isValidElement(r))return Y.cloneElement(r,s);if(Lt(r))return r(s);var o=Bt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return Y.createElement(Em,xc({},s,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,s,i){if(Y.isValidElement(r))return Y.cloneElement(r,s);var o=i;if(Lt(r)&&(o=r(s),Y.isValidElement(o)))return o;var c=Bt("recharts-pie-label-text",typeof r!="boolean"&&!Lt(r)?r.className:"");return Y.createElement(ol,xc({},s,{alignmentBaseline:"middle",className:c}),o)}}])})(m.PureComponent);zh=Ci;Ta(Ci,"displayName","Pie");Ta(Ci,"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:!_l.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Ta(Ci,"parseDeltaAngle",function(e,t){var n=Pr(t-e),r=Math.min(Math.abs(t-e),360);return n*r});Ta(Ci,"getRealPieData",function(e){var t=e.data,n=e.children,r=kt(e,!1),s=xa(n,Hv);return t&&t.length?t.map(function(i,o){return Nn(Nn(Nn({payload:i},r),i),s&&s[o]&&s[o].props)}):s&&s.length?s.map(function(i){return Nn(Nn({},r),i.props)}):[]});Ta(Ci,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,s=t.width,i=t.height,o=I4(s,i),c=r+Tr(e.cx,s,s/2),d=n+Tr(e.cy,i,i/2),f=Tr(e.innerRadius,o,0),h=Tr(e.outerRadius,o,o*.8),p=e.maxRadius||Math.sqrt(s*s+i*i)/2;return{cx:c,cy:d,innerRadius:f,outerRadius:h,maxRadius:p}});Ta(Ci,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?Nn(Nn({},t.type.defaultProps),t.props):t.props,s=zh.getRealPieData(r);if(!s||!s.length)return null;var i=r.cornerRadius,o=r.startAngle,c=r.endAngle,d=r.paddingAngle,f=r.dataKey,h=r.nameKey,p=r.valueKey,g=r.tooltipType,x=Math.abs(r.minAngle),j=zh.parseCoordinateOfPie(r,n),y=zh.parseDeltaAngle(o,c),b=Math.abs(y),N=f;Ft(f)&&Ft(p)?(li(!1,`Use "dataKey" to specify the value of pie,
|
|
114
|
-
the props "valueKey" will be deprecated in 1.1.0`),N="value"):Ft(f)&&(li(!1,`Use "dataKey" to specify the value of pie,
|
|
115
|
-
the props "valueKey" will be deprecated in 1.1.0`),N=p);var C=s.filter(function(O){return tr(O,N,0)!==0}).length,S=(b>=360?C:C-1)*d,E=b-C*x-S,A=s.reduce(function(O,D){var q=tr(D,N,0);return O+(Qe(q)?q:0)},0),k;if(A>0){var T;k=s.map(function(O,D){var q=tr(O,N,0),U=tr(O,h,D),B=(Qe(q)?q:0)/A,X;D?X=T.endAngle+Pr(y)*d*(q!==0?1:0):X=o;var W=X+Pr(y)*((q!==0?x:0)+B*E),M=(X+W)/2,z=(j.innerRadius+j.outerRadius)/2,K=[{name:U,value:q,payload:O,dataKey:N,type:g}],V=En(j.cx,j.cy,z,M);return T=Nn(Nn(Nn({percent:B,cornerRadius:i,name:U,tooltipPayload:K,midAngle:M,middleRadius:z,tooltipPosition:V},O),j),{},{value:tr(O,N),startAngle:X,endAngle:W,payload:O,paddingAngle:Pr(y)*d}),T})}return Nn(Nn({},j),{},{sectors:k,data:s})});var yj,VI;function Lce(){if(VI)return yj;VI=1;var e=Math.ceil,t=Math.max;function n(r,s,i,o){for(var c=-1,d=t(e((s-r)/(i||1)),0),f=Array(d);d--;)f[o?d:++c]=r,r+=i;return f}return yj=n,yj}var bj,HI;function Z4(){if(HI)return bj;HI=1;var e=SL(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var i=s<0?-1:1;return i*n}return s===s?s:0}return bj=r,bj}var wj,KI;function Fce(){if(KI)return wj;KI=1;var e=Lce(),t=Vv(),n=Z4();function r(s){return function(i,o,c){return c&&typeof c!="number"&&t(i,o,c)&&(o=c=void 0),i=n(i),o===void 0?(o=i,i=0):o=n(o),c=c===void 0?i<o?1:-1:n(c),e(i,o,c,s)}}return wj=r,wj}var jj,GI;function zce(){if(GI)return jj;GI=1;var e=Fce(),t=e();return jj=t,jj}var Bce=zce();const Fm=hn(Bce);function vf(e){"@babel/helpers - typeof";return vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vf(e)}function YI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function XI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YI(Object(n),!0).forEach(function(r){eF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eF(e,t,n){return t=qce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qce(e){var t=Uce(e,"string");return vf(t)=="symbol"?t:t+""}function Uce(e,t){if(vf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wce=["Webkit","Moz","O","ms"],Vce=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),s=Wce.reduce(function(i,o){return XI(XI({},i),{},eF({},o+r,n))},{});return s[t]=n,s};function Yc(e){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yc(e)}function zm(){return zm=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},zm.apply(this,arguments)}function QI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Sj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QI(Object(n),!0).forEach(function(r){ua(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JI(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,nF(r.key),r)}}function Kce(e,t,n){return t&&JI(e.prototype,t),n&&JI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gce(e,t,n){return t=Bm(t),Yce(e,tF()?Reflect.construct(t,n||[],Bm(e).constructor):t.apply(e,n))}function Yce(e,t){if(t&&(Yc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xce(e)}function Xce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tF=function(){return!!e})()}function Bm(e){return Bm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bm(e)}function Qce(e,t){if(typeof t!="function"&&t!==null)throw new 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&&N1(e,t)}function N1(e,t){return N1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},N1(e,t)}function ua(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=Jce(e,"string");return Yc(t)=="symbol"?t:t+""}function Jce(e,t){if(Yc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Zce=function(t){var n=t.data,r=t.startIndex,s=t.endIndex,i=t.x,o=t.width,c=t.travellerWidth;if(!n||!n.length)return{};var d=n.length,f=Ed().domain(Fm(0,d)).range([i,i+o-c]),h=f.domain().map(function(p){return f(p)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:f(r),endX:f(s),scale:f,scaleValues:h}},ZI=function(t){return t.changedTouches&&!!t.changedTouches.length},Xc=(function(e){function t(n){var r;return Hce(this,t),r=Gce(this,t,[n]),ua(r,"handleDrag",function(s){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(s):r.state.isSlideMoving&&r.handleSlideDrag(s)}),ua(r,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&r.handleDrag(s.changedTouches[0])}),ua(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=r.props,i=s.endIndex,o=s.onDragEnd,c=s.startIndex;o?.({endIndex:i,startIndex:c})}),r.detachDragEndListener()}),ua(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),ua(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),ua(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),ua(r,"handleSlideDragStart",function(s){var i=ZI(s)?s.changedTouches[0]:s;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Qce(t,e),Kce(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=r.startX,i=r.endX,o=this.state.scaleValues,c=this.props,d=c.gap,f=c.data,h=f.length-1,p=Math.min(s,i),g=Math.max(s,i),x=t.getIndexInRange(o,p),j=t.getIndexInRange(o,g);return{startIndex:x-x%d,endIndex:j===h?h:j-j%d}}},{key:"getTextOfTick",value:function(r){var s=this.props,i=s.data,o=s.tickFormatter,c=s.dataKey,d=tr(i[r],c,r);return Lt(o)?o(d,r):d}},{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(r){var s=this.state,i=s.slideMoveStartX,o=s.startX,c=s.endX,d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.startIndex,x=d.endIndex,j=d.onChange,y=r.pageX-i;y>0?y=Math.min(y,f+h-p-c,f+h-p-o):y<0&&(y=Math.max(y,f-o,f-c));var b=this.getIndex({startX:o+y,endX:c+y});(b.startIndex!==g||b.endIndex!==x)&&j&&j(b),this.setState({startX:o+y,endX:c+y,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var i=ZI(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var s=this.state,i=s.brushMoveStartX,o=s.movingTravellerId,c=s.endX,d=s.startX,f=this.state[o],h=this.props,p=h.x,g=h.width,x=h.travellerWidth,j=h.onChange,y=h.gap,b=h.data,N={startX:this.state.startX,endX:this.state.endX},C=r.pageX-i;C>0?C=Math.min(C,p+g-x-f):C<0&&(C=Math.max(C,p-f)),N[o]=f+C;var S=this.getIndex(N),E=S.startIndex,A=S.endIndex,k=function(){var O=b.length-1;return o==="startX"&&(c>d?E%y===0:A%y===0)||c<d&&A===O||o==="endX"&&(c>d?A%y===0:E%y===0)||c>d&&A===O};this.setState(ua(ua({},o,f+C),"brushMoveStartX",r.pageX),function(){j&&k()&&j(S)})}},{key:"handleTravellerMoveKeyboard",value:function(r,s){var i=this,o=this.state,c=o.scaleValues,d=o.startX,f=o.endX,h=this.state[s],p=c.indexOf(h);if(p!==-1){var g=p+r;if(!(g===-1||g>=c.length)){var x=c[g];s==="startX"&&x>=f||s==="endX"&&x<=d||this.setState(ua({},s,x),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,s=r.x,i=r.y,o=r.width,c=r.height,d=r.fill,f=r.stroke;return Y.createElement("rect",{stroke:f,fill:d,x:s,y:i,width:o,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,s=r.x,i=r.y,o=r.width,c=r.height,d=r.data,f=r.children,h=r.padding,p=m.Children.only(f);return p?Y.cloneElement(p,{x:s,y:i,width:o,height:c,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,s){var i,o,c=this,d=this.props,f=d.y,h=d.travellerWidth,p=d.height,g=d.traveller,x=d.ariaLabel,j=d.data,y=d.startIndex,b=d.endIndex,N=Math.max(r,this.props.x),C=Sj(Sj({},kt(this.props,!1)),{},{x:N,y:f,width:h,height:p}),S=x||"Min value: ".concat((i=j[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=j[b])===null||o===void 0?void 0:o.name);return Y.createElement(sn,{tabIndex:0,role:"slider","aria-label":S,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),c.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,s))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(g,C))}},{key:"renderSlide",value:function(r,s){var i=this.props,o=i.y,c=i.height,d=i.stroke,f=i.travellerWidth,h=Math.min(r,s)+f,p=Math.max(Math.abs(s-r)-f,0);return Y.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:h,y:o,width:p,height:c})}},{key:"renderText",value:function(){var r=this.props,s=r.startIndex,i=r.endIndex,o=r.y,c=r.height,d=r.travellerWidth,f=r.stroke,h=this.state,p=h.startX,g=h.endX,x=5,j={pointerEvents:"none",fill:f};return Y.createElement(sn,{className:"recharts-brush-texts"},Y.createElement(ol,zm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,g)-x,y:o+c/2},j),this.getTextOfTick(s)),Y.createElement(ol,zm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,g)+d+x,y:o+c/2},j),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,s=r.data,i=r.className,o=r.children,c=r.x,d=r.y,f=r.width,h=r.height,p=r.alwaysShowText,g=this.state,x=g.startX,j=g.endX,y=g.isTextActive,b=g.isSlideMoving,N=g.isTravellerMoving,C=g.isTravellerFocused;if(!s||!s.length||!Qe(c)||!Qe(d)||!Qe(f)||!Qe(h)||f<=0||h<=0)return null;var S=Bt("recharts-brush",i),E=Y.Children.count(o)===1,A=Vce("userSelect","none");return Y.createElement(sn,{className:S,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(x,j),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(j,"endX"),(y||b||N||C||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var s=r.x,i=r.y,o=r.width,c=r.height,d=r.stroke,f=Math.floor(i+c/2)-1;return Y.createElement(Y.Fragment,null,Y.createElement("rect",{x:s,y:i,width:o,height:c,fill:d,stroke:"none"}),Y.createElement("line",{x1:s+1,y1:f,x2:s+o-1,y2:f,fill:"none",stroke:"#fff"}),Y.createElement("line",{x1:s+1,y1:f+2,x2:s+o-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,s){var i;return Y.isValidElement(r)?i=Y.cloneElement(r,s):Lt(r)?i=r(s):i=t.renderDefaultTraveller(s),i}},{key:"getDerivedStateFromProps",value:function(r,s){var i=r.data,o=r.width,c=r.x,d=r.travellerWidth,f=r.updateId,h=r.startIndex,p=r.endIndex;if(i!==s.prevData||f!==s.prevUpdateId)return Sj({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?Zce({data:i,width:o,x:c,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||c!==s.prevX||d!==s.prevTravellerWidth)){s.scale.range([c,c+o-d]);var g=s.scale.domain().map(function(x){return s.scale(x)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(r,s){for(var i=r.length,o=0,c=i-1;c-o>1;){var d=Math.floor((o+c)/2);r[d]>s?c=d:o=d}return s>=r[c]?c:o}}])})(m.PureComponent);ua(Xc,"displayName","Brush");ua(Xc,"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 Nj,eM;function eue(){if(eM)return Nj;eM=1;var e=oC();function t(n,r){var s;return e(n,function(i,o,c){return s=r(i,o,c),!s}),!!s}return Nj=t,Nj}var Cj,tM;function tue(){if(tM)return Cj;tM=1;var e=eL(),t=Fs(),n=eue(),r=Zr(),s=Vv();function i(o,c,d){var f=r(o)?e:n;return d&&s(o,c,d)&&(c=void 0),f(o,t(c,3))}return Cj=i,Cj}var nue=tue();const rue=hn(nue);var Es=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},_j,nM;function aue(){if(nM)return _j;nM=1;var e=xL();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return _j=t,_j}var Aj,rM;function sue(){if(rM)return Aj;rM=1;var e=aue(),t=vL(),n=Fs();function r(s,i){var o={};return i=n(i,3),t(s,function(c,d,f){e(o,d,i(c,d,f))}),o}return Aj=r,Aj}var iue=sue();const oue=hn(iue);var Ej,aM;function lue(){if(aM)return Ej;aM=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(!n(t[r],r,t))return!1;return!0}return Ej=e,Ej}var kj,sM;function cue(){if(sM)return kj;sM=1;var e=oC();function t(n,r){var s=!0;return e(n,function(i,o,c){return s=!!r(i,o,c),s}),s}return kj=t,kj}var Pj,iM;function uue(){if(iM)return Pj;iM=1;var e=lue(),t=cue(),n=Fs(),r=Zr(),s=Vv();function i(o,c,d){var f=r(o)?e:t;return d&&s(o,c,d)&&(c=void 0),f(o,n(c,3))}return Pj=i,Pj}var due=uue();const fue=hn(due);var pue=["x","y"];function gf(e){"@babel/helpers - typeof";return gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gf(e)}function C1(){return C1=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},C1.apply(this,arguments)}function oM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function gd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oM(Object(n),!0).forEach(function(r){hue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hue(e,t,n){return t=mue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mue(e){var t=vue(e,"string");return gf(t)=="symbol"?t:t+""}function vue(e,t){if(gf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gue(e,t){if(e==null)return{};var n=xue(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xue(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 yue(e,t){var n=e.x,r=e.y,s=gue(e,pue),i="".concat(n),o=parseInt(i,10),c="".concat(r),d=parseInt(c,10),f="".concat(t.height||s.height),h=parseInt(f,10),p="".concat(t.width||s.width),g=parseInt(p,10);return gd(gd(gd(gd(gd({},t),s),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:g,name:t.name,radius:t.radius})}function lM(e){return Y.createElement(X4,C1({shapeType:"rectangle",propTransformer:yue,activeClassName:"recharts-active-bar"},e))}var bue=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,s){if(typeof t=="number")return t;var i=Qe(r)||FX(r);return i?t(r,s):(i||cl(),n)}},wue=["value","background"],rF;function Qc(e){"@babel/helpers - typeof";return Qc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qc(e)}function jue(e,t){if(e==null)return{};var n=Sue(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sue(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 qm(){return qm=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},qm.apply(this,arguments)}function cM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cM(Object(n),!0).forEach(function(r){Ji(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uM(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,sF(r.key),r)}}function Cue(e,t,n){return t&&uM(e.prototype,t),n&&uM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _ue(e,t,n){return t=Um(t),Aue(e,aF()?Reflect.construct(t,n||[],Um(e).constructor):t.apply(e,n))}function Aue(e,t){if(t&&(Qc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Eue(e)}function Eue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aF=function(){return!!e})()}function Um(e){return Um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Um(e)}function kue(e,t){if(typeof t!="function"&&t!==null)throw new 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&&_1(e,t)}function _1(e,t){return _1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},_1(e,t)}function Ji(e,t,n){return t=sF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sF(e){var t=Pue(e,"string");return Qc(t)=="symbol"?t:t+""}function Pue(e,t){if(Qc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Pl=(function(e){function t(){var n;Nue(this,t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=_ue(this,t,[].concat(s)),Ji(n,"state",{isAnimationFinished:!1}),Ji(n,"id",yu("recharts-bar-")),Ji(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Ji(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return kue(t,e),Cue(t,[{key:"renderRectanglesStatically",value:function(r){var s=this,i=this.props,o=i.shape,c=i.dataKey,d=i.activeIndex,f=i.activeBar,h=kt(this.props,!1);return r&&r.map(function(p,g){var x=g===d,j=x?f:o,y=Gn(Gn(Gn({},h),p),{},{isActive:x,option:j,index:g,dataKey:c,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return Y.createElement(sn,qm({className:"recharts-bar-rectangle"},il(s.props,p,g),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(g)}),Y.createElement(lM,y))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,s=this.props,i=s.data,o=s.layout,c=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,p=s.animationId,g=this.state.prevData;return Y.createElement(Rs,{begin:d,duration:f,isActive:c,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(x){var j=x.t,y=i.map(function(b,N){var C=g&&g[N];if(C){var S=pa(C.x,b.x),E=pa(C.y,b.y),A=pa(C.width,b.width),k=pa(C.height,b.height);return Gn(Gn({},b),{},{x:S(j),y:E(j),width:A(j),height:k(j)})}if(o==="horizontal"){var T=pa(0,b.height),O=T(j);return Gn(Gn({},b),{},{y:b.y+b.height-O,height:O})}var D=pa(0,b.width),q=D(j);return Gn(Gn({},b),{},{width:q})});return Y.createElement(sn,null,r.renderRectanglesStatically(y))})}},{key:"renderRectangles",value:function(){var r=this.props,s=r.data,i=r.isAnimationActive,o=this.state.prevData;return i&&s&&s.length&&(!o||!Vf(o,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}},{key:"renderBackground",value:function(){var r=this,s=this.props,i=s.data,o=s.dataKey,c=s.activeIndex,d=kt(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,g=jue(f,wue);if(!p)return null;var x=Gn(Gn(Gn(Gn(Gn({},g),{},{fill:"#eee"},p),d),il(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return Y.createElement(lM,qm({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},x))})}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,c=i.xAxis,d=i.yAxis,f=i.layout,h=i.children,p=xa(h,Hf);if(!p)return null;var g=f==="vertical"?o[0].height/2:o[0].width/2,x=function(b,N){var C=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:C,errorVal:tr(b,N)}},j={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Y.createElement(sn,j,p.map(function(y){return Y.cloneElement(y,{key:"error-bar-".concat(s,"-").concat(y.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,offset:g,dataPointFormatter:x})}))}},{key:"render",value:function(){var r=this.props,s=r.hide,i=r.data,o=r.className,c=r.xAxis,d=r.yAxis,f=r.left,h=r.top,p=r.width,g=r.height,x=r.isAnimationActive,j=r.background,y=r.id;if(s||!i||!i.length)return null;var b=this.state.isAnimationFinished,N=Bt("recharts-bar",o),C=c&&c.allowDataOverflow,S=d&&d.allowDataOverflow,E=C||S,A=Ft(y)?this.id:y;return Y.createElement(sn,{className:N},C||S?Y.createElement("defs",null,Y.createElement("clipPath",{id:"clipPath-".concat(A)},Y.createElement("rect",{x:C?f:f-p/2,y:S?h:h-g/2,width:C?p:p*2,height:S?g:g*2}))):null,Y.createElement(sn,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(A,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,A),(!x||b)&&ui.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:s.curData}:r.data!==s.curData?{curData:r.data}:null}}])})(m.PureComponent);rF=Pl;Ji(Pl,"displayName","Bar");Ji(Pl,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!_l.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ji(Pl,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,s=e.bandSize,i=e.xAxis,o=e.yAxis,c=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,h=e.dataStartIndex,p=e.displayedData,g=e.offset,x=ese(r,n);if(!x)return null;var j=t.layout,y=n.type.defaultProps,b=y!==void 0?Gn(Gn({},y),n.props):n.props,N=b.dataKey,C=b.children,S=b.minPointSize,E=j==="horizontal"?o:i,A=f?E.scale.domain():null,k=ose({numericAxis:E}),T=xa(C,Hv),O=p.map(function(D,q){var U,B,X,W,M,z;f?U=tse(f[h+q],A):(U=tr(D,N),Array.isArray(U)||(U=[k,U]));var K=bue(S,rF.defaultProps.minPointSize)(U[1],q);if(j==="horizontal"){var V,R=[o.scale(U[0]),o.scale(U[1])],G=R[0],$=R[1];B=L2({axis:i,ticks:c,bandSize:s,offset:x.offset,entry:D,index:q}),X=(V=$??G)!==null&&V!==void 0?V:void 0,W=x.size;var I=G-$;if(M=Number.isNaN(I)?0:I,z={x:B,y:o.y,width:W,height:o.height},Math.abs(K)>0&&Math.abs(M)<Math.abs(K)){var ee=Pr(M||K)*(Math.abs(K)-Math.abs(M));X-=ee,M+=ee}}else{var Q=[i.scale(U[0]),i.scale(U[1])],ie=Q[0],ue=Q[1];if(B=ie,X=L2({axis:o,ticks:d,bandSize:s,offset:x.offset,entry:D,index:q}),W=ue-ie,M=x.size,z={x:i.x,y:X,width:i.width,height:M},Math.abs(K)>0&&Math.abs(W)<Math.abs(K)){var re=Pr(W||K)*(Math.abs(K)-Math.abs(W));W+=re}}return Gn(Gn(Gn({},D),{},{x:B,y:X,width:W,height:M,value:f?U:U[1],payload:D,background:z},T&&T[q]&&T[q].props),{},{tooltipPayload:[O4(n,D)],tooltipPosition:{x:B+W/2,y:X+M/2}})});return Gn({data:O,layout:j},g)});function xf(e){"@babel/helpers - typeof";return xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xf(e)}function Tue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dM(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,iF(r.key),r)}}function Oue(e,t,n){return t&&dM(e.prototype,t),n&&dM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Qa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fM(Object(n),!0).forEach(function(r){dg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dg(e,t,n){return t=iF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iF(e){var t=Rue(e,"string");return xf(t)=="symbol"?t:t+""}function Rue(e,t){if(xf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oF=function(t,n,r,s,i){var o=t.width,c=t.height,d=t.layout,f=t.children,h=Object.keys(n),p={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:c-r.bottom,bottomMirror:c-r.bottom},g=!!da(f,Pl);return h.reduce(function(x,j){var y=n[j],b=y.orientation,N=y.domain,C=y.padding,S=C===void 0?{}:C,E=y.mirror,A=y.reversed,k="".concat(b).concat(E?"Mirror":""),T,O,D,q,U;if(y.type==="number"&&(y.padding==="gap"||y.padding==="no-gap")){var B=N[1]-N[0],X=1/0,W=y.categoricalDomain.sort(qX);if(W.forEach(function(Q,ie){ie>0&&(X=Math.min((Q||0)-(W[ie-1]||0),X))}),Number.isFinite(X)){var M=X/B,z=y.layout==="vertical"?r.height:r.width;if(y.padding==="gap"&&(T=M*z/2),y.padding==="no-gap"){var K=Tr(t.barCategoryGap,M*z),V=M*z/2;T=V-K-(V-K)/z*K}}}s==="xAxis"?O=[r.left+(S.left||0)+(T||0),r.left+r.width-(S.right||0)-(T||0)]:s==="yAxis"?O=d==="horizontal"?[r.top+r.height-(S.bottom||0),r.top+(S.top||0)]:[r.top+(S.top||0)+(T||0),r.top+r.height-(S.bottom||0)-(T||0)]:O=y.range,A&&(O=[O[1],O[0]]);var R=E4(y,i,g),G=R.scale,$=R.realScaleType;G.domain(N).range(O),k4(G);var I=P4(G,Qa(Qa({},y),{},{realScaleType:$}));s==="xAxis"?(U=b==="top"&&!E||b==="bottom"&&E,D=r.left,q=p[k]-U*y.height):s==="yAxis"&&(U=b==="left"&&!E||b==="right"&&E,D=p[k]-U*y.width,q=r.top);var ee=Qa(Qa(Qa({},y),I),{},{realScaleType:$,x:D,y:q,scale:G,width:s==="xAxis"?r.width:y.width,height:s==="yAxis"?r.height:y.height});return ee.bandSize=Cm(ee,I),!y.hide&&s==="xAxis"?p[k]+=(U?-1:1)*ee.height:y.hide||(p[k]+=(U?-1:1)*ee.width),Qa(Qa({},x),{},dg({},j,ee))},{})},lF=function(t,n){var r=t.x,s=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(s,o),width:Math.abs(i-r),height:Math.abs(o-s)}},Iue=function(t){var n=t.x1,r=t.y1,s=t.x2,i=t.y2;return lF({x:n,y:r},{x:s,y:i})},cF=(function(){function e(t){Tue(this,e),this.scale=t}return Oue(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(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(s){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+d}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),s=r[0],i=r[r.length-1];return s<=i?n>=s&&n<=i:n>=i&&n<=s}}],[{key:"create",value:function(n){return new e(n)}}])})();dg(cF,"EPS",1e-4);var $C=function(t){var n=Object.keys(t).reduce(function(r,s){return Qa(Qa({},r),{},dg({},s,cF.create(t[s])))},{});return Qa(Qa({},n),{},{apply:function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return oue(s,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(s){return fue(s,function(i,o){return n[o].isInRange(i)})}})};function Mue(e){return(e%180+180)%180}var $ue=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Mue(s),o=i*Math.PI/180,c=Math.atan(r/n),d=o>c&&o<Math.PI-c?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},Tj,pM;function Due(){if(pM)return Tj;pM=1;var e=Fs(),t=zf(),n=Uv();function r(s){return function(i,o,c){var d=Object(i);if(!t(i)){var f=e(o,3);i=n(i),o=function(p){return f(d[p],p,d)}}var h=s(i,o,c);return h>-1?d[f?i[h]:h]:void 0}}return Tj=r,Tj}var Oj,hM;function Lue(){if(hM)return Oj;hM=1;var e=Z4();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return Oj=t,Oj}var Rj,mM;function Fue(){if(mM)return Rj;mM=1;var e=dL(),t=Fs(),n=Lue(),r=Math.max;function s(i,o,c){var d=i==null?0:i.length;if(!d)return-1;var f=c==null?0:n(c);return f<0&&(f=r(d+f,0)),e(i,t(o,3),f)}return Rj=s,Rj}var Ij,vM;function zue(){if(vM)return Ij;vM=1;var e=Due(),t=Fue(),n=e(t);return Ij=n,Ij}zue();var Bue=A3();const que=hn(Bue);var Uue=que(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("")}),uF=m.createContext(void 0),dF=m.createContext(void 0),fF=m.createContext(void 0),Wue=m.createContext({}),pF=m.createContext(void 0),hF=m.createContext(0),mF=m.createContext(0),gM=function(t){var n=t.state,r=n.xAxisMap,s=n.yAxisMap,i=n.offset,o=t.clipPathId,c=t.children,d=t.width,f=t.height,h=Uue(i);return Y.createElement(uF.Provider,{value:r},Y.createElement(dF.Provider,{value:s},Y.createElement(Wue.Provider,{value:i},Y.createElement(fF.Provider,{value:h},Y.createElement(pF.Provider,{value:o},Y.createElement(hF.Provider,{value:f},Y.createElement(mF.Provider,{value:d},c)))))))},Vue=function(){return m.useContext(pF)},vF=function(t){var n=m.useContext(uF);n==null&&cl();var r=n[t];return r==null&&cl(),r},gF=function(t){var n=m.useContext(dF);n==null&&cl();var r=n[t];return r==null&&cl(),r},Hue=function(){var t=m.useContext(fF);return t},xF=function(){return m.useContext(mF)},yF=function(){return m.useContext(hF)};function Jc(e){"@babel/helpers - typeof";return Jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jc(e)}function Kue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gue(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,wF(r.key),r)}}function Yue(e,t,n){return t&&Gue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xue(e,t,n){return t=Wm(t),Que(e,bF()?Reflect.construct(t,n||[],Wm(e).constructor):t.apply(e,n))}function Que(e,t){if(t&&(Jc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jue(e)}function Jue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bF=function(){return!!e})()}function Wm(e){return Wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wm(e)}function Zue(e,t){if(typeof t!="function"&&t!==null)throw new 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&&A1(e,t)}function A1(e,t){return A1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},A1(e,t)}function xM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function yM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xM(Object(n),!0).forEach(function(r){DC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DC(e,t,n){return t=wF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wF(e){var t=ede(e,"string");return Jc(t)=="symbol"?t:t+""}function ede(e,t){if(Jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function tde(e,t){return sde(e)||ade(e,t)||rde(e,t)||nde()}function nde(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
116
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rde(e,t){if(e){if(typeof e=="string")return bM(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 bM(e,t)}}function bM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ade(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function sde(e){if(Array.isArray(e))return e}function E1(){return E1=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},E1.apply(this,arguments)}var ide=function(t,n){var r;return Y.isValidElement(t)?r=Y.cloneElement(t,n):Lt(t)?r=t(n):r=Y.createElement("line",E1({},n,{className:"recharts-reference-line-line"})),r},ode=function(t,n,r,s,i,o,c,d,f){var h=i.x,p=i.y,g=i.width,x=i.height;if(r){var j=f.y,y=t.y.apply(j,{position:o});if(Es(f,"discard")&&!t.y.isInRange(y))return null;var b=[{x:h+g,y},{x:h,y}];return d==="left"?b.reverse():b}if(n){var N=f.x,C=t.x.apply(N,{position:o});if(Es(f,"discard")&&!t.x.isInRange(C))return null;var S=[{x:C,y:p+x},{x:C,y:p}];return c==="top"?S.reverse():S}if(s){var E=f.segment,A=E.map(function(k){return t.apply(k,{position:o})});return Es(f,"discard")&&rue(A,function(k){return!t.isInRange(k)})?null:A}return null};function lde(e){var t=e.x,n=e.y,r=e.segment,s=e.xAxisId,i=e.yAxisId,o=e.shape,c=e.className,d=e.alwaysShow,f=Vue(),h=vF(s),p=gF(i),g=Hue();if(!f||!g)return null;li(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var x=$C({x:h.scale,y:p.scale}),j=nr(t),y=nr(n),b=r&&r.length===2,N=ode(x,j,y,b,g,e.position,h.orientation,p.orientation,e);if(!N)return null;var C=tde(N,2),S=C[0],E=S.x,A=S.y,k=C[1],T=k.x,O=k.y,D=Es(e,"hidden")?"url(#".concat(f,")"):void 0,q=yM(yM({clipPath:D},kt(e,!0)),{},{x1:E,y1:A,x2:T,y2:O});return Y.createElement(sn,{className:Bt("recharts-reference-line",c)},ide(o,q),fr.renderCallByParent(e,Iue({x1:E,y1:A,x2:T,y2:O})))}var LC=(function(e){function t(){return Kue(this,t),Xue(this,t,arguments)}return Zue(t,e),Yue(t,[{key:"render",value:function(){return Y.createElement(lde,this.props)}}])})(Y.Component);DC(LC,"displayName","ReferenceLine");DC(LC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function k1(){return k1=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},k1.apply(this,arguments)}function Zc(e){"@babel/helpers - typeof";return Zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zc(e)}function wM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function jM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wM(Object(n),!0).forEach(function(r){fg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ude(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,SF(r.key),r)}}function dde(e,t,n){return t&&ude(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fde(e,t,n){return t=Vm(t),pde(e,jF()?Reflect.construct(t,n||[],Vm(e).constructor):t.apply(e,n))}function pde(e,t){if(t&&(Zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hde(e)}function hde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jF=function(){return!!e})()}function Vm(e){return Vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vm(e)}function mde(e,t){if(typeof t!="function"&&t!==null)throw new 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&&P1(e,t)}function P1(e,t){return P1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},P1(e,t)}function fg(e,t,n){return t=SF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SF(e){var t=vde(e,"string");return Zc(t)=="symbol"?t:t+""}function vde(e,t){if(Zc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var gde=function(t){var n=t.x,r=t.y,s=t.xAxis,i=t.yAxis,o=$C({x:s.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return Es(t,"discard")&&!o.isInRange(c)?null:c},pg=(function(e){function t(){return cde(this,t),fde(this,t,arguments)}return mde(t,e),dde(t,[{key:"render",value:function(){var r=this.props,s=r.x,i=r.y,o=r.r,c=r.alwaysShow,d=r.clipPathId,f=nr(s),h=nr(i);if(li(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=gde(this.props);if(!p)return null;var g=p.x,x=p.y,j=this.props,y=j.shape,b=j.className,N=Es(this.props,"hidden")?"url(#".concat(d,")"):void 0,C=jM(jM({clipPath:N},kt(this.props,!0)),{},{cx:g,cy:x});return Y.createElement(sn,{className:Bt("recharts-reference-dot",b)},t.renderDot(y,C),fr.renderCallByParent(this.props,{x:g-o,y:x-o,width:2*o,height:2*o}))}}])})(Y.Component);fg(pg,"displayName","ReferenceDot");fg(pg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});fg(pg,"renderDot",function(e,t){var n;return Y.isValidElement(e)?n=Y.cloneElement(e,t):Lt(e)?n=e(t):n=Y.createElement(ag,k1({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function T1(){return T1=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},T1.apply(this,arguments)}function eu(e){"@babel/helpers - typeof";return eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eu(e)}function SM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function NM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SM(Object(n),!0).forEach(function(r){hg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yde(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,CF(r.key),r)}}function bde(e,t,n){return t&&yde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wde(e,t,n){return t=Hm(t),jde(e,NF()?Reflect.construct(t,n||[],Hm(e).constructor):t.apply(e,n))}function jde(e,t){if(t&&(eu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sde(e)}function Sde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NF=function(){return!!e})()}function Hm(e){return Hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hm(e)}function Nde(e,t){if(typeof t!="function"&&t!==null)throw new 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&&O1(e,t)}function O1(e,t){return O1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},O1(e,t)}function hg(e,t,n){return t=CF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CF(e){var t=Cde(e,"string");return eu(t)=="symbol"?t:t+""}function Cde(e,t){if(eu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(eu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var _de=function(t,n,r,s,i){var o=i.x1,c=i.x2,d=i.y1,f=i.y2,h=i.xAxis,p=i.yAxis;if(!h||!p)return null;var g=$C({x:h.scale,y:p.scale}),x={x:t?g.x.apply(o,{position:"start"}):g.x.rangeMin,y:r?g.y.apply(d,{position:"start"}):g.y.rangeMin},j={x:n?g.x.apply(c,{position:"end"}):g.x.rangeMax,y:s?g.y.apply(f,{position:"end"}):g.y.rangeMax};return Es(i,"discard")&&(!g.isInRange(x)||!g.isInRange(j))?null:lF(x,j)},mg=(function(e){function t(){return xde(this,t),wde(this,t,arguments)}return Nde(t,e),bde(t,[{key:"render",value:function(){var r=this.props,s=r.x1,i=r.x2,o=r.y1,c=r.y2,d=r.className,f=r.alwaysShow,h=r.clipPathId;li(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=nr(s),g=nr(i),x=nr(o),j=nr(c),y=this.props.shape;if(!p&&!g&&!x&&!j&&!y)return null;var b=_de(p,g,x,j,this.props);if(!b&&!y)return null;var N=Es(this.props,"hidden")?"url(#".concat(h,")"):void 0;return Y.createElement(sn,{className:Bt("recharts-reference-area",d)},t.renderRect(y,NM(NM({clipPath:N},kt(this.props,!0)),b)),fr.renderCallByParent(this.props,b))}}])})(Y.Component);hg(mg,"displayName","ReferenceArea");hg(mg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});hg(mg,"renderRect",function(e,t){var n;return Y.isValidElement(e)?n=Y.cloneElement(e,t):Lt(e)?n=e(t):n=Y.createElement(MC,T1({},t,{className:"recharts-reference-area-rect"})),n});function _F(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],s=0;s<e.length;s+=t)r.push(e[s]);return r}function Ade(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return $ue(r,n)}function Ede(e,t,n){var r=n==="width",s=e.x,i=e.y,o=e.width,c=e.height;return t===1?{start:r?s:i,end:r?s+o:i+c}:{start:r?s+o:i+c,end:r?s:i}}function Km(e,t,n,r,s){if(e*t<e*r||e*t>e*s)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-s)<=0}function kde(e,t){return _F(e,t+1)}function Pde(e,t,n,r,s){for(var i=(r||[]).slice(),o=t.start,c=t.end,d=0,f=1,h=o,p=function(){var j=r?.[d];if(j===void 0)return{v:_F(r,f)};var y=d,b,N=function(){return b===void 0&&(b=n(j,y)),b},C=j.coordinate,S=d===0||Km(e,C,N,h,c);S||(d=0,h=o,f+=1),S&&(h=C+e*(N()/2+s),d+=f)},g;f<=i.length;)if(g=p(),g)return g.v;return[]}function yf(e){"@babel/helpers - typeof";return yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yf(e)}function CM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CM(Object(n),!0).forEach(function(r){Tde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tde(e,t,n){return t=Ode(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ode(e){var t=Rde(e,"string");return yf(t)=="symbol"?t:t+""}function Rde(e,t){if(yf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ide(e,t,n,r,s){for(var i=(r||[]).slice(),o=i.length,c=t.start,d=t.end,f=function(g){var x=i[g],j,y=function(){return j===void 0&&(j=n(x,g)),j};if(g===o-1){var b=e*(x.coordinate+e*y()/2-d);i[g]=x=Nr(Nr({},x),{},{tickCoord:b>0?x.coordinate-b*e:x.coordinate})}else i[g]=x=Nr(Nr({},x),{},{tickCoord:x.coordinate});var N=Km(e,x.tickCoord,y,c,d);N&&(d=x.tickCoord-e*(y()/2+s),i[g]=Nr(Nr({},x),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function Mde(e,t,n,r,s,i){var o=(r||[]).slice(),c=o.length,d=t.start,f=t.end;if(i){var h=r[c-1],p=n(h,c-1),g=e*(h.coordinate+e*p/2-f);o[c-1]=h=Nr(Nr({},h),{},{tickCoord:g>0?h.coordinate-g*e:h.coordinate});var x=Km(e,h.tickCoord,function(){return p},d,f);x&&(f=h.tickCoord-e*(p/2+s),o[c-1]=Nr(Nr({},h),{},{isShow:!0}))}for(var j=i?c-1:c,y=function(C){var S=o[C],E,A=function(){return E===void 0&&(E=n(S,C)),E};if(C===0){var k=e*(S.coordinate-e*A()/2-d);o[C]=S=Nr(Nr({},S),{},{tickCoord:k<0?S.coordinate-k*e:S.coordinate})}else o[C]=S=Nr(Nr({},S),{},{tickCoord:S.coordinate});var T=Km(e,S.tickCoord,A,d,f);T&&(d=S.tickCoord+e*(A()/2+s),o[C]=Nr(Nr({},S),{},{isShow:!0}))},b=0;b<j;b++)y(b);return o}function $de(e,t,n){var r=e.tick,s=e.ticks,i=e.viewBox,o=e.minTickGap,c=e.orientation,d=e.interval,f=e.tickFormatter,h=e.unit,p=e.angle;if(!s||!s.length||!r)return[];if(Qe(d)||_l.isSsr)return kde(s,typeof d=="number"&&Qe(d)?d:0);var g=[],x=c==="top"||c==="bottom"?"width":"height",j=h&&x==="width"?Ad(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},y=function(S,E){var A=Lt(f)?f(S.value,E):S.value;return x==="width"?Ade(Ad(A,{fontSize:t,letterSpacing:n}),j,p):Ad(A,{fontSize:t,letterSpacing:n})[x]},b=s.length>=2?Pr(s[1].coordinate-s[0].coordinate):1,N=Ede(i,b,x);return d==="equidistantPreserveStart"?Pde(b,N,y,s,o):(d==="preserveStart"||d==="preserveStartEnd"?g=Mde(b,N,y,s,o,d==="preserveStartEnd"):g=Ide(b,N,y,s,o),g.filter(function(C){return C.isShow}))}var Dde=["viewBox"],Lde=["viewBox"],Fde=["ticks"];function tu(e){"@babel/helpers - typeof";return tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tu(e)}function yc(){return yc=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},yc.apply(this,arguments)}function _M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_M(Object(n),!0).forEach(function(r){FC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_M(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mj(e,t){if(e==null)return{};var n=zde(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zde(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 Bde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AM(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,EF(r.key),r)}}function qde(e,t,n){return t&&AM(e.prototype,t),n&&AM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ude(e,t,n){return t=Gm(t),Wde(e,AF()?Reflect.construct(t,n||[],Gm(e).constructor):t.apply(e,n))}function Wde(e,t){if(t&&(tu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vde(e)}function Vde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AF=function(){return!!e})()}function Gm(e){return Gm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gm(e)}function Hde(e,t){if(typeof t!="function"&&t!==null)throw new 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&&R1(e,t)}function R1(e,t){return R1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},R1(e,t)}function FC(e,t,n){return t=EF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EF(e){var t=Kde(e,"string");return tu(t)=="symbol"?t:t+""}function Kde(e,t){if(tu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var vg=(function(e){function t(n){var r;return Bde(this,t),r=Ude(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Hde(t,e),qde(t,[{key:"shouldComponentUpdate",value:function(r,s){var i=r.viewBox,o=Mj(r,Dde),c=this.props,d=c.viewBox,f=Mj(c,Lde);return!_c(i,d)||!_c(o,f)||!_c(s,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var s=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];s&&this.setState({fontSize:window.getComputedStyle(s).fontSize,letterSpacing:window.getComputedStyle(s).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var s=this.props,i=s.x,o=s.y,c=s.width,d=s.height,f=s.orientation,h=s.tickSize,p=s.mirror,g=s.tickMargin,x,j,y,b,N,C,S=p?-1:1,E=r.tickSize||h,A=Qe(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":x=j=r.coordinate,b=o+ +!p*d,y=b-S*E,C=y-S*g,N=A;break;case"left":y=b=r.coordinate,j=i+ +!p*c,x=j-S*E,N=x-S*g,C=A;break;case"right":y=b=r.coordinate,j=i+ +p*c,x=j+S*E,N=x+S*g,C=A;break;default:x=j=r.coordinate,b=o+ +p*d,y=b+S*E,C=y+S*g,N=A;break}return{line:{x1:x,y1:y,x2:j,y2:b},tick:{x:N,y:C}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,s=r.orientation,i=r.mirror,o;switch(s){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,s=r.orientation,i=r.mirror,o="end";switch(s){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.x,i=r.y,o=r.width,c=r.height,d=r.orientation,f=r.mirror,h=r.axisLine,p=Zn(Zn(Zn({},kt(this.props,!1)),kt(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var g=+(d==="top"&&!f||d==="bottom"&&f);p=Zn(Zn({},p),{},{x1:s,y1:i+g*c,x2:s+o,y2:i+g*c})}else{var x=+(d==="left"&&!f||d==="right"&&f);p=Zn(Zn({},p),{},{x1:s+x*o,y1:i,x2:s+x*o,y2:i+c})}return Y.createElement("line",yc({},p,{className:Bt("recharts-cartesian-axis-line",ga(h,"className"))}))}},{key:"renderTicks",value:function(r,s,i){var o=this,c=this.props,d=c.tickLine,f=c.stroke,h=c.tick,p=c.tickFormatter,g=c.unit,x=$de(Zn(Zn({},this.props),{},{ticks:r}),s,i),j=this.getTickTextAnchor(),y=this.getTickVerticalAnchor(),b=kt(this.props,!1),N=kt(h,!1),C=Zn(Zn({},b),{},{fill:"none"},kt(d,!1)),S=x.map(function(E,A){var k=o.getTickLineCoord(E),T=k.line,O=k.tick,D=Zn(Zn(Zn(Zn({textAnchor:j,verticalAnchor:y},b),{},{stroke:"none",fill:f},N),O),{},{index:A,payload:E,visibleTicksCount:x.length,tickFormatter:p});return Y.createElement(sn,yc({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},il(o.props,E,A)),d&&Y.createElement("line",yc({},C,T,{className:Bt("recharts-cartesian-axis-tick-line",ga(d,"className"))})),h&&t.renderTickItem(h,D,"".concat(Lt(p)?p(E.value,A):E.value).concat(g||"")))});return Y.createElement("g",{className:"recharts-cartesian-axis-ticks"},S)}},{key:"render",value:function(){var r=this,s=this.props,i=s.axisLine,o=s.width,c=s.height,d=s.ticksGenerator,f=s.className,h=s.hide;if(h)return null;var p=this.props,g=p.ticks,x=Mj(p,Fde),j=g;return Lt(d)&&(j=g&&g.length>0?d(this.props):d(x)),o<=0||c<=0||!j||!j.length?null:Y.createElement(sn,{className:Bt("recharts-cartesian-axis",f),ref:function(b){r.layerReference=b}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),fr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,i){var o,c=Bt(s.className,"recharts-cartesian-axis-tick-value");return Y.isValidElement(r)?o=Y.cloneElement(r,Zn(Zn({},s),{},{className:c})):Lt(r)?o=r(Zn(Zn({},s),{},{className:c})):o=Y.createElement(ol,yc({},s,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(m.Component);FC(vg,"displayName","CartesianAxis");FC(vg,"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 Gde=["type","layout","connectNulls","ref"],Yde=["key"];function nu(e){"@babel/helpers - typeof";return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nu(e)}function EM(e,t){if(e==null)return{};var n=Xde(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xde(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(){return Rd=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},Rd.apply(this,arguments)}function kM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function la(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kM(Object(n),!0).forEach(function(r){Ja(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lc(e){return efe(e)||Zde(e)||Jde(e)||Qde()}function Qde(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
117
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jde(e,t){if(e){if(typeof e=="string")return I1(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 I1(e,t)}}function Zde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function efe(e){if(Array.isArray(e))return I1(e)}function I1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PM(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,PF(r.key),r)}}function nfe(e,t,n){return t&&PM(e.prototype,t),n&&PM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rfe(e,t,n){return t=Ym(t),afe(e,kF()?Reflect.construct(t,n||[],Ym(e).constructor):t.apply(e,n))}function afe(e,t){if(t&&(nu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sfe(e)}function sfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kF=function(){return!!e})()}function Ym(e){return Ym=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ym(e)}function ife(e,t){if(typeof t!="function"&&t!==null)throw new 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&&M1(e,t)}function M1(e,t){return M1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},M1(e,t)}function Ja(e,t,n){return t=PF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PF(e){var t=ofe(e,"string");return nu(t)=="symbol"?t:t+""}function ofe(e,t){if(nu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ul=(function(e){function t(){var n;tfe(this,t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=rfe(this,t,[].concat(s)),Ja(n,"state",{isAnimationFinished:!0,totalLength:0}),Ja(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),Ja(n,"getStrokeDasharray",function(o,c,d){var f=d.reduce(function(N,C){return N+C});if(!f)return n.generateSimpleStrokeDasharray(c,o);for(var h=Math.floor(o/f),p=o%f,g=c-o,x=[],j=0,y=0;j<d.length;y+=d[j],++j)if(y+d[j]>p){x=[].concat(lc(d.slice(0,j)),[p-y]);break}var b=x.length%2===0?[0,g]:[g];return[].concat(lc(t.repeat(d,h)),lc(x),b).map(function(N){return"".concat(N,"px")}).join(", ")}),Ja(n,"id",yu("recharts-line-")),Ja(n,"pathRef",function(o){n.mainCurve=o}),Ja(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Ja(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return ife(t,e),nfe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,c=i.xAxis,d=i.yAxis,f=i.layout,h=i.children,p=xa(h,Hf);if(!p)return null;var g=function(y,b){return{x:y.x,y:y.y,value:y.value,errorVal:tr(y.payload,b)}},x={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Y.createElement(sn,x,p.map(function(j){return Y.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,dataPointFormatter:g})}))}},{key:"renderDots",value:function(r,s,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var c=this.props,d=c.dot,f=c.points,h=c.dataKey,p=kt(this.props,!1),g=kt(d,!0),x=f.map(function(y,b){var N=la(la(la({key:"dot-".concat(b),r:3},p),g),{},{index:b,cx:y.x,cy:y.y,value:y.value,dataKey:h,payload:y.payload,points:f});return t.renderDotItem(d,N)}),j={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(i,")"):null};return Y.createElement(sn,Rd({className:"recharts-line-dots",key:"dots"},j),x)}},{key:"renderCurveStatically",value:function(r,s,i,o){var c=this.props,d=c.type,f=c.layout,h=c.connectNulls;c.ref;var p=EM(c,Gde),g=la(la(la({},kt(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(i,")"):null,points:r},o),{},{type:d,layout:f,connectNulls:h});return Y.createElement(Em,Rd({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,s){var i=this,o=this.props,c=o.points,d=o.strokeDasharray,f=o.isAnimationActive,h=o.animationBegin,p=o.animationDuration,g=o.animationEasing,x=o.animationId,j=o.animateNewValues,y=o.width,b=o.height,N=this.state,C=N.prevPoints,S=N.totalLength;return Y.createElement(Rs,{begin:h,duration:p,isActive:f,easing:g,from:{t:0},to:{t:1},key:"line-".concat(x),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var A=E.t;if(C){var k=C.length/c.length,T=c.map(function(B,X){var W=Math.floor(X*k);if(C[W]){var M=C[W],z=pa(M.x,B.x),K=pa(M.y,B.y);return la(la({},B),{},{x:z(A),y:K(A)})}if(j){var V=pa(y*2,B.x),R=pa(b/2,B.y);return la(la({},B),{},{x:V(A),y:R(A)})}return la(la({},B),{},{x:B.x,y:B.y})});return i.renderCurveStatically(T,r,s)}var O=pa(0,S),D=O(A),q;if(d){var U="".concat(d).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});q=i.getStrokeDasharray(D,S,U)}else q=i.generateSimpleStrokeDasharray(S,D);return i.renderCurveStatically(c,r,s,{strokeDasharray:q})})}},{key:"renderCurve",value:function(r,s){var i=this.props,o=i.points,c=i.isAnimationActive,d=this.state,f=d.prevPoints,h=d.totalLength;return c&&o&&o.length&&(!f&&h>0||!Vf(f,o))?this.renderCurveWithAnimation(r,s):this.renderCurveStatically(o,r,s)}},{key:"render",value:function(){var r,s=this.props,i=s.hide,o=s.dot,c=s.points,d=s.className,f=s.xAxis,h=s.yAxis,p=s.top,g=s.left,x=s.width,j=s.height,y=s.isAnimationActive,b=s.id;if(i||!c||!c.length)return null;var N=this.state.isAnimationFinished,C=c.length===1,S=Bt("recharts-line",d),E=f&&f.allowDataOverflow,A=h&&h.allowDataOverflow,k=E||A,T=Ft(b)?this.id:b,O=(r=kt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},D=O.r,q=D===void 0?3:D,U=O.strokeWidth,B=U===void 0?2:U,X=QX(o)?o:{},W=X.clipDot,M=W===void 0?!0:W,z=q*2+B;return Y.createElement(sn,{className:S},E||A?Y.createElement("defs",null,Y.createElement("clipPath",{id:"clipPath-".concat(T)},Y.createElement("rect",{x:E?g:g-x/2,y:A?p:p-j/2,width:E?x:x*2,height:A?j:j*2})),!M&&Y.createElement("clipPath",{id:"clipPath-dots-".concat(T)},Y.createElement("rect",{x:g-z/2,y:p-z/2,width:x+z,height:j+z}))):null,!C&&this.renderCurve(k,T),this.renderErrorBar(k,T),(C||o)&&this.renderDots(k,M,T),(!y||N)&&ui.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:s.curPoints}:r.points!==s.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,s){for(var i=r.length%2!==0?[].concat(lc(r),[0]):r,o=[],c=0;c<s;++c)o=[].concat(lc(o),lc(i));return o}},{key:"renderDotItem",value:function(r,s){var i;if(Y.isValidElement(r))i=Y.cloneElement(r,s);else if(Lt(r))i=r(s);else{var o=s.key,c=EM(s,Yde),d=Bt("recharts-line-dot",typeof r!="boolean"?r.className:"");i=Y.createElement(ag,Rd({key:o},c,{className:d}))}return i}}])})(m.PureComponent);Ja(ul,"displayName","Line");Ja(ul,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!_l.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Ja(ul,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,s=e.xAxisTicks,i=e.yAxisTicks,o=e.dataKey,c=e.bandSize,d=e.displayedData,f=e.offset,h=t.layout,p=d.map(function(g,x){var j=tr(g,o);return h==="horizontal"?{x:D2({axis:n,ticks:s,bandSize:c,entry:g,index:x}),y:Ft(j)?null:r.scale(j),value:j,payload:g}:{x:Ft(j)?null:n.scale(j),y:D2({axis:r,ticks:i,bandSize:c,entry:g,index:x}),value:j,payload:g}});return la({points:p,layout:h},f)});function ru(e){"@babel/helpers - typeof";return ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(e)}function lfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cfe(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,RF(r.key),r)}}function ufe(e,t,n){return t&&cfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function dfe(e,t,n){return t=Xm(t),ffe(e,TF()?Reflect.construct(t,n||[],Xm(e).constructor):t.apply(e,n))}function ffe(e,t){if(t&&(ru(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pfe(e)}function pfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TF=function(){return!!e})()}function Xm(e){return Xm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xm(e)}function hfe(e,t){if(typeof t!="function"&&t!==null)throw new 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&&$1(e,t)}function $1(e,t){return $1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},$1(e,t)}function OF(e,t,n){return t=RF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RF(e){var t=mfe(e,"string");return ru(t)=="symbol"?t:t+""}function mfe(e,t){if(ru(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ru(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function D1(){return D1=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},D1.apply(this,arguments)}function vfe(e){var t=e.xAxisId,n=xF(),r=yF(),s=vF(t);return s==null?null:m.createElement(vg,D1({},s,{className:Bt("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Go(o,!0)}}))}var oo=(function(e){function t(){return lfe(this,t),dfe(this,t,arguments)}return hfe(t,e),ufe(t,[{key:"render",value:function(){return m.createElement(vfe,this.props)}}])})(m.Component);OF(oo,"displayName","XAxis");OF(oo,"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 au(e){"@babel/helpers - typeof";return au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},au(e)}function gfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xfe(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,$F(r.key),r)}}function yfe(e,t,n){return t&&xfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function bfe(e,t,n){return t=Qm(t),wfe(e,IF()?Reflect.construct(t,n||[],Qm(e).constructor):t.apply(e,n))}function wfe(e,t){if(t&&(au(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jfe(e)}function jfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(IF=function(){return!!e})()}function Qm(e){return Qm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qm(e)}function Sfe(e,t){if(typeof t!="function"&&t!==null)throw new 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&&L1(e,t)}function L1(e,t){return L1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},L1(e,t)}function MF(e,t,n){return t=$F(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $F(e){var t=Nfe(e,"string");return au(t)=="symbol"?t:t+""}function Nfe(e,t){if(au(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(au(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function F1(){return F1=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},F1.apply(this,arguments)}var Cfe=function(t){var n=t.yAxisId,r=xF(),s=yF(),i=gF(n);return i==null?null:m.createElement(vg,F1({},i,{className:Bt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:s},ticksGenerator:function(c){return Go(c,!0)}}))},lo=(function(e){function t(){return gfe(this,t),bfe(this,t,arguments)}return Sfe(t,e),yfe(t,[{key:"render",value:function(){return m.createElement(Cfe,this.props)}}])})(m.Component);MF(lo,"displayName","YAxis");MF(lo,"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 TM(e){return kfe(e)||Efe(e)||Afe(e)||_fe()}function _fe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
118
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Afe(e,t){if(e){if(typeof e=="string")return z1(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 z1(e,t)}}function Efe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kfe(e){if(Array.isArray(e))return z1(e)}function z1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var B1=function(t,n,r,s,i){var o=xa(t,LC),c=xa(t,pg),d=[].concat(TM(o),TM(c)),f=xa(t,mg),h="".concat(s,"Id"),p=s[0],g=n;if(d.length&&(g=d.reduce(function(y,b){if(b.props[h]===r&&Es(b.props,"extendDomain")&&Qe(b.props[p])){var N=b.props[p];return[Math.min(y[0],N),Math.max(y[1],N)]}return y},g)),f.length){var x="".concat(p,"1"),j="".concat(p,"2");g=f.reduce(function(y,b){if(b.props[h]===r&&Es(b.props,"extendDomain")&&Qe(b.props[x])&&Qe(b.props[j])){var N=b.props[x],C=b.props[j];return[Math.min(y[0],N,C),Math.max(y[1],N,C)]}return y},g)}return i&&i.length&&(g=i.reduce(function(y,b){return Qe(b)?[Math.min(y[0],b),Math.max(y[1],b)]:y},g)),g},$j={exports:{}},OM;function Pfe(){return OM||(OM=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(d,f,h){this.fn=d,this.context=f,this.once=h||!1}function i(d,f,h,p,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var x=new s(h,p||d,g),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],x]:d._events[j].push(x):(d._events[j]=x,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],h,p;if(this._eventsCount===0)return f;for(p in h=this._events)t.call(h,p)&&f.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},c.prototype.listeners=function(f){var h=n?n+f:f,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var g=0,x=p.length,j=new Array(x);g<x;g++)j[g]=p[g].fn;return j},c.prototype.listenerCount=function(f){var h=n?n+f:f,p=this._events[h];return p?p.fn?1:p.length:0},c.prototype.emit=function(f,h,p,g,x,j){var y=n?n+f:f;if(!this._events[y])return!1;var b=this._events[y],N=arguments.length,C,S;if(b.fn){switch(b.once&&this.removeListener(f,b.fn,void 0,!0),N){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,h),!0;case 3:return b.fn.call(b.context,h,p),!0;case 4:return b.fn.call(b.context,h,p,g),!0;case 5:return b.fn.call(b.context,h,p,g,x),!0;case 6:return b.fn.call(b.context,h,p,g,x,j),!0}for(S=1,C=new Array(N-1);S<N;S++)C[S-1]=arguments[S];b.fn.apply(b.context,C)}else{var E=b.length,A;for(S=0;S<E;S++)switch(b[S].once&&this.removeListener(f,b[S].fn,void 0,!0),N){case 1:b[S].fn.call(b[S].context);break;case 2:b[S].fn.call(b[S].context,h);break;case 3:b[S].fn.call(b[S].context,h,p);break;case 4:b[S].fn.call(b[S].context,h,p,g);break;default:if(!C)for(A=1,C=new Array(N-1);A<N;A++)C[A-1]=arguments[A];b[S].fn.apply(b[S].context,C)}}return!0},c.prototype.on=function(f,h,p){return i(this,f,h,p,!1)},c.prototype.once=function(f,h,p){return i(this,f,h,p,!0)},c.prototype.removeListener=function(f,h,p,g){var x=n?n+f:f;if(!this._events[x])return this;if(!h)return o(this,x),this;var j=this._events[x];if(j.fn)j.fn===h&&(!g||j.once)&&(!p||j.context===p)&&o(this,x);else{for(var y=0,b=[],N=j.length;y<N;y++)(j[y].fn!==h||g&&!j[y].once||p&&j[y].context!==p)&&b.push(j[y]);b.length?this._events[x]=b.length===1?b[0]:b:o(this,x)}return this},c.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})($j)),$j.exports}var Tfe=Pfe();const Ofe=hn(Tfe);var Dj=new Ofe,Lj="recharts.syncMouseEvents";function bf(e){"@babel/helpers - typeof";return bf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bf(e)}function Rfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ife(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,DF(r.key),r)}}function Mfe(e,t,n){return t&&Ife(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fj(e,t,n){return t=DF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DF(e){var t=$fe(e,"string");return bf(t)=="symbol"?t:t+""}function $fe(e,t){if(bf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Dfe=(function(){function e(){Rfe(this,e),Fj(this,"activeIndex",0),Fj(this,"coordinateList",[]),Fj(this,"layout","horizontal")}return Mfe(e,[{key:"setDetails",value:function(n){var r,s=n.coordinateList,i=s===void 0?null:s,o=n.container,c=o===void 0?null:o,d=n.layout,f=d===void 0?null:d,h=n.offset,p=h===void 0?null:h,g=n.mouseHandlerCallback,x=g===void 0?null:g;this.coordinateList=(r=i??this.coordinateList)!==null&&r!==void 0?r:[],this.container=c??this.container,this.layout=f??this.layout,this.offset=p??this.offset,this.mouseHandlerCallback=x??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(n){if(this.coordinateList.length!==0)switch(n.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();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var s=this.container.getBoundingClientRect(),i=s.x,o=s.y,c=s.height,d=this.coordinateList[this.activeIndex].coordinate,f=((n=window)===null||n===void 0?void 0:n.scrollX)||0,h=((r=window)===null||r===void 0?void 0:r.scrollY)||0,p=i+d+f,g=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:g})}}}])})();function Lfe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],s=e?.[1];if(r&&s&&Qe(r)&&Qe(s))return!0}return!1}function Ffe(e,t,n,r){var s=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-s,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function LF(e){var t=e.cx,n=e.cy,r=e.radius,s=e.startAngle,i=e.endAngle,o=En(t,n,r,s),c=En(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:s,endAngle:i}}function zfe(e,t,n){var r,s,i,o;if(e==="horizontal")r=t.x,i=r,s=n.top,o=n.top+n.height;else if(e==="vertical")s=t.y,o=s,r=n.left,i=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var c=t.cx,d=t.cy,f=t.innerRadius,h=t.outerRadius,p=t.angle,g=En(c,d,f,p),x=En(c,d,h,p);r=g.x,s=g.y,i=x.x,o=x.y}else return LF(t);return[{x:r,y:s},{x:i,y:o}]}function wf(e){"@babel/helpers - typeof";return wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wf(e)}function RM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Eh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RM(Object(n),!0).forEach(function(r){Bfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bfe(e,t,n){return t=qfe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qfe(e){var t=Ufe(e,"string");return wf(t)=="symbol"?t:t+""}function Ufe(e,t){if(wf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wfe(e){var t,n,r=e.element,s=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,c=e.activePayload,d=e.offset,f=e.activeTooltipIndex,h=e.tooltipAxisBandSize,p=e.layout,g=e.chartName,x=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!x||!i||!o||g!=="ScatterChart"&&s!=="axis")return null;var j,y=Em;if(g==="ScatterChart")j=o,y=Ale;else if(g==="BarChart")j=Ffe(p,o,d,h),y=MC;else if(p==="radial"){var b=LF(o),N=b.cx,C=b.cy,S=b.radius,E=b.startAngle,A=b.endAngle;j={cx:N,cy:C,startAngle:E,endAngle:A,innerRadius:S,outerRadius:S},y=L4}else j={points:zfe(p,o,d)},y=Em;var k=Eh(Eh(Eh(Eh({stroke:"#ccc",pointerEvents:"none"},d),j),kt(x,!1)),{},{payload:c,payloadIndex:f,className:Bt("recharts-tooltip-cursor",x.className)});return m.isValidElement(x)?m.cloneElement(x,k):m.createElement(y,k)}var Vfe=["item"],Hfe=["children","className","width","height","style","compact","title","desc"];function su(e){"@babel/helpers - typeof";return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},su(e)}function bc(){return bc=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},bc.apply(this,arguments)}function IM(e,t){return Yfe(e)||Gfe(e,t)||zF(e,t)||Kfe()}function Kfe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
119
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gfe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function Yfe(e){if(Array.isArray(e))return e}function MM(e,t){if(e==null)return{};var n=Xfe(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xfe(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 Qfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jfe(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,BF(r.key),r)}}function Zfe(e,t,n){return t&&Jfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function epe(e,t,n){return t=Jm(t),tpe(e,FF()?Reflect.construct(t,n||[],Jm(e).constructor):t.apply(e,n))}function tpe(e,t){if(t&&(su(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return npe(e)}function npe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FF=function(){return!!e})()}function Jm(e){return Jm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jm(e)}function rpe(e,t){if(typeof t!="function"&&t!==null)throw new 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&&q1(e,t)}function q1(e,t){return q1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},q1(e,t)}function iu(e){return ipe(e)||spe(e)||zF(e)||ape()}function ape(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
120
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zF(e,t){if(e){if(typeof e=="string")return U1(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 U1(e,t)}}function spe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ipe(e){if(Array.isArray(e))return U1(e)}function U1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$M(Object(n),!0).forEach(function(r){Pt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$M(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pt(e,t,n){return t=BF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BF(e){var t=ope(e,"string");return su(t)=="symbol"?t:t+""}function ope(e,t){if(su(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(su(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lpe={xAxis:["bottom","top"],yAxis:["left","right"]},cpe={width:"100%",height:"100%"},qF={x:0,y:0};function kh(e){return e}var upe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},dpe=function(t,n,r,s){var i=n.find(function(h){return h&&h.index===r});if(i){if(t==="horizontal")return{x:i.coordinate,y:s.y};if(t==="vertical")return{x:s.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,c=s.radius;return Ne(Ne(Ne({},s),En(s.cx,s.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=s.angle;return Ne(Ne(Ne({},s),En(s.cx,s.cy,d,f)),{},{angle:f,radius:d})}return qF},gg=function(t,n){var r=n.graphicalItems,s=n.dataStartIndex,i=n.dataEndIndex,o=(r??[]).reduce(function(c,d){var f=d.props.data;return f&&f.length?[].concat(iu(c),iu(f)):c},[]);return o.length>0?o:t&&t.length&&Qe(s)&&Qe(i)?t.slice(s,i+1):[]};function UF(e){return e==="number"?[0,"auto"]:void 0}var W1=function(t,n,r,s){var i=t.graphicalItems,o=t.tooltipAxis,c=gg(n,t);return r<0||!i||!i.length||r>=c.length?null:i.reduce(function(d,f){var h,p=(h=f.props.data)!==null&&h!==void 0?h:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(o.dataKey&&!o.allowDuplicatedCategory){var x=p===void 0?c:p;g=Jh(x,o.dataKey,s)}else g=p&&p[r]||c[r];return g?[].concat(iu(d),[O4(f,g)]):d},[])},DM=function(t,n,r,s){var i=s||{x:t.chartX,y:t.chartY},o=upe(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=Gae(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,g=W1(t,n,h,p),x=dpe(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:g,activeCoordinate:x}}return null},fpe=function(t,n){var r=n.axes,s=n.graphicalItems,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,g=t.stackOffset,x=A4(h,i);return r.reduce(function(j,y){var b,N=y.type.defaultProps!==void 0?Ne(Ne({},y.type.defaultProps),y.props):y.props,C=N.type,S=N.dataKey,E=N.allowDataOverflow,A=N.allowDuplicatedCategory,k=N.scale,T=N.ticks,O=N.includeHidden,D=N[o];if(j[D])return j;var q=gg(t.data,{graphicalItems:s.filter(function(I){var ee,Q=o in I.props?I.props[o]:(ee=I.type.defaultProps)===null||ee===void 0?void 0:ee[o];return Q===D}),dataStartIndex:d,dataEndIndex:f}),U=q.length,B,X,W;Lfe(N.domain,E,C)&&(B=a1(N.domain,null,E),x&&(C==="number"||k!=="auto")&&(W=kd(q,S,"category")));var M=UF(C);if(!B||B.length===0){var z,K=(z=N.domain)!==null&&z!==void 0?z:M;if(S){if(B=kd(q,S,C),C==="category"&&x){var V=BX(B);A&&V?(X=B,B=Fm(0,U)):A||(B=B2(K,B,y).reduce(function(I,ee){return I.indexOf(ee)>=0?I:[].concat(iu(I),[ee])},[]))}else if(C==="category")A?B=B.filter(function(I){return I!==""&&!Ft(I)}):B=B2(K,B,y).reduce(function(I,ee){return I.indexOf(ee)>=0||ee===""||Ft(ee)?I:[].concat(iu(I),[ee])},[]);else if(C==="number"){var R=Zae(q,s.filter(function(I){var ee,Q,ie=o in I.props?I.props[o]:(ee=I.type.defaultProps)===null||ee===void 0?void 0:ee[o],ue="hide"in I.props?I.props.hide:(Q=I.type.defaultProps)===null||Q===void 0?void 0:Q.hide;return ie===D&&(O||!ue)}),S,i,h);R&&(B=R)}x&&(C==="number"||k!=="auto")&&(W=kd(q,S,"category"))}else x?B=Fm(0,U):c&&c[D]&&c[D].hasStack&&C==="number"?B=g==="expand"?[0,1]:T4(c[D].stackGroups,d,f):B=_4(q,s.filter(function(I){var ee=o in I.props?I.props[o]:I.type.defaultProps[o],Q="hide"in I.props?I.props.hide:I.type.defaultProps.hide;return ee===D&&(O||!Q)}),C,h,!0);if(C==="number")B=B1(p,B,D,i,T),K&&(B=a1(K,B,E));else if(C==="category"&&K){var G=K,$=B.every(function(I){return G.indexOf(I)>=0});$&&(B=G)}}return Ne(Ne({},j),{},Pt({},D,Ne(Ne({},N),{},{axisType:i,domain:B,categoricalDomain:W,duplicateDomain:X,originalDomain:(b=N.domain)!==null&&b!==void 0?b:M,isCategorical:x,layout:h})))},{})},ppe=function(t,n){var r=n.graphicalItems,s=n.Axis,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,g=gg(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),x=g.length,j=A4(h,i),y=-1;return r.reduce(function(b,N){var C=N.type.defaultProps!==void 0?Ne(Ne({},N.type.defaultProps),N.props):N.props,S=C[o],E=UF("number");if(!b[S]){y++;var A;return j?A=Fm(0,x):c&&c[S]&&c[S].hasStack?(A=T4(c[S].stackGroups,d,f),A=B1(p,A,S,i)):(A=a1(E,_4(g,r.filter(function(k){var T,O,D=o in k.props?k.props[o]:(T=k.type.defaultProps)===null||T===void 0?void 0:T[o],q="hide"in k.props?k.props.hide:(O=k.type.defaultProps)===null||O===void 0?void 0:O.hide;return D===S&&!q}),"number",h),s.defaultProps.allowDataOverflow),A=B1(p,A,S,i)),Ne(Ne({},b),{},Pt({},S,Ne(Ne({axisType:i},s.defaultProps),{},{hide:!0,orientation:ga(lpe,"".concat(i,".").concat(y%2),null),domain:A,originalDomain:E,isCategorical:j,layout:h})))}return b},{})},hpe=function(t,n){var r=n.axisType,s=r===void 0?"xAxis":r,i=n.AxisComp,o=n.graphicalItems,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.children,p="".concat(s,"Id"),g=xa(h,i),x={};return g&&g.length?x=fpe(t,{axes:g,graphicalItems:o,axisType:s,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(x=ppe(t,{Axis:i,graphicalItems:o,axisType:s,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),x},mpe=function(t){var n=fc(t),r=Go(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:lC(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Cm(n,r)}},LM=function(t){var n=t.children,r=t.defaultShowTooltip,s=da(n,Xc),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(i=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},vpe=function(t){return!t||!t.length?!1:t.some(function(n){var r=oi(n&&n.type);return r&&r.indexOf("Bar")>=0})},FM=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},gpe=function(t,n){var r=t.props,s=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,c=t.yAxisMap,d=c===void 0?{}:c,f=r.width,h=r.height,p=r.children,g=r.margin||{},x=da(p,Xc),j=da(p,Xo),y=Object.keys(d).reduce(function(A,k){var T=d[k],O=T.orientation;return!T.mirror&&!T.hide?Ne(Ne({},A),{},Pt({},O,A[O]+T.width)):A},{left:g.left||0,right:g.right||0}),b=Object.keys(o).reduce(function(A,k){var T=o[k],O=T.orientation;return!T.mirror&&!T.hide?Ne(Ne({},A),{},Pt({},O,ga(A,"".concat(O))+T.height)):A},{top:g.top||0,bottom:g.bottom||0}),N=Ne(Ne({},b),y),C=N.bottom;x&&(N.bottom+=x.props.height||Xc.defaultProps.height),j&&n&&(N=Qae(N,s,r,n));var S=f-N.left-N.right,E=h-N.top-N.bottom;return Ne(Ne({brushBottom:C},N),{},{width:Math.max(S,0),height:Math.max(E,0)})},xpe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},zC=function(t){var n=t.chartName,r=t.GraphicalChild,s=t.defaultTooltipEventType,i=s===void 0?"axis":s,o=t.validateTooltipEventTypes,c=o===void 0?["axis"]:o,d=t.axisComponents,f=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,g=function(N,C){var S=C.graphicalItems,E=C.stackGroups,A=C.offset,k=C.updateId,T=C.dataStartIndex,O=C.dataEndIndex,D=N.barSize,q=N.layout,U=N.barGap,B=N.barCategoryGap,X=N.maxBarSize,W=FM(q),M=W.numericAxisName,z=W.cateAxisName,K=vpe(S),V=[];return S.forEach(function(R,G){var $=gg(N.data,{graphicalItems:[R],dataStartIndex:T,dataEndIndex:O}),I=R.type.defaultProps!==void 0?Ne(Ne({},R.type.defaultProps),R.props):R.props,ee=I.dataKey,Q=I.maxBarSize,ie=I["".concat(M,"Id")],ue=I["".concat(z,"Id")],re={},je=d.reduce(function(et,st){var xt=C["".concat(st.axisType,"Map")],qt=I["".concat(st.axisType,"Id")];xt&&xt[qt]||st.axisType==="zAxis"||cl();var Ut=xt[qt];return Ne(Ne({},et),{},Pt(Pt({},st.axisType,Ut),"".concat(st.axisType,"Ticks"),Go(Ut)))},re),pe=je[z],oe=je["".concat(z,"Ticks")],_e=E&&E[ie]&&E[ie].hasStack&&lse(R,E[ie].stackGroups),ce=oi(R.type).indexOf("Bar")>=0,de=Cm(pe,oe),ve=[],Pe=K&&Yae({barSize:D,stackGroups:E,totalSize:xpe(je,z)});if(ce){var F,te,fe=Ft(Q)?X:Q,Ee=(F=(te=Cm(pe,oe,!0))!==null&&te!==void 0?te:fe)!==null&&F!==void 0?F:0;ve=Xae({barGap:U,barCategoryGap:B,bandSize:Ee!==de?Ee:de,sizeList:Pe[ue],maxBarSize:fe}),Ee!==de&&(ve=ve.map(function(et){return Ne(Ne({},et),{},{position:Ne(Ne({},et.position),{},{offset:et.position.offset-Ee/2})})}))}var Me=R&&R.type&&R.type.getComposedData;Me&&V.push({props:Ne(Ne({},Me(Ne(Ne({},je),{},{displayedData:$,props:N,dataKey:ee,item:R,bandSize:de,barPosition:ve,offset:A,stackedData:_e,layout:q,dataStartIndex:T,dataEndIndex:O}))),{},Pt(Pt(Pt({key:R.key||"item-".concat(G)},M,je[M]),z,je[z]),"animationId",k)),childIndex:eQ(R,N.children),item:R})}),V},x=function(N,C){var S=N.props,E=N.dataStartIndex,A=N.dataEndIndex,k=N.updateId;if(!tT({props:S}))return null;var T=S.children,O=S.layout,D=S.stackOffset,q=S.data,U=S.reverseStackOrder,B=FM(O),X=B.numericAxisName,W=B.cateAxisName,M=xa(T,r),z=ise(q,M,"".concat(X,"Id"),"".concat(W,"Id"),D,U),K=d.reduce(function(I,ee){var Q="".concat(ee.axisType,"Map");return Ne(Ne({},I),{},Pt({},Q,hpe(S,Ne(Ne({},ee),{},{graphicalItems:M,stackGroups:ee.axisType===X&&z,dataStartIndex:E,dataEndIndex:A}))))},{}),V=gpe(Ne(Ne({},K),{},{props:S,graphicalItems:M}),C?.legendBBox);Object.keys(K).forEach(function(I){K[I]=h(S,K[I],V,I.replace("Map",""),n)});var R=K["".concat(W,"Map")],G=mpe(R),$=g(S,Ne(Ne({},K),{},{dataStartIndex:E,dataEndIndex:A,updateId:k,graphicalItems:M,stackGroups:z,offset:V}));return Ne(Ne({formattedGraphicalItems:$,graphicalItems:M,offset:V,stackGroups:z},G),K)},j=(function(b){function N(C){var S,E,A;return Qfe(this,N),A=epe(this,N,[C]),Pt(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Pt(A,"accessibilityManager",new Dfe),Pt(A,"handleLegendBBoxUpdate",function(k){if(k){var T=A.state,O=T.dataStartIndex,D=T.dataEndIndex,q=T.updateId;A.setState(Ne({legendBBox:k},x({props:A.props,dataStartIndex:O,dataEndIndex:D,updateId:q},Ne(Ne({},A.state),{},{legendBBox:k}))))}}),Pt(A,"handleReceiveSyncEvent",function(k,T,O){if(A.props.syncId===k){if(O===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(T)}}),Pt(A,"handleBrushChange",function(k){var T=k.startIndex,O=k.endIndex;if(T!==A.state.dataStartIndex||O!==A.state.dataEndIndex){var D=A.state.updateId;A.setState(function(){return Ne({dataStartIndex:T,dataEndIndex:O},x({props:A.props,dataStartIndex:T,dataEndIndex:O,updateId:D},A.state))}),A.triggerSyncEvent({dataStartIndex:T,dataEndIndex:O})}}),Pt(A,"handleMouseEnter",function(k){var T=A.getMouseInfo(k);if(T){var O=Ne(Ne({},T),{},{isTooltipActive:!0});A.setState(O),A.triggerSyncEvent(O);var D=A.props.onMouseEnter;Lt(D)&&D(O,k)}}),Pt(A,"triggeredAfterMouseMove",function(k){var T=A.getMouseInfo(k),O=T?Ne(Ne({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(O),A.triggerSyncEvent(O);var D=A.props.onMouseMove;Lt(D)&&D(O,k)}),Pt(A,"handleItemMouseEnter",function(k){A.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),Pt(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),Pt(A,"handleMouseMove",function(k){k.persist(),A.throttleTriggeredAfterMouseMove(k)}),Pt(A,"handleMouseLeave",function(k){A.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};A.setState(T),A.triggerSyncEvent(T);var O=A.props.onMouseLeave;Lt(O)&&O(T,k)}),Pt(A,"handleOuterEvent",function(k){var T=ZX(k),O=ga(A.props,"".concat(T));if(T&&Lt(O)){var D,q;/.*touch.*/i.test(T)?q=A.getMouseInfo(k.changedTouches[0]):q=A.getMouseInfo(k),O((D=q)!==null&&D!==void 0?D:{},k)}}),Pt(A,"handleClick",function(k){var T=A.getMouseInfo(k);if(T){var O=Ne(Ne({},T),{},{isTooltipActive:!0});A.setState(O),A.triggerSyncEvent(O);var D=A.props.onClick;Lt(D)&&D(O,k)}}),Pt(A,"handleMouseDown",function(k){var T=A.props.onMouseDown;if(Lt(T)){var O=A.getMouseInfo(k);T(O,k)}}),Pt(A,"handleMouseUp",function(k){var T=A.props.onMouseUp;if(Lt(T)){var O=A.getMouseInfo(k);T(O,k)}}),Pt(A,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),Pt(A,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&A.handleMouseDown(k.changedTouches[0])}),Pt(A,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&A.handleMouseUp(k.changedTouches[0])}),Pt(A,"handleDoubleClick",function(k){var T=A.props.onDoubleClick;if(Lt(T)){var O=A.getMouseInfo(k);T(O,k)}}),Pt(A,"handleContextMenu",function(k){var T=A.props.onContextMenu;if(Lt(T)){var O=A.getMouseInfo(k);T(O,k)}}),Pt(A,"triggerSyncEvent",function(k){A.props.syncId!==void 0&&Dj.emit(Lj,A.props.syncId,k,A.eventEmitterSymbol)}),Pt(A,"applySyncEvent",function(k){var T=A.props,O=T.layout,D=T.syncMethod,q=A.state.updateId,U=k.dataStartIndex,B=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)A.setState(Ne({dataStartIndex:U,dataEndIndex:B},x({props:A.props,dataStartIndex:U,dataEndIndex:B,updateId:q},A.state)));else if(k.activeTooltipIndex!==void 0){var X=k.chartX,W=k.chartY,M=k.activeTooltipIndex,z=A.state,K=z.offset,V=z.tooltipTicks;if(!K)return;if(typeof D=="function")M=D(V,k);else if(D==="value"){M=-1;for(var R=0;R<V.length;R++)if(V[R].value===k.activeLabel){M=R;break}}var G=Ne(Ne({},K),{},{x:K.left,y:K.top}),$=Math.min(X,G.x+G.width),I=Math.min(W,G.y+G.height),ee=V[M]&&V[M].value,Q=W1(A.state,A.props.data,M),ie=V[M]?{x:O==="horizontal"?V[M].coordinate:$,y:O==="horizontal"?I:V[M].coordinate}:qF;A.setState(Ne(Ne({},k),{},{activeLabel:ee,activeCoordinate:ie,activePayload:Q,activeTooltipIndex:M}))}else A.setState(k)}),Pt(A,"renderCursor",function(k){var T,O=A.state,D=O.isTooltipActive,q=O.activeCoordinate,U=O.activePayload,B=O.offset,X=O.activeTooltipIndex,W=O.tooltipAxisBandSize,M=A.getTooltipEventType(),z=(T=k.props.active)!==null&&T!==void 0?T:D,K=A.props.layout,V=k.key||"_recharts-cursor";return Y.createElement(Wfe,{key:V,activeCoordinate:q,activePayload:U,activeTooltipIndex:X,chartName:n,element:k,isActive:z,layout:K,offset:B,tooltipAxisBandSize:W,tooltipEventType:M})}),Pt(A,"renderPolarAxis",function(k,T,O){var D=ga(k,"type.axisType"),q=ga(A.state,"".concat(D,"Map")),U=k.type.defaultProps,B=U!==void 0?Ne(Ne({},U),k.props):k.props,X=q&&q[B["".concat(D,"Id")]];return m.cloneElement(k,Ne(Ne({},X),{},{className:Bt(D,X.className),key:k.key||"".concat(T,"-").concat(O),ticks:Go(X,!0)}))}),Pt(A,"renderPolarGrid",function(k){var T=k.props,O=T.radialLines,D=T.polarAngles,q=T.polarRadius,U=A.state,B=U.radiusAxisMap,X=U.angleAxisMap,W=fc(B),M=fc(X),z=M.cx,K=M.cy,V=M.innerRadius,R=M.outerRadius;return m.cloneElement(k,{polarAngles:Array.isArray(D)?D:Go(M,!0).map(function(G){return G.coordinate}),polarRadius:Array.isArray(q)?q:Go(W,!0).map(function(G){return G.coordinate}),cx:z,cy:K,innerRadius:V,outerRadius:R,key:k.key||"polar-grid",radialLines:O})}),Pt(A,"renderLegend",function(){var k=A.state.formattedGraphicalItems,T=A.props,O=T.children,D=T.width,q=T.height,U=A.props.margin||{},B=D-(U.left||0)-(U.right||0),X=N4({children:O,formattedGraphicalItems:k,legendWidth:B,legendContent:f});if(!X)return null;var W=X.item,M=MM(X,Vfe);return m.cloneElement(W,Ne(Ne({},M),{},{chartWidth:D,chartHeight:q,margin:U,onBBoxUpdate:A.handleLegendBBoxUpdate}))}),Pt(A,"renderTooltip",function(){var k,T=A.props,O=T.children,D=T.accessibilityLayer,q=da(O,Wr);if(!q)return null;var U=A.state,B=U.isTooltipActive,X=U.activeCoordinate,W=U.activePayload,M=U.activeLabel,z=U.offset,K=(k=q.props.active)!==null&&k!==void 0?k:B;return m.cloneElement(q,{viewBox:Ne(Ne({},z),{},{x:z.left,y:z.top}),active:K,label:M,payload:K?W:[],coordinate:X,accessibilityLayer:D})}),Pt(A,"renderBrush",function(k){var T=A.props,O=T.margin,D=T.data,q=A.state,U=q.offset,B=q.dataStartIndex,X=q.dataEndIndex,W=q.updateId;return m.cloneElement(k,{key:k.key||"_recharts-brush",onChange:Nh(A.handleBrushChange,k.props.onChange),data:D,x:Qe(k.props.x)?k.props.x:U.left,y:Qe(k.props.y)?k.props.y:U.top+U.height+U.brushBottom-(O.bottom||0),width:Qe(k.props.width)?k.props.width:U.width,startIndex:B,endIndex:X,updateId:"brush-".concat(W)})}),Pt(A,"renderReferenceElement",function(k,T,O){if(!k)return null;var D=A,q=D.clipPathId,U=A.state,B=U.xAxisMap,X=U.yAxisMap,W=U.offset,M=k.type.defaultProps||{},z=k.props,K=z.xAxisId,V=K===void 0?M.xAxisId:K,R=z.yAxisId,G=R===void 0?M.yAxisId:R;return m.cloneElement(k,{key:k.key||"".concat(T,"-").concat(O),xAxis:B[V],yAxis:X[G],viewBox:{x:W.left,y:W.top,width:W.width,height:W.height},clipPathId:q})}),Pt(A,"renderActivePoints",function(k){var T=k.item,O=k.activePoint,D=k.basePoint,q=k.childIndex,U=k.isRange,B=[],X=T.props.key,W=T.item.type.defaultProps!==void 0?Ne(Ne({},T.item.type.defaultProps),T.item.props):T.item.props,M=W.activeDot,z=W.dataKey,K=Ne(Ne({index:q,dataKey:z,cx:O.x,cy:O.y,r:4,fill:IC(T.item),strokeWidth:2,stroke:"#fff",payload:O.payload,value:O.value},kt(M,!1)),Zh(M));return B.push(N.renderActiveDot(M,K,"".concat(X,"-activePoint-").concat(q))),D?B.push(N.renderActiveDot(M,Ne(Ne({},K),{},{cx:D.x,cy:D.y}),"".concat(X,"-basePoint-").concat(q))):U&&B.push(null),B}),Pt(A,"renderGraphicChild",function(k,T,O){var D=A.filterFormatItem(k,T,O);if(!D)return null;var q=A.getTooltipEventType(),U=A.state,B=U.isTooltipActive,X=U.tooltipAxis,W=U.activeTooltipIndex,M=U.activeLabel,z=A.props.children,K=da(z,Wr),V=D.props,R=V.points,G=V.isRange,$=V.baseLine,I=D.item.type.defaultProps!==void 0?Ne(Ne({},D.item.type.defaultProps),D.item.props):D.item.props,ee=I.activeDot,Q=I.hide,ie=I.activeBar,ue=I.activeShape,re=!!(!Q&&B&&K&&(ee||ie||ue)),je={};q!=="axis"&&K&&K.props.trigger==="click"?je={onClick:Nh(A.handleItemMouseEnter,k.props.onClick)}:q!=="axis"&&(je={onMouseLeave:Nh(A.handleItemMouseLeave,k.props.onMouseLeave),onMouseEnter:Nh(A.handleItemMouseEnter,k.props.onMouseEnter)});var pe=m.cloneElement(k,Ne(Ne({},D.props),je));function oe(st){return typeof X.dataKey=="function"?X.dataKey(st.payload):null}if(re)if(W>=0){var _e,ce;if(X.dataKey&&!X.allowDuplicatedCategory){var de=typeof X.dataKey=="function"?oe:"payload.".concat(X.dataKey.toString());_e=Jh(R,de,M),ce=G&&$&&Jh($,de,M)}else _e=R?.[W],ce=G&&$&&$[W];if(ue||ie){var ve=k.props.activeIndex!==void 0?k.props.activeIndex:W;return[m.cloneElement(k,Ne(Ne(Ne({},D.props),je),{},{activeIndex:ve})),null,null]}if(!Ft(_e))return[pe].concat(iu(A.renderActivePoints({item:D,activePoint:_e,basePoint:ce,childIndex:W,isRange:G})))}else{var Pe,F=(Pe=A.getItemByXY(A.state.activeCoordinate))!==null&&Pe!==void 0?Pe:{graphicalItem:pe},te=F.graphicalItem,fe=te.item,Ee=fe===void 0?k:fe,Me=te.childIndex,et=Ne(Ne(Ne({},D.props),je),{},{activeIndex:Me});return[m.cloneElement(Ee,et),null,null]}return G?[pe,null,null]:[pe,null]}),Pt(A,"renderCustomized",function(k,T,O){return m.cloneElement(k,Ne(Ne({key:"recharts-customized-".concat(O)},A.props),A.state))}),Pt(A,"renderMap",{CartesianGrid:{handler:kh,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:kh},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:kh},YAxis:{handler:kh},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((S=C.id)!==null&&S!==void 0?S:yu("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=NL(A.triggeredAfterMouseMove,(E=C.throttleDelay)!==null&&E!==void 0?E:1e3/60),A.state={},A}return rpe(N,b),Zfe(N,[{key:"componentDidMount",value:function(){var S,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var S=this.props,E=S.children,A=S.data,k=S.height,T=S.layout,O=da(E,Wr);if(O){var D=O.props.defaultIndex;if(!(typeof D!="number"||D<0||D>this.state.tooltipTicks.length-1)){var q=this.state.tooltipTicks[D]&&this.state.tooltipTicks[D].value,U=W1(this.state,A,D,q),B=this.state.tooltipTicks[D].coordinate,X=(this.state.offset.top+k)/2,W=T==="horizontal",M=W?{x:B,y:X}:{y:B,x:X},z=this.state.formattedGraphicalItems.find(function(V){var R=V.item;return R.type.name==="Scatter"});z&&(M=Ne(Ne({},M),z.props.points[D].tooltipPosition),U=z.props.points[D].tooltipPayload);var K={activeTooltipIndex:D,isTooltipActive:!0,activeLabel:q,activePayload:U,activeCoordinate:M};this.setState(K),this.renderCursor(O),this.accessibilityManager.setIndex(D)}}}},{key:"getSnapshotBeforeUpdate",value:function(S,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==S.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==S.margin){var A,k;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(S){_S([da(S.children,Wr)],[da(this.props.children,Wr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var S=da(this.props.children,Wr);if(S&&typeof S.props.shared=="boolean"){var E=S.props.shared?"axis":"item";return c.indexOf(E)>=0?E:i}return i}},{key:"getMouseInfo",value:function(S){if(!this.container)return null;var E=this.container,A=E.getBoundingClientRect(),k=zee(A),T={chartX:Math.round(S.pageX-k.left),chartY:Math.round(S.pageY-k.top)},O=A.width/E.offsetWidth||1,D=this.inRange(T.chartX,T.chartY,O);if(!D)return null;var q=this.state,U=q.xAxisMap,B=q.yAxisMap,X=this.getTooltipEventType(),W=DM(this.state,this.props.data,this.props.layout,D);if(X!=="axis"&&U&&B){var M=fc(U).scale,z=fc(B).scale,K=M&&M.invert?M.invert(T.chartX):null,V=z&&z.invert?z.invert(T.chartY):null;return Ne(Ne({},T),{},{xValue:K,yValue:V},W)}return W?Ne(Ne({},T),W):null}},{key:"inRange",value:function(S,E){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,T=S/A,O=E/A;if(k==="horizontal"||k==="vertical"){var D=this.state.offset,q=T>=D.left&&T<=D.left+D.width&&O>=D.top&&O<=D.top+D.height;return q?{x:T,y:O}:null}var U=this.state,B=U.angleAxisMap,X=U.radiusAxisMap;if(B&&X){var W=fc(B);return W2({x:T,y:O},W)}return null}},{key:"parseEventsOfWrapper",value:function(){var S=this.props.children,E=this.getTooltipEventType(),A=da(S,Wr),k={};A&&E==="axis"&&(A.props.trigger==="click"?k={onClick:this.handleClick}:k={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=Zh(this.props,this.handleOuterEvent);return Ne(Ne({},T),k)}},{key:"addListener",value:function(){Dj.on(Lj,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Dj.removeListener(Lj,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(S,E,A){for(var k=this.state.formattedGraphicalItems,T=0,O=k.length;T<O;T++){var D=k[T];if(D.item===S||D.props.key===S.key||E===oi(D.item.type)&&A===D.childIndex)return D}return null}},{key:"renderClipPath",value:function(){var S=this.clipPathId,E=this.state.offset,A=E.left,k=E.top,T=E.height,O=E.width;return Y.createElement("defs",null,Y.createElement("clipPath",{id:S},Y.createElement("rect",{x:A,y:k,height:T,width:O})))}},{key:"getXScales",value:function(){var S=this.state.xAxisMap;return S?Object.entries(S).reduce(function(E,A){var k=IM(A,2),T=k[0],O=k[1];return Ne(Ne({},E),{},Pt({},T,O.scale))},{}):null}},{key:"getYScales",value:function(){var S=this.state.yAxisMap;return S?Object.entries(S).reduce(function(E,A){var k=IM(A,2),T=k[0],O=k[1];return Ne(Ne({},E),{},Pt({},T,O.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(S){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[S])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(S){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[S])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(S){var E=this.state,A=E.formattedGraphicalItems,k=E.activeItem;if(A&&A.length)for(var T=0,O=A.length;T<O;T++){var D=A[T],q=D.props,U=D.item,B=U.type.defaultProps!==void 0?Ne(Ne({},U.type.defaultProps),U.props):U.props,X=oi(U.type);if(X==="Bar"){var W=(q.data||[]).find(function(V){return ole(S,V)});if(W)return{graphicalItem:D,payload:W}}else if(X==="RadialBar"){var M=(q.data||[]).find(function(V){return W2(S,V)});if(M)return{graphicalItem:D,payload:M}}else if(cg(D,k)||ug(D,k)||mf(D,k)){var z=Pce({graphicalItem:D,activeTooltipItem:k,itemData:B.data}),K=B.activeIndex===void 0?z:B.activeIndex;return{graphicalItem:Ne(Ne({},D),{},{childIndex:K}),payload:mf(D,k)?B.data[z]:D.props.data[z]}}}return null}},{key:"render",value:function(){var S=this;if(!tT(this))return null;var E=this.props,A=E.children,k=E.className,T=E.width,O=E.height,D=E.style,q=E.compact,U=E.title,B=E.desc,X=MM(E,Hfe),W=kt(X,!1);if(q)return Y.createElement(gM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Y.createElement(ES,bc({},W,{width:T,height:O,title:U,desc:B}),this.renderClipPath(),rT(A,this.renderMap)));if(this.props.accessibilityLayer){var M,z;W.tabIndex=(M=this.props.tabIndex)!==null&&M!==void 0?M:0,W.role=(z=this.props.role)!==null&&z!==void 0?z:"application",W.onKeyDown=function(V){S.accessibilityManager.keyboardEvent(V)},W.onFocus=function(){S.accessibilityManager.focus()}}var K=this.parseEventsOfWrapper();return Y.createElement(gM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Y.createElement("div",bc({className:Bt("recharts-wrapper",k),style:Ne({position:"relative",cursor:"default",width:T,height:O},D)},K,{ref:function(R){S.container=R}}),Y.createElement(ES,bc({},W,{width:T,height:O,title:U,desc:B,style:cpe}),this.renderClipPath(),rT(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(m.Component);Pt(j,"displayName",n),Pt(j,"defaultProps",Ne({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),Pt(j,"getDerivedStateFromProps",function(b,N){var C=b.dataKey,S=b.data,E=b.children,A=b.width,k=b.height,T=b.layout,O=b.stackOffset,D=b.margin,q=N.dataStartIndex,U=N.dataEndIndex;if(N.updateId===void 0){var B=LM(b);return Ne(Ne(Ne({},B),{},{updateId:0},x(Ne(Ne({props:b},B),{},{updateId:0}),N)),{},{prevDataKey:C,prevData:S,prevWidth:A,prevHeight:k,prevLayout:T,prevStackOffset:O,prevMargin:D,prevChildren:E})}if(C!==N.prevDataKey||S!==N.prevData||A!==N.prevWidth||k!==N.prevHeight||T!==N.prevLayout||O!==N.prevStackOffset||!_c(D,N.prevMargin)){var X=LM(b),W={chartX:N.chartX,chartY:N.chartY,isTooltipActive:N.isTooltipActive},M=Ne(Ne({},DM(N,S,T)),{},{updateId:N.updateId+1}),z=Ne(Ne(Ne({},X),W),M);return Ne(Ne(Ne({},z),x(Ne({props:b},z),N)),{},{prevDataKey:C,prevData:S,prevWidth:A,prevHeight:k,prevLayout:T,prevStackOffset:O,prevMargin:D,prevChildren:E})}if(!_S(E,N.prevChildren)){var K,V,R,G,$=da(E,Xc),I=$&&(K=(V=$.props)===null||V===void 0?void 0:V.startIndex)!==null&&K!==void 0?K:q,ee=$&&(R=(G=$.props)===null||G===void 0?void 0:G.endIndex)!==null&&R!==void 0?R:U,Q=I!==q||ee!==U,ie=!Ft(S),ue=ie&&!Q?N.updateId:N.updateId+1;return Ne(Ne({updateId:ue},x(Ne(Ne({props:b},N),{},{updateId:ue,dataStartIndex:I,dataEndIndex:ee}),N)),{},{prevChildren:E,dataStartIndex:I,dataEndIndex:ee})}return null}),Pt(j,"renderActiveDot",function(b,N,C){var S;return m.isValidElement(b)?S=m.cloneElement(b,N):Lt(b)?S=b(N):S=Y.createElement(ag,N),Y.createElement(sn,{className:"recharts-active-dot",key:C},S)});var y=m.forwardRef(function(N,C){return Y.createElement(j,bc({},N,{ref:C}))});return y.displayName=j.displayName,y},V1=zC({chartName:"LineChart",GraphicalChild:ul,axisComponents:[{axisType:"xAxis",AxisComp:oo},{axisType:"yAxis",AxisComp:lo}],formatAxisMap:oF}),ype=zC({chartName:"BarChart",GraphicalChild:Pl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:oo},{axisType:"yAxis",AxisComp:lo}],formatAxisMap:oF}),bpe=zC({chartName:"PieChart",GraphicalChild:Ci,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:lg},{axisType:"radiusAxis",AxisComp:ig}],formatAxisMap:xse,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function BC(e){const t=Array.from(new Map(e.scenarios.map(p=>{const g=String(p.scenarioId??"").trim(),x=String(p.scenarioName??"").trim();return!g&&!x?null:[g||x,x||g]}).filter(p=>!!p)).values()),n=Array.from(new Set(e.scenarios.map(p=>p.agentName||p.agentId).filter(Boolean))),r=Array.from(new Set(e.scenarios.map(p=>p.model).filter(p=>!!p))),s=t.slice(0,2).join(", "),i=t.length>2?` +${t.length-2}`:"",o=r.slice(0,2).join(", "),c=r.length>2?` +${r.length-2}`:"",d=e.configName?.trim()||"",f=e.configPath?.trim()||"",h=d&&f?`${d} · ${f}`:d||f;return{scenarioCount:t.length,agentCount:n.length,scopePreview:h||(s?`${s}${i}`:"n/a"),modelSummary:o?`${o}${c}`:""}}const zM=10080*60*1e3;function BM(e){return e.length===0?0:e.reduce((t,n)=>t+n,0)/e.length}function qM(e,t=0){const n=Number(e.toFixed(t));return`${n>0?"+":""}${n.toFixed(t)}`}const wpe=()=>{const{configs:e}=Df(),{source:t}=Ln(),[n,r]=m.useState(!0),[s,i]=m.useState([]),[o,c]=m.useState([]),[d,f]=m.useState([]),[h,p]=m.useState("timestamp"),[g,x]=m.useState("desc"),j=z=>{if(h===z){x(K=>K==="asc"?"desc":"asc");return}p(z),x("desc")};m.useEffect(()=>{let z=!0;r(!0);const K=Date.now(),V=K-720*60*60*1e3,R=K-zM,G=R-zM,$=new Date(V).toISOString(),I=new Date(R).toISOString(),ee=new Date(G).toISOString(),Q=new Date(R-1).toISOString(),ie=new Date(K).toISOString();return Promise.all([t.listResults({since:$,until:ie}),t.listResults({since:I,until:ie}),t.listResults({since:ee,until:Q})]).then(([ue,re,je])=>{z&&(i(ue),c(re),f(je))}).finally(()=>{z&&r(!1)}),()=>{z=!1}},[t]);const y=e.length,b=s.length,N=o.length===0?0:o.reduce((z,K)=>z+K.overallPassRate,0)/o.length,C=o.length===0?0:Math.round(o.reduce((z,K)=>z+K.avgLatency,0)/o.length),S=BM(d.map(z=>z.overallPassRate)),E=BM(d.map(z=>z.avgLatency)),A=(N-S)*100,k=C-E,T=d.length>0,O=T?`${qM(A,1)}% from last week`:"No prior-week baseline",D=T?`${qM(k,0)}ms from last week`:"No prior-week baseline",q=T?A>0?"up":A<0?"down":"neutral":"neutral",U=T?k<0?"up":k>0?"down":"neutral":"neutral",B=m.useMemo(()=>[...s].sort((K,V)=>{let R=0;return h==="timestamp"&&(R=new Date(K.timestamp).getTime()-new Date(V.timestamp).getTime()),h==="passRate"&&(R=K.overallPassRate-V.overallPassRate),h==="latency"&&(R=K.avgLatency-V.avgLatency),h==="scenarios"&&(R=K.totalScenarios-V.totalScenarios),g==="asc"?R:-R}),[s,h,g]),X=B.slice(0,20),W=z=>{const K=z.toolTokenUsage?.totalTokens;return typeof K=="number"?K.toLocaleString():"n/a"},M=[...B].reverse().map(z=>({date:new Date(z.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(z.overallPassRate*100),latency:z.avgLatency}));return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(cD,{className:"h-6 w-6"}),"Dashboard"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Overview of your MCP evaluation runs"})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx(ne,{asChild:!0,children:a.jsxs(Tt,{to:"/mcp-evaluations/new",children:[a.jsx(yN,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),a.jsx(ne,{variant:"outline",asChild:!0,children:a.jsxs(Tt,{to:"/run",children:[a.jsx(ii,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),a.jsx(ne,{variant:"outline",asChild:!0,children:a.jsxs(Tt,{to:"/results",children:[a.jsx(Pc,{className:"mr-2 h-4 w-4"}),"Browse Results"]})})]})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsx(bs,{title:"MCP Evaluations",value:y,icon:rS,subtitle:`${y} active`}),a.jsx(bs,{title:"Total Runs",value:b,icon:aD,subtitle:"Last 30 days"}),a.jsx(bs,{title:"Pass Rate",value:n?"—":`${Math.round(N*100)}%`,icon:Pc,subtitle:n?"Loading...":O,trend:n?"neutral":q}),a.jsx(bs,{title:"Avg Latency",value:n?"—":`${C}ms`,icon:fD,subtitle:n?"Loading...":D,trend:n?"neutral":U})]}),a.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Pass Rate Trend"})}),a.jsx(Ge,{children:a.jsx(cm,{width:"100%",height:200,children:a.jsxs(V1,{data:M,children:[a.jsx(oo,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(lo,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:z=>`${z}%`}),a.jsx(Wr,{formatter:z=>[`${z}%`,"Pass Rate"]}),a.jsx(ul,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Recent Tool Latency (ms)"})}),a.jsx(Ge,{children:a.jsx(cm,{width:"100%",height:200,children:a.jsxs(V1,{data:M,children:[a.jsx(oo,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(lo,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(Wr,{formatter:z=>[`${z}ms`,"Latency"]}),a.jsx(ul,{type:"monotone",dataKey:"latency",stroke:"hsl(200, 80%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(200, 80%, 50%)"}})]})})})]})]}),a.jsx("div",{className:"grid gap-6",children:a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Recent Runs"})}),a.jsxs(Ge,{className:"p-0",children:[a.jsxs(Kr,{children:[a.jsx(Gr,{children:a.jsxs(Gt,{children:[a.jsx(it,{children:"Run ID"}),a.jsx(it,{children:"Evaluated"}),a.jsx(it,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>j("timestamp"),children:["Timestamp",h==="timestamp"?g==="asc"?a.jsx(Cs,{className:"h-3.5 w-3.5"}):a.jsx(Qt,{className:"h-3.5 w-3.5"}):a.jsx(wc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),a.jsx(it,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex w-full items-center justify-end gap-1 hover:text-foreground",onClick:()=>j("passRate"),children:["Pass Rate",h==="passRate"?g==="asc"?a.jsx(Cs,{className:"h-3.5 w-3.5"}):a.jsx(Qt,{className:"h-3.5 w-3.5"}):a.jsx(wc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),a.jsx(it,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>j("scenarios"),children:["Scenarios",h==="scenarios"?g==="asc"?a.jsx(Cs,{className:"h-3.5 w-3.5"}):a.jsx(Qt,{className:"h-3.5 w-3.5"}):a.jsx(wc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),a.jsx(it,{className:"text-right",children:"Avg Tool Calls"}),a.jsx(it,{className:"text-right",children:"Tool Tokens"})]})}),a.jsxs(Yr,{children:[X.length===0&&a.jsx(Gt,{children:a.jsx(We,{colSpan:7,className:"py-8 text-center text-sm text-muted-foreground",children:"No runs in the past 30 days."})}),X.map(z=>a.jsxs(Gt,{className:"cursor-pointer",children:[a.jsx(We,{children:a.jsx(Tt,{to:`/results/${z.id}`,className:"font-mono text-xs text-primary hover:underline",children:z.id})}),a.jsx(We,{className:"text-[11px] text-muted-foreground",children:(()=>{const K=BC(z);return a.jsxs("div",{className:"space-y-0.5",children:[a.jsxs("div",{children:["Evaluated: ",K.scenarioCount," scenario",K.scenarioCount===1?"":"s"," · ",K.agentCount," agent",K.agentCount===1?"":"s",K.modelSummary?` · ${K.modelSummary}`:""]}),a.jsx("div",{className:"font-mono text-xs text-foreground/80",children:K.scopePreview})]})})()}),a.jsx(We,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(yi,{className:"h-3 w-3"}),new Date(z.timestamp).toLocaleString()]})}),a.jsx(We,{className:"text-right",children:a.jsx(ni,{rate:z.overallPassRate})}),a.jsx(We,{className:"text-right font-mono text-sm",children:z.totalScenarios}),a.jsx(We,{className:"text-right font-mono text-sm",children:z.avgToolCalls.toFixed(0)}),a.jsx(We,{className:"text-right font-mono text-sm",children:W(z)})]},z.id))]})]}),B.length>20&&a.jsx("div",{className:"border-t p-4 text-center",children:a.jsx(ne,{variant:"outline",asChild:!0,children:a.jsx(Tt,{to:"/results",children:"Show more"})})})]})]})})]})};function qC({value:e,onValueChange:t,placeholder:n="Search...",className:r,inputClassName:s,clearAriaLabel:i="Clear search"}){return a.jsxs("div",{className:Ce("relative",r),children:[a.jsx(bt,{value:e,onChange:o=>t(o.target.value),placeholder:n,className:Ce("h-9 w-[240px] pr-8",s)}),e&&a.jsx(ne,{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":i,children:a.jsx(rs,{className:"h-4 w-4"})})]})}var jpe=m.createContext(void 0);function Nu(e){const t=m.useContext(jpe);return e||t||"ltr"}var zj="rovingFocusGroup.onEntryFocus",Spe={bubbles:!1,cancelable:!0},Kf="RovingFocusGroup",[H1,WF,Npe]=Af(Kf),[Cpe,xg]=gr(Kf,[Npe]),[_pe,Ape]=Cpe(Kf),VF=m.forwardRef((e,t)=>a.jsx(H1.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(H1.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Epe,{...e,ref:t})})}));VF.displayName=Kf;var Epe=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,g=m.useRef(null),x=Et(t,g),j=Nu(i),[y,b]=ya({prop:o,defaultProp:c??null,onChange:d,caller:Kf}),[N,C]=m.useState(!1),S=Hn(f),E=WF(n),A=m.useRef(!1),[k,T]=m.useState(0);return m.useEffect(()=>{const O=g.current;if(O)return O.addEventListener(zj,S),()=>O.removeEventListener(zj,S)},[S]),a.jsx(_pe,{scope:n,orientation:r,dir:j,loop:s,currentTabStopId:y,onItemFocus:m.useCallback(O=>b(O),[b]),onItemShiftTab:m.useCallback(()=>C(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(O=>O+1),[]),onFocusableItemRemove:m.useCallback(()=>T(O=>O-1),[]),children:a.jsx(tt.div,{tabIndex:N||k===0?-1:0,"data-orientation":r,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:Le(e.onMouseDown,()=>{A.current=!0}),onFocus:Le(e.onFocus,O=>{const D=!A.current;if(O.target===O.currentTarget&&D&&!N){const q=new CustomEvent(zj,Spe);if(O.currentTarget.dispatchEvent(q),!q.defaultPrevented){const U=E().filter(z=>z.focusable),B=U.find(z=>z.active),X=U.find(z=>z.id===y),M=[B,X,...U].filter(Boolean).map(z=>z.ref.current);GF(M,h)}}A.current=!1}),onBlur:Le(e.onBlur,()=>C(!1))})})}),HF="RovingFocusGroupItem",KF=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:o,...c}=e,d=rr(),f=i||d,h=Ape(HF,n),p=h.currentTabStopId===f,g=WF(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:y}=h;return m.useEffect(()=>{if(r)return x(),()=>j()},[r,x,j]),a.jsx(H1.ItemSlot,{scope:n,id:f,focusable:r,active:s,children:a.jsx(tt.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Le(e.onMouseDown,b=>{r?h.onItemFocus(f):b.preventDefault()}),onFocus:Le(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Le(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){h.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const N=Tpe(b,h.orientation,h.dir);if(N!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let S=g().filter(E=>E.focusable).map(E=>E.ref.current);if(N==="last")S.reverse();else if(N==="prev"||N==="next"){N==="prev"&&S.reverse();const E=S.indexOf(b.currentTarget);S=h.loop?Ope(S,E+1):S.slice(E+1)}setTimeout(()=>GF(S))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:y!=null}):o})})});KF.displayName=HF;var kpe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ppe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Tpe(e,t,n){const r=Ppe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return kpe[r]}function GF(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ope(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var YF=VF,XF=KF;function Rpe(e){const t=Ipe(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find($pe);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function Ipe(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=Lpe(s),c=Dpe(i,s.props);return s.type!==m.Fragment&&(c.ref=r?Ir(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Mpe=Symbol("radix.slottable");function $pe(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Mpe}function Dpe(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Lpe(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 K1=["Enter"," "],Fpe=["ArrowDown","PageUp","Home"],QF=["ArrowUp","PageDown","End"],zpe=[...Fpe,...QF],Bpe={ltr:[...K1,"ArrowRight"],rtl:[...K1,"ArrowLeft"]},qpe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gf="Menu",[jf,Upe,Wpe]=Af(Gf),[Tl,JF]=gr(Gf,[Wpe,fo,xg]),yg=fo(),ZF=xg(),[Vpe,Ol]=Tl(Gf),[Hpe,Yf]=Tl(Gf),ez=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:o=!0}=e,c=yg(t),[d,f]=m.useState(null),h=m.useRef(!1),p=Hn(i),g=Nu(s);return m.useEffect(()=>{const x=()=>{h.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>h.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),a.jsx(gv,{...c,children:a.jsx(Vpe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:a.jsx(Hpe,{scope:t,onClose:m.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:g,modal:o,children:r})})})};ez.displayName=Gf;var Kpe="MenuAnchor",UC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=yg(n);return a.jsx(Pf,{...s,...r,ref:t})});UC.displayName=Kpe;var WC="MenuPortal",[Gpe,tz]=Tl(WC,{forceMount:void 0}),nz=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=Ol(WC,t);return a.jsx(Gpe,{scope:t,forceMount:n,children:a.jsx(Xn,{present:n||i.open,children:a.jsx(jl,{asChild:!0,container:s,children:r})})})};nz.displayName=WC;var Ia="MenuContent",[Ype,VC]=Tl(Ia),rz=m.forwardRef((e,t)=>{const n=tz(Ia,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Ol(Ia,e.__scopeMenu),o=Yf(Ia,e.__scopeMenu);return a.jsx(jf.Provider,{scope:e.__scopeMenu,children:a.jsx(Xn,{present:r||i.open,children:a.jsx(jf.Slot,{scope:e.__scopeMenu,children:o.modal?a.jsx(Xpe,{...s,ref:t}):a.jsx(Qpe,{...s,ref:t})})})})}),Xpe=m.forwardRef((e,t)=>{const n=Ol(Ia,e.__scopeMenu),r=m.useRef(null),s=Et(t,r);return m.useEffect(()=>{const i=r.current;if(i)return kv(i)},[]),a.jsx(HC,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Le(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Qpe=m.forwardRef((e,t)=>{const n=Ol(Ia,e.__scopeMenu);return a.jsx(HC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Jpe=Rpe("MenuContent.ScrollLock"),HC=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:x,disableOutsideScroll:j,...y}=e,b=Ol(Ia,n),N=Yf(Ia,n),C=yg(n),S=ZF(n),E=Upe(n),[A,k]=m.useState(null),T=m.useRef(null),O=Et(t,T,b.onContentChange),D=m.useRef(0),q=m.useRef(""),U=m.useRef(0),B=m.useRef(null),X=m.useRef("right"),W=m.useRef(0),M=j?Rf:m.Fragment,z=j?{as:Jpe,allowPinchZoom:!0}:void 0,K=R=>{const G=q.current+R,$=E().filter(re=>!re.disabled),I=document.activeElement,ee=$.find(re=>re.ref.current===I)?.textValue,Q=$.map(re=>re.textValue),ie=uhe(Q,G,ee),ue=$.find(re=>re.textValue===ie)?.ref.current;(function re(je){q.current=je,window.clearTimeout(D.current),je!==""&&(D.current=window.setTimeout(()=>re(""),1e3))})(G),ue&&setTimeout(()=>ue.focus())};m.useEffect(()=>()=>window.clearTimeout(D.current),[]),Av();const V=m.useCallback(R=>X.current===B.current?.side&&fhe(R,B.current?.area),[]);return a.jsx(Ype,{scope:n,searchRef:q,onItemEnter:m.useCallback(R=>{V(R)&&R.preventDefault()},[V]),onItemLeave:m.useCallback(R=>{V(R)||(T.current?.focus(),k(null))},[V]),onTriggerLeave:m.useCallback(R=>{V(R)&&R.preventDefault()},[V]),pointerGraceTimerRef:U,onPointerGraceIntentChange:m.useCallback(R=>{B.current=R},[]),children:a.jsx(M,{...z,children:a.jsx(Of,{asChild:!0,trapped:s,onMountAutoFocus:Le(i,R=>{R.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:a.jsx(wl,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:x,children:a.jsx(YF,{asChild:!0,...S,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:k,onEntryFocus:Le(d,R=>{N.isUsingKeyboardRef.current||R.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(xv,{role:"menu","aria-orientation":"vertical","data-state":yz(b.open),"data-radix-menu-content":"",dir:N.dir,...C,...y,ref:O,style:{outline:"none",...y.style},onKeyDown:Le(y.onKeyDown,R=>{const $=R.target.closest("[data-radix-menu-content]")===R.currentTarget,I=R.ctrlKey||R.altKey||R.metaKey,ee=R.key.length===1;$&&(R.key==="Tab"&&R.preventDefault(),!I&&ee&&K(R.key));const Q=T.current;if(R.target!==Q||!zpe.includes(R.key))return;R.preventDefault();const ue=E().filter(re=>!re.disabled).map(re=>re.ref.current);QF.includes(R.key)&&ue.reverse(),lhe(ue)}),onBlur:Le(e.onBlur,R=>{R.currentTarget.contains(R.target)||(window.clearTimeout(D.current),q.current="")}),onPointerMove:Le(e.onPointerMove,Sf(R=>{const G=R.target,$=W.current!==R.clientX;if(R.currentTarget.contains(G)&&$){const I=R.clientX>W.current?"right":"left";X.current=I,W.current=R.clientX}}))})})})})})})});rz.displayName=Ia;var Zpe="MenuGroup",KC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(tt.div,{role:"group",...r,ref:t})});KC.displayName=Zpe;var ehe="MenuLabel",az=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(tt.div,{...r,ref:t})});az.displayName=ehe;var Zm="MenuItem",UM="menu.itemSelect",bg=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=m.useRef(null),o=Yf(Zm,e.__scopeMenu),c=VC(Zm,e.__scopeMenu),d=Et(t,i),f=m.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const g=new CustomEvent(UM,{bubbles:!0,cancelable:!0});p.addEventListener(UM,x=>r?.(x),{once:!0}),dN(p,g),g.defaultPrevented?f.current=!1:o.onClose()}};return a.jsx(sz,{...s,ref:d,disabled:n,onClick:Le(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Le(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Le(e.onKeyDown,p=>{const g=c.searchRef.current!=="";n||g&&p.key===" "||K1.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});bg.displayName=Zm;var sz=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,o=VC(Zm,n),c=ZF(n),d=m.useRef(null),f=Et(t,d),[h,p]=m.useState(!1),[g,x]=m.useState("");return m.useEffect(()=>{const j=d.current;j&&x((j.textContent??"").trim())},[i.children]),a.jsx(jf.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:a.jsx(XF,{asChild:!0,...c,focusable:!r,children:a.jsx(tt.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Le(e.onPointerMove,Sf(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Le(e.onPointerLeave,Sf(j=>o.onItemLeave(j))),onFocus:Le(e.onFocus,()=>p(!0)),onBlur:Le(e.onBlur,()=>p(!1))})})})}),the="MenuCheckboxItem",iz=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return a.jsx(dz,{scope:e.__scopeMenu,checked:n,children:a.jsx(bg,{role:"menuitemcheckbox","aria-checked":ev(n)?"mixed":n,...s,ref:t,"data-state":YC(n),onSelect:Le(s.onSelect,()=>r?.(ev(n)?!0:!n),{checkForDefaultPrevented:!1})})})});iz.displayName=the;var oz="MenuRadioGroup",[nhe,rhe]=Tl(oz,{value:void 0,onValueChange:()=>{}}),lz=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=Hn(r);return a.jsx(nhe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:a.jsx(KC,{...s,ref:t})})});lz.displayName=oz;var cz="MenuRadioItem",uz=m.forwardRef((e,t)=>{const{value:n,...r}=e,s=rhe(cz,e.__scopeMenu),i=n===s.value;return a.jsx(dz,{scope:e.__scopeMenu,checked:i,children:a.jsx(bg,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":YC(i),onSelect:Le(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});uz.displayName=cz;var GC="MenuItemIndicator",[dz,ahe]=Tl(GC,{checked:!1}),fz=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=ahe(GC,n);return a.jsx(Xn,{present:r||ev(i.checked)||i.checked===!0,children:a.jsx(tt.span,{...s,ref:t,"data-state":YC(i.checked)})})});fz.displayName=GC;var she="MenuSeparator",pz=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(tt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});pz.displayName=she;var ihe="MenuArrow",hz=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=yg(n);return a.jsx(yv,{...s,...r,ref:t})});hz.displayName=ihe;var ohe="MenuSub",[kye,mz]=Tl(ohe),Sd="MenuSubTrigger",vz=m.forwardRef((e,t)=>{const n=Ol(Sd,e.__scopeMenu),r=Yf(Sd,e.__scopeMenu),s=mz(Sd,e.__scopeMenu),i=VC(Sd,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=i,f={__scopeMenu:e.__scopeMenu},h=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>h,[h]),m.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),d(null)}},[c,d]),a.jsx(UC,{asChild:!0,...f,children:a.jsx(sz,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":yz(n.open),...e,ref:Ir(t,s.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Le(e.onPointerMove,Sf(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Le(e.onPointerLeave,Sf(p=>{h();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,j=x==="right",y=j?-5:5,b=g[j?"left":"right"],N=g[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+y,y:p.clientY},{x:b,y:g.top},{x:N,y:g.top},{x:N,y:g.bottom},{x:b,y:g.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Le(e.onKeyDown,p=>{const g=i.searchRef.current!=="";e.disabled||g&&p.key===" "||Bpe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});vz.displayName=Sd;var gz="MenuSubContent",xz=m.forwardRef((e,t)=>{const n=tz(Ia,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Ol(Ia,e.__scopeMenu),o=Yf(Ia,e.__scopeMenu),c=mz(gz,e.__scopeMenu),d=m.useRef(null),f=Et(t,d);return a.jsx(jf.Provider,{scope:e.__scopeMenu,children:a.jsx(Xn,{present:r||i.open,children:a.jsx(jf.Slot,{scope:e.__scopeMenu,children:a.jsx(HC,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:f,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{o.isUsingKeyboardRef.current&&d.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Le(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Le(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Le(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),g=qpe[o.dir].includes(h.key);p&&g&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});xz.displayName=gz;function yz(e){return e?"open":"closed"}function ev(e){return e==="indeterminate"}function YC(e){return ev(e)?"indeterminate":e?"checked":"unchecked"}function lhe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function che(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function uhe(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=che(e,Math.max(i,0));s.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function dhe(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(s=!s)}return s}function fhe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return dhe(n,t)}function Sf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var phe=ez,hhe=UC,mhe=nz,vhe=rz,ghe=KC,xhe=az,yhe=bg,bhe=iz,whe=lz,jhe=uz,She=fz,Nhe=pz,Che=hz,_he=vz,Ahe=xz,wg="DropdownMenu",[Ehe]=gr(wg,[JF]),Mr=JF(),[khe,bz]=Ehe(wg),wz=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=Mr(t),f=m.useRef(null),[h,p]=ya({prop:s,defaultProp:i??!1,onChange:o,caller:wg});return a.jsx(khe,{scope:t,triggerId:rr(),triggerRef:f,contentId:rr(),open:h,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(g=>!g),[p]),modal:c,children:a.jsx(phe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};wz.displayName=wg;var jz="DropdownMenuTrigger",Sz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=bz(jz,n),o=Mr(n);return a.jsx(hhe,{asChild:!0,...o,children:a.jsx(tt.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Ir(t,i.triggerRef),onPointerDown:Le(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:Le(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Sz.displayName=jz;var Phe="DropdownMenuPortal",Nz=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Mr(t);return a.jsx(mhe,{...r,...n})};Nz.displayName=Phe;var Cz="DropdownMenuContent",_z=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=bz(Cz,n),i=Mr(n),o=m.useRef(!1);return a.jsx(vhe,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Le(e.onCloseAutoFocus,c=>{o.current||s.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Le(e.onInteractOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!s.modal||h)&&(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)"}})});_z.displayName=Cz;var The="DropdownMenuGroup",Ohe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return a.jsx(ghe,{...s,...r,ref:t})});Ohe.displayName=The;var Rhe="DropdownMenuLabel",Az=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return a.jsx(xhe,{...s,...r,ref:t})});Az.displayName=Rhe;var Ihe="DropdownMenuItem",Ez=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return a.jsx(yhe,{...s,...r,ref:t})});Ez.displayName=Ihe;var Mhe="DropdownMenuCheckboxItem",kz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return a.jsx(bhe,{...s,...r,ref:t})});kz.displayName=Mhe;var $he="DropdownMenuRadioGroup",Dhe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return a.jsx(whe,{...s,...r,ref:t})});Dhe.displayName=$he;var Lhe="DropdownMenuRadioItem",Pz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return a.jsx(jhe,{...s,...r,ref:t})});Pz.displayName=Lhe;var Fhe="DropdownMenuItemIndicator",Tz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return a.jsx(She,{...s,...r,ref:t})});Tz.displayName=Fhe;var zhe="DropdownMenuSeparator",Oz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return a.jsx(Nhe,{...s,...r,ref:t})});Oz.displayName=zhe;var Bhe="DropdownMenuArrow",qhe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return a.jsx(Che,{...s,...r,ref:t})});qhe.displayName=Bhe;var Uhe="DropdownMenuSubTrigger",Rz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return a.jsx(_he,{...s,...r,ref:t})});Rz.displayName=Uhe;var Whe="DropdownMenuSubContent",Iz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mr(n);return a.jsx(Ahe,{...s,...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)"}})});Iz.displayName=Whe;var Vhe=wz,Hhe=Sz,Khe=Nz,Mz=_z,$z=Az,Dz=Ez,Lz=kz,Fz=Pz,zz=Tz,Bz=Oz,qz=Rz,Uz=Iz;const Xf=Vhe,Qf=Hhe,Ghe=m.forwardRef(({className:e,inset:t,children:n,...r},s)=>a.jsxs(qz,{ref:s,className:Ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,a.jsx(mN,{className:"ml-auto h-4 w-4"})]}));Ghe.displayName=qz.displayName;const Yhe=m.forwardRef(({className:e,...t},n)=>a.jsx(Uz,{ref:n,className:Ce("z-50 min-w-[8rem] 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}));Yhe.displayName=Uz.displayName;const Cu=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(Khe,{children:a.jsx(Mz,{ref:r,sideOffset:t,className:Ce("z-50 min-w-[8rem] 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})}));Cu.displayName=Mz.displayName;const Qr=m.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(Dz,{ref:r,className:Ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));Qr.displayName=Dz.displayName;const Xhe=m.forwardRef(({className:e,children:t,checked:n,...r},s)=>a.jsxs(Lz,{ref:s,className:Ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(zz,{children:a.jsx(Tc,{className:"h-4 w-4"})})}),t]}));Xhe.displayName=Lz.displayName;const Qhe=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Fz,{ref:r,className:Ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(zz,{children:a.jsx($7,{className:"h-2 w-2 fill-current"})})}),t]}));Qhe.displayName=Fz.displayName;const Wz=m.forwardRef(({className:e,inset:t,...n},r)=>a.jsx($z,{ref:r,className:Ce("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Wz.displayName=$z.displayName;const Vz=m.forwardRef(({className:e,...t},n)=>a.jsx(Bz,{ref:n,className:Ce("-mx-1 my-1 h-px bg-muted",e),...t}));Vz.displayName=Bz.displayName;function Nf(e,[t,n]){return Math.min(n,Math.max(t,e))}function Jhe(e){const t=Zhe(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(tme);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function Zhe(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=rme(s),c=nme(i,s.props);return s.type!==m.Fragment&&(c.ref=r?Ir(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eme=Symbol("radix.slottable");function tme(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eme}function nme(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function rme(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 jg(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ame=[" ","Enter","ArrowUp","ArrowDown"],sme=[" ","Enter"],dl="Select",[Sg,Ng,ime]=Af(dl),[_u]=gr(dl,[ime,fo]),Cg=fo(),[ome,xo]=_u(dl),[lme,cme]=_u(dl),Hz=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:c,onValueChange:d,dir:f,name:h,autoComplete:p,disabled:g,required:x,form:j}=e,y=Cg(t),[b,N]=m.useState(null),[C,S]=m.useState(null),[E,A]=m.useState(!1),k=Nu(f),[T,O]=ya({prop:r,defaultProp:s??!1,onChange:i,caller:dl}),[D,q]=ya({prop:o,defaultProp:c,onChange:d,caller:dl}),U=m.useRef(null),B=b?j||!!b.closest("form"):!0,[X,W]=m.useState(new Set),M=Array.from(X).map(z=>z.props.value).join(";");return a.jsx(gv,{...y,children:a.jsxs(ome,{required:x,scope:t,trigger:b,onTriggerChange:N,valueNode:C,onValueNodeChange:S,valueNodeHasChildren:E,onValueNodeHasChildrenChange:A,contentId:rr(),value:D,onValueChange:q,open:T,onOpenChange:O,dir:k,triggerPointerDownPosRef:U,disabled:g,children:[a.jsx(Sg.Provider,{scope:t,children:a.jsx(lme,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(z=>{W(K=>new Set(K).add(z))},[]),onNativeOptionRemove:m.useCallback(z=>{W(K=>{const V=new Set(K);return V.delete(z),V})},[]),children:n})}),B?a.jsxs(vB,{"aria-hidden":!0,required:x,tabIndex:-1,name:h,autoComplete:p,value:D,onChange:z=>q(z.target.value),disabled:g,form:j,children:[D===void 0?a.jsx("option",{value:""}):null,Array.from(X)]},M):null]})})};Hz.displayName=dl;var Kz="SelectTrigger",Gz=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=Cg(n),o=xo(Kz,n),c=o.disabled||r,d=Et(t,o.onTriggerChange),f=Ng(n),h=m.useRef("touch"),[p,g,x]=xB(y=>{const b=f().filter(S=>!S.disabled),N=b.find(S=>S.value===o.value),C=yB(b,y,N);C!==void 0&&o.onValueChange(C.value)}),j=y=>{c||(o.onOpenChange(!0),x()),y&&(o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return a.jsx(Pf,{asChild:!0,...i,children:a.jsx(tt.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:c,"data-disabled":c?"":void 0,"data-placeholder":gB(o.value)?"":void 0,...s,ref:d,onClick:Le(s.onClick,y=>{y.currentTarget.focus(),h.current!=="mouse"&&j(y)}),onPointerDown:Le(s.onPointerDown,y=>{h.current=y.pointerType;const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(j(y),y.preventDefault())}),onKeyDown:Le(s.onKeyDown,y=>{const b=p.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&g(y.key),!(b&&y.key===" ")&&ame.includes(y.key)&&(j(),y.preventDefault())})})})});Gz.displayName=Kz;var Yz="SelectValue",Xz=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...c}=e,d=xo(Yz,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=Et(t,d.onValueNodeChange);return ar(()=>{f(h)},[f,h]),a.jsx(tt.span,{...c,ref:p,style:{pointerEvents:"none"},children:gB(d.value)?a.jsx(a.Fragment,{children:o}):i})});Xz.displayName=Yz;var ume="SelectIcon",Qz=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(tt.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});Qz.displayName=ume;var dme="SelectPortal",Jz=e=>a.jsx(jl,{asChild:!0,...e});Jz.displayName=dme;var fl="SelectContent",Zz=m.forwardRef((e,t)=>{const n=xo(fl,e.__scopeSelect),[r,s]=m.useState();if(ar(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?cu.createPortal(a.jsx(eB,{scope:e.__scopeSelect,children:a.jsx(Sg.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(tB,{...e,ref:t})});Zz.displayName=fl;var Ya=10,[eB,yo]=_u(fl),fme="SelectContentImpl",pme=Jhe("SelectContent.RemoveScroll"),tB=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:y,avoidCollisions:b,...N}=e,C=xo(fl,n),[S,E]=m.useState(null),[A,k]=m.useState(null),T=Et(t,re=>E(re)),[O,D]=m.useState(null),[q,U]=m.useState(null),B=Ng(n),[X,W]=m.useState(!1),M=m.useRef(!1);m.useEffect(()=>{if(S)return kv(S)},[S]),Av();const z=m.useCallback(re=>{const[je,...pe]=B().map(ce=>ce.ref.current),[oe]=pe.slice(-1),_e=document.activeElement;for(const ce of re)if(ce===_e||(ce?.scrollIntoView({block:"nearest"}),ce===je&&A&&(A.scrollTop=0),ce===oe&&A&&(A.scrollTop=A.scrollHeight),ce?.focus(),document.activeElement!==_e))return},[B,A]),K=m.useCallback(()=>z([O,S]),[z,O,S]);m.useEffect(()=>{X&&K()},[X,K]);const{onOpenChange:V,triggerPointerDownPosRef:R}=C;m.useEffect(()=>{if(S){let re={x:0,y:0};const je=oe=>{re={x:Math.abs(Math.round(oe.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(oe.pageY)-(R.current?.y??0))}},pe=oe=>{re.x<=10&&re.y<=10?oe.preventDefault():S.contains(oe.target)||V(!1),document.removeEventListener("pointermove",je),R.current=null};return R.current!==null&&(document.addEventListener("pointermove",je),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",je),document.removeEventListener("pointerup",pe,{capture:!0})}}},[S,V,R]),m.useEffect(()=>{const re=()=>V(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[V]);const[G,$]=xB(re=>{const je=B().filter(_e=>!_e.disabled),pe=je.find(_e=>_e.ref.current===document.activeElement),oe=yB(je,re,pe);oe&&setTimeout(()=>oe.ref.current.focus())}),I=m.useCallback((re,je,pe)=>{const oe=!M.current&&!pe;(C.value!==void 0&&C.value===je||oe)&&(D(re),oe&&(M.current=!0))},[C.value]),ee=m.useCallback(()=>S?.focus(),[S]),Q=m.useCallback((re,je,pe)=>{const oe=!M.current&&!pe;(C.value!==void 0&&C.value===je||oe)&&U(re)},[C.value]),ie=r==="popper"?G1:nB,ue=ie===G1?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:y,avoidCollisions:b}:{};return a.jsx(eB,{scope:n,content:S,viewport:A,onViewportChange:k,itemRefCallback:I,selectedItem:O,onItemLeave:ee,itemTextRefCallback:Q,focusSelectedItem:K,selectedItemText:q,position:r,isPositioned:X,searchRef:G,children:a.jsx(Rf,{as:pme,allowPinchZoom:!0,children:a.jsx(Of,{asChild:!0,trapped:C.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:Le(s,re=>{C.trigger?.focus({preventScroll:!0}),re.preventDefault()}),children:a.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:a.jsx(ie,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:re=>re.preventDefault(),...N,...ue,onPlaced:()=>W(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Le(N.onKeyDown,re=>{const je=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!je&&re.key.length===1&&$(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let oe=B().filter(_e=>!_e.disabled).map(_e=>_e.ref.current);if(["ArrowUp","End"].includes(re.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const _e=re.target,ce=oe.indexOf(_e);oe=oe.slice(ce+1)}setTimeout(()=>z(oe)),re.preventDefault()}})})})})})})});tB.displayName=fme;var hme="SelectItemAlignedPosition",nB=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=xo(fl,n),o=yo(fl,n),[c,d]=m.useState(null),[f,h]=m.useState(null),p=Et(t,T=>h(T)),g=Ng(n),x=m.useRef(!1),j=m.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:N,focusSelectedItem:C}=o,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&f&&y&&b&&N){const T=i.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),q=N.getBoundingClientRect();if(i.dir!=="rtl"){const _e=q.left-O.left,ce=D.left-_e,de=T.left-ce,ve=T.width+de,Pe=Math.max(ve,O.width),F=window.innerWidth-Ya,te=Nf(ce,[Ya,Math.max(Ya,F-Pe)]);c.style.minWidth=ve+"px",c.style.left=te+"px"}else{const _e=O.right-q.right,ce=window.innerWidth-D.right-_e,de=window.innerWidth-T.right-ce,ve=T.width+de,Pe=Math.max(ve,O.width),F=window.innerWidth-Ya,te=Nf(ce,[Ya,Math.max(Ya,F-Pe)]);c.style.minWidth=ve+"px",c.style.right=te+"px"}const U=g(),B=window.innerHeight-Ya*2,X=y.scrollHeight,W=window.getComputedStyle(f),M=parseInt(W.borderTopWidth,10),z=parseInt(W.paddingTop,10),K=parseInt(W.borderBottomWidth,10),V=parseInt(W.paddingBottom,10),R=M+z+X+V+K,G=Math.min(b.offsetHeight*5,R),$=window.getComputedStyle(y),I=parseInt($.paddingTop,10),ee=parseInt($.paddingBottom,10),Q=T.top+T.height/2-Ya,ie=B-Q,ue=b.offsetHeight/2,re=b.offsetTop+ue,je=M+z+re,pe=R-je;if(je<=Q){const _e=U.length>0&&b===U[U.length-1].ref.current;c.style.bottom="0px";const ce=f.clientHeight-y.offsetTop-y.offsetHeight,de=Math.max(ie,ue+(_e?ee:0)+ce+K),ve=je+de;c.style.height=ve+"px"}else{const _e=U.length>0&&b===U[0].ref.current;c.style.top="0px";const de=Math.max(Q,M+y.offsetTop+(_e?I:0)+ue)+pe;c.style.height=de+"px",y.scrollTop=je-Q+y.offsetTop}c.style.margin=`${Ya}px 0`,c.style.minHeight=G+"px",c.style.maxHeight=B+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[g,i.trigger,i.valueNode,c,f,y,b,N,i.dir,r]);ar(()=>S(),[S]);const[E,A]=m.useState();ar(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const k=m.useCallback(T=>{T&&j.current===!0&&(S(),C?.(),j.current=!1)},[S,C]);return a.jsx(vme,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:x,onScrollButtonChange:k,children:a.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:a.jsx(tt.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});nB.displayName=hme;var mme="SelectPopperPosition",G1=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ya,...i}=e,o=Cg(n);return a.jsx(xv,{...o,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.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)"}})});G1.displayName=mme;var[vme,XC]=_u(fl,{}),Y1="SelectViewport",rB=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=yo(Y1,n),o=XC(Y1,n),c=Et(t,i.onViewportChange),d=m.useRef(0);return a.jsxs(a.Fragment,{children:[a.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}),a.jsx(Sg.Slot,{scope:n,children:a.jsx(tt.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Le(s.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=o;if(g?.current&&p){const x=Math.abs(d.current-h.scrollTop);if(x>0){const j=window.innerHeight-Ya*2,y=parseFloat(p.style.minHeight),b=parseFloat(p.style.height),N=Math.max(y,b);if(N<j){const C=N+x,S=Math.min(j,C),E=C-S;p.style.height=S+"px",p.style.bottom==="0px"&&(h.scrollTop=E>0?E:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});rB.displayName=Y1;var aB="SelectGroup",[gme,xme]=_u(aB),yme=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=rr();return a.jsx(gme,{scope:n,id:s,children:a.jsx(tt.div,{role:"group","aria-labelledby":s,...r,ref:t})})});yme.displayName=aB;var sB="SelectLabel",iB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=xme(sB,n);return a.jsx(tt.div,{id:s.id,...r,ref:t})});iB.displayName=sB;var tv="SelectItem",[bme,oB]=_u(tv),lB=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,c=xo(tv,n),d=yo(tv,n),f=c.value===r,[h,p]=m.useState(i??""),[g,x]=m.useState(!1),j=Et(t,C=>d.itemRefCallback?.(C,r,s)),y=rr(),b=m.useRef("touch"),N=()=>{s||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new 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 a.jsx(bme,{scope:n,value:r,disabled:s,textId:y,isSelected:f,onItemTextChange:m.useCallback(C=>{p(S=>S||(C?.textContent??"").trim())},[]),children:a.jsx(Sg.ItemSlot,{scope:n,value:r,disabled:s,textValue:h,children:a.jsx(tt.div,{role:"option","aria-labelledby":y,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:j,onFocus:Le(o.onFocus,()=>x(!0)),onBlur:Le(o.onBlur,()=>x(!1)),onClick:Le(o.onClick,()=>{b.current!=="mouse"&&N()}),onPointerUp:Le(o.onPointerUp,()=>{b.current==="mouse"&&N()}),onPointerDown:Le(o.onPointerDown,C=>{b.current=C.pointerType}),onPointerMove:Le(o.onPointerMove,C=>{b.current=C.pointerType,s?d.onItemLeave?.():b.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Le(o.onPointerLeave,C=>{C.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Le(o.onKeyDown,C=>{d.searchRef?.current!==""&&C.key===" "||(sme.includes(C.key)&&N(),C.key===" "&&C.preventDefault())})})})})});lB.displayName=tv;var Nd="SelectItemText",cB=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=xo(Nd,n),c=yo(Nd,n),d=oB(Nd,n),f=cme(Nd,n),[h,p]=m.useState(null),g=Et(t,N=>p(N),d.onItemTextChange,N=>c.itemTextRefCallback?.(N,d.value,d.disabled)),x=h?.textContent,j=m.useMemo(()=>a.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=f;return ar(()=>(y(j),()=>b(j)),[y,b,j]),a.jsxs(a.Fragment,{children:[a.jsx(tt.span,{id:d.textId,...i,ref:g}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?cu.createPortal(i.children,o.valueNode):null]})});cB.displayName=Nd;var uB="SelectItemIndicator",dB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return oB(uB,n).isSelected?a.jsx(tt.span,{"aria-hidden":!0,...r,ref:t}):null});dB.displayName=uB;var X1="SelectScrollUpButton",fB=m.forwardRef((e,t)=>{const n=yo(X1,e.__scopeSelect),r=XC(X1,e.__scopeSelect),[s,i]=m.useState(!1),o=Et(t,r.onScrollButtonChange);return ar(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollTop>0;i(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?a.jsx(hB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});fB.displayName=X1;var Q1="SelectScrollDownButton",pB=m.forwardRef((e,t)=>{const n=yo(Q1,e.__scopeSelect),r=XC(Q1,e.__scopeSelect),[s,i]=m.useState(!1),o=Et(t,r.onScrollButtonChange);return ar(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<f;i(h)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?a.jsx(hB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});pB.displayName=Q1;var hB=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=yo("SelectScrollButton",n),o=m.useRef(null),c=Ng(n),d=m.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return m.useEffect(()=>()=>d(),[d]),ar(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),a.jsx(tt.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Le(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Le(s.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Le(s.onPointerLeave,()=>{d()})})}),wme="SelectSeparator",mB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(tt.div,{"aria-hidden":!0,...r,ref:t})});mB.displayName=wme;var J1="SelectArrow",jme=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Cg(n),i=xo(J1,n),o=yo(J1,n);return i.open&&o.position==="popper"?a.jsx(yv,{...s,...r,ref:t}):null});jme.displayName=J1;var Sme="SelectBubbleInput",vB=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=m.useRef(null),i=Et(r,s),o=jg(t);return m.useEffect(()=>{const c=s.current;if(!c)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("change",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),a.jsx(tt.select,{...n,style:{...$$,...n.style},ref:i,defaultValue:t})});vB.displayName=Sme;function gB(e){return e===""||e===void 0}function xB(e){const t=Hn(e),n=m.useRef(""),r=m.useRef(0),s=m.useCallback(o=>{const c=n.current+o;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function yB(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=Nme(e,Math.max(i,0));s.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function Nme(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Cme=Hz,bB=Gz,_me=Xz,Ame=Qz,Eme=Jz,wB=Zz,kme=rB,jB=iB,SB=lB,Pme=cB,Tme=dB,NB=fB,CB=pB,_B=mB;const _n=Cme,An=_me,bn=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(bB,{ref:r,className:Ce("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-none 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,a.jsx(Ame,{asChild:!0,children:a.jsx(Qt,{className:"h-4 w-4 opacity-50"})})]}));bn.displayName=bB.displayName;const AB=m.forwardRef(({className:e,...t},n)=>a.jsx(NB,{ref:n,className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Cs,{className:"h-4 w-4"})}));AB.displayName=NB.displayName;const EB=m.forwardRef(({className:e,...t},n)=>a.jsx(CB,{ref:n,className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Qt,{className:"h-4 w-4"})}));EB.displayName=CB.displayName;const wn=m.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>a.jsx(Eme,{children:a.jsxs(wB,{ref:s,className:Ce("relative z-50 max-h-96 min-w-[8rem] 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:[a.jsx(AB,{}),a.jsx(kme,{className:Ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(EB,{})]})}));wn.displayName=wB.displayName;const Ome=m.forwardRef(({className:e,...t},n)=>a.jsx(jB,{ref:n,className:Ce("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ome.displayName=jB.displayName;const ot=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(SB,{ref:r,className:Ce("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(Tme,{children:a.jsx(Tc,{className:"h-4 w-4"})})}),a.jsx(Pme,{children:t})]}));ot.displayName=SB.displayName;const Rme=m.forwardRef(({className:e,...t},n)=>a.jsx(_B,{ref:n,className:Ce("-mx-1 my-1 h-px bg-muted",e),...t}));Rme.displayName=_B.displayName;const Gi=e=>e.configName?.trim()||e.name,Ime="(root)",kB="__ROOT__",WM="mcplab.configurations.collapsedSuites",Bj=e=>e.suitePath&&e.suitePath.trim().length>0?e.suitePath.trim():null,Fo=e=>e??Ime,qj=e=>e===null?kB:`suite:${e}`,Mme=e=>e===kB?null:e.startsWith("suite:")?e.slice(6):null,$me=(e,t)=>t===null?e===null:e===null?!1:e===t||e.startsWith(`${t}/`),Dme=e=>{for(const t of e){const n=t.scenarioEntries??[];for(const s of n){if(s.kind==="inline"&&s.scenario?.id)return String(s.scenario.id);if(s.kind==="referenced"&&s.ref)return String(s.ref)}const r=t.scenarios??[];for(const s of r)if(s?.id)return String(s.id)}return null},Lme=e=>Dme([e]),Fme=e=>{const t=Lme(e);return t?{href:`/results?scenario=${encodeURIComponent(t)}`,tooltipLabel:`Open results filtered by scenario ${t}`}:{href:"/results",tooltipLabel:"Open results"}},VM=["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"];function zme(e){if(e===null)return"bg-slate-400";const t=e.split("").reduce((n,r)=>(n+r.charCodeAt(0))%VM.length,0);return VM[t]??"bg-slate-400"}const Bme=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:s}=Df(),{source:i}=Ln(),o=La(),[c,d]=m.useState("name"),[f,h]=m.useState("asc"),[p,g]=m.useState(""),[x,j]=m.useState("all"),[y,b]=m.useState(()=>{try{const $=window.localStorage.getItem(WM);if(!$)return new Set;const I=JSON.parse($);return Array.isArray(I)?new Set(I.filter(ee=>typeof ee=="string")):new Set}catch($){return console.warn("Failed to restore collapsed suites from localStorage",$),new Set}}),[N,C]=m.useState(new Set),[S,E]=m.useState(new Set),[A,k]=m.useState(new Set),T=p.trim().toLowerCase(),O=$=>{if(c===$){h(I=>I==="asc"?"desc":"asc");return}d($),h($==="updatedAt"?"desc":"asc")};m.useEffect(()=>{s();const $=()=>{s()};return window.addEventListener("focus",$),()=>{window.removeEventListener("focus",$)}},[s]);const D=async($,I)=>{await t($),ke({title:"Deleted",description:`"${I}" has been removed.`})},q=async $=>{const I=await n($);ke({title:"Cloned",description:`Created "${Gi(I)}".`}),o(`/mcp-evaluations/${I.id}`)},U=$=>$.agentEntries?.length??$.agents?.length??0,B=$=>$.scenarioEntries?.length??$.scenarios?.length??0,X=m.useMemo(()=>{const $=new Set;for(const I of e){const ee=Bj(I);if($.add(ee),!ee)continue;const Q=ee.split("/").filter(Boolean);for(let ie=1;ie<Q.length;ie+=1)$.add(Q.slice(0,ie).join("/"))}return Array.from($).sort((I,ee)=>Fo(I).localeCompare(Fo(ee)))},[e]),W=m.useMemo(()=>e.filter($=>{const I=Bj($),ee=x==="all"?void 0:Mme(x),Q=Fo(I);return ee!==void 0&&!$me(I,ee)?!1:T.length===0?!0:[Gi($),$.id,$.description??"",$.loadError??"",Q,$.relativePath??""].join(" ").toLowerCase().includes(T)}),[e,T,x]),M=m.useMemo(()=>[...W].sort((I,ee)=>{let Q=0;return c==="name"&&(Q=Gi(I).localeCompare(Gi(ee))),c==="scenarios"&&(Q=B(I)-B(ee)),c==="agents"&&(Q=U(I)-U(ee)),c==="updatedAt"&&(Q=new Date(I.updatedAt).getTime()-new Date(ee.updatedAt).getTime()),f==="asc"?Q:-Q}),[W,c,f]),z=$=>c!==$?a.jsx(wc,{className:"h-3.5 w-3.5 text-muted-foreground"}):f==="asc"?a.jsx(Cs,{className:"h-3.5 w-3.5"}):a.jsx(Qt,{className:"h-3.5 w-3.5"}),K=$=>{b(I=>{const ee=new Set(I);return ee.has($)?ee.delete($):ee.add($),ee})},V=async($,I,ee)=>{if(!S.has($)){E(Q=>new Set(Q).add($));try{await i.startRun({configPath:I,runsPerScenario:1,applySnapshotEval:!0}),C(Q=>new Set(Q).add($)),window.setTimeout(()=>{C(Q=>{const ie=new Set(Q);return ie.delete($),ie})},2e3),ke({title:"Queued",description:`"${ee}" added to run queue.`})}catch(Q){ke({title:"Could not queue evaluation",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}finally{E(Q=>{const ie=new Set(Q);return ie.delete($),ie})}}};m.useEffect(()=>{try{window.localStorage.setItem(WM,JSON.stringify(Array.from(y)))}catch($){console.warn("Failed to persist collapsed suites to localStorage (quota/private mode?)",$)}},[y]);const R=async($,I,ee)=>{if(!A.has($)){k(Q=>new Set(Q).add($));try{const Q=ee.filter(oe=>typeof oe.sourcePath=="string"&&oe.sourcePath.trim().length>0);if(Q.length===0){ke({title:"No runnable evaluations",description:`Suite "${I}" has no evaluation files with a source path.`,variant:"destructive"});return}const ie=await Promise.allSettled(Q.map(oe=>i.startRun({configPath:String(oe.sourcePath),runsPerScenario:1,applySnapshotEval:!0}))),ue=ie.filter(oe=>oe.status==="fulfilled").length,re=ie.length-ue,je=ie.find(oe=>oe.status==="rejected"),pe=je?je.reason instanceof Error?je.reason.message:String(je.reason):void 0;ke({title:re===0?"Suite queued":"Suite queued with errors",description:re===0?`Queued ${ue} evaluation${ue===1?"":"s"} for suite "${I}".`:`Queued ${ue}/${Q.length} evaluations for suite "${I}" (${re} failed${pe?`: ${pe}`:""}).`,variant:re===0?"default":"destructive"})}catch(Q){ke({title:"Could not queue suite",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}finally{k(Q=>{const ie=new Set(Q);return ie.delete($),ie})}}},G=m.useMemo(()=>{const $=new Map;for(const I of M){const ee=Bj(I),Q=$.get(ee);Q?Q.push(I):$.set(ee,[I])}return Array.from($.entries()).sort((I,ee)=>Fo(I[0]).localeCompare(Fo(ee[0])))},[M]);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(lD,{className:"h-6 w-6"}),"MCP Evaluations"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your MCP evaluation suites"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(qC,{value:p,onValueChange:g,placeholder:"Search evaluations..."}),a.jsxs(_n,{value:x,onValueChange:j,children:[a.jsx(bn,{className:"h-9 w-[200px]",children:a.jsx(An,{placeholder:"All suites"})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"all",children:"All suites"}),X.map($=>a.jsx(ot,{value:qj($),children:Fo($)},qj($)))]})]}),a.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>{s()},children:[a.jsx(ba,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(ne,{variant:"outline",size:"sm",children:[a.jsx(X7,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),a.jsx(ne,{size:"sm",asChild:!0,children:a.jsxs(Tt,{to:"/mcp-evaluations/new",children:[a.jsx(fi,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),a.jsx(Ke,{children:a.jsx(Ge,{className:"p-0",children:a.jsxs(Kr,{children:[a.jsx(Gr,{children:a.jsxs(Gt,{children:[a.jsx(it,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>O("name"),children:["Name",z("name")]})}),a.jsx(it,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>O("scenarios"),children:["Scenarios",z("scenarios")]})}),a.jsx(it,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>O("agents"),children:["Agents",z("agents")]})}),a.jsx(it,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>O("updatedAt"),children:["Last Updated",z("updatedAt")]})}),a.jsx(it,{className:"w-[220px] text-right"})]})}),a.jsxs(Yr,{children:[G.map(([$,I])=>{const ee=Fo($),Q=qj($),ie=y.has(Q),ue=A.has(Q);return a.jsxs(m.Fragment,{children:[a.jsx(Gt,{className:"bg-muted/40 hover:bg-muted/40",children:a.jsx(We,{colSpan:5,className:"py-2",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("button",{type:"button",className:"inline-flex h-6 items-center gap-2 text-xs leading-none hover:text-foreground",onClick:()=>K(Q),"aria-expanded":!ie,"aria-label":`${ie?"Expand":"Collapse"} suite ${ee}`,children:[a.jsx(mN,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${ie?"":"rotate-90"}`,"aria-hidden":"true"}),a.jsx("span",{className:`h-2 w-2 rounded-full ${zme($)}`,"aria-hidden":"true"}),$===null?a.jsx(B7,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}):a.jsx(F7,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),a.jsx("span",{className:"font-medium",children:ee}),a.jsxs("span",{className:"text-muted-foreground",children:["(",I.length,")"]})]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:ue,onClick:()=>{R(Q,ee,I)},children:[a.jsx(ii,{className:"mr-1 h-3.5 w-3.5"}),ue?"Queueing...":"Run Suite"]})]})})},`suite-${Q}`),!ie&&I.map(re=>{const je=Fme(re);return a.jsxs(Gt,{children:[a.jsx(We,{children:a.jsxs("div",{children:[a.jsx(Tt,{to:`/mcp-evaluations/${re.id}`,className:"font-medium text-sm hover:text-primary",children:Gi(re)}),re.loadError&&a.jsxs(He,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[a.jsx($h,{className:"mr-1 h-3 w-3"}),"Broken"]}),re.relativePath&&a.jsx("div",{className:"mt-0.5",children:a.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:re.relativePath})}),re.loadError&&a.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:re.loadError})]})}),a.jsx(We,{className:"text-right font-mono text-sm",children:B(re)}),a.jsx(We,{className:"text-right font-mono text-sm",children:U(re)}),a.jsx(We,{className:"text-right text-xs text-muted-foreground",children:a.jsxs("div",{className:"inline-flex items-center gap-1",children:[a.jsx(yi,{className:"h-3 w-3"}),new Date(re.updatedAt).toLocaleDateString()]})}),a.jsx(We,{className:"w-[220px] whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsxs(Xf,{children:[a.jsx(Qf,{asChild:!0,children:a.jsx(ne,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(uv,{className:"h-4 w-4"})})}),a.jsxs(Cu,{align:"end",children:[a.jsxs(Qr,{onClick:()=>o(`/mcp-evaluations/${re.id}`),children:[a.jsx(dv,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),a.jsxs(Qr,{onClick:()=>{q(re.id)},children:[a.jsx(Ps,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),a.jsxs(Qr,{className:"text-destructive",onClick:()=>{D(re.id,Gi(re))},children:[a.jsx($a,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]}),a.jsx(ao,{children:a.jsxs(so,{children:[a.jsx(io,{asChild:!0,children:a.jsx(ne,{size:"icon",variant:"outline",className:"h-8 w-8",asChild:!0,"aria-label":je.tooltipLabel,children:a.jsxs(Tt,{to:je.href,children:[a.jsx(Pc,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"sr-only",children:je.tooltipLabel})]})})}),a.jsx(mi,{children:je.tooltipLabel})]})}),a.jsx(ao,{children:a.jsxs(so,{children:[a.jsx(io,{asChild:!0,children:a.jsx(ne,{size:"sm",variant:"outline",className:`h-8 px-2 text-xs ${N.has(re.id)?"border-green-600 bg-green-600 text-white hover:bg-green-700 hover:text-white":""}`,disabled:S.has(re.id)||!re.sourcePath,onClick:()=>re.sourcePath&&void V(re.id,re.sourcePath,Gi(re)),"aria-label":`Queue ${Gi(re)}`,children:N.has(re.id)?"Queued":S.has(re.id)?"Queueing...":a.jsxs(a.Fragment,{children:[a.jsx(W7,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"sr-only",children:"Queue evaluation"})]})})}),a.jsx(mi,{children:"Queue evaluation run"})]})}),a.jsx(ne,{size:"sm",variant:"outline",asChild:!0,children:a.jsxs(Tt,{to:`/run?configId=${encodeURIComponent(re.id)}`,children:[a.jsx(ii,{className:"h-3.5 w-3.5"}),"Run"]})})]})})]},re.id)})]},`suite-group-${Q}`)}),!r&&e.length===0&&a.jsx(Gt,{children:a.jsx(We,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations yet. Create your first one to get started."})}),!r&&e.length>0&&M.length===0&&a.jsx(Gt,{children:a.jsx(We,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations match this filter."})}),r&&a.jsx(Gt,{children:a.jsx(We,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var qme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ume=qme.reduce((e,t)=>{const n=_v(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:o,...c}=s,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Wme="Label",PB=m.forwardRef((e,t)=>a.jsx(Ume.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));PB.displayName=Wme;var TB=PB;const Vme=Sl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ze=m.forwardRef(({className:e,...t},n)=>a.jsx(TB,{ref:n,className:Ce(Vme(),e),...t}));ze.displayName=TB.displayName;const Is=m.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:Ce("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-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Is.displayName="Textarea";var _g="Switch",[Hme]=gr(_g),[Kme,Gme]=Hme(_g),OB=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:o,disabled:c,value:d="on",onCheckedChange:f,form:h,...p}=e,[g,x]=m.useState(null),j=Et(t,S=>x(S)),y=m.useRef(!1),b=g?h||!!g.closest("form"):!0,[N,C]=ya({prop:s,defaultProp:i??!1,onChange:f,caller:_g});return a.jsxs(Kme,{scope:n,checked:N,disabled:c,children:[a.jsx(tt.button,{type:"button",role:"switch","aria-checked":N,"aria-required":o,"data-state":$B(N),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:Le(e.onClick,S=>{C(E=>!E),b&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),b&&a.jsx(MB,{control:g,bubbles:!y.current,name:r,value:d,checked:N,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});OB.displayName=_g;var RB="SwitchThumb",IB=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=Gme(RB,n);return a.jsx(tt.span,{"data-state":$B(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});IB.displayName=RB;var Yme="SwitchBubbleInput",MB=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const o=m.useRef(null),c=Et(o,i),d=jg(n),f=vv(t);return m.useEffect(()=>{const h=o.current;if(!h)return;const p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&x){const j=new Event("click",{bubbles:r});x.call(h,n),h.dispatchEvent(j)}},[d,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});MB.displayName=Yme;function $B(e){return e?"checked":"unchecked"}var DB=OB,Xme=IB;const nv=m.forwardRef(({className:e,...t},n)=>a.jsx(DB,{className:Ce("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-none 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:a.jsx(Xme,{className:Ce("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")})}));nv.displayName=DB.displayName;var Ag="Tabs",[Qme]=gr(Ag,[xg]),LB=xg(),[Jme,QC]=Qme(Ag),FB=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=Nu(c),[p,g]=ya({prop:r,onChange:s,defaultProp:i??"",caller:Ag});return a.jsx(Jme,{scope:n,baseId:rr(),value:p,onValueChange:g,orientation:o,dir:h,activationMode:d,children:a.jsx(tt.div,{dir:h,"data-orientation":o,...f,ref:t})})});FB.displayName=Ag;var zB="TabsList",BB=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=QC(zB,n),o=LB(n);return a.jsx(YF,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:a.jsx(tt.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});BB.displayName=zB;var qB="TabsTrigger",UB=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,o=QC(qB,n),c=LB(n),d=HB(o.baseId,r),f=KB(o.baseId,r),h=r===o.value;return a.jsx(XF,{asChild:!0,...c,focusable:!s,active:h,children:a.jsx(tt.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...i,ref:t,onMouseDown:Le(e.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:Le(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:Le(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!s&&p&&o.onValueChange(r)})})})});UB.displayName=qB;var WB="TabsContent",VB=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=e,c=QC(WB,n),d=HB(c.baseId,r),f=KB(c.baseId,r),h=r===c.value,p=m.useRef(h);return m.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),a.jsx(Xn,{present:s||h,children:({present:g})=>a.jsx(tt.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&i})})});VB.displayName=WB;function HB(e,t){return`${e}-trigger-${t}`}function KB(e,t){return`${e}-content-${t}`}var Zme=FB,GB=BB,YB=UB,XB=VB;const Eg=Zme,Jf=m.forwardRef(({className:e,...t},n)=>a.jsx(GB,{ref:n,className:Ce("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Jf.displayName=GB.displayName;const ks=m.forwardRef(({className:e,...t},n)=>a.jsx(YB,{ref:n,className:Ce("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-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));ks.displayName=YB.displayName;const Cf=m.forwardRef(({className:e,...t},n)=>a.jsx(XB,{ref:n,className:Ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Cf.displayName=XB.displayName;const eve={openai:"OpenAI",anthropic:"Anthropic",azure:"Azure OpenAI",azure_openai:"Azure OpenAI",google:"Google"};function rv(e){return eve[e]??e}const HM={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 QB({provider:e}){return a.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${HM[e]??HM.custom}`,children:rv(e)})}var kg="Collapsible",[tve]=gr(kg),[nve,JC]=tve(kg),JB=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:o,...c}=e,[d,f]=ya({prop:r,defaultProp:s??!1,onChange:o,caller:kg});return a.jsx(nve,{scope:n,disabled:i,contentId:rr(),open:d,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),children:a.jsx(tt.div,{"data-state":e_(d),"data-disabled":i?"":void 0,...c,ref:t})})});JB.displayName=kg;var ZB="CollapsibleTrigger",e8=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=JC(ZB,n);return a.jsx(tt.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":e_(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Le(e.onClick,s.onOpenToggle)})});e8.displayName=ZB;var ZC="CollapsibleContent",t8=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=JC(ZC,e.__scopeCollapsible);return a.jsx(Xn,{present:n||s.open,children:({present:i})=>a.jsx(rve,{...r,ref:t,present:i})})});t8.displayName=ZC;var rve=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,o=JC(ZC,n),[c,d]=m.useState(r),f=m.useRef(null),h=Et(t,f),p=m.useRef(0),g=p.current,x=m.useRef(0),j=x.current,y=o.open||c,b=m.useRef(y),N=m.useRef(void 0);return m.useEffect(()=>{const C=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(C)},[]),ar(()=>{const C=f.current;if(C){N.current=N.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const S=C.getBoundingClientRect();p.current=S.height,x.current=S.width,b.current||(C.style.transitionDuration=N.current.transitionDuration,C.style.animationName=N.current.animationName),d(r)}},[o.open,r]),a.jsx(tt.div,{"data-state":e_(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!y,...i,ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:y&&s})});function e_(e){return e?"open":"closed"}var ave=JB;const Za=ave,Pa=e8,es=t8;function Ma({text:e,variant:t="assistant",className:n}){const r=sve(e);return a.jsx("div",{className:Ce("space-y-2",t==="system"&&"text-xs",n),children:r.map((s,i)=>a.jsx(m.Fragment,{children:ive(s,i,t)},`md-${i}`))})}function sve(e){const t=e.replace(/\r\n/g,`
|
|
121
|
-
`).split(`
|
|
122
|
-
`),n=[];let r=0;const s=o=>o.trim()==="",i=o=>o.trimStart().startsWith("```");for(;r<t.length;){const o=t[r],c=o.trim();if(s(o)){r+=1;continue}if(i(o)){const g=c.replace(/^```/,"").trim()||void 0;r+=1;const x=[];for(;r<t.length&&!i(t[r]);)x.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:g,code:x.join(`
|
|
123
|
-
`)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const g=[];for(;r<t.length&&t[r].trim().startsWith(">");)g.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:g.join(`
|
|
124
|
-
`)});continue}const d=c.match(/^(#{1,4})\s+(.+)$/);if(d){n.push({type:"heading",level:d[1].length,text:d[2].trim()}),r+=1;continue}if(KM(t,r)){const g=GM(t[r]);r+=2;const x=[];for(;r<t.length&&t[r].includes("|")&&!s(t[r]);)x.push(GM(t[r])),r+=1;n.push({type:"table",headers:g,rows:x});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const g=!!f,x=[];for(;r<t.length;){const j=t[r].trim();if(g?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){x.push(j.replace(g?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}s(t[r])&&(r+=1);break}n.push({type:"list",ordered:g,items:x});continue}const p=[o];for(r+=1;r<t.length;){const g=t[r],x=g.trim();if(s(g)||i(g)||/^---+$/.test(x)||/^#{1,4}\s+/.test(x)||x.startsWith(">")||KM(t,r)||/^\d+\.\s+/.test(x)||/^[-*+]\s+/.test(x))break;p.push(g),r+=1}n.push({type:"paragraph",text:p.join(`
|
|
125
|
-
`)})}return n}function KM(e,t){if(t+1>=e.length)return!1;const n=e[t].trim(),r=e[t+1].trim();return n.includes("|")?/^\|?(\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?$/.test(r):!1}function GM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function ive(e,t,n){if(e.type==="hr")return a.jsx("hr",{className:"border-border/60"});if(e.type==="heading"){const r=e.level===1?"text-base font-semibold":e.level===2?"text-sm font-semibold":"text-sm font-medium";return a.jsx("h4",{className:r,children:cc(e.text,`${t}-h`)})}if(e.type==="paragraph")return a.jsx("p",{className:Ce("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:cc(e.text,`${t}-p`)});if(e.type==="blockquote")return a.jsx("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground italic",children:cc(e.text,`${t}-bq`)});if(e.type==="code")return a.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&a.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),a.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:a.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return a.jsx(r,{className:Ce("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((s,i)=>a.jsx("li",{className:"leading-relaxed",children:cc(s,`${t}-li-${i}`)},`${t}-li-${i}`))})}return e.type==="table"?a.jsx("div",{className:"overflow-x-auto rounded-md border",children:a.jsxs("table",{className:"w-full min-w-[480px] border-collapse text-xs",children:[a.jsx("thead",{className:"bg-muted/40",children:a.jsx("tr",{children:e.headers.map((r,s)=>a.jsx("th",{className:"border-b px-2 py-1.5 text-left font-semibold align-top",children:cc(r,`${t}-thc-${s}`)},`${t}-th-${s}`))})}),a.jsx("tbody",{children:e.rows.map((r,s)=>a.jsx("tr",{className:"border-t",children:r.map((i,o)=>a.jsx("td",{className:"px-2 py-1.5 align-top",children:cc(i,`${t}-tdc-${s}-${o}`)},`${t}-td-${s}-${o}`))},`${t}-row-${s}`))})]})}):null}function cc(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*|\*[^*\n]+\*|_[^_\n]+_|~~[^~\n]+~~|\[[^\]]+\]\([^)]+\))/g).filter(Boolean).map((r,s)=>{if(r.startsWith("`")&&r.endsWith("`"))return a.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]",children:r.slice(1,-1)},`${t}-${s}`);if(r.startsWith("**")&&r.endsWith("**"))return a.jsx("strong",{children:r.slice(2,-2)},`${t}-${s}`);if(r.startsWith("*")&&r.endsWith("*"))return a.jsx("em",{children:r.slice(1,-1)},`${t}-${s}`);if(r.startsWith("_")&&r.endsWith("_"))return a.jsx("em",{children:r.slice(1,-1)},`${t}-${s}`);if(r.startsWith("~~")&&r.endsWith("~~"))return a.jsx("s",{children:r.slice(2,-2)},`${t}-${s}`);const i=r.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return i?a.jsx("a",{href:i[2],target:"_blank",rel:"noreferrer",className:"underline underline-offset-2",children:i[1]},`${t}-${s}`):a.jsx(m.Fragment,{children:r},`${t}-${s}`)})}function n8({message:e,className:t,assistantLabel:n,renderActions:r}){const s=e.role;if(s==="tool"){const c=String(e.text??"").trim();return/^(Approved|Denied) tool call\b/i.test(c)?null:a.jsxs("div",{className:Ce("rounded-md border border-sky-500/30 bg-sky-500/10 px-3 py-2 text-sm",t),children:[a.jsxs("div",{className:"mb-1 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wide text-sky-700",children:[a.jsx(ts,{className:"h-3.5 w-3.5"}),"Tool",a.jsx("span",{className:"font-normal normal-case text-sky-700/80",children:new Date(e.createdAt).toLocaleTimeString()})]}),a.jsx("p",{className:"whitespace-pre-wrap text-sky-900",children:e.text})]})}if(s==="system")return a.jsxs("div",{className:Ce("flex items-start gap-2 text-xs",t),children:[a.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.jsx(gN,{className:"h-3 w-3"})}),a.jsx("div",{className:"max-w-[92%] rounded-md border border-amber-400/30 bg-amber-50/70 p-3 text-sm",children:a.jsx(Ma,{text:e.text,variant:"assistant"})})]});const i=s==="user",o=i?Oc:Rr;return a.jsxs("div",{className:Ce(`flex items-start gap-2 text-xs ${i?"justify-end":"justify-start"}`,t),children:[!i&&a.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.jsx(o,{className:"h-3 w-3"})}),a.jsxs("div",{className:"relative max-w-[92%]",children:[a.jsxs("div",{className:`max-w-full break-words rounded-md border px-3 py-2 text-sm ${i?"border-primary/20 bg-primary/10":"border-border/80 bg-background shadow-sm"}`,children:[!i&&n&&a.jsx("p",{className:"mb-2 text-[11px] font-semibold text-muted-foreground",children:n}),i?a.jsx("p",{className:"whitespace-pre-wrap",children:e.text}):a.jsx(Ma,{text:e.text,variant:"assistant",className:"text-sm"})]}),r]}),i&&a.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:a.jsx(Oc,{className:"h-3 w-3"})})]})}function Z1({call:e,loading:t=!1,onApprove:n,onDeny:r,defaultOpen:s,className:i,description:o}){const c=e.status==="pending",d=e.tool||e.publicToolName||"unknown_tool";return a.jsxs("details",{open:s??c,className:Ce("group overflow-hidden rounded-md border border-border/60 bg-background",i),children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ts,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${d}`}),a.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${c?"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:c?"Needs approval":e.status==="error"?"Error":e.status==="denied"?"Denied":"Approved"})]})}),a.jsx(Qt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),a.jsxs("div",{className:"space-y-2 border-t border-border/50 px-3 py-2",children:[o&&a.jsx(Ma,{text:o,variant:"assistant",className:"text-sm"}),a.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:a.jsx("code",{children:JSON.stringify(e.arguments??{},null,2)})}),e.error&&a.jsx("p",{className:"text-xs text-destructive",children:e.error}),c&&a.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:t,onClick:()=>r?.(e.id),children:"Deny"}),a.jsx(ne,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:t,onClick:()=>n?.(e.id),children:"Approve"})]})]})]})}function r8(){return a.jsxs("div",{className:"flex items-start gap-2",children:[a.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.jsx(Rr,{className:"h-3 w-3"})}),a.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground",children:[a.jsx(Cr,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]})}function ove({snippets:e,snippetsLabel:t,onSnippetSelect:n,disabled:r=!1,contentClassName:s="w-[360px]"}){return a.jsxs(Xf,{children:[a.jsx(Qf,{asChild:!0,children:a.jsxs(ne,{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:[a.jsx(fi,{className:"h-3 w-3"}),"Snippets",a.jsx(Qt,{className:"h-3 w-3"})]})}),a.jsxs(Cu,{align:"start",className:s,children:[a.jsx(Wz,{children:t}),a.jsx(Vz,{}),e.map(i=>a.jsx(Qr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>n(i.prompt),children:a.jsxs("div",{className:"space-y-0.5",children:[a.jsx("div",{className:"text-xs font-medium leading-tight",children:i.label}),a.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:i.description})]})},i.label))]})]})}function a8({input:e,onInputChange:t,onSend:n,onCancel:r,inputPlaceholder:s,snippets:i,snippetsLabel:o,onSnippetSelect:c,loading:d=!1,disabled:f=!1,inputRef:h,snippetContentClassName:p}){const g=f||d;return a.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[a.jsx(Is,{ref:h,value:e,onChange:x=>t(x.target.value),placeholder:s,disabled:f,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:x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),g||n())}}),a.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[a.jsx(ove,{snippets:i,snippetsLabel:o,onSnippetSelect:c,disabled:g,contentClassName:p}),d&&r?a.jsxs(ne,{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:[a.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]"}),a.jsx("span",{className:"pointer-events-none absolute inset-[4px] rounded-full border border-primary/10 motion-reduce:animate-none animate-pulse"}),a.jsx(_d,{className:"relative z-10 h-4 w-4"})]}):d?a.jsx(ne,{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:a.jsx(Cr,{className:"h-4 w-4 animate-spin"})}):a.jsx(ne,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full pr-0.5",onClick:n,disabled:g||!e.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:a.jsx(G7,{className:"h-4 w-4"})})]})]})}const lve=Tv,cve=Ov,s8=m.forwardRef(({className:e,...t},n)=>a.jsx(mu,{ref:n,className:Ce("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}));s8.displayName=mu.displayName;const i8=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(cve,{children:[a.jsx(s8,{}),a.jsxs(vu,{ref:r,className:Ce("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,a.jsxs(Rv,{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-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[a.jsx(rs,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));i8.displayName=vu.displayName;const o8=({className:e,...t})=>a.jsx("div",{className:Ce("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});o8.displayName="DialogHeader";const l8=m.forwardRef(({className:e,...t},n)=>a.jsx(If,{ref:n,className:Ce("text-lg font-semibold leading-none tracking-tight",e),...t}));l8.displayName=If.displayName;const c8=m.forwardRef(({className:e,...t},n)=>a.jsx(Mf,{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));c8.displayName=Mf.displayName;function uve(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var t_="ScrollArea",[u8]=gr(t_),[dve,za]=u8(t_),d8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...o}=e,[c,d]=m.useState(null),[f,h]=m.useState(null),[p,g]=m.useState(null),[x,j]=m.useState(null),[y,b]=m.useState(null),[N,C]=m.useState(0),[S,E]=m.useState(0),[A,k]=m.useState(!1),[T,O]=m.useState(!1),D=Et(t,U=>d(U)),q=Nu(s);return a.jsx(dve,{scope:n,type:r,dir:q,scrollHideDelay:i,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:g,scrollbarX:x,onScrollbarXChange:j,scrollbarXEnabled:A,onScrollbarXEnabledChange:k,scrollbarY:y,onScrollbarYChange:b,scrollbarYEnabled:T,onScrollbarYEnabledChange:O,onCornerWidthChange:C,onCornerHeightChange:E,children:a.jsx(tt.div,{dir:q,...o,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});d8.displayName=t_;var f8="ScrollAreaViewport",p8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=e,o=za(f8,n),c=m.useRef(null),d=Et(t,c,o.onViewportChange);return a.jsxs(a.Fragment,{children:[a.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:s}),a.jsx(tt.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:a.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});p8.displayName=f8;var zs="ScrollAreaScrollbar",n_=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=za(zs,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,c=e.orientation==="horizontal";return m.useEffect(()=>(c?i(!0):o(!0),()=>{c?i(!1):o(!1)}),[c,i,o]),s.type==="hover"?a.jsx(fve,{...r,ref:t,forceMount:n}):s.type==="scroll"?a.jsx(pve,{...r,ref:t,forceMount:n}):s.type==="auto"?a.jsx(h8,{...r,ref:t,forceMount:n}):s.type==="always"?a.jsx(r_,{...r,ref:t}):null});n_.displayName=zs;var fve=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=za(zs,e.__scopeScrollArea),[i,o]=m.useState(!1);return m.useEffect(()=>{const c=s.scrollArea;let d=0;if(c){const f=()=>{window.clearTimeout(d),o(!0)},h=()=>{d=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",f),c.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",f),c.removeEventListener("pointerleave",h)}}},[s.scrollArea,s.scrollHideDelay]),a.jsx(Xn,{present:n||i,children:a.jsx(h8,{"data-state":i?"visible":"hidden",...r,ref:t})})}),pve=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=za(zs,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Tg(()=>d("SCROLL_END"),100),[c,d]=uve("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 m.useEffect(()=>{if(c==="idle"){const f=window.setTimeout(()=>d("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(f)}},[c,s.scrollHideDelay,d]),m.useEffect(()=>{const f=s.viewport,h=i?"scrollLeft":"scrollTop";if(f){let p=f[h];const g=()=>{const x=f[h];p!==x&&(d("SCROLL"),o()),p=x};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[s.viewport,i,d,o]),a.jsx(Xn,{present:n||c!=="hidden",children:a.jsx(r_,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Le(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Le(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),h8=m.forwardRef((e,t)=>{const n=za(zs,e.__scopeScrollArea),{forceMount:r,...s}=e,[i,o]=m.useState(!1),c=e.orientation==="horizontal",d=Tg(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return ou(n.viewport,d),ou(n.content,d),a.jsx(Xn,{present:r||i,children:a.jsx(r_,{"data-state":i?"visible":"hidden",...s,ref:t})})}),r_=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=za(zs,e.__scopeScrollArea),i=m.useRef(null),o=m.useRef(0),[c,d]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=y8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:g=>o.current=g};function p(g,x){return yve(g,o.current,c,x)}return n==="horizontal"?a.jsx(hve,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollLeft,x=YM(g,c,s.dir);i.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=p(g,s.dir))}}):n==="vertical"?a.jsx(mve,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollTop,x=YM(g,c);i.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=p(g))}}):null}),hve=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=za(zs,e.__scopeScrollArea),[o,c]=m.useState(),d=m.useRef(null),f=Et(t,d,i.onScrollbarXChange);return m.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),a.jsx(v8,{"data-orientation":"horizontal",...s,ref:f,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Pg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const g=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(g),w8(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:sv(o.paddingLeft),paddingEnd:sv(o.paddingRight)}})}})}),mve=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=za(zs,e.__scopeScrollArea),[o,c]=m.useState(),d=m.useRef(null),f=Et(t,d,i.onScrollbarYChange);return m.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),a.jsx(v8,{"data-orientation":"vertical",...s,ref:f,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Pg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const g=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(g),w8(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:sv(o.paddingTop),paddingEnd:sv(o.paddingBottom)}})}})}),[vve,m8]=u8(zs),v8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...g}=e,x=za(zs,n),[j,y]=m.useState(null),b=Et(t,D=>y(D)),N=m.useRef(null),C=m.useRef(""),S=x.viewport,E=r.content-r.viewport,A=Hn(h),k=Hn(d),T=Tg(p,10);function O(D){if(N.current){const q=D.clientX-N.current.left,U=D.clientY-N.current.top;f({x:q,y:U})}}return m.useEffect(()=>{const D=q=>{const U=q.target;j?.contains(U)&&A(q,E)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[S,j,E,A]),m.useEffect(k,[r,k]),ou(j,T),ou(x.content,T),a.jsx(vve,{scope:n,scrollbar:j,hasThumb:s,onThumbChange:Hn(i),onThumbPointerUp:Hn(o),onThumbPositionChange:k,onThumbPointerDown:Hn(c),children:a.jsx(tt.div,{...g,ref:b,style:{position:"absolute",...g.style},onPointerDown:Le(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),N.current=j.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),O(D))}),onPointerMove:Le(e.onPointerMove,O),onPointerUp:Le(e.onPointerUp,D=>{const q=D.target;q.hasPointerCapture(D.pointerId)&&q.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=C.current,x.viewport&&(x.viewport.style.scrollBehavior=""),N.current=null})})})}),av="ScrollAreaThumb",g8=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=m8(av,e.__scopeScrollArea);return a.jsx(Xn,{present:n||s.hasThumb,children:a.jsx(gve,{ref:t,...r})})}),gve=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,i=za(av,n),o=m8(av,n),{onThumbPositionChange:c}=o,d=Et(t,p=>o.onThumbChange(p)),f=m.useRef(void 0),h=Tg(()=>{f.current&&(f.current(),f.current=void 0)},100);return m.useEffect(()=>{const p=i.viewport;if(p){const g=()=>{if(h(),!f.current){const x=bve(p,c);f.current=x,c()}};return c(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[i.viewport,h,c]),a.jsx(tt.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Le(e.onPointerDownCapture,p=>{const x=p.target.getBoundingClientRect(),j=p.clientX-x.left,y=p.clientY-x.top;o.onThumbPointerDown({x:j,y})}),onPointerUp:Le(e.onPointerUp,o.onThumbPointerUp)})});g8.displayName=av;var a_="ScrollAreaCorner",x8=m.forwardRef((e,t)=>{const n=za(a_,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(xve,{...e,ref:t}):null});x8.displayName=a_;var xve=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=za(a_,n),[i,o]=m.useState(0),[c,d]=m.useState(0),f=!!(i&&c);return ou(s.scrollbarX,()=>{const h=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(h),d(h)}),ou(s.scrollbarY,()=>{const h=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(h),o(h)}),f?a.jsx(tt.div,{...r,ref:t,style:{width:i,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function sv(e){return e?parseInt(e,10):0}function y8(e,t){const n=e/t;return isNaN(n)?0:n}function Pg(e){const t=y8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function yve(e,t,n,r="ltr"){const s=Pg(n),i=s/2,o=t||i,c=s-o,d=n.scrollbar.paddingStart+o,f=n.scrollbar.size-n.scrollbar.paddingEnd-c,h=n.content-n.viewport,p=r==="ltr"?[0,h]:[h*-1,0];return b8([d,f],p)(e)}function YM(e,t,n="ltr"){const r=Pg(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,o=t.content-t.viewport,c=i-r,d=n==="ltr"?[0,o]:[o*-1,0],f=Nf(e,d);return b8([0,o],[0,c])(f)}function b8(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function w8(e,t){return e>0&&e<t}var bve=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function s(){const i={left:e.scrollLeft,top:e.scrollTop},o=n.left!==i.left,c=n.top!==i.top;(o||c)&&t(),n=i,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function Tg(e,t){const n=Hn(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function ou(e,t){const n=Hn(t);ar(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var j8=d8,wve=p8,jve=x8;const s_=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(j8,{ref:r,className:Ce("relative overflow-hidden",e),...n,children:[a.jsx(wve,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(S8,{}),a.jsx(jve,{})]}));s_.displayName=j8.displayName;const S8=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>a.jsx(n_,{ref:r,orientation:t,className:Ce("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:a.jsx(g8,{className:"relative flex-1 rounded-full bg-border"})}));S8.displayName=n_.displayName;function eN(e){return e instanceof Error&&e.name==="AbortError"||typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError"}async function Sve(e){const{sessionId:t,source:n,serverName:r,onLaunchUrl:s,timeoutMs:i=5*6e4}=e,o=Date.now()+i;let c=!1;for(;Date.now()<o;){const{session:d}=await n.getOAuthRuntimeSession(t),f=d.authorizeLaunchUrl||d.authorizationUrl||"";if(f&&s&&s(f),d.status==="completed"&&d.hasAccessToken){c=!0;break}if(d.status==="error"||d.status==="stopped")throw new Error(`OAuth login failed for '${r}' (${d.status}). ${d.lastError||""}`.trim());await new Promise(h=>setTimeout(h,1500))}if(!c)throw new Error(`OAuth login timed out for '${r}'. Authorization was not completed within 5 minutes.`)}const Nve=250;async function di(e){const{serverNames:t,source:n,onServerAuthStart:r,onServerStatus:s,timeoutMs:i=5*6e4}=e,o=Array.from(new Set(t.filter(Boolean)));if(o.length===0)return;const c=Date.now()+i,d=new Set,f=new Map;for(;Date.now()<c;){const h=await n.ensureOAuthServers({serverNames:o});for(const g of h.servers){const x=`${g.status}:${g.debugState??""}:${g.runtimeSessionId??""}`;f.get(g.serverName)!==x&&(f.set(g.serverName,x),s?.({serverName:g.serverName,status:g.status,debugState:g.debugState,tokenExpiresAt:g.tokenExpiresAt,tokenExpiresInSeconds:g.tokenExpiresInSeconds,message:g.message}))}const p=h.servers.filter(g=>g.status==="auth_required");if(p.length===0&&h.allReady)return;for(const g of p){const x=g.runtimeSessionId;if(!x)throw new Error(g.message||`OAuth login required for '${g.serverName}'.`);d.has(x)||(d.add(x),r?.(g.serverName));const j=(()=>{let y=!1;return b=>{if(y||!b)return;y=!0;const N=b.startsWith("http")?b:`${window.location.origin}${b}`;window.open(N,"_blank","noopener,noreferrer")}})();j(g.authorizeLaunchUrl||g.authorizationUrl||""),await Sve({sessionId:x,source:n,serverName:g.serverName,onLaunchUrl:j,timeoutMs:Math.max(1e4,c-Date.now())})}await new Promise(g=>{window.setTimeout(g,Nve)})}throw new Error("OAuth login timed out before all required servers were authorized.")}const Cve=[{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:"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 _ve({open:e,onOpenChange:t,configId:n,configPath:r,scenario:s,agents:i,servers:o,snapshotEval:c,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:h}){const{source:p}=Ln(),[g,x]=m.useState(null),[j,y]=m.useState(null),[b,N]=m.useState(""),[C,S]=m.useState(!1),[E,A]=m.useState(!1),[k,T]=m.useState(new Set),O=m.useRef(null),D=m.useRef(null),q=m.useRef(null),U=m.useRef(null),B=m.useRef(0),[X,W]=m.useState(!1),M=m.useRef(!1),z=d||i[0]?.id||"",K=m.useCallback(()=>{const de=U.current;de&&de.controller.abort()},[]);m.useEffect(()=>{if(!e||!z||g)return;let de=!1;return S(!0),(async()=>{const Pe=Array.from(new Set(s.serverIds.filter(te=>o.find(Ee=>Ee.id===te)?.authType==="oauth2")));await di({serverNames:Pe,source:p});const F=await p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:s.id,selectedAssistantAgentName:z,context:{configSnapshotPolicy:c?{enabled:c.enabled,mode:c.mode,baselineSnapshotId:c.baselineSnapshotId}:void 0,scenario:{id:s.id,name:s.name,prompt:s.prompt,serverNames:s.serverIds,evalRules:s.evalRules,extractRules:s.extractRules,snapshotEval:s.snapshotEval?{enabled:s.snapshotEval.enabled,baselineSnapshotId:s.snapshotEval.baselineSnapshotId}:void 0},availableServers:o.map(te=>({name:te.name||te.id,url:te.url})),availableAgents:i.map(te=>({name:te.name||te.id,provider:te.provider,model:te.model}))}});de||(x(F.sessionId),R(F.session),S(!1))})().catch(Pe=>{de||ke({title:"Could not start Scenario Assistant",description:Pe instanceof Error?Pe.message:String(Pe),variant:"destructive"})}).finally(()=>{de||S(!1)}),()=>{de=!0}},[e,p,g,n,r,s,c,i,o,z]);const V=()=>{K(),x(null),y(null),N(""),T(new Set),q.current=null},R=m.useCallback(de=>{y(ve=>ve&&ve.messages.length>de.messages.length?ve:de)},[]),G=m.useCallback(()=>{const de=U.current;de&&(K(),N(de.prompt),S(!1),A(!1))},[K]),$=de=>{V(),p.closeScenarioAssistantSession(de).catch(()=>{})};m.useEffect(()=>{e||g&&(M.current||X||$(g))},[e,g,p,X]),m.useEffect(()=>()=>{K(),g&&p.closeScenarioAssistantSession(g).catch(()=>{})},[K,g,p]),m.useEffect(()=>{if(!e)return;X&&W(!1),M.current&&(M.current=!1);const de=window.setTimeout(()=>{O.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(de)},[e,C,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),m.useEffect(()=>{const de=D.current;if(!de)return;de.style.height="0px";const ve=Math.min(de.scrollHeight,160);de.style.height=`${Math.max(40,ve)}px`},[b,e]);const I=i.length>0&&s.serverIds.length>0&&!!z,ee=async de=>{if(!g)return;const ve=de.trim();if(!ve)return;const Pe=++B.current,F=new AbortController,te=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,fe={id:te,role:"user",text:ve,createdAt:new Date().toISOString()};U.current={id:Pe,controller:F,prompt:ve},A(!0),y(Ee=>Ee&&{...Ee,messages:[...Ee.messages,fe]}),N(""),S(!0);try{const Ee=await p.sendScenarioAssistantMessage(g,ve,F.signal);if(F.signal.aborted||U.current?.id!==Pe)return;R(Ee.session)}catch(Ee){if(eN(Ee)||F.signal.aborted||U.current?.id!==Pe)return;y(Me=>Me&&{...Me,messages:Me.messages.filter(et=>et.id!==te)}),N(Me=>Me.trim()?Me:ve),ke({title:"Scenario Assistant error",description:Ee instanceof Error?Ee.message:String(Ee),variant:"destructive"})}finally{U.current?.id===Pe&&(U.current=null,S(!1),A(!1))}},Q=de=>{N(de),requestAnimationFrame(()=>D.current?.focus())};m.useEffect(()=>{if(!e||!g||!j||!I||C)return;const de=String(f??"").trim();de&&q.current!==de&&(q.current=de,ee(de))},[e,g,j,I,C,f]),m.useEffect(()=>{if(!(!e||!g||!j))return p.subscribeScenarioAssistantSessionEvents(g,de=>{R(de.payload.session)})},[e,g,p,R]);const ie=async de=>{if(g){S(!0);try{const ve=await p.approveScenarioAssistantToolCall(g,de);R(ve.session)}catch(ve){ke({title:"Tool call failed",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{S(!1)}}},ue=async de=>{if(g){S(!0);try{const ve=await p.denyScenarioAssistantToolCall(g,de);R(ve.session)}catch(ve){ke({title:"Could not deny tool call",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{S(!1)}}},re=async()=>{if(g){S(!0);try{const de=await p.approveAllScenarioAssistantToolCalls(g);R(de.session)}catch(de){ke({title:"Could not approve all tool calls",description:de instanceof Error?de.message:String(de),variant:"destructive"})}finally{S(!1)}}},je=(de,ve,Pe)=>{if(!ve)return;if(Pe==="prompt"&&ve.prompt&&h({prompt:ve.prompt.replacement}),Pe==="evalRules"&&ve.evalRules&&h({evalRules:ve.evalRules.replacement}),Pe==="extractRules"&&ve.extractRules&&h({extractRules:ve.extractRules.replacement}),Pe==="snapshotEval"&&ve.snapshotEval&&h({snapshotEval:{enabled:ve.snapshotEval.patch.enabled,baselineSnapshotId:ve.snapshotEval.patch.baselineSnapshotId}}),de){const te=`${de}:${Pe}`;T(fe=>new Set([...fe,te]))}ke({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[Pe]}`})},pe=()=>{const de=document.activeElement;de instanceof HTMLElement&&de.blur()},oe=de=>{de||(pe(),W(!1),M.current=!1),t(de)},_e=()=>{pe(),M.current=!0,W(!0),t(!1)},ce=()=>{pe(),M.current=!1,W(!1),g&&$(g)};return a.jsxs(a.Fragment,{children:[!e&&g&&a.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 rounded-md border bg-background px-3 py-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm font-medium",children:"Scenario Assistant (session active)"}),a.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:["Resume conversation for ",a.jsx("span",{className:"font-mono",children:s.id}),j?` · ${j.messages.length} messages`:""]})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[a.jsx(Vr,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),a.jsx(ne,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:ce,"aria-label":"Discard assistant session",title:"Discard assistant session",children:a.jsx(rs,{className:"h-4 w-4"})})]})]}),a.jsx(lve,{open:e,onOpenChange:oe,children:a.jsxs(i8,{className:"max-w-6xl h-[85vh] flex flex-col",children:[g&&a.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-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:_e,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[a.jsx(V7,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Minimize"})]}),a.jsx(o8,{className:"pr-20",children:a.jsx("div",{className:"flex items-start justify-between gap-3",children:a.jsxs("div",{className:"min-w-0",children:[a.jsxs(l8,{className:"flex items-center gap-2",children:[a.jsx(Vr,{className:"h-4 w-4"}),"Scenario Assistant"]}),a.jsx(c8,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),I?a.jsxs("div",{className:"min-h-0 flex flex-1 flex-col gap-3",children:[a.jsx("div",{className:"grid gap-3 sm:grid-cols-1",children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"MCP Context"}),a.jsxs("div",{className:"h-8 rounded-md border px-2 text-xs flex items-center gap-2",children:[a.jsx(ts,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),a.jsx(s_,{className:"min-h-0 flex-1 rounded-md border p-3",children:a.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((de,ve)=>a.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:de},`${de}-${ve}`)),j?.messages.map(de=>a.jsxs(m.Fragment,{children:[(()=>{const ve=de.pendingToolCallIds??(de.pendingToolCallId?[de.pendingToolCallId]:[]),Pe=ve.map(Me=>(j?.pendingToolCalls??[]).find(et=>et.id===Me)).filter(Me=>!!Me),F=ve.map(Me=>j.pendingToolCalls.find(et=>et.id===Me)??j.pendingToolCalls.find(et=>et.id===Me)).filter(Boolean);if(!(de.role==="assistant"&&ve.length>0))return a.jsx("div",{className:"space-y-2",children:a.jsx(Ave,{message:de})});const fe=Pe.length,Ee=F.length-fe;return a.jsxs("div",{className:"flex items-start gap-2",children:[a.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.jsx(Rr,{className:"h-3 w-3"})}),a.jsxs("div",{className:"w-full max-w-[92%] space-y-2",children:[F.length>1&&fe>0&&a.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:[a.jsxs("span",{className:"text-xs text-amber-900",children:[Ee," of ",F.length," tool calls resolved"]}),a.jsxs(ne,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:fe===0,onClick:()=>{re()},children:["Approve All (",fe,")"]})]}),F.map((Me,et)=>a.jsx(Z1,{call:Me,loading:C,description:et===0?de.text:void 0,onApprove:st=>{ie(st)},onDeny:st=>{ue(st)}},Me.id))]})]})})(),de.suggestions&&a.jsxs("div",{className:"ml-0 space-y-3 rounded-md border border-dashed bg-muted/10 p-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[a.jsx(Vr,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),de.suggestions.prompt&&a.jsx(Ph,{title:"Prompt",rationale:de.suggestions.prompt.rationale,preview:de.suggestions.prompt.replacement,applied:k.has(`${de.id}:prompt`),onApply:()=>je(de.id,de.suggestions,"prompt")}),de.suggestions.evalRules&&a.jsx(Ph,{title:"Checks",rationale:de.suggestions.evalRules.rationale,preview:JSON.stringify(de.suggestions.evalRules.replacement,null,2),applied:k.has(`${de.id}:evalRules`),onApply:()=>je(de.id,de.suggestions,"evalRules")}),de.suggestions.extractRules&&a.jsx(Ph,{title:"Value Capture Rules",rationale:de.suggestions.extractRules.rationale,preview:JSON.stringify(de.suggestions.extractRules.replacement,null,2),applied:k.has(`${de.id}:extractRules`),onApply:()=>je(de.id,de.suggestions,"extractRules")}),de.suggestions.snapshotEval&&a.jsx(Ph,{title:"Snapshot Settings",rationale:de.suggestions.snapshotEval.rationale,preview:JSON.stringify(de.suggestions.snapshotEval.patch,null,2),applied:k.has(`${de.id}:snapshotEval`),onApply:()=>je(de.id,de.suggestions,"snapshotEval")}),(()=>{const ve=de.suggestions?.notes,Pe=Array.isArray(ve)?ve:typeof ve=="string"?[ve]:[];return Pe.length===0?null:a.jsxs("div",{className:"space-y-2 rounded-md border p-3",children:[a.jsx("h5",{className:"text-sm font-medium",children:"Notes"}),a.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground list-disc pl-4",children:Pe.map((F,te)=>a.jsx("li",{children:F},`${de.id}-note-${te}`))})]})})()]})]},de.id)),(j?.pendingToolCalls??[]).filter(de=>!(j?.messages??[]).some(ve=>ve.pendingToolCallId===de.id||ve.pendingToolCallIds?.includes(de.id))).map(de=>a.jsx(Z1,{call:de,loading:C,onApprove:ve=>{ie(ve)},onDeny:ve=>{ue(ve)}},de.id)),!j&&C&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(Cr,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&C&&a.jsx(r8,{}),a.jsx("div",{ref:O})]})}),a.jsx(a8,{input:b,onInputChange:N,onSend:()=>{ee(b)},onCancel:g&&E?G:void 0,inputPlaceholder:"Get assistance with creating or refining this scenario ...",snippets:Cve,snippetsLabel:"Scenario Assistant Snippets",onSnippetSelect:Q,loading:C,disabled:!g,inputRef:D,snippetContentClassName:"w-[320px]"})]}):a.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 Ph({title:e,rationale:t,preview:n,applied:r=!1,onApply:s}){return a.jsxs("div",{className:`space-y-2 rounded-md border p-3 ${r?"border-emerald-300 bg-emerald-50/40":""}`,children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("h5",{className:"text-sm font-medium",children:e}),a.jsx(ne,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:s,disabled:r,children:r?a.jsxs(a.Fragment,{children:[a.jsx(si,{className:"mr-1.5 h-3.5 w-3.5"}),"Applied"]}):"Apply"})]}),t&&a.jsx("p",{className:"text-xs text-muted-foreground",children:t}),a.jsx("pre",{className:"max-h-56 overflow-auto rounded bg-muted p-2 text-xs whitespace-pre-wrap",children:n})]})}function Ave({message:e}){const t=async s=>{try{await navigator.clipboard.writeText(s),ke({title:"Copied"})}catch(i){ke({title:"Could not copy",description:i instanceof Error?i.message:String(i),variant:"destructive"})}},n=e.role==="user"||e.role==="assistant",r=e.role==="user";return a.jsx(n8,{message:e,assistantLabel:e.role==="assistant"?"Assistant":void 0,renderActions:n?a.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:`absolute bottom-1 h-6 w-6 text-muted-foreground ${r?"-left-8":"-right-8"}`,onClick:()=>{t(e.text)},"aria-label":"Copy message",title:"Copy message",children:a.jsx(Ps,{className:"h-3.5 w-3.5"})}):void 0})}function ca(e){return typeof e=="number"?e.toLocaleString():"n/a"}function tN(e,t){const n=t?.nonPositiveLabel??"0s";if(!Number.isFinite(e)||e<=0)return n;const r=Math.floor(e),s=Math.floor(r/3600),i=Math.floor(r%3600/60),o=r%60;return s>0?`${s}h ${i}m ${o}s`:i>0?`${i}m ${o}s`:`${o}s`}function Eve({run:e,fallbackUserPrompt:t}){const[n,r]=m.useState(!0),[s,i]=m.useState(!1);return a.jsxs("div",{className:"space-y-2",children:[a.jsx(Za,{open:n,onOpenChange:r,children:a.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[a.jsx(Pa,{asChild:!0,children:a.jsx("button",{type:"button",className:"mb-2 flex w-full items-center justify-between gap-2 text-left",children:a.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[a.jsx(Qt,{className:`h-3.5 w-3.5 transition-transform ${n?"rotate-180":""}`}),a.jsx(Rr,{className:"h-3.5 w-3.5"}),"Final answer"]})})}),a.jsx(es,{children:a.jsx(nN,{text:e.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),a.jsx(Za,{open:s,onOpenChange:i,children:a.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[a.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[a.jsx(Pa,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[a.jsx(Qt,{className:`h-3.5 w-3.5 transition-transform ${s?"rotate-180":""}`}),a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Conversation trace"})]})}),a.jsxs(He,{variant:"outline",className:"h-5 text-[10px]",children:[e.toolCalls.length," tool calls"]})]}),a.jsx(es,{children:a.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:e.conversation.length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):e.conversation.map(o=>a.jsx(kve,{item:o,fallbackUserPrompt:t},o.id))})})]})})]})}function kve({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=XM(e,"input");return a.jsx(JM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=XM(e,"output"),f=e.ok?a.jsx(si,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):a.jsx(jc,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return a.jsx(JM,{variant:e.ok?"result_ok":"result_error",title:`Tool result · ${e.toolName||"unknown"} · ${e.ok?"ok":"error"}${typeof e.durationMs=="number"?` · ${e.durationMs}ms`:""}${d}`,text:e.text,icon:f})}const n=e.kind==="user_prompt",r=QM(e.text,e.kind),s=t?QM(t,"user_prompt"):"",i=n&&!r&&s?s:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?Oc:Rr;return a.jsxs("div",{className:`flex items-start gap-2 text-xs ${n?"justify-end":"justify-start"}`,children:[!n&&a.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:a.jsx(c,{className:"h-3 w-3"})}),a.jsxs("div",{className:`max-w-[90%] rounded-md p-2 ${n?"bg-primary/10":"bg-muted/50"}`,children:[a.jsx("p",{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?"text-right":""}`,children:o}),n?a.jsx(nN,{text:i,maxLength:280,className:"text-xs"}):a.jsx(nN,{text:i,maxLength:500,className:"text-xs"})]}),n&&a.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:a.jsx(c,{className:"h-3 w-3"})})]})}function XM(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · estimated ${ca(n)} tokens`}function QM(e,t){const r=String(e??"").replace(/^\s+/,"");return t==="user_prompt"?r.replace(/^user:\s*/i,""):t==="assistant_final"||t==="assistant_thought"?r.replace(/^assistant:\s*/i,""):r}function JM({variant:e,title:t,text:n,icon:r}){const[s,i]=m.useState(!1),o={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"};return a.jsx(Za,{open:s,onOpenChange:i,children:a.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[a.jsx(Pa,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-2 text-left",children:[a.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[11px]",children:[r??a.jsx(ts,{className:"h-3.5 w-3.5"}),a.jsx("span",{children:t})]}),a.jsx("span",{className:"text-[11px] font-semibold",children:s?"Hide content":"Show content"})]})}),a.jsx(es,{children:a.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function nN({text:e,maxLength:t,className:n}){const[r,s]=m.useState(!1),i=e.length>t,o=r||!i?e:`${e.slice(0,t)}...`;return a.jsxs("div",{children:[a.jsx(Ma,{text:o,className:n}),i&&a.jsx("button",{type:"button",className:"mt-1 text-[11px] font-medium text-primary hover:underline",onClick:()=>s(c=>!c),children:r?"Show less":"Show all"})]})}const Pve="mcplab.feature.";function Og(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${Pve}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const Tve=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function rN({scenarios:e,scenarioOrigins:t,scenarioOverrides:n,agents:r,servers:s,configId:i,configPath:o,defaultAssistantAgentName:c,assistantInitialPromptByScenarioId:d,assistantAutoOpenNonceByScenarioId:f,snapshotEval:h,onChange:p,readOnly:g,allowAdd:x=!g,allowStructureEdits:j=!g}){const y=(S,E)=>{const A=e.map((k,T)=>T===S?{...k,...E}:k);p(A)},b=S=>p(e.filter((E,A)=>A!==S)),N=()=>p([...e,Tve()]),C=(S,E)=>{const A=S+E;if(A<0||A>=e.length)return;const k=[...e],[T]=k.splice(S,1);k.splice(A,0,T),p(k)};return a.jsxs("div",{className:g?"space-y-2":"space-y-4",children:[!g&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-semibold",children:"Scenarios"}),x&&j&&a.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:N,children:[a.jsx(fi,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((S,E)=>a.jsx(Ove,{scenario:S,scenarioOrigin:t?.[E],hasMcpServerOverride:n?.[E],index:E,total:e.length,agents:r,servers:s,configId:i,configPath:o,defaultAssistantAgentName:c,assistantInitialPrompt:d?.[S.id],assistantAutoOpenNonce:f?.[S.id],snapshotEval:h,onUpdate:A=>y(E,A),onMoveUp:()=>C(E,-1),onMoveDown:()=>C(E,1),onRemove:()=>b(E),readOnly:g,allowStructureEdits:j},S.id)),e.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No scenarios configured. Add one to get started."})]})}function Ove({scenario:e,scenarioOrigin:t,hasMcpServerOverride:n,index:r,total:s,agents:i,servers:o,configId:c,configPath:d,defaultAssistantAgentName:f,assistantInitialPrompt:h,assistantAutoOpenNonce:p,snapshotEval:g,onUpdate:x,onMoveUp:j,onMoveDown:y,onRemove:b,readOnly:N,allowStructureEdits:C}){const{source:S}=Ln(),E=Og("snapshots",!1),[A,k]=m.useState("required_tool"),[T,O]=m.useState(""),[D,q]=m.useState(""),[U,B]=m.useState(""),[X,W]=m.useState(""),[M,z]=m.useState(null),[K,V]=m.useState(!1),[R,G]=m.useState(null),[$,I]=m.useState(""),[ee,Q]=m.useState(""),[ie,ue]=m.useState(!1),[re,je]=m.useState(f||i[0]?.id||""),[pe,oe]=m.useState(!1),[_e,ce]=m.useState(null),[de,ve]=m.useState(""),[Pe,F]=m.useState(null),[te,fe]=m.useState(!N),Ee=we=>{const at=we.target;at&&(at.closest("button, a, input, select, textarea, [role='button']")||fe(wt=>!wt))},Me=()=>{if(A==="response_jsonpath"||A==="response_jsonpath_exists"||A==="response_jsonpath_not_exists"){const we=D.trim();if(!we)return;if(A==="response_jsonpath"){const at=U.trim();let wt;at.length>0&&(at==="true"?wt=!0:at==="false"?wt=!1:Number.isNaN(Number(at))?wt=at:wt=Number(at)),x({evalRules:[...e.evalRules,{type:A,path:we,...wt!==void 0?{equals:wt}:{}}]})}else x({evalRules:[...e.evalRules,{type:A,path:we}]});q(""),B("");return}T.trim()&&(x({evalRules:[...e.evalRules,{type:A,value:T.trim()}]}),O(""),W(""))},et=we=>{x({evalRules:e.evalRules.filter((at,wt)=>wt!==we)})},st=()=>{!$.trim()||!ee.trim()||(x({extractRules:[...e.extractRules,{name:$.trim(),pattern:ee.trim()}]}),I(""),Q(""))},xt=we=>{x({extractRules:e.extractRules.filter((at,wt)=>wt!==we)})},qt=we=>{const at=e.serverIds.includes(we)?e.serverIds.filter(wt=>wt!==we):[...e.serverIds,we];x({serverIds:at})},Ut={required_tool:"Required",forbidden_tool:"Forbidden",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"},xe={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",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"},Ye=A==="required_tool"||A==="forbidden_tool",he=A==="response_jsonpath"||A==="response_jsonpath_exists"||A==="response_jsonpath_not_exists",Te=e.serverIds.filter(we=>o.some(at=>at.id===we)),Ie=i.map(we=>we.id).filter(Boolean),Ot=Te.length>0,Ht=e.snapshotEval?.baselineSnapshotId!==void 0,[Ct,ge]=m.useState(""),[qe,Ve]=m.useState(0);m.useEffect(()=>{const we=(h??"").trim();we&&Ct!==we&&(ue(!0),ge(we))},[h,Ct]),m.useEffect(()=>{p&&p!==qe&&(ue(!0),Ve(p))},[p,qe]),m.useEffect(()=>{z(null),G(null),W("")},[e.serverIds.join("|")]),m.useEffect(()=>{W(""),q(""),B("")},[A]),m.useEffect(()=>{re&&Ie.includes(re)||je(f||i[0]?.id||"")},[re,f,i,Ie]);const St=async()=>{if(re){oe(!0),ce(null);try{const we=e.serverIds.filter(wt=>o.find(Fn=>Fn.id===wt)?.authType==="oauth2");await di({serverNames:we,source:S});const at=await S.runScenarioPreview({selectedAgentName:re,scenario:{id:e.id,name:e.name,prompt:e.prompt,serverNames:e.serverIds,evalRules:e.evalRules,extractRules:e.extractRules}});F(at)}catch(we){ce(we instanceof Error?we.message:String(we))}finally{oe(!1)}}},Oe=()=>{if(!Pe)return;const we=ZM(e.evalRules,Pe.run.failureReasons),at=we.length?we.map(lt=>`${lt.status.toUpperCase()} - ${Rve(lt.rule)}${lt.failureReason?` (${lt.failureReason})`:""}`).join(`
|
|
126
|
-
`):"No checks configured.",wt=Object.keys(Pe.run.extractedValues).length>0?Object.entries(Pe.run.extractedValues).map(([lt,zt])=>`${lt}: ${String(zt)}`).join(`
|
|
127
|
-
`):"No extracted values.",Dt=Pe.run.toolCalls.length>0?Pe.run.toolCalls.map((lt,zt)=>`${zt+1}. ${lt.name} (${lt.duration}ms)`).join(`
|
|
128
|
-
`):"No tool calls.",Fn=[`I ran a prompt preview for scenario '${e.id}' and want you to suggest concrete updates.`,`Run ID: ${Pe.runId}`,`Agent: ${Pe.agentName}`,`Outcome: ${Pe.run.passed?"passed":"failed"}`,`Duration: ${Pe.run.duration}ms`,"","Current check outcomes:",at,"","Tool sequence:",Dt,"","Extracted values:",wt,"","Final answer:",Pe.run.finalAnswer||"(empty)","","Please propose concrete updates to the Prompt, Checks, and/or Value Capture Rules based on this preview."].join(`
|
|
129
|
-
`);ve(Fn),ue(!0)},Ze=async()=>{if(!(!Ot||N)){V(!0),G(null);try{const we=Te.filter(wt=>o.find(Fn=>Fn.id===wt)?.authType==="oauth2");await di({serverNames:we,source:S});const at=new Set;for(const wt of Te){const Dt=await S.discoverToolsForAnalysis({serverNames:[wt]});for(const Fn of Dt.servers)for(const lt of Fn.tools)at.add(lt.name)}z(Array.from(at).sort((wt,Dt)=>wt.localeCompare(Dt)))}catch(we){G(we instanceof Error?we.message:"Failed to load tools")}finally{V(!1)}}};return a.jsx(Za,{open:te,onOpenChange:fe,children:a.jsxs(Ke,{className:N?"rounded-md border shadow-none":"border-dashed",children:[a.jsxs(Rt,{className:`${N?"px-3 py-3":"pb-3"} flex-row items-center justify-between space-y-0 cursor-pointer`,onClick:Ee,children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!N&&a.jsx(Pa,{asChild:!0,children:a.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:a.jsx(Qt,{className:`h-3.5 w-3.5 transition-transform ${te?"rotate-0":"-rotate-90"}`})})}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[r+1,"."]}),a.jsx(It,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${r+1}`})]}),N?a.jsxs("div",{className:"flex items-center gap-2",children:[t&&a.jsx(He,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),n&&a.jsx(He,{variant:"secondary",children:"Override"}),a.jsx(Pa,{asChild:!0,children:a.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":te?"Collapse scenario details":"Expand scenario details",children:a.jsx(Qt,{className:`h-4 w-4 transition-transform ${te?"rotate-180":""}`})})})]}):C&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>ue(!0),title:i.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:[a.jsx(Vr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]}),a.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:r===0,"aria-label":"Move scenario up",children:a.jsx(Cs,{className:"h-3.5 w-3.5"})}),a.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:y,disabled:r===s-1,"aria-label":"Move scenario down",children:a.jsx(Qt,{className:"h-3.5 w-3.5"})}),a.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:b,children:a.jsx($a,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),a.jsx(es,{children:a.jsxs(Ge,{className:"space-y-3",children:[a.jsx(_ve,{open:ie,onOpenChange:we=>{ue(we),we||ve("")},configId:c,configPath:d,scenario:e,agents:i,servers:o,snapshotEval:g,defaultAssistantAgentName:f,initialUserMessage:de||h,onApplyPatch:we=>x({...we.prompt!==void 0?{prompt:we.prompt}:{},...we.evalRules!==void 0?{evalRules:we.evalRules}:{},...we.extractRules!==void 0?{extractRules:we.extractRules}:{},...we.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...we.snapshotEval}}:{}})}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Name"}),a.jsx(bt,{value:e.name,onChange:we=>x({name:we.target.value}),disabled:N,placeholder:"e.g. List directory"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Servers"}),a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[o.map(we=>a.jsx(He,{variant:e.serverIds.includes(we.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(we.id)?"":"opacity-50"}`,onClick:()=>!N&&qt(we.id),children:we.name||we.id},we.id)),o.length===0&&a.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),a.jsxs(Ke,{className:"border bg-card",children:[a.jsxs(Rt,{className:"pb-2",children:[a.jsx(It,{className:"text-sm",children:"Prompt"}),a.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."})]}),a.jsx(Ge,{className:"pt-0",children:a.jsx(Is,{value:e.prompt,onChange:we=>x({prompt:we.target.value}),disabled:N,placeholder:"The prompt to send to the agent...",rows:4,className:"text-xs"})})]}),!N&&a.jsxs(Ke,{className:"border bg-muted/20",children:[a.jsxs(Rt,{className:"pb-2",children:[a.jsx(It,{className:"text-sm",children:"Run Prompt Preview"}),a.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."})]}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Agent"}),a.jsxs(_n,{value:re,onValueChange:je,children:[a.jsx(bn,{className:"h-8 text-xs",children:a.jsx(An,{placeholder:"Select agent"})}),a.jsx(wn,{children:i.map(we=>a.jsx(ot,{value:we.id,children:we.name||we.id},we.id))})]})]}),a.jsx("div",{className:"flex items-end",children:a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>{St()},disabled:pe||!re||!e.prompt.trim()||e.serverIds.length===0,children:pe?a.jsxs(a.Fragment,{children:[a.jsx(Cr,{className:"h-3.5 w-3.5 animate-spin"}),"Running..."]}):a.jsxs(a.Fragment,{children:[a.jsx(ii,{className:"h-3.5 w-3.5"}),"Run Prompt"]})})})]}),!e.prompt.trim()&&a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Add a prompt to run preview."}),e.serverIds.length===0&&a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server to run preview."}),_e&&a.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:_e}),Pe&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[a.jsx(He,{variant:Pe.run.passed?"default":"destructive",children:Pe.run.passed?"Passed":"Failed"}),a.jsxs(He,{variant:"outline",children:[Pe.run.duration,"ms"]}),a.jsxs(He,{variant:"outline",children:[Pe.run.toolCalls.length," tool calls"]}),a.jsx(He,{variant:"outline",className:"font-mono",children:Pe.agentName}),a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-6 gap-1.5 px-2 text-[11px]",onClick:Oe,children:[a.jsx(Vr,{className:"h-3 w-3"}),"Send to Assistant"]})]}),e.evalRules.length===0?a.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[a.jsx("p",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Check results"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"No checks configured for this scenario."})]}):(()=>{const we=ZM(e.evalRules,Pe.run.failureReasons),at=we.filter(Dt=>Dt.status==="passed"),wt=we.filter(Dt=>Dt.status==="failed");return a.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),a.jsxs(He,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[at.length," passed"]}),a.jsxs(He,{variant:"outline",className:`h-5 text-[10px] ${wt.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[wt.length," failed"]})]}),a.jsx("div",{className:"space-y-1",children:we.map((Dt,Fn)=>a.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Dt.status==="failed"?"border-destructive/20 bg-destructive/5":"border-success/20 bg-success/5"}`,children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[Dt.status==="failed"?a.jsx(jc,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):a.jsx(si,{className:"h-3.5 w-3.5 shrink-0 text-success"}),a.jsx("span",{className:"font-medium",children:Ive(Dt.rule)})]}),Dt.failureReason&&a.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:Mve(Dt.failureReason)})]}),a.jsx(He,{variant:"outline",className:`shrink-0 text-[10px] ${Dt.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Dt.status})]},`${e.id}-preview-check-${Fn}`))})]})})(),Pe.run.failureReasons.length>0&&a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2",children:[a.jsx("p",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-destructive",children:"Check failures"}),a.jsx("ul",{className:"list-disc space-y-1 pl-4 text-xs text-destructive",children:Pe.run.failureReasons.map((we,at)=>a.jsx("li",{children:we},`${Pe.runId}-failure-${at}`))})]}),Object.keys(Pe.run.extractedValues).length>0&&a.jsxs("div",{className:"rounded-md border bg-background p-2",children:[a.jsx("p",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Extracted values"}),a.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(Pe.run.extractedValues).map(([we,at])=>a.jsxs("div",{className:"rounded border bg-muted/20 px-2 py-1 text-xs",children:[a.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:we}),a.jsx("div",{className:"break-all",children:String(at)})]},we))})]}),a.jsx(Eve,{run:Pe.run,fallbackUserPrompt:e.prompt})]})]})]}),a.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[a.jsxs(Ke,{className:"border bg-muted/20",children:[a.jsx(Rt,{className:"pb-2",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx(It,{className:"text-sm",children:"Checks"}),a.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."})]}),!N&&a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>ue(!0),title:"Ask for help improving checks",children:[a.jsx(Vr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]})]})}),a.jsx(Ge,{className:"space-y-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(ze,{className:"text-xs",children:"Checks (pass / fail)"}),a.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."}),a.jsx("div",{className:"space-y-1.5",children:e.evalRules.length===0?a.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((we,at)=>a.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[a.jsx("div",{className:"min-w-0",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`rounded-full border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${xe[we.type]}`,children:Ut[we.type]}),a.jsx("span",{className:"font-mono break-all",children:we.path?we.equals!==void 0?`${we.path} == ${String(we.equals)}`:we.path:we.value})]})}),!N&&a.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>et(at),"aria-label":`Remove check ${at+1}`,children:a.jsx(rs,{className:"h-3.5 w-3.5"})})]},at))}),!N&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex gap-2 items-end",children:[a.jsxs(_n,{value:A,onValueChange:we=>k(we),children:[a.jsx(bn,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"required_tool",children:"Required Tool"}),a.jsx(ot,{value:"forbidden_tool",children:"Forbidden Tool"}),a.jsx(ot,{value:"response_contains",children:"Text contains"}),a.jsx(ot,{value:"response_not_contains",children:"Text does not contain"}),a.jsx(ot,{value:"response_starts_with",children:"Text starts with"}),a.jsx(ot,{value:"response_ends_with",children:"Text ends with"}),a.jsx(ot,{value:"response_equals",children:"Text equals"}),a.jsx(ot,{value:"response_regex",children:"Text matches regex"}),a.jsx(ot,{value:"response_jsonpath",children:"JSONPath (optional equals)"}),a.jsx(ot,{value:"response_jsonpath_exists",children:"JSONPath exists"}),a.jsx(ot,{value:"response_jsonpath_not_exists",children:"JSONPath not exists"})]})]}),he?a.jsxs(a.Fragment,{children:[a.jsx(bt,{value:D,onChange:we=>q(we.target.value),placeholder:"JSONPath (e.g. $.status)",className:"h-8 text-xs font-mono",onKeyDown:we=>we.key==="Enter"&&(we.preventDefault(),Me())}),A==="response_jsonpath"&&a.jsx(bt,{value:U,onChange:we=>B(we.target.value),placeholder:"Equals (optional)",className:"h-8 w-[12rem] text-xs font-mono",onKeyDown:we=>we.key==="Enter"&&(we.preventDefault(),Me())})]}):a.jsx(bt,{value:T,onChange:we=>O(we.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:we=>we.key==="Enter"&&(we.preventDefault(),Me())}),a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Me,children:"Add"})]}),Ye&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx(ze,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),a.jsxs(_n,{value:X,onValueChange:we=>{W(we),O(we)},disabled:K||!M||M.length===0,children:[a.jsx(bn,{className:"h-8 text-xs",children:a.jsx(An,{placeholder:K?"Loading tools...":M&&M.length>0?"Select tool to insert in value field":"Load tools first"})}),a.jsx(wn,{children:(M??[]).map(we=>a.jsx(ot,{value:we,children:we},we))})]})]}),a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Ze,disabled:!Ot||K,children:K?"Loading...":M?"Refresh tools":"Load tools"})]}),!Ot&&a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),R&&a.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",R]})]})]})]})})]}),a.jsxs(Ke,{className:"border bg-muted/10",children:[a.jsx(Rt,{className:"pb-2",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx(It,{className:"text-sm",children:"Value Capture Rules"}),a.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, snapshots, and comparisons."})]}),!N&&a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>ue(!0),title:"Ask for help improving value capture rules",children:[a.jsx(Vr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]})]})}),a.jsx(Ge,{className:"space-y-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(ze,{className:"text-xs",children:"Value Capture Rules"}),a.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."}),a.jsx("div",{className:"space-y-1.5",children:e.extractRules.length===0?a.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((we,at)=>a.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[a.jsx("div",{className:"min-w-0",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.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:we.name}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground",children:"regex:"}),a.jsx("code",{className:"font-mono break-all text-foreground",children:we.pattern})]})}),!N&&a.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>xt(at),"aria-label":`Remove value capture rule ${at+1}`,children:a.jsx(rs,{className:"h-3.5 w-3.5"})})]},at))}),!N&&a.jsxs("div",{className:"flex gap-2 items-end",children:[a.jsx(bt,{value:$,onChange:we=>I(we.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),a.jsx(bt,{value:ee,onChange:we=>Q(we.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:we=>we.key==="Enter"&&(we.preventDefault(),st())}),a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:st,children:"Add"})]})]})})]})]}),E&&a.jsxs(Ke,{className:"border bg-amber-50/40",children:[a.jsxs(Rt,{className:"pb-2",children:[a.jsx(It,{className:"text-sm",children:"Snapshot Evaluation"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Per-scenario toggle for config baseline drift checks."})]}),a.jsxs(Ge,{className:"space-y-2 text-xs text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[a.jsx("span",{children:"Enabled for this scenario"}),a.jsx(nv,{checked:e.snapshotEval?.enabled!==!1,disabled:N,onCheckedChange:we=>x({snapshotEval:{...e.snapshotEval??{},enabled:we}})})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[a.jsx("span",{children:"Use config baseline"}),a.jsx(nv,{checked:!Ht,disabled:N,onCheckedChange:we=>{if(we){x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),Ht&&a.jsx(bt,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:we=>x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:we.target.value}}),disabled:N,placeholder:"Override baseline snapshot id",className:"h-8 text-xs font-mono"})]}),a.jsxs("p",{children:["Effective baseline snapshot:"," ",a.jsx("span",{className:"font-mono",children:e.snapshotEval?.baselineSnapshotId||g?.baselineSnapshotId||"Not configured"})]}),a.jsxs("p",{children:["Policy: ",a.jsx("span",{className:"font-mono",children:g?.mode??"warn"})," · config-level switch"," ",a.jsx("span",{className:"font-mono",children:g?.enabled?"on":"off"})]})]})]})]})})]})})}function ZM(e,t){return e.map(n=>{const r=$ve(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function Rve(e){return e.path?e.equals!==void 0?`${e.type}: ${e.path} == ${String(e.equals)}`:`${e.type}: ${e.path}`:`${e.type}: ${e.value??""}`}function Ive(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`: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 equals · ${e.path} == ${String(e.equals)}`:`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_exists"?`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not exists · ${e.path}`:`${e.type} · ${e.value}`}function Mve(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}function $ve(e,t){if(e.type==="response_jsonpath_exists"){const r=String(e.path??"").trim();return r?t.find(s=>s.startsWith(`JSONPath assertion failed: ${r}`)||s.startsWith(`JSONPath assertion failed: invalid JSON for path ${r}`)):void 0}const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:e.type==="response_contains"?`Contains assertion failed: ${e.value}`:e.type==="response_not_contains"?`Not-contains assertion failed: ${e.value}`:e.type==="response_starts_with"?`Starts-with assertion failed: ${e.value}`:e.type==="response_ends_with"?`Ends-with assertion failed: ${e.value}`:e.type==="response_equals"?`Equals assertion failed: ${e.value}`:e.type==="response_regex"?`Regex assertion failed: ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals assertion failed: ${e.path}`:`JSONPath assertion failed: ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not-exists assertion failed: ${e.path}`:"";if(n)return t.find(r=>r.startsWith(n))}function N8(e){const 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}const Dve=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),e$=()=>{const{id:e,tab:t}=Nl(),n=La(),[r,s]=wi(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=Df(),{source:f}=Ln(),h=Og("snapshots",!1),{servers:p,agents:g,scenarios:x}=os(),j=e==="new",y=!j&&!!e,b=y?i(e):void 0,[N,C]=m.useState(j||t==="edit"),[S,E]=m.useState(()=>b?structuredClone(b):Dve()),[A,k]=m.useState([]),[T,O]=m.useState(""),[D,q]=m.useState(""),[U,B]=m.useState(""),[X,W]=m.useState(null),[M,z]=m.useState(!1),[K,V]=m.useState(!1),[R,G]=m.useState(""),[$,I]=m.useState(""),[ee,Q]=m.useState({}),[ie,ue]=m.useState({}),[re,je]=m.useState({}),pe=m.useMemo(()=>{const H=t||r.get("tab");return H==="agents"||H==="scenarios"?H:"scenarios"},[t,r]);m.useEffect(()=>{b&&!N&&E(structuredClone(b))},[b,N]),m.useEffect(()=>{t==="edit"&&!j&&C(!0)},[t,j]),m.useEffect(()=>{let H=!0;return f.listSnapshots().then(ye=>{H&&k(ye)}).catch(()=>{H&&k([])}),()=>{H=!1}},[f]),m.useEffect(()=>{if(!T.trim()){W(null);return}let H=!0;return f.getResult(T.trim()).then(ye=>{if(!H)return;if(!ye){W(!1);return}const Xe=ye.overallPassRate===1&&ye.scenarios.every(ft=>ft.runs.every(Vt=>Vt.passed));W(Xe)}).catch(()=>{H&&W(!1)}),()=>{H=!1}},[T,f]);const oe=H=>E(ye=>({...ye,...H})),_e=m.useMemo(()=>S.serverEntries&&S.serverEntries.length>0?S.serverEntries:(S.servers??[]).map(H=>({kind:"inline",server:H})),[S.serverEntries,S.servers]),ce=m.useMemo(()=>S.scenarioEntries&&S.scenarioEntries.length>0?S.scenarioEntries:S.scenarios.map(H=>({kind:"inline",scenario:H})),[S.scenarioEntries,S.scenarios]),de=H=>{oe({scenarioEntries:H,scenarios:H.filter(ye=>ye.kind==="inline").map(ye=>ye.scenario)})},ve=m.useMemo(()=>S.agentEntries&&S.agentEntries.length>0?S.agentEntries:S.agents.map(H=>({kind:"inline",agent:H})),[S.agentEntries,S.agents]),Pe=H=>{oe({agentEntries:H,agents:H.filter(ye=>ye.kind==="inline").map(ye=>ye.agent)})},F=!N,te=S.runDefaults?.selectedAgentNames??[],fe=async H=>{if(!S.id||F===!1){oe({snapshotEval:{enabled:H.enabled,mode:H.mode,baselineSnapshotId:H.baselineSnapshotId,baselineSourceRunId:H.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}z(!0);try{const ye=await f.updateSnapshotPolicy(S.id,H);E(ye),ke({title:"Snapshot policy updated"})}catch(ye){ke({title:"Could not update snapshot policy",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}finally{z(!1)}},Ee=async()=>{if(!(!S.id||!T.trim())){V(!0);try{const H=await f.generateSnapshotEvalBaseline(T.trim(),S.id,D.trim()||void 0);E(H.config),B(H.snapshot.id),k(ye=>[H.snapshot,...ye.filter(Xe=>Xe.id!==H.snapshot.id)]),ke({title:"Snapshot baseline generated",description:`${H.snapshot.name} (${H.snapshot.id})`})}catch(H){ke({title:"Could not generate baseline",description:H instanceof Error?H.message:String(H),variant:"destructive"})}finally{V(!1)}}},Me=async()=>{if(!S.name.trim()){ke({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const H=_e.map($e=>$e.kind==="referenced"?{kind:"referenced",ref:p.find(yt=>yt.id===$e.ref)?.id||$e.ref}:$e),ye=ve.map($e=>$e.kind==="referenced"?{kind:"referenced",ref:g.find(yt=>yt.id===$e.ref)?.id||$e.ref}:$e),Xe=ce.map($e=>{if($e.kind==="referenced"){const yn=x.find(rn=>rn.id===$e.ref),yt=($e.mcpServers??[]).map(rn=>rn.kind==="referenced"?{kind:"referenced",ref:p.find(wo=>wo.id===rn.ref)?.id||rn.ref}:rn);return{kind:"referenced",ref:yn?.id||$e.ref,...$e.mcpServers!==void 0?{mcpServers:yt}:{}}}return $e}),ft=H.filter($e=>$e.kind==="inline").map($e=>({server:$e.server,error:N8($e.server)})).find($e=>!!$e.error);if(ft?.error){ke({title:"Validation Error",description:ft.error,variant:"destructive"});return}if(Xe.filter($e=>$e.kind==="inline").some($e=>!$e.scenario.name?.trim())){ke({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const Kt=new Set(ye.map($e=>$e.kind==="inline"?$e.agent.id:$e.ref)),Wn=(S.runDefaults?.selectedAgentNames??[]).filter($e=>Kt.has($e)),tn={...S,serverEntries:H,servers:H.filter($e=>$e.kind==="inline").map($e=>$e.server),agentEntries:ye,agents:ye.filter($e=>$e.kind==="inline").map($e=>$e.agent),scenarioEntries:Xe,scenarios:Xe.filter($e=>$e.kind==="inline").map($e=>$e.scenario),runDefaults:Wn.length>0?{...S.runDefaults??{},selectedAgentNames:Wn}:void 0,updatedAt:new Date().toISOString()};if(j){const $e=await o(tn);E($e);const yn=$e.configName?.trim()||$e.name;ke({title:"MCP Evaluation Created",description:`"${yn}" has been saved.`}),n(`/mcp-evaluations/${$e.id}`)}else{const $e=await c(S.id,tn);E($e);const yn=$e.configName?.trim()||$e.name;ke({title:"MCP Evaluation Updated",description:`"${yn}" has been updated.`}),C(!1),n(`/mcp-evaluations/${$e.id}`,{replace:!0})}},et=S.configName?.trim()||S.name,st=j?"New MCP Evaluation":N?`Editing: ${et}`:et,xt=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(S.id||e||"")}`,qt=!!b?.loadError,Ut=m.useMemo(()=>g.map(H=>({id:H.id,ref:H.id,label:H.name||H.id,model:H.model})).sort((H,ye)=>H.label.localeCompare(ye.label)),[g]),xe=(H,ye)=>{const Xe=ye?Array.from(new Set([...te,H])):te.filter(ft=>ft!==H);oe({runDefaults:{...S.runDefaults??{},selectedAgentNames:Xe}})},Ye=H=>{const ye=new Set([...ve.filter(Kt=>Kt.kind==="inline").map(Kt=>Kt.agent.name||Kt.agent.id),...g.map(Kt=>Kt.name||Kt.id)]),Xe=`${H}-custom`;let ft=Xe,Vt=2;for(;ye.has(ft);)ft=`${Xe}-${Vt}`,Vt+=1;return ft},he=()=>{const ye={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};Pe([{kind:"inline",agent:ye},...ve]),Q(Xe=>({...Xe,[ye.id]:!0}))},Te=()=>{const H=g.find(ft=>ft.id===$);if(!H)return;const ye=H.id;new Set(ve.filter(ft=>ft.kind==="referenced").map(ft=>ft.ref)).has(ye)||Pe([...ve,{kind:"referenced",ref:ye}]),I("")},Ie=()=>{const H=new Set(ve.filter(Xe=>Xe.kind==="referenced").map(Xe=>Xe.ref)),ye=g.filter(Xe=>!H.has(Xe.id)).map(Xe=>({kind:"referenced",ref:Xe.id}));ye.length>0&&Pe([...ve,...ye])},Ot=()=>{const H=g.find(Vt=>Vt.id===$);if(!H)return;const ye=H.name||H.id,Xe=Ye(ye),ft={...structuredClone(H),id:`agt-${Date.now()}`,name:Xe};Pe([...ve,{kind:"inline",agent:ft}]),Q(Vt=>({...Vt,[ft.id]:!0})),I(""),ke({title:"Imported agent as inline",description:Xe})},Ht=H=>{const ye=ve[H];if(!ye)return;const Xe=ye.kind==="inline"?ye.agent.id:ye.ref,ft=te.filter(Vt=>Vt!==Xe);oe({runDefaults:{...S.runDefaults??{},selectedAgentNames:ft}}),ye.kind==="inline"&&Q(Vt=>{const Kt={...Vt};return delete Kt[ye.agent.id],Kt}),Pe(ve.filter((Vt,Kt)=>Kt!==H))},Ct=(H,ye)=>{const Xe=H+ye;if(Xe<0||Xe>=ve.length)return;const ft=[...ve],[Vt]=ft.splice(H,1);ft.splice(Xe,0,Vt),Pe(ft)},ge=H=>{const ye=ve[H];if(!ye||ye.kind!=="referenced")return;const Xe=wt(ye.ref);if(!Xe){ke({title:"Referenced agent not found",variant:"destructive"});return}const ft=Xe.name||Xe.id,Vt=Ye(ft),Kt={...structuredClone(Xe),id:`agt-${Date.now()}`,name:Vt},Wn=[...ve];if(Wn[H]={kind:"inline",agent:Kt},Pe(Wn),te.includes(ye.ref)){const tn=te.map($e=>$e===ye.ref?Kt.id:$e);oe({runDefaults:{...S.runDefaults??{},selectedAgentNames:Array.from(new Set(tn))}})}Q(tn=>({...tn,[Kt.id]:!0})),ke({title:"Referenced agent converted to inline",description:Vt})},qe=()=>{const H=x.find(Xe=>Xe.id===R);if(!H)return;const ye={...structuredClone(H),id:`scn-${Date.now()}`,serverIds:[...H.serverIds]};de([...ce,{kind:"inline",scenario:ye}]),je(Xe=>({...Xe,[ye.id]:!0})),G("")},Ve=()=>{const ye={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};de([{kind:"inline",scenario:ye},...ce]),je(Xe=>({...Xe,[ye.id]:!0}))},St=()=>{const H=x.find(ft=>ft.id===R);if(!H)return;const ye=H.id;new Set(ce.filter(ft=>ft.kind==="referenced").map(ft=>ft.ref)).has(ye)||de([...ce,{kind:"referenced",ref:ye}]),G("")},Oe=H=>{const ye=ce[H];ye?.kind==="inline"&&je(Xe=>{const ft={...Xe};return delete ft[ye.scenario.id],ft}),de(ce.filter((Xe,ft)=>ft!==H))},Ze=(H,ye)=>{const Xe=H+ye;if(Xe<0||Xe>=ce.length)return;const ft=[...ce],[Vt]=ft.splice(H,1);ft.splice(Xe,0,Vt),de(ft)},we=H=>{const ye=ce[H];if(!ye||ye.kind!=="referenced")return;const Xe=Dt(ye.ref);if(!Xe){ke({title:"Referenced scenario not found",variant:"destructive"});return}const ft=new Set(ce.filter(yt=>yt.kind==="inline").map(yt=>yt.scenario.name?.trim().toLowerCase()).filter(Boolean)),Vt=`${(Xe.name||Xe.id).trim()}-custom`;let Kt=Vt,Wn=2;for(;ft.has(Kt.toLowerCase());)Kt=`${Vt}-${Wn}`,Wn+=1;const tn=Date.now(),$e={...structuredClone(Xe),id:`scn-${tn}`,name:Kt,serverIds:ye.mcpServers&&ye.mcpServers.length>0?ye.mcpServers.map(yt=>yt.kind==="referenced"?yt.ref:yt.server.id):[...Xe.serverIds]},yn=[...ce];yn[H]={kind:"inline",scenario:$e},de(yn),je(yt=>({...yt,[$e.id]:!0})),ke({title:"Referenced scenario converted to inline",description:Kt})},at=H=>p.find(ye=>ye.id===H),wt=H=>g.find(ye=>ye.id===H),Dt=H=>x.find(ye=>ye.id===H),Fn=_e.filter(H=>H.kind==="referenced").map(H=>H.ref),lt=Fn.map(at).filter(H=>!!H),zt=ve.filter(H=>H.kind==="referenced").map(H=>H.ref),Jt=zt.map(wt).filter(H=>!!H);ve.filter(H=>H.kind==="inline");const dn=ve.flatMap(H=>{if(H.kind==="referenced"){const ye=wt(H.ref);return ye?[{agent:ye,origin:"referenced",ref:H.ref}]:[]}return[{agent:H.agent,origin:"inline",ref:void 0}]}),mn=ce.filter(H=>H.kind==="referenced").map(H=>H.ref),Xt=ce.flatMap(H=>{if(H.kind==="referenced"){const ye=Dt(H.ref);if(!ye)return[];if(H.mcpServers===void 0)return[{scenario:ye,origin:"referenced",hasMcpServerOverride:!1}];const Xe=H.mcpServers.flatMap(ft=>ft.kind==="referenced"?[ft.ref]:[ft.server.id]);return[{scenario:{...ye,serverIds:Xe},origin:"referenced",hasMcpServerOverride:!0}]}return[{scenario:H.scenario,origin:"inline",hasMcpServerOverride:!1}]}),ir=Array.from(new Map([...g,...S.agents,...Jt].map(H=>[H.id,H])).values()),se=Array.from(new Map([...p,...S.servers??[],...lt].map(H=>[H.id,H])).values()),Je=ce.filter(H=>H.kind==="referenced").flatMap(H=>(H.mcpServers??[]).filter(ye=>ye.kind==="referenced").map(ye=>ye.ref)),Nt=Array.from(new Set([...Fn,...Je].filter(H=>!at(H)))),ln=zt.filter(H=>!wt(H)),jt=mn.filter(H=>!Dt(H));new Set(Nt);const qn=new Set(jt),xr=ve.length,or=ce.length,$r=[...p],Un=(H,ye)=>{const Xe=ce[H];if(!Xe||Xe.kind!=="referenced")return;const ft=[...ce];ft[H]={kind:"referenced",ref:Xe.ref,mcpServers:ye.map(Vt=>({kind:"referenced",ref:Vt}))},de(ft)},qs=H=>{const ye=ce[H];if(!ye||ye.kind!=="referenced")return;const Xe=[...ce];Xe[H]={kind:"referenced",ref:ye.ref},de(Xe)};return m.useEffect(()=>{if(!$)return;g.some(ye=>ye.id===$)||I("")},[g,$]),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ne,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:a.jsx(Tt,{to:"/mcp-evaluations",children:a.jsx(nl,{className:"h-4 w-4"})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h1",{className:"text-2xl font-bold truncate",children:st}),a.jsx("p",{className:"text-sm text-muted-foreground",children:j?"Create a new MCP evaluation":d?"Loading configuration...":b?b.loadError?"MCP evaluation could not be fully loaded":`Last updated ${new Date(S.updatedAt).toLocaleDateString()}`:"MCP evaluation not found"})]}),a.jsxs("div",{className:"flex gap-2 shrink-0",children:[y&&!N&&a.jsx(ne,{size:"sm",onClick:()=>{C(!0),n(`${xt}/edit`)},children:"Edit"}),y&&!N&&b&&!qt&&a.jsx(ne,{size:"sm",variant:"outline",asChild:!0,children:a.jsxs(Tt,{to:`/run?configId=${encodeURIComponent(b.id)}`,children:[a.jsx(ii,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),y&&!N&&qt&&a.jsxs(He,{variant:"destructive",className:"py-1 px-3 text-xs",children:[a.jsx($h,{className:"mr-1 h-3 w-3"}),"Broken config"]}),N&&a.jsxs(a.Fragment,{children:[!j&&a.jsx(ne,{variant:"outline",size:"sm",onClick:()=>{E(structuredClone(b)),C(!1),n(xt)},children:"Cancel"}),a.jsxs(ne,{size:"sm",onClick:()=>{Me()},children:[a.jsx(K7,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),qt&&!N&&a.jsx(Ke,{className:"border-destructive/40",children:a.jsxs(Ge,{className:"pt-6 space-y-3",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx($h,{className:"mt-0.5 h-5 w-5 text-destructive"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm font-semibold",children:"This configuration is broken"}),a.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."})]})]}),a.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[a.jsx("p",{className:"text-xs font-medium mb-1",children:"File"}),a.jsx("p",{className:"text-xs font-mono break-all",children:b?.sourcePath||b?.description})]}),a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3",children:[a.jsx("p",{className:"text-xs font-medium mb-1 text-destructive",children:"Load Error"}),a.jsx("p",{className:"text-xs break-all text-destructive",children:b?.loadError})]}),(Nt.length>0||ln.length>0||jt.length>0)&&a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-background p-3 space-y-1.5",children:[a.jsx("p",{className:"text-xs font-medium",children:"Broken references"}),Nt.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers:"," ",a.jsx("span",{className:"text-destructive",children:Nt.join(", ")})]}),ln.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",a.jsx("span",{className:"text-destructive",children:ln.join(", ")})]}),jt.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios:"," ",a.jsx("span",{className:"text-destructive",children:jt.join(", ")})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!qt&&(S.loadWarnings?.length??0)>0&&a.jsx(Ke,{className:"border-amber-500/30",children:a.jsxs(Ge,{className:"pt-4 space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-amber-700 dark:text-amber-300",children:[a.jsx($h,{className:"h-4 w-4"}),"Migration warnings"]}),S.loadWarnings?.map((H,ye)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:H},`${H}-${ye}`))]})}),a.jsxs("div",{className:"flex gap-4",children:[a.jsx(He,{variant:pe==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:a.jsxs(Tt,{to:`${xt}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[a.jsx(XE,{className:"h-3 w-3"}),or," scenario",or!==1?"s":""]})}),a.jsx(He,{variant:pe==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:a.jsxs(Tt,{to:`${xt}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[a.jsx(Rr,{className:"h-3 w-3"}),xr," agent",xr!==1?"s":""]})})]}),a.jsx(Ke,{children:a.jsx(Ge,{className:"pt-6 space-y-3",children:a.jsxs("div",{className:`grid gap-4 ${F||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!F&&j&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Config ID"}),a.jsx(bt,{value:S.name,onChange:H=>oe({name:H.target.value}),disabled:F,placeholder:"e.g. check-weather"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Name (optional)"}),a.jsx(bt,{value:S.configName||"",onChange:H=>oe({configName:H.target.value}),disabled:F,placeholder:"e.g. Weather checks baseline"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Description"}),a.jsx(bt,{value:S.description||"",onChange:H=>oe({description:H.target.value}),disabled:F,placeholder:"Brief description..."})]})]})})}),h&&a.jsx(Ke,{children:a.jsxs(Ge,{className:"pt-6 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold",children:"Snapshot Evaluation"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Config baseline versioning. One active baseline is selected; scenarios can opt in/out below."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ze,{className:"text-xs",children:"Enable snapshot baseline"}),a.jsx(nv,{checked:S.snapshotEval?.enabled??!1,disabled:M,onCheckedChange:H=>{const ye=S.snapshotEval;fe({enabled:H,mode:ye?.mode??"warn",baselineSnapshotId:ye?.baselineSnapshotId,baselineSourceRunId:ye?.baselineSourceRunId})}})]})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Drift mode"}),a.jsxs(_n,{value:S.snapshotEval?.mode??"warn",onValueChange:H=>{const ye=S.snapshotEval;fe({enabled:ye?.enabled??!1,mode:H,baselineSnapshotId:ye?.baselineSnapshotId,baselineSourceRunId:ye?.baselineSourceRunId})},children:[a.jsx(bn,{className:"h-8",children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"warn",children:"Warn"}),a.jsx(ot,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Active baseline"}),a.jsx("p",{className:"rounded-md border bg-muted/20 px-2 py-2 text-xs font-mono",children:S.snapshotEval?.baselineSnapshotId??"No baseline linked"})]})]}),S.id&&a.jsxs("div",{className:"grid gap-2 rounded-md border bg-muted/20 p-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Generate baseline from passing run"}),a.jsx(bt,{value:T,onChange:H=>O(H.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),X===!1&&a.jsx("p",{className:"text-[11px] text-destructive",children:"Run is missing or not fully passing."})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Snapshot name (optional)"}),a.jsx(bt,{value:D,onChange:H=>q(H.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Switch baseline"}),a.jsxs(_n,{value:U||S.snapshotEval?.baselineSnapshotId||"",onValueChange:H=>{B(H),fe({enabled:S.snapshotEval?.enabled??!0,mode:S.snapshotEval?.mode??"warn",baselineSnapshotId:H||void 0,baselineSourceRunId:S.snapshotEval?.baselineSourceRunId})},children:[a.jsx(bn,{className:"h-8",children:a.jsx(An,{placeholder:"Select snapshot"})}),a.jsx(wn,{children:A.map(H=>a.jsx(ot,{value:H.id,children:H.name},H.id))})]})]}),a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{Ee()},disabled:K||!T.trim()||X!==!0,children:K?"Generating...":"Generate Baseline"}),a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{fe({enabled:S.snapshotEval?.enabled??!1,mode:S.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:M,children:"Clear Baseline"})]})]})]})}),a.jsxs(Eg,{value:pe,onValueChange:H=>{if(H!=="servers"&&H!=="agents"&&H!=="scenarios")return;const ye=new URLSearchParams(r);if(ye.delete("tab"),s(ye,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${H}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${H}`,{replace:!0})},className:"space-y-4",children:[a.jsxs(Jf,{children:[a.jsxs(ks,{value:"scenarios",className:"gap-1.5",children:[a.jsx(XE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),a.jsxs(ks,{value:"agents",className:"gap-1.5",children:[a.jsx(Rr,{className:"h-3.5 w-3.5"}),"Agents"]})]}),a.jsxs(Cf,{value:"agents",children:[!F&&a.jsx(Ke,{className:"mb-4",children:a.jsxs(Ge,{className:"pt-4 space-y-3",children:[a.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[a.jsxs(_n,{value:$,onValueChange:I,children:[a.jsx(bn,{className:"h-8",children:a.jsx(An,{placeholder:"Select agent from library"})}),a.jsx(wn,{children:Ut.map(H=>a.jsx(ot,{value:H.id,children:H.label},H.id))})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!$,onClick:Te,children:"Add Ref"}),a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!$,onClick:Ot,children:"Import Inline"}),a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:g.length===0||g.every(H=>ve.some(ye=>ye.kind==="referenced"&&ye.ref===H.id)),onClick:Ie,children:"Add All Refs"}),a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:he,children:"Add agent"})]})]}),a.jsxs("div",{className:"space-y-2",children:[ve.map((H,ye)=>{const Xe=H.kind==="referenced"?wt(H.ref):null,ft=H.kind==="inline"?H.agent.name?.trim()||H.agent.id:Xe?.name||H.ref,Vt=H.kind==="inline"?H.agent.model:Xe?.model||"unknown",Kt=H.kind==="inline"?H.agent.id:H.ref,Wn=H.kind==="referenced"&&!Xe,tn=H.kind==="inline"?H.agent.id:H.ref,$e=te.includes(tn),yn=H.kind==="inline"&&!!ee[H.agent.id];return a.jsxs("div",{className:"rounded-md border text-sm",children:[a.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ct(ye,-1),disabled:ye===0,"aria-label":"Move agent up",children:a.jsx(Cs,{className:"h-3 w-3"})}),a.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ct(ye,1),disabled:ye===ve.length-1,"aria-label":"Move agent down",children:a.jsx(Qt,{className:"h-3 w-3"})})]}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[ye+1,"."]}),a.jsx("span",{className:"truncate font-medium",children:ft}),a.jsx(He,{variant:H.kind==="inline"?"secondary":"outline",children:H.kind==="inline"?"Inline":"Referenced"}),a.jsx(He,{variant:"outline",className:"font-mono text-[10px]",children:Vt}),$e&&a.jsx(He,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),Wn&&a.jsx(He,{variant:"destructive",children:"Missing"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs("label",{className:"mx-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[a.jsx("input",{type:"checkbox",checked:$e,onChange:yt=>xe(tn,yt.target.checked)}),a.jsx("span",{children:"Default"})]}),H.kind==="inline"&&a.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>Q(yt=>({...yt,[H.agent.id]:!yt[H.agent.id]})),children:yn?"Collapse":"Expand"}),H.kind==="referenced"&&a.jsx(a.Fragment,{children:a.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>ge(ye),disabled:Wn,children:"Convert to inline"})}),a.jsx(ne,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Ht(ye),"aria-label":"Remove agent entry",children:a.jsx($a,{className:"h-3.5 w-3.5"})})]})]}),H.kind==="inline"&&yn&&a.jsxs("div",{className:"border-t px-3 py-3 space-y-3",children:[a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Name"}),a.jsx(bt,{value:H.agent.name,onChange:yt=>{const rn=[...ve];rn[ye]={kind:"inline",agent:{...H.agent,name:yt.target.value}},Pe(rn)},placeholder:"e.g. GPT-5 Mini custom"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Provider"}),a.jsxs(_n,{value:H.agent.provider,onValueChange:yt=>{const rn=[...ve];rn[ye]={kind:"inline",agent:{...H.agent,provider:yt}},Pe(rn)},children:[a.jsx(bn,{children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"openai",children:"OpenAI"}),a.jsx(ot,{value:"anthropic",children:"Anthropic"}),a.jsx(ot,{value:"azure",children:"Azure OpenAI"}),a.jsx(ot,{value:"google",children:"Google"}),a.jsx(ot,{value:"custom",children:"Custom"})]})]})]})]}),a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Model"}),a.jsx(bt,{value:H.agent.model,onChange:yt=>{const rn=[...ve];rn[ye]={kind:"inline",agent:{...H.agent,model:yt.target.value}},Pe(rn)},className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Max Tokens"}),a.jsx(bt,{type:"number",min:1,max:128e3,value:H.agent.maxTokens,onChange:yt=>{const rn=[...ve];rn[ye]={kind:"inline",agent:{...H.agent,maxTokens:parseInt(yt.target.value)||0}},Pe(rn)},className:"font-mono text-xs"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Temperature"}),a.jsx(bt,{type:"number",min:0,max:2,step:.01,value:H.agent.temperature,onChange:yt=>{const rn=[...ve];rn[ye]={kind:"inline",agent:{...H.agent,temperature:Number(yt.target.value)||0}},Pe(rn)},className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"System Prompt"}),a.jsx(Is,{value:H.agent.systemPrompt||"",onChange:yt=>{const rn=[...ve];rn[ye]={kind:"inline",agent:{...H.agent,systemPrompt:yt.target.value}},Pe(rn)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ye}-${Kt}`)}),ve.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),ln.length>0&&a.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",ln.join(", ")]})]})}),F?a.jsx(Ke,{children:a.jsx(Ge,{className:"pt-4",children:a.jsxs("div",{className:"space-y-2",children:[dn.map((H,ye)=>{const Xe=H.agent.name||H.agent.id,ft=te.includes(H.origin==="inline"?H.agent.id:H.ref||H.agent.id),Vt=H.ref??H.agent.id,Kt=!!ie[Vt];return a.jsxs("div",{className:"rounded-md border p-3",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:[ye+1,"."]}),a.jsx("div",{className:"truncate font-medium text-sm",children:Xe})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[ft&&a.jsx(He,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),a.jsx(He,{variant:H.origin==="inline"?"secondary":"outline",children:H.origin==="inline"?"Inline":"Referenced"}),a.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>ue(Wn=>({...Wn,[Vt]:!Wn[Vt]})),"aria-label":Kt?"Collapse agent details":"Expand agent details",children:a.jsx(Qt,{className:`h-4 w-4 transition-transform ${Kt?"rotate-180":""}`})})]})]}),Kt&&a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[a.jsx(QB,{provider:H.agent.provider}),a.jsx(He,{variant:"outline",className:"text-xs font-mono",children:H.agent.model}),a.jsxs(He,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",H.agent.maxTokens]}),a.jsxs(He,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",H.agent.temperature]})]})]},`agent-view-${ye}-${H.ref??H.agent.id}`)}),dn.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),a.jsxs(Cf,{value:"scenarios",children:[!F&&a.jsx(Ke,{className:"mb-4",children:a.jsxs(Ge,{className:"pt-4 space-y-3",children:[a.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[a.jsxs(_n,{value:R,onValueChange:G,children:[a.jsx(bn,{className:"h-8",children:a.jsx(An,{placeholder:"Select scenario from library"})}),a.jsx(wn,{children:[...x].sort((H,ye)=>(H.name||H.id).localeCompare(ye.name||ye.id)).map(H=>a.jsx(ot,{value:H.id,children:H.name||H.id},H.id))})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!R,onClick:St,children:"Add Ref"}),a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!R,onClick:qe,children:"Import Inline"}),a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Ve,children:"Add scenario"})]})]}),a.jsxs("div",{className:"space-y-2",children:[ce.map((H,ye)=>{const Xe=H.kind==="referenced"?Dt(H.ref):null,ft=H.kind==="inline"?H.scenario.name?.trim()||H.scenario.id:Xe?.name||H.ref,Vt=H.kind==="inline"&&!H.scenario.name?.trim(),Kt=H.kind==="referenced"&&qn.has(H.ref),Wn=H.kind==="referenced"&&Array.isArray(H.mcpServers),tn=H.kind==="inline"&&!!re[H.scenario.id];return a.jsxs("div",{className:"rounded-md border text-sm",children:[a.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ze(ye,-1),disabled:ye===0,"aria-label":"Move scenario up",children:a.jsx(Cs,{className:"h-3 w-3"})}),a.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ze(ye,1),disabled:ye===ce.length-1,"aria-label":"Move scenario down",children:a.jsx(Qt,{className:"h-3 w-3"})})]}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[ye+1,"."]}),a.jsx("span",{className:"truncate font-medium",children:ft}),a.jsx(He,{variant:H.kind==="inline"?"secondary":"outline",children:H.kind==="inline"?"Inline":"Referenced"}),Wn&&a.jsx(He,{variant:"secondary",children:"Override"}),Vt&&a.jsx(He,{variant:"destructive",children:"Name required"}),Kt&&a.jsx(He,{variant:"destructive",children:"Missing"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[H.kind==="inline"&&a.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>je($e=>({...$e,[H.scenario.id]:!$e[H.scenario.id]})),"aria-label":tn?"Collapse scenario details":"Expand scenario details",children:a.jsx(Qt,{className:`h-3.5 w-3.5 transition-transform ${tn?"rotate-180":""}`})}),H.kind==="referenced"&&a.jsx(a.Fragment,{children:a.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>we(ye),disabled:Kt,children:"Convert to inline"})}),a.jsx(ne,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Oe(ye),"aria-label":"Remove scenario entry",children:a.jsx($a,{className:"h-3.5 w-3.5"})})]})]}),H.kind==="inline"&&tn&&a.jsx("div",{className:"border-t px-3 py-3",children:a.jsx(rN,{scenarios:[H.scenario],scenarioOrigins:["inline"],agents:[...S.agents,...Jt],servers:[...S.servers??[],...lt],configId:S.id,configPath:S.sourcePath,defaultAssistantAgentName:S.runDefaults?.selectedAgentNames?.[0],snapshotEval:S.snapshotEval,onChange:$e=>{const yn=$e[0];if(!yn)return;const yt=[...ce];yt[ye]={kind:"inline",scenario:yn},de(yt)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})}),H.kind==="referenced"&&!Kt&&a.jsxs("div",{className:"border-t px-3 py-3 space-y-2",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Optional MCP server override for this referenced scenario."}),a.jsx("div",{className:"flex flex-wrap gap-2",children:$r.map($e=>{const yn=(H.mcpServers??[]).some(yt=>yt.kind==="referenced"&&yt.ref===$e.id);return a.jsx(ne,{type:"button",size:"sm",variant:yn?"default":"outline",className:`h-7 text-xs ${yn?"":"opacity-70"}`,onClick:()=>{const yt=(H.mcpServers??[]).filter(ta=>ta.kind==="referenced").map(ta=>ta.ref),rn=yt.includes($e.id)?yt.filter(ta=>ta!==$e.id):[...yt,$e.id];Un(ye,rn)},children:$e.name||$e.id},`${H.ref}-override-server-${$e.id}`)})}),Wn&&a.jsx(ne,{type:"button",size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>qs(ye),children:"Reset override"})]})]},`scenario-entry-${ye}-${H.kind==="inline"?H.scenario.id:H.ref}`)}),ce.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),jt.length>0&&a.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",jt.join(", ")]})]})}),F?a.jsx(Ke,{children:a.jsx(Ge,{className:"pt-4",children:a.jsx(rN,{scenarios:Xt.map(H=>H.scenario),scenarioOrigins:Xt.map(H=>H.origin),scenarioOverrides:Xt.map(H=>H.hasMcpServerOverride),agents:ir,servers:se,configId:S.id,configPath:S.sourcePath,defaultAssistantAgentName:S.runDefaults?.selectedAgentNames?.[0],snapshotEval:S.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var Lve=Symbol("radix.slottable");function Fve(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Lve,t}var C8="AlertDialog",[zve]=gr(C8,[O5]),_i=O5(),_8=e=>{const{__scopeAlertDialog:t,...n}=e,r=_i(t);return a.jsx(Tv,{...r,...n,modal:!0})};_8.displayName=C8;var Bve="AlertDialogTrigger",qve=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=_i(n);return a.jsx(sY,{...s,...r,ref:t})});qve.displayName=Bve;var Uve="AlertDialogPortal",A8=e=>{const{__scopeAlertDialog:t,...n}=e,r=_i(t);return a.jsx(Ov,{...r,...n})};A8.displayName=Uve;var Wve="AlertDialogOverlay",E8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=_i(n);return a.jsx(mu,{...s,...r,ref:t})});E8.displayName=Wve;var kc="AlertDialogContent",[Vve,Hve]=zve(kc),Kve=Fve("AlertDialogContent"),k8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=_i(n),o=m.useRef(null),c=Et(t,o),d=m.useRef(null);return a.jsx(tY,{contentName:kc,titleName:P8,docsSlug:"alert-dialog",children:a.jsx(Vve,{scope:n,cancelRef:d,children:a.jsxs(vu,{role:"alertdialog",...i,...s,ref:c,onOpenAutoFocus:Le(s.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[a.jsx(Kve,{children:r}),a.jsx(Yve,{contentRef:o})]})})})});k8.displayName=kc;var P8="AlertDialogTitle",T8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=_i(n);return a.jsx(If,{...s,...r,ref:t})});T8.displayName=P8;var O8="AlertDialogDescription",R8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=_i(n);return a.jsx(Mf,{...s,...r,ref:t})});R8.displayName=O8;var Gve="AlertDialogAction",I8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=_i(n);return a.jsx(Rv,{...s,...r,ref:t})});I8.displayName=Gve;var M8="AlertDialogCancel",$8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=Hve(M8,n),i=_i(n),o=Et(t,s);return a.jsx(Rv,{...i,...r,ref:o})});$8.displayName=M8;var Yve=({contentRef:e})=>{const t=`\`${kc}\` requires a description for the component to be accessible for screen reader users.
|
|
130
|
-
|
|
131
|
-
You can add a description to the \`${kc}\` by passing a \`${O8}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
132
|
-
|
|
133
|
-
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 \`${kc}\`. 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.
|
|
134
|
-
|
|
135
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Xve=_8,Qve=A8,D8=E8,L8=k8,F8=I8,z8=$8,B8=T8,q8=R8;const Bs=Xve,Jve=Qve,U8=m.forwardRef(({className:e,...t},n)=>a.jsx(D8,{className:Ce("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}));U8.displayName=D8.displayName;const cs=m.forwardRef(({className:e,...t},n)=>a.jsxs(Jve,{children:[a.jsx(U8,{}),a.jsx(L8,{ref:n,className:Ce("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})]}));cs.displayName=L8.displayName;const us=({className:e,...t})=>a.jsx("div",{className:Ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});us.displayName="AlertDialogHeader";const ds=({className:e,...t})=>a.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ds.displayName="AlertDialogFooter";const fs=m.forwardRef(({className:e,...t},n)=>a.jsx(B8,{ref:n,className:Ce("text-lg font-semibold",e),...t}));fs.displayName=B8.displayName;const ps=m.forwardRef(({className:e,...t},n)=>a.jsx(q8,{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));ps.displayName=q8.displayName;const hs=m.forwardRef(({className:e,...t},n)=>a.jsx(F8,{ref:n,className:Ce($N(),e),...t}));hs.displayName=F8.displayName;const ms=m.forwardRef(({className:e,...t},n)=>a.jsx(z8,{ref:n,className:Ce($N({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ms.displayName=z8.displayName;const Zve=()=>{const{servers:e,setServers:t,reload:n,loading:r}=os(),s=La(),[i,o]=m.useState(null),[c,d]=m.useState(""),f=c.trim().toLowerCase(),h=y=>y.name?.trim()||y.id,p=async y=>{const b=`${h(y)}-copy`;let N=b,C=1;for(;e.some(E=>(E.name?.trim()||E.id)===N);)N=`${b}-${C}`,C+=1;const S={...structuredClone(y),id:`srv-${Date.now()}`,name:N};await t([...e,S]),ke({title:"Server duplicated",description:`Created ${N}.`})},g=async y=>{await t(e.filter(b=>b.id!==y.id)),ke({title:"Server deleted",description:`${h(y)} was removed.`}),o(null)},x=y=>y.transport==="stdio"?[y.command,...y.args||[]].filter(Boolean).join(" "):y.url||"",j=m.useMemo(()=>[...f.length===0?e:e.filter(b=>[h(b),b.id,b.transport,x(b),b.authType??""].join(" ").toLowerCase().includes(f))].sort((b,N)=>h(b).localeCompare(h(N),void 0,{sensitivity:"base"})),[e,f]);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(iD,{className:"h-6 w-6"}),"MCP Servers"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable MCP server definitions shared across configurations."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(qC,{value:c,onValueChange:d,placeholder:"Search MCP servers..."}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[a.jsx(ba,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(ne,{type:"button",size:"sm",onClick:()=>s("/libraries/servers/new"),children:[a.jsx(fi,{className:"mr-2 h-4 w-4"}),"Add Server"]})]})]}),e.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers configured. Add one to get started."}),a.jsxs(ne,{type:"button",size:"sm",className:"mt-4",onClick:()=>s("/libraries/servers/new"),children:[a.jsx(fi,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):j.length===0?a.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers match this filter."})}):a.jsx(Ke,{children:a.jsx(Ge,{className:"p-0",children:a.jsxs(Kr,{children:[a.jsx(Gr,{children:a.jsxs(Gt,{children:[a.jsx(it,{children:"Name"}),a.jsx(it,{children:"Transport"}),a.jsx(it,{children:"Endpoint"}),a.jsx(it,{children:"Auth"}),a.jsx(it,{className:"text-right",children:"Actions"})]})}),a.jsx(Yr,{children:j.map(y=>a.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>s(`/libraries/servers/${encodeURIComponent(y.id)}`),children:[a.jsx(We,{className:"font-medium",children:h(y)}),a.jsx(We,{children:a.jsx(He,{variant:"secondary",className:"font-mono text-xs",children:y.transport})}),a.jsx(We,{children:a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:x(y)})}),a.jsx(We,{children:!y.authType||y.authType==="none"?a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):a.jsx(He,{variant:"outline",className:"text-xs",children:y.authType})}),a.jsx(We,{className:"text-right",onClick:b=>b.stopPropagation(),children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsxs(ne,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(y),children:[a.jsx($a,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(y)},children:[a.jsx(Ps,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>s(`/libraries/servers/${encodeURIComponent(y.id)}`),children:[a.jsx(dv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},y.id))})]})})}),a.jsx(Bs,{open:!!i,onOpenChange:y=>!y&&o(null),children:a.jsxs(cs,{children:[a.jsxs(us,{children:[a.jsx(fs,{children:"Delete server?"}),a.jsxs(ps,{children:["This will permanently remove"," ",a.jsx("span",{className:"font-mono",children:i?h(i):""})," ","from the library. This action cannot be undone."]})]}),a.jsxs(ds,{children:[a.jsx(ms,{children:"Cancel"}),a.jsx(hs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&g(i)},children:"Delete Server"})]})]})})]})},t$={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"},n$=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none"}),ege=()=>{const{serverId:e}=Nl(),t=La(),{servers:n,setServers:r}=os(),{source:s}=Ln(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(M=>M.id===o||M.name===o),d=M=>M.name?.trim()||M.id,[f,h]=m.useState(()=>c??n$()),[p,g]=m.useState(!1),[x,j]=m.useState(!1),[y,b]=m.useState({status:"idle"}),[N,C]=m.useState(!1),[S,E]=m.useState(!1),[A,k]=m.useState([]),[T,O]=m.useState(!1),D=m.useRef(null);m.useEffect(()=>{const M=i?`new:${o||"new"}`:`srv:${o}`;if(D.current!==M){if(i){h(n$()),O(!1),D.current=M;return}c&&(h(c),O(!1),D.current=M)}},[i,o,c]);const q=M=>{O(!1),h(z=>({...z,authType:M,...M!=="bearer"&&M!=="api-key"?{authValue:void 0}:{},...M!=="api-key"?{apiKeyHeaderName:void 0}:{apiKeyHeaderName:z.apiKeyHeaderName||"X-API-Key"},...M!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0,oauthMode:void 0,oauthAuthorizationUrl:void 0,oauthTokenEndpoint:void 0}:{oauthRedirectUrl:z.oauthRedirectUrl||void 0}}))},U=async()=>{if(C(!0),b({status:"loading"}),k([]),f.authType==="oauth2")try{E(!0),await di({serverNames:[f.id],source:s,onServerStatus:M=>{const z=new Date().toLocaleTimeString(),K=typeof M.tokenExpiresInSeconds=="number"?` (valid ${tN(M.tokenExpiresInSeconds,{nonPositiveLabel:"expired"})}; until ${new Date(M.tokenExpiresAt||Date.now()).toLocaleTimeString()})`:"";if(M.status==="auth_required"){k(V=>[...V,`[${z}] OAuth debug: callback required for '${M.serverName}'`]);return}M.status==="ready"&&(M.debugState==="refreshed"?k(V=>[...V,`[${z}] OAuth debug: token refreshed (no callback)${K}`]):M.debugState==="reused"?k(V=>[...V,`[${z}] OAuth debug: session/token reused${K}`]):k(V=>[...V,`[${z}] OAuth debug: authorized${K}`]))}})}catch(M){b({status:"error",message:`OAuth login failed: ${M instanceof Error?M.message:String(M)}`,testedAt:new Date().toISOString()}),E(!1);return}finally{E(!1)}try{const z=(await s.discoverToolsForAnalysis({serverNames:[f.id]})).servers[0];z&&z.warnings.length===0?b({status:"success",toolNames:z.tools.map(K=>K.name),toolCount:z.tools.length,mcpServerVersion:z.mcpServerVersion,mcpServerImplementation:z.mcpServerImplementation,testedAt:new Date().toISOString()}):b({status:"error",message:z?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(M){b({status:"error",message:M instanceof Error?M.message:String(M),testedAt:new Date().toISOString()})}},B=async()=>{if(!f.name.trim()){ke({title:"Name is required",variant:"destructive"});return}const M=N8(f);if(M){ke({title:"Validation Error",description:M,variant:"destructive"});return}const z={...f,authValue:f.authValue?.trim(),apiKeyHeaderName:f.apiKeyHeaderName?.trim()||void 0};j(!0);try{if(i)await r([...n,z]),ke({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(z.id)}`);else{const K=n.map(V=>V.id===c?.id?z:V);await r(K),ke({title:"Server saved"}),z.id!==o&&t(`/libraries/servers/${encodeURIComponent(z.id)}`,{replace:!0})}}finally{j(!1)}},X=async()=>{const M=n.filter(z=>z.id!==c?.id);await r(M),ke({title:"Server deleted"}),t("/libraries/servers")},W=()=>f.transport==="stdio"?[f.command,...f.args||[]].filter(Boolean).join(" "):f.url||"";return!i&&!c?a.jsxs("div",{className:"space-y-4",children:[a.jsxs(Tt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(nl,{className:"h-4 w-4"})," Servers"]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:['Server "',o,'" not found.']})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs(Tt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(nl,{className:"h-4 w-4"})," Servers"]}),a.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&a.jsxs(ne,{type:"button",onClick:()=>{U()},disabled:y.status==="loading"||S,children:[a.jsx(pD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),N&&a.jsxs(Ke,{children:[a.jsxs(Rt,{className:"flex-row items-center justify-between space-y-0",children:[a.jsx(It,{className:"text-base",children:"Connection Test"}),a.jsx("button",{type:"button",onClick:()=>C(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:a.jsx(rs,{className:"h-4 w-4"})})]}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[a.jsx("span",{children:"Server:"}),a.jsx("span",{className:"font-medium text-foreground",children:d(f)}),a.jsx("span",{className:"mx-1",children:"·"}),a.jsx("span",{children:"Transport:"}),a.jsx("span",{className:"font-medium text-foreground",children:f.transport}),W()&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"mx-1",children:"·"}),a.jsx("span",{children:"Endpoint:"}),a.jsx("code",{className:"font-mono text-xs",children:W()})]})]}),y.status==="loading"&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(Cr,{className:"h-4 w-4 animate-spin"}),S?"Waiting for OAuth login in browser…":"Connecting to MCP server…"]}),A.length>0&&a.jsx("div",{className:"space-y-0.5",children:A.map((M,z)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:M},z))})]}),y.status==="success"&&a.jsxs("div",{className:"space-y-3",children:[a.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[a.jsx(Tc,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",y.toolCount," tool",y.toolCount!==1?"s":""]}),y.toolNames.length>0&&a.jsxs("div",{className:"rounded-md bg-muted p-3",children:[a.jsx("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"First 5 tools:"}),a.jsx("ul",{className:"space-y-0.5",children:y.toolNames.slice(0,5).map(M=>a.jsx("li",{className:"font-mono text-xs",children:M},M))})]}),(y.mcpServerImplementation||y.mcpServerVersion)&&a.jsx("div",{className:"rounded-md border bg-muted/40 p-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[y.mcpServerImplementation?.icons?.[0]?.src?a.jsx("img",{src:y.mcpServerImplementation.icons[0].src,alt:y.mcpServerImplementation.title||y.mcpServerImplementation.name,className:"h-7 w-7 rounded-sm border bg-background object-contain"}):null,a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"MCP server"}),a.jsx("p",{className:"truncate text-sm",children:y.mcpServerImplementation?y.mcpServerImplementation.title||y.mcpServerImplementation.name:"Unknown MCP server"}),y.mcpServerVersion?a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Version:"," ",a.jsx("code",{className:"font-mono",children:y.mcpServerVersion})]}):null,y.mcpServerImplementation?.description?a.jsx("p",{className:"text-xs text-muted-foreground",children:y.mcpServerImplementation.description}):null]})]})}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(y.testedAt).toLocaleString()]}),A.length>0&&a.jsx("div",{className:"space-y-0.5",children:A.map((M,z)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:M},z))})]}),y.status==="error"&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"text-sm text-destructive",children:[a.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," — ",y.message]}),t$[f.transport]&&a.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",t$[f.transport]]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(y.testedAt).toLocaleString()]})]})]})]}),a.jsxs(Ke,{children:[a.jsx(Rt,{children:a.jsx(It,{className:"text-base",children:"Configuration"})}),a.jsxs(Ge,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"Name"}),a.jsx(bt,{value:f.name,onChange:M=>h(z=>({...z,name:M.target.value})),placeholder:"e.g. Filesystem MCP"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"Transport"}),a.jsxs(_n,{value:f.transport,onValueChange:M=>h(z=>({...z,transport:M})),children:[a.jsx(bn,{children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"stdio",children:"stdio"}),a.jsx(ot,{value:"sse",children:"SSE"}),a.jsx(ot,{value:"streamable-http",children:"Streamable HTTP"})]})]})]})]}),f.transport==="stdio"?a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"Command"}),a.jsx(bt,{value:f.command||"",onChange:M=>h(z=>({...z,command:M.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"Args (comma-separated)"}),a.jsx(bt,{value:(f.args||[]).join(", "),onChange:M=>h(z=>({...z,args:M.target.value.split(",").map(K=>K.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"URL"}),a.jsx(bt,{value:f.url||"",onChange:M=>h(z=>({...z,url:M.target.value})),placeholder:"http://localhost:3001/sse",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"Auth Type"}),a.jsxs(_n,{value:f.authType||"none",onValueChange:M=>q(M),children:[a.jsx(bn,{children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"none",children:"None"}),a.jsx(ot,{value:"bearer",children:"Bearer Token"}),a.jsx(ot,{value:"api-key",children:"API Key"}),a.jsx(ot,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType==="bearer"&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"Token"}),a.jsx(bt,{value:f.authValue||"",onChange:M=>h(z=>({...z,authValue:M.target.value})),placeholder:"${DATABRICKS_TOKEN}",className:"font-mono text-xs"})]})]}),f.authType==="bearer"&&a.jsxs("p",{className:"text-xs text-muted-foreground -mt-1",children:["Use ",a.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a token directly."]}),f.authType==="api-key"&&a.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[a.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Header Name"}),a.jsx(bt,{value:f.apiKeyHeaderName||"X-API-Key",onChange:M=>h(z=>({...z,apiKeyHeaderName:M.target.value})),placeholder:"X-API-Key",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Value"}),a.jsx(bt,{value:f.authValue||"",onChange:M=>h(z=>({...z,authValue:M.target.value})),placeholder:"${MY_API_KEY}",className:"font-mono text-xs"})]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",a.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a value directly."]})]}),f.authType==="oauth2"&&a.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[a.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"OAuth 2.0 Flow"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ne,{type:"button",variant:!f.oauthMode||f.oauthMode==="pre_registered"?"default":"outline",size:"sm",onClick:()=>h(M=>({...M,oauthMode:"pre_registered"})),children:"Pre-registered"}),a.jsx(ne,{type:"button",variant:f.oauthMode==="dcr"?"default":"outline",size:"sm",onClick:()=>h(M=>({...M,oauthMode:"dcr",oauthClientId:void 0,oauthClientSecret:void 0})),children:"DCR (Dynamic)"})]}),(!f.oauthMode||f.oauthMode==="pre_registered")&&a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Client ID"}),a.jsx(bt,{value:f.oauthClientId||"",onChange:M=>h(z=>({...z,oauthClientId:M.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Client Secret (optional)"}),a.jsx(bt,{type:"password",value:f.oauthClientSecret||"",onChange:M=>h(z=>({...z,oauthClientSecret:M.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Scope (optional, space-separated)"}),a.jsx(bt,{value:f.oauthScope||"",onChange:M=>h(z=>({...z,oauthScope:M.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]}),a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>O(M=>!M),children:[a.jsx("span",{children:T?"▾":"▸"}),"Advanced — manual endpoint overrides"]}),T&&a.jsxs("div",{className:"mt-2 grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Authorization URL"}),a.jsx(bt,{value:f.oauthAuthorizationUrl||"",onChange:M=>h(z=>({...z,oauthAuthorizationUrl:M.target.value||void 0})),placeholder:"leave blank to use .well-known discovery",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Token URL"}),a.jsx(bt,{value:f.oauthTokenEndpoint||"",onChange:M=>h(z=>({...z,oauthTokenEndpoint:M.target.value||void 0})),placeholder:"leave blank to use .well-known discovery",className:"font-mono text-xs"})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between pt-2",children:[a.jsx("div",{children:!i&&a.jsx(ne,{type:"button",variant:"destructive",size:"sm",onClick:()=>g(!0),children:"Delete"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),a.jsxs(ne,{type:"button",size:"sm",onClick:()=>{B()},disabled:x,children:[x&&a.jsx(Cr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),a.jsx(Bs,{open:p,onOpenChange:g,children:a.jsxs(cs,{children:[a.jsxs(us,{children:[a.jsx(fs,{children:"Delete server?"}),a.jsxs(ps,{children:["This will permanently remove the server ",a.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),a.jsxs(ds,{children:[a.jsx(ms,{children:"Cancel"}),a.jsx(hs,{onClick:()=>{X()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},tge=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=os(),s=La(),[i,o]=m.useState(null),[c,d]=m.useState(""),f=c.trim().toLowerCase(),h=m.useMemo(()=>f.length===0?e:e.filter(x=>{const j=x.name.toLowerCase(),y=x.model.toLowerCase();return j.includes(f)||y.includes(f)}),[e,f]),p=async x=>{const j=`${x.name}-copy`;let y=j,b=1;for(;e.some(C=>C.name===y);)y=`${j}-${b}`,b+=1;const N={...structuredClone(x),id:`agt-${Date.now()}`,name:y};await t([...e,N]),ke({title:"Agent duplicated",description:`Created ${y}.`})},g=async x=>{await t(e.filter(j=>j.id!==x.id)),ke({title:"Agent deleted",description:`${x.name} was removed.`}),o(null)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(Rr,{className:"h-6 w-6"}),"Agents"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable agent profiles shared across configurations."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(qC,{value:c,onValueChange:d,placeholder:"Search agents..."}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[a.jsx(ba,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(ne,{type:"button",size:"sm",onClick:()=>s("/libraries/agents/new"),children:[a.jsx(fi,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]})]}),e.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents configured. Add one to get started."}),a.jsxs(ne,{type:"button",size:"sm",className:"mt-4",onClick:()=>s("/libraries/agents/new"),children:[a.jsx(fi,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):h.length===0?a.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents match this filter."})}):a.jsx(Ke,{children:a.jsx(Ge,{className:"p-0",children:a.jsxs(Kr,{children:[a.jsx(Gr,{children:a.jsxs(Gt,{children:[a.jsx(it,{children:"Name"}),a.jsx(it,{children:"Provider"}),a.jsx(it,{children:"Model"}),a.jsx(it,{children:"Max Tokens"}),a.jsx(it,{children:"Temperature"}),a.jsx(it,{className:"text-right",children:"Actions"})]})}),a.jsx(Yr,{children:h.map(x=>a.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>s(`/libraries/agents/${encodeURIComponent(x.id)}`),children:[a.jsx(We,{className:"font-medium",children:x.name}),a.jsx(We,{children:a.jsx(QB,{provider:x.provider})}),a.jsx(We,{children:a.jsx("span",{className:"font-mono text-xs",children:x.model})}),a.jsx(We,{className:"font-mono text-xs",children:x.maxTokens}),a.jsx(We,{className:"font-mono text-xs",children:x.temperature.toFixed(2)}),a.jsx(We,{className:"text-right",onClick:j=>j.stopPropagation(),children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsxs(ne,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(x),children:[a.jsx($a,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(x)},children:[a.jsx(Ps,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>s(`/libraries/agents/${encodeURIComponent(x.id)}`),children:[a.jsx(dv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},x.id))})]})})}),a.jsx(Bs,{open:!!i,onOpenChange:x=>!x&&o(null),children:a.jsxs(cs,{children:[a.jsxs(us,{children:[a.jsx(fs,{children:"Delete agent?"}),a.jsxs(ps,{children:["This will permanently remove ",a.jsx("span",{className:"font-mono",children:i?.name})," ","from the library. This action cannot be undone."]})]}),a.jsxs(ds,{children:[a.jsx(ms,{children:"Cancel"}),a.jsx(hs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&g(i)},children:"Delete Agent"})]})]})})]})};var W8=["PageUp","PageDown"],V8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],H8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Au="Slider",[aN,nge,rge]=Af(Au),[K8]=gr(Au,[rge]),[age,Rg]=K8(Au),G8=m.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:h,onValueChange:p=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:j,...y}=e,b=m.useRef(new Set),N=m.useRef(0),S=o==="horizontal"?sge:ige,[E=[],A]=ya({prop:h,defaultProp:f,onChange:U=>{[...b.current][N.current]?.focus(),p(U)}}),k=m.useRef(E);function T(U){const B=dge(E,U);q(U,B)}function O(U){q(U,N.current)}function D(){const U=k.current[N.current];E[N.current]!==U&&g(E)}function q(U,B,{commit:X}={commit:!1}){const W=mge(i),M=vge(Math.round((U-r)/i)*i+r,W),z=Nf(M,[r,s]);A((K=[])=>{const V=cge(K,z,B);if(hge(V,d*i)){N.current=V.indexOf(z);const R=String(V)!==String(K);return R&&X&&g(V),R?V:K}else return K})}return a.jsx(age,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:s,valueIndexToChangeRef:N,thumbs:b.current,values:E,orientation:o,form:j,children:a.jsx(aN.Provider,{scope:e.__scopeSlider,children:a.jsx(aN.Slot,{scope:e.__scopeSlider,children:a.jsx(S,{"aria-disabled":c,"data-disabled":c?"":void 0,...y,ref:t,onPointerDown:Le(y.onPointerDown,()=>{c||(k.current=E)}),min:r,max:s,inverted:x,onSlideStart:c?void 0:T,onSlideMove:c?void 0:O,onSlideEnd:c?void 0:D,onHomeKeyDown:()=>!c&&q(r,0,{commit:!0}),onEndKeyDown:()=>!c&&q(s,E.length-1,{commit:!0}),onStepKeyDown:({event:U,direction:B})=>{if(!c){const M=W8.includes(U.key)||U.shiftKey&&V8.includes(U.key)?10:1,z=N.current,K=E[z],V=i*M*B;q(K+V,z,{commit:!0})}}})})})})});G8.displayName=Au;var[Y8,X8]=K8(Au,{startEdge:"left",endEdge:"right",size:"width",direction:1}),sge=m.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,g]=m.useState(null),x=Et(t,S=>g(S)),j=m.useRef(void 0),y=Nu(s),b=y==="ltr",N=b&&!i||!b&&i;function C(S){const E=j.current||p.getBoundingClientRect(),A=[0,E.width],T=i_(A,N?[n,r]:[r,n]);return j.current=E,T(S-E.left)}return a.jsx(Y8,{scope:e.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:a.jsx(Q8,{dir:y,"data-orientation":"horizontal",...h,ref:x,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:S=>{const E=C(S.clientX);o?.(E)},onSlideMove:S=>{const E=C(S.clientX);c?.(E)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:S=>{const A=H8[N?"from-left":"from-right"].includes(S.key);f?.({event:S,direction:A?-1:1})}})})}),ige=m.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=m.useRef(null),p=Et(t,h),g=m.useRef(void 0),x=!s;function j(y){const b=g.current||h.current.getBoundingClientRect(),N=[0,b.height],S=i_(N,x?[r,n]:[n,r]);return g.current=b,S(y-b.top)}return a.jsx(Y8,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:a.jsx(Q8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:y=>{const b=j(y.clientY);i?.(b)},onSlideMove:y=>{const b=j(y.clientY);o?.(b)},onSlideEnd:()=>{g.current=void 0,c?.()},onStepKeyDown:y=>{const N=H8[x?"from-bottom":"from-top"].includes(y.key);d?.({event:y,direction:N?-1:1})}})})}),Q8=m.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=Rg(Au,n);return a.jsx(tt.span,{...f,ref:t,onKeyDown:Le(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):W8.concat(V8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Le(e.onPointerDown,p=>{const g=p.target;g.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(g)?g.focus():r(p)}),onPointerMove:Le(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&s(p)}),onPointerUp:Le(e.onPointerUp,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&(g.releasePointerCapture(p.pointerId),i(p))})})}),J8="SliderTrack",Z8=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Rg(J8,n);return a.jsx(tt.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});Z8.displayName=J8;var sN="SliderRange",e6=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Rg(sN,n),i=X8(sN,n),o=m.useRef(null),c=Et(t,o),d=s.values.length,f=s.values.map(g=>r6(g,s.min,s.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return a.jsx(tt.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});e6.displayName=sN;var iN="SliderThumb",t6=m.forwardRef((e,t)=>{const n=nge(e.__scopeSlider),[r,s]=m.useState(null),i=Et(t,c=>s(c)),o=m.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return a.jsx(oge,{...e,ref:i,index:o})}),oge=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...i}=e,o=Rg(iN,n),c=X8(iN,n),[d,f]=m.useState(null),h=Et(t,C=>f(C)),p=d?o.form||!!d.closest("form"):!0,g=vv(d),x=o.values[r],j=x===void 0?0:r6(x,o.min,o.max),y=uge(r,o.values.length),b=g?.[c.size],N=b?fge(b,j,c.direction):0;return m.useEffect(()=>{if(d)return o.thumbs.add(d),()=>{o.thumbs.delete(d)}},[d,o.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${j}% + ${N}px)`},children:[a.jsx(aN.ItemSlot,{scope:e.__scopeSlider,children:a.jsx(tt.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":o.min,"aria-valuenow":x,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:h,style:x===void 0?{display:"none"}:e.style,onFocus:Le(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&a.jsx(n6,{name:s??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:x},r)]})});t6.displayName=iN;var lge="RadioBubbleInput",n6=m.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=m.useRef(null),i=Et(s,r),o=jg(t);return m.useEffect(()=>{const c=s.current;if(!c)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("input",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),a.jsx(tt.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});n6.displayName=lge;function cge(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,i)=>s-i)}function r6(e,t,n){const i=100/(n-t)*(e-t);return Nf(i,[0,100])}function uge(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function dge(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function fge(e,t,n){const r=e/2,i=i_([0,50],[0,r]);return(r-i(t)*n)*n}function pge(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function hge(e,t){if(t>0){const n=pge(e);return Math.min(...n)>=t}return!0}function i_(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function mge(e){return(String(e).split(".")[1]||"").length}function vge(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var a6=G8,gge=Z8,xge=e6,yge=t6;const s6=m.forwardRef(({className:e,...t},n)=>a.jsxs(a6,{ref:n,className:Ce("relative flex w-full touch-none select-none items-center",e),...t,children:[a.jsx(gge,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx(xge,{className:"absolute h-full bg-primary"})}),a.jsx(yge,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));s6.displayName=a6.displayName;function bge(e){const t=wge(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(Sge);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function wge(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=Cge(s),c=Nge(i,s.props);return s.type!==m.Fragment&&(c.ref=r?Ir(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jge=Symbol("radix.slottable");function Sge(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jge}function Nge(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Cge(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 Ig="Popover",[i6]=gr(Ig,[fo]),Zf=fo(),[_ge,bo]=i6(Ig),o6=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=e,c=Zf(t),d=m.useRef(null),[f,h]=m.useState(!1),[p,g]=ya({prop:r,defaultProp:s??!1,onChange:i,caller:Ig});return a.jsx(gv,{...c,children:a.jsx(_ge,{scope:t,contentId:rr(),triggerRef:d,open:p,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:f,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};o6.displayName=Ig;var l6="PopoverAnchor",Age=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=bo(l6,n),i=Zf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=s;return m.useEffect(()=>(o(),()=>c()),[o,c]),a.jsx(Pf,{...i,...r,ref:t})});Age.displayName=l6;var c6="PopoverTrigger",u6=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=bo(c6,n),i=Zf(n),o=Et(t,s.triggerRef),c=a.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":m6(s.open),...r,ref:o,onClick:Le(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx(Pf,{asChild:!0,...i,children:c})});u6.displayName=c6;var o_="PopoverPortal",[Ege,kge]=i6(o_,{forceMount:void 0}),d6=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=bo(o_,t);return a.jsx(Ege,{scope:t,forceMount:n,children:a.jsx(Xn,{present:n||i.open,children:a.jsx(jl,{asChild:!0,container:s,children:r})})})};d6.displayName=o_;var lu="PopoverContent",f6=m.forwardRef((e,t)=>{const n=kge(lu,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=bo(lu,e.__scopePopover);return a.jsx(Xn,{present:r||i.open,children:i.modal?a.jsx(Tge,{...s,ref:t}):a.jsx(Oge,{...s,ref:t})})});f6.displayName=lu;var Pge=bge("PopoverContent.RemoveScroll"),Tge=m.forwardRef((e,t)=>{const n=bo(lu,e.__scopePopover),r=m.useRef(null),s=Et(t,r),i=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return kv(o)},[]),a.jsx(Rf,{as:Pge,allowPinchZoom:!0,children:a.jsx(p6,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Le(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Le(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Le(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Oge=m.forwardRef((e,t)=>{const n=bo(lu,e.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(p6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),p6=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,...p}=e,g=bo(lu,n),x=Zf(n);return Av(),a.jsx(Of,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(wl,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1),children:a.jsx(xv,{"data-state":m6(g.open),role:"dialog",id:g.contentId,...x,...p,ref:t,style:{...p.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)"}})})})}),h6="PopoverClose",Rge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=bo(h6,n);return a.jsx(tt.button,{type:"button",...r,ref:t,onClick:Le(e.onClick,()=>s.onOpenChange(!1))})});Rge.displayName=h6;var Ige="PopoverArrow",Mge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Zf(n);return a.jsx(yv,{...s,...r,ref:t})});Mge.displayName=Ige;function m6(e){return e?"open":"closed"}var $ge=o6,Dge=u6,Lge=d6,v6=f6;const pl=$ge,hl=Dge,co=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx(Lge,{children:a.jsx(v6,{ref:s,align:t,sideOffset:n,className:Ce("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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})}));co.displayName=v6.displayName;var r$=1,Fge=.9,zge=.8,Bge=.17,Uj=.1,Wj=.999,qge=.9999,Uge=.99,Wge=/[\\\/_+.#"@\[\(\{&]/,Vge=/[\\\/_+.#"@\[\(\{&]/g,Hge=/[\s-]/,g6=/[\s-]/g;function oN(e,t,n,r,s,i,o){if(i===t.length)return s===e.length?r$:Uge;var c=`${s},${i}`;if(o[c]!==void 0)return o[c];for(var d=r.charAt(i),f=n.indexOf(d,s),h=0,p,g,x,j;f>=0;)p=oN(e,t,n,r,f+1,i+1,o),p>h&&(f===s?p*=r$:Wge.test(e.charAt(f-1))?(p*=zge,x=e.slice(s,f-1).match(Vge),x&&s>0&&(p*=Math.pow(Wj,x.length))):Hge.test(e.charAt(f-1))?(p*=Fge,j=e.slice(s,f-1).match(g6),j&&s>0&&(p*=Math.pow(Wj,j.length))):(p*=Bge,s>0&&(p*=Math.pow(Wj,f-s))),e.charAt(f)!==t.charAt(i)&&(p*=qge)),(p<Uj&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(g=oN(e,t,n,r,f+1,i+2,o),g*Uj>p&&(p=g*Uj)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function a$(e){return e.toLowerCase().replace(g6," ")}function Kge(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,oN(e,t,a$(e),a$(t),0,0,{})}var xd='[cmdk-group=""]',Vj='[cmdk-group-items=""]',Gge='[cmdk-group-heading=""]',x6='[cmdk-item=""]',s$=`${x6}:not([aria-disabled="true"])`,lN="cmdk-item-select",pc="data-value",Yge=(e,t,n)=>Kge(e,t,n),y6=m.createContext(void 0),ep=()=>m.useContext(y6),b6=m.createContext(void 0),l_=()=>m.useContext(b6),w6=m.createContext(void 0),j6=m.forwardRef((e,t)=>{let n=hc(()=>{var I,ee;return{search:"",value:(ee=(I=e.value)!=null?I:e.defaultValue)!=null?ee:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=hc(()=>new Set),s=hc(()=>new Map),i=hc(()=>new Map),o=hc(()=>new Set),c=S6(e),{label:d,children:f,value:h,onValueChange:p,filter:g,shouldFilter:x,loop:j,disablePointerSelection:y=!1,vimBindings:b=!0,...N}=e,C=rr(),S=rr(),E=rr(),A=m.useRef(null),k=ixe();ml(()=>{if(h!==void 0){let I=h.trim();n.current.value=I,T.emit()}},[h]),ml(()=>{k(6,X)},[]);let T=m.useMemo(()=>({subscribe:I=>(o.current.add(I),()=>o.current.delete(I)),snapshot:()=>n.current,setState:(I,ee,Q)=>{var ie,ue,re,je;if(!Object.is(n.current[I],ee)){if(n.current[I]=ee,I==="search")B(),q(),k(1,U);else if(I==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let pe=document.getElementById(E);pe?pe.focus():(ie=document.getElementById(C))==null||ie.focus()}if(k(7,()=>{var pe;n.current.selectedItemId=(pe=W())==null?void 0:pe.id,T.emit()}),Q||k(5,X),((ue=c.current)==null?void 0:ue.value)!==void 0){let pe=ee??"";(je=(re=c.current).onValueChange)==null||je.call(re,pe);return}}T.emit()}},emit:()=>{o.current.forEach(I=>I())}}),[]),O=m.useMemo(()=>({value:(I,ee,Q)=>{var ie;ee!==((ie=i.current.get(I))==null?void 0:ie.value)&&(i.current.set(I,{value:ee,keywords:Q}),n.current.filtered.items.set(I,D(ee,Q)),k(2,()=>{q(),T.emit()}))},item:(I,ee)=>(r.current.add(I),ee&&(s.current.has(ee)?s.current.get(ee).add(I):s.current.set(ee,new Set([I]))),k(3,()=>{B(),q(),n.current.value||U(),T.emit()}),()=>{i.current.delete(I),r.current.delete(I),n.current.filtered.items.delete(I);let Q=W();k(4,()=>{B(),Q?.getAttribute("id")===I&&U(),T.emit()})}),group:I=>(s.current.has(I)||s.current.set(I,new Set),()=>{i.current.delete(I),s.current.delete(I)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:C,inputId:E,labelId:S,listInnerRef:A}),[]);function D(I,ee){var Q,ie;let ue=(ie=(Q=c.current)==null?void 0:Q.filter)!=null?ie:Yge;return I?ue(I,n.current.search,ee):0}function q(){if(!n.current.search||c.current.shouldFilter===!1)return;let I=n.current.filtered.items,ee=[];n.current.filtered.groups.forEach(ie=>{let ue=s.current.get(ie),re=0;ue.forEach(je=>{let pe=I.get(je);re=Math.max(pe,re)}),ee.push([ie,re])});let Q=A.current;M().sort((ie,ue)=>{var re,je;let pe=ie.getAttribute("id"),oe=ue.getAttribute("id");return((re=I.get(oe))!=null?re:0)-((je=I.get(pe))!=null?je:0)}).forEach(ie=>{let ue=ie.closest(Vj);ue?ue.appendChild(ie.parentElement===ue?ie:ie.closest(`${Vj} > *`)):Q.appendChild(ie.parentElement===Q?ie:ie.closest(`${Vj} > *`))}),ee.sort((ie,ue)=>ue[1]-ie[1]).forEach(ie=>{var ue;let re=(ue=A.current)==null?void 0:ue.querySelector(`${xd}[${pc}="${encodeURIComponent(ie[0])}"]`);re?.parentElement.appendChild(re)})}function U(){let I=M().find(Q=>Q.getAttribute("aria-disabled")!=="true"),ee=I?.getAttribute(pc);T.setState("value",ee||void 0)}function B(){var I,ee,Q,ie;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let re of r.current){let je=(ee=(I=i.current.get(re))==null?void 0:I.value)!=null?ee:"",pe=(ie=(Q=i.current.get(re))==null?void 0:Q.keywords)!=null?ie:[],oe=D(je,pe);n.current.filtered.items.set(re,oe),oe>0&&ue++}for(let[re,je]of s.current)for(let pe of je)if(n.current.filtered.items.get(pe)>0){n.current.filtered.groups.add(re);break}n.current.filtered.count=ue}function X(){var I,ee,Q;let ie=W();ie&&(((I=ie.parentElement)==null?void 0:I.firstChild)===ie&&((Q=(ee=ie.closest(xd))==null?void 0:ee.querySelector(Gge))==null||Q.scrollIntoView({block:"nearest"})),ie.scrollIntoView({block:"nearest"}))}function W(){var I;return(I=A.current)==null?void 0:I.querySelector(`${x6}[aria-selected="true"]`)}function M(){var I;return Array.from(((I=A.current)==null?void 0:I.querySelectorAll(s$))||[])}function z(I){let ee=M()[I];ee&&T.setState("value",ee.getAttribute(pc))}function K(I){var ee;let Q=W(),ie=M(),ue=ie.findIndex(je=>je===Q),re=ie[ue+I];(ee=c.current)!=null&&ee.loop&&(re=ue+I<0?ie[ie.length-1]:ue+I===ie.length?ie[0]:ie[ue+I]),re&&T.setState("value",re.getAttribute(pc))}function V(I){let ee=W(),Q=ee?.closest(xd),ie;for(;Q&&!ie;)Q=I>0?axe(Q,xd):sxe(Q,xd),ie=Q?.querySelector(s$);ie?T.setState("value",ie.getAttribute(pc)):K(I)}let R=()=>z(M().length-1),G=I=>{I.preventDefault(),I.metaKey?R():I.altKey?V(1):K(1)},$=I=>{I.preventDefault(),I.metaKey?z(0):I.altKey?V(-1):K(-1)};return m.createElement(tt.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:I=>{var ee;(ee=N.onKeyDown)==null||ee.call(N,I);let Q=I.nativeEvent.isComposing||I.keyCode===229;if(!(I.defaultPrevented||Q))switch(I.key){case"n":case"j":{b&&I.ctrlKey&&G(I);break}case"ArrowDown":{G(I);break}case"p":case"k":{b&&I.ctrlKey&&$(I);break}case"ArrowUp":{$(I);break}case"Home":{I.preventDefault(),z(0);break}case"End":{I.preventDefault(),R();break}case"Enter":{I.preventDefault();let ie=W();if(ie){let ue=new Event(lN);ie.dispatchEvent(ue)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:lxe},d),Mg(e,I=>m.createElement(b6.Provider,{value:T},m.createElement(y6.Provider,{value:O},I))))}),Xge=m.forwardRef((e,t)=>{var n,r;let s=rr(),i=m.useRef(null),o=m.useContext(w6),c=ep(),d=S6(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;ml(()=>{if(!f)return c.item(s,o?.id)},[f]);let h=N6(s,i,[e.value,e.children,i],e.keywords),p=l_(),g=uo(k=>k.value&&k.value===h.current),x=uo(k=>f||c.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);m.useEffect(()=>{let k=i.current;if(!(!k||e.disabled))return k.addEventListener(lN,j),()=>k.removeEventListener(lN,j)},[x,e.onSelect,e.disabled]);function j(){var k,T;y(),(T=(k=d.current).onSelect)==null||T.call(k,h.current)}function y(){p.setState("value",h.current,!0)}if(!x)return null;let{disabled:b,value:N,onSelect:C,forceMount:S,keywords:E,...A}=e;return m.createElement(tt.div,{ref:Ir(i,t),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!g,"data-disabled":!!b,"data-selected":!!g,onPointerMove:b||c.getDisablePointerSelection()?void 0:y,onClick:b?void 0:j},e.children)}),Qge=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,o=rr(),c=m.useRef(null),d=m.useRef(null),f=rr(),h=ep(),p=uo(x=>s||h.filter()===!1?!0:x.search?x.filtered.groups.has(o):!0);ml(()=>h.group(o),[]),N6(o,c,[e.value,e.heading,d]);let g=m.useMemo(()=>({id:o,forceMount:s}),[s]);return m.createElement(tt.div,{ref:Ir(c,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&m.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Mg(e,x=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},m.createElement(w6.Provider,{value:g},x))))}),Jge=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=m.useRef(null),i=uo(o=>!o.search);return!n&&!i?null:m.createElement(tt.div,{ref:Ir(s,t),...r,"cmdk-separator":"",role:"separator"})}),Zge=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=l_(),o=uo(f=>f.search),c=uo(f=>f.selectedItemId),d=ep();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(tt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":c,id:d.inputId,type:"text",value:s?e.value:o,onChange:f=>{s||i.setState("search",f.target.value),n?.(f.target.value)}})}),exe=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=m.useRef(null),o=m.useRef(null),c=uo(f=>f.selectedItemId),d=ep();return m.useEffect(()=>{if(o.current&&i.current){let f=o.current,h=i.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let x=f.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(p),g.unobserve(f)}}},[]),m.createElement(tt.div,{ref:Ir(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},Mg(e,f=>m.createElement("div",{ref:Ir(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),txe=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:o,...c}=e;return m.createElement(Tv,{open:n,onOpenChange:r},m.createElement(Ov,{container:o},m.createElement(mu,{"cmdk-overlay":"",className:s}),m.createElement(vu,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(j6,{ref:t,...c}))))}),nxe=m.forwardRef((e,t)=>uo(n=>n.filtered.count===0)?m.createElement(tt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),rxe=m.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return m.createElement(tt.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Mg(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),ea=Object.assign(j6,{List:exe,Item:Xge,Input:Zge,Group:Qge,Separator:Jge,Dialog:txe,Empty:nxe,Loading:rxe});function axe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function sxe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function S6(e){let t=m.useRef(e);return ml(()=>{t.current=e}),t}var ml=typeof window>"u"?m.useEffect:m.useLayoutEffect;function hc(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function uo(e){let t=l_(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function N6(e,t,n,r=[]){let s=m.useRef(),i=ep();return ml(()=>{var o;let c=(()=>{var f;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(f=h.current.textContent)==null?void 0:f.trim():s.current}})(),d=r.map(f=>f.trim());i.value(e,c,d),(o=t.current)==null||o.setAttribute(pc,c),s.current=c}),s}var ixe=()=>{let[e,t]=m.useState(),n=hc(()=>new Map);return ml(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function oxe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Mg({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(oxe(t),{ref:t.ref},n(t.props.children)):n(t)}var lxe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const vl=m.forwardRef(({className:e,...t},n)=>a.jsx(ea,{ref:n,className:Ce("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));vl.displayName=ea.displayName;const gl=m.forwardRef(({className:e,...t},n)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(xN,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(ea.Input,{ref:n,className:Ce("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));gl.displayName=ea.Input.displayName;const xl=m.forwardRef(({className:e,...t},n)=>a.jsx(ea.List,{ref:n,className:Ce("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));xl.displayName=ea.List.displayName;const yl=m.forwardRef((e,t)=>a.jsx(ea.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));yl.displayName=ea.Empty.displayName;const bl=m.forwardRef(({className:e,...t},n)=>a.jsx(ea.Group,{ref:n,className:Ce("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}));bl.displayName=ea.Group.displayName;const cxe=m.forwardRef(({className:e,...t},n)=>a.jsx(ea.Separator,{ref:n,className:Ce("-mx-1 h-px bg-border",e),...t}));cxe.displayName=ea.Separator.displayName;const ma=m.forwardRef(({className:e,...t},n)=>a.jsx(ea.Item,{ref:n,className:Ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));ma.displayName=ea.Item.displayName;const i$={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:[]},o$={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"},l$=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),uxe=()=>{const{agentName:e}=Nl(),t=La(),{agents:n,setAgents:r}=os(),{source:s}=Ln(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(R=>R.id===o)??n.find(R=>R.name===o),[d,f]=m.useState(()=>c??l$()),[h,p]=m.useState(!1),[g,x]=m.useState(!1),[j,y]=m.useState({status:"idle"}),[b,N]=m.useState(!1),[C,S]=m.useState([]),[E,A]=m.useState(!1),[k,T]=m.useState(!1),[O,D]=m.useState(!1),q=m.useRef(null);m.useEffect(()=>{const R=i?`new:${o||"new"}`:`agt:${o}`;if(q.current!==R){if(i){f(l$()),q.current=R;return}c&&(f(c),q.current=R)}},[i,o,c]);const U=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",B=Array.from(new Set([...i$[d.provider]||[],...C])),X=B.includes(d.model),W=O||!!d.model&&!X,M=async()=>{if(N(!0),d.provider==="google"||d.provider==="custom"){y({status:"unsupported"});return}y({status:"loading"});try{const R=await s.listProviderModels(d.provider);y({status:"success",items:R.items,source:R.source,kind:R.kind,testedAt:new Date().toISOString()})}catch(R){y({status:"error",message:R instanceof Error?R.message:String(R),testedAt:new Date().toISOString()})}},z=async()=>{if(!U){ke({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}A(!0);try{const R=await s.listProviderModels(d.provider);S(R.items),ke({title:R.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${R.items.length} ${R.kind} from ${R.source}`})}catch(R){ke({title:"Could not load provider models",description:String(R instanceof Error?R.message:R),variant:"destructive"})}finally{A(!1)}},K=async()=>{if(!d.name.trim()){ke({title:"Name is required",variant:"destructive"});return}x(!0);try{if(i)await r([...n,d]),ke({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const R=n.map(G=>G.id===c?.id?d:G);await r(R),ke({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{x(!1)}},V=async()=>{const R=n.filter(G=>G.id!==c?.id);await r(R),ke({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?a.jsxs("div",{className:"space-y-4",children:[a.jsxs(Tt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(nl,{className:"h-4 w-4"})," Agents"]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:['Agent "',o,'" not found.']})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs(Tt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(nl,{className:"h-4 w-4"})," Agents"]}),a.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&a.jsxs(ne,{type:"button",onClick:()=>{M()},children:[a.jsx(pD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),b&&a.jsxs(Ke,{children:[a.jsxs(Rt,{className:"flex-row items-center justify-between space-y-0",children:[a.jsx(It,{className:"text-base",children:"Connection Test"}),a.jsx("button",{type:"button",onClick:()=>N(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:a.jsx(rs,{className:"h-4 w-4"})})]}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[a.jsx("span",{children:"Provider:"}),a.jsx("span",{className:"font-medium text-foreground",children:d.provider}),a.jsx("span",{className:"mx-1",children:"·"}),a.jsx("span",{children:"Endpoint:"}),a.jsxs("code",{className:"font-mono text-xs",children:["/api/providers/models?provider=",d.provider]})]}),j.status==="loading"&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(Cr,{className:"h-4 w-4 animate-spin"}),"Testing connection..."]}),j.status==="success"&&a.jsxs("div",{className:"space-y-3",children:[a.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[a.jsx(Tc,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",j.items.length," ",j.kind," from"," ",j.source]}),a.jsxs("div",{className:"rounded-md bg-muted p-3",children:[a.jsxs("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:["First 5 ",j.kind,":"]}),a.jsx("ul",{className:"space-y-0.5",children:j.items.slice(0,5).map(R=>a.jsx("li",{className:"font-mono text-xs",children:R},R))})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="error"&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"text-sm text-destructive",children:[a.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," — ",j.message]}),o$[d.provider]&&a.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",o$[d.provider]]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="unsupported"&&a.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground",children:["Connection testing is not supported for the"," ",a.jsx("span",{className:"font-medium",children:d.provider})," provider. Supported providers: Anthropic, OpenAI, Azure OpenAI."]})]})]}),a.jsxs(Ke,{children:[a.jsx(Rt,{children:a.jsx(It,{className:"text-base",children:"Configuration"})}),a.jsxs(Ge,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"Name"}),a.jsx(bt,{value:d.name,onChange:R=>f(G=>({...G,name:R.target.value})),placeholder:"e.g. GPT-4o"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"Provider"}),a.jsxs(_n,{value:d.provider,onValueChange:R=>f(G=>({...G,provider:R,model:i$[R]?.[0]||""})),children:[a.jsx(bn,{children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"openai",children:"OpenAI"}),a.jsx(ot,{value:"anthropic",children:"Anthropic"}),a.jsx(ot,{value:"azure",children:"Azure OpenAI"}),a.jsx(ot,{value:"google",children:"Google"}),a.jsx(ot,{value:"custom",children:"Custom"})]})]})]})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:d.provider==="azure"?"Deployment":"Model"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(pl,{open:k,onOpenChange:T,children:[a.jsx(hl,{asChild:!0,children:a.jsxs(ne,{type:"button",variant:"outline",role:"combobox","aria-expanded":k,className:"h-9 flex-1 justify-between font-mono text-xs",children:[a.jsx("span",{className:"truncate text-left",children:d.model||"Select model..."}),a.jsx(Qt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(co,{className:"w-[420px] p-0",align:"start",children:a.jsxs(vl,{children:[a.jsx(gl,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),a.jsxs(xl,{children:[a.jsxs(yl,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),a.jsxs(bl,{heading:d.provider==="azure"?"Deployments":"Models",children:[B.map(R=>a.jsxs(ma,{value:R,onSelect:G=>{f($=>({...$,model:G})),D(!1),T(!1)},children:[a.jsx(Tc,{className:Ce("mr-2 h-4 w-4",d.model===R?"opacity-100":"opacity-0")}),a.jsx("span",{className:"font-mono text-xs",children:R})]},R)),a.jsx(ma,{value:"__custom_model_id__",onSelect:()=>{D(!0),T(!1)},children:a.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),U&&a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{z()},disabled:E,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[E?a.jsx(Cr,{className:"mr-1 h-3 w-3 animate-spin"}):a.jsx(ba,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),W&&a.jsx(bt,{value:d.model,onChange:R=>f(G=>({...G,model:R.target.value})),placeholder:d.provider==="azure"?"Type deployment name manually":"Type model name manually",className:"font-mono text-xs"}),C.length>0&&a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Loaded ",C.length," ",d.provider==="azure"?"deployment names":"models"," from provider discovery."]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"Max Tokens"}),a.jsx(bt,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:R=>f(G=>({...G,maxTokens:parseInt(R.target.value)||0})),className:"font-mono text-xs"})]})]}),a.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"Max Turns"}),a.jsx(bt,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:R=>{const G=R.target.value.trim();f($=>({...$,maxTurns:G&&parseInt(G)||void 0}))},placeholder:"30 (default)",className:"font-mono text-xs"}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Maximum number of LLM round-trips (tool calls + final answer) per eval run."})]})}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ze,{children:"Temperature"}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),a.jsx(s6,{value:[d.temperature],onValueChange:([R])=>f(G=>({...G,temperature:R})),min:0,max:2,step:.01})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{children:"System Prompt"}),a.jsx(Is,{value:d.systemPrompt||"",onChange:R=>f(G=>({...G,systemPrompt:R.target.value})),placeholder:"Optional system prompt...",rows:3,className:"text-xs"})]}),a.jsxs("div",{className:"flex items-center justify-between pt-2",children:[a.jsx("div",{children:!i&&a.jsx(ne,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),a.jsxs(ne,{type:"button",size:"sm",onClick:()=>{K()},disabled:g,children:[g&&a.jsx(Cr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),a.jsx(Bs,{open:h,onOpenChange:p,children:a.jsxs(cs,{children:[a.jsxs(us,{children:[a.jsx(fs,{children:"Delete agent?"}),a.jsxs(ps,{children:["This will permanently remove the agent ",a.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),a.jsxs(ds,{children:[a.jsx(ms,{children:"Cancel"}),a.jsx(hs,{onClick:()=>{V()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},c$="mcplab.resultAssistantScenarioHandoff",u$=()=>{const{testCaseId:e}=Nl(),[t,n]=wi(),r=La(),{source:s}=Ln(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=os(),[p,g]=m.useState(""),[x,j]=m.useState("all"),[y,b]=m.useState("name"),[N,C]=m.useState("asc"),[S,E]=m.useState(""),[A,k]=m.useState(null),[T,O]=m.useState("idle"),[D,q]=m.useState(""),[U,B]=m.useState(""),[X,W]=m.useState(0),[M,z]=m.useState(null),K=m.useRef(null),V=m.useRef(!1),R=m.useRef(!1),G=m.useRef(null),$=m.useRef(0),I=e?decodeURIComponent(e):void 0,ee=I?i.findIndex(F=>F.id===I):-1,Q=ee>=0?i[ee]:void 0,ie=async F=>{if(!Q||ee<0||!F)return;const te=[...i];te[ee]=F,await o(te)},ue=async()=>{const F=G.current;if(!F||!Q)return;if(V.current){R.current=!0;return}V.current=!0,R.current=!1;const te=++$.current;O("saving"),q("");try{await ie(F),te===$.current&&O("saved")}catch(fe){const Ee=fe instanceof Error?fe.message:String(fe);te===$.current&&(O("error"),q(Ee)),ke({title:"Could not save scenario",description:Ee,variant:"destructive"})}finally{V.current=!1,R.current&&(R.current=!1,ue())}},re=F=>{G.current=F,O("dirty"),q(""),K.current&&window.clearTimeout(K.current),K.current=window.setTimeout(()=>{K.current=null,ue()},700)},je=async()=>{const F=`scn-${Date.now()}`;let te=F,fe=1;for(;i.some(Me=>Me.id===te);)te=`${F}-${fe}`,fe+=1;const Ee={id:te,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,Ee]),r(`/libraries/test-cases/${encodeURIComponent(te)}`),ke({title:"Test case created",description:`Opened ${te} for editing.`})},pe=F=>{const te=(F||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let fe=te,Ee=1;for(;i.some(Me=>Me.id===fe);)fe=`${te}-${Ee}`,Ee+=1;return fe},oe=async(F,te=!1)=>{const fe=pe(`${F.id}-copy`),Ee={...structuredClone(F),id:fe,name:F.name?`${F.name} (Copy)`:""};await o([...i,Ee]),ke({title:"Test case duplicated",description:`Created ${Ee.id}.`}),te&&r(`/libraries/test-cases/${encodeURIComponent(Ee.id)}`)},_e=async F=>{K.current&&(window.clearTimeout(K.current),K.current=null);const te=i.filter(fe=>fe.id!==F.id);await o(te),ke({title:"Test case deleted",description:`${F.id} was removed.`}),Q?.id===F.id&&(k(null),G.current=null,O("idle"),q(""),r("/libraries/test-cases"))},ce=F=>F.map(te=>d.find(fe=>fe.id===te)).filter(Boolean).map(te=>te?.name||te?.id).filter(Boolean),de=m.useMemo(()=>{const F=new Set;for(const te of i)for(const fe of ce(te.serverIds))F.add(fe);return Array.from(F).sort((te,fe)=>te.localeCompare(fe))},[i,d]),ve=m.useMemo(()=>{const F=p.trim().toLowerCase(),te=i.filter(fe=>{const Ee=(fe.name||"").toLowerCase(),Me=fe.id.toLowerCase(),et=(fe.prompt||"").toLowerCase(),st=ce(fe.serverIds);return x!=="all"&&!st.includes(x)?!1:F?Ee.includes(F)||Me.includes(F)||et.includes(F)||st.some(xt=>xt.toLowerCase().includes(F)):!0});return te.sort((fe,Ee)=>{const Me=ce(fe.serverIds),et=ce(Ee.serverIds);let st=0;switch(y){case"id":st=fe.id.localeCompare(Ee.id);break;case"servers":st=Me.length-et.length;break;case"evalRules":st=fe.evalRules.length-Ee.evalRules.length;break;case"extractRules":st=fe.extractRules.length-Ee.extractRules.length;break;default:st=(fe.name||fe.id).localeCompare(Ee.name||Ee.id);break}return st===0&&(st=fe.id.localeCompare(Ee.id)),N==="asc"?st:-st}),te},[i,p,x,y,N,d]);m.useEffect(()=>{let F=!0;return s.getWorkspaceSettings().then(te=>{!F||!te||E(te.scenarioAssistantAgentName??"")}).catch(()=>{F&&E("")}),()=>{F=!1}},[s]),m.useEffect(()=>{if(I&&t.get("assistantHandoff")==="1")try{const F=window.sessionStorage.getItem(c$);if(!F)return;const te=JSON.parse(F);if(!te||te.scenarioId!==I||!te.prompt)return;B(String(te.prompt)),W(Date.now()),window.sessionStorage.removeItem(c$);const fe=new URLSearchParams(t);fe.delete("assistantHandoff"),n(fe,{replace:!0}),ke({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[I,t,n]),m.useEffect(()=>{Q?(k(structuredClone(Q)),G.current=structuredClone(Q),O("idle"),q("")):(k(null),G.current=null,O("idle"),q("")),K.current&&(window.clearTimeout(K.current),K.current=null),V.current=!1,R.current=!1},[Q]),m.useEffect(()=>()=>{K.current&&window.clearTimeout(K.current)},[]);const Pe=S||c[0]?.name||"";return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(oD,{className:"h-6 w-6"}),"Manage Test Cases"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable test case templates shared across configurations."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[Q&&a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[a.jsx(nl,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[a.jsx(ba,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!Q&&a.jsxs(ne,{type:"button",size:"sm",onClick:()=>{je()},children:[a.jsx(fi,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!Q&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/30 p-3 md:grid-cols-[1.6fr_1fr_1fr_auto]",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Search"}),a.jsxs("div",{className:"relative",children:[a.jsx(xN,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),a.jsx(bt,{value:p,onChange:F=>g(F.target.value),placeholder:"Search by name, id, prompt, server...",className:"h-8 pl-8 text-xs"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Server Filter"}),a.jsxs(_n,{value:x,onValueChange:j,children:[a.jsx(bn,{className:"h-8 text-xs",children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"all",children:"All servers"}),de.map(F=>a.jsx(ot,{value:F,children:F},F))]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Sort By"}),a.jsxs(_n,{value:y,onValueChange:F=>b(F),children:[a.jsx(bn,{className:"h-8 text-xs",children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"name",children:"Name"}),a.jsx(ot,{value:"id",children:"ID"}),a.jsx(ot,{value:"servers",children:"# Servers"}),a.jsx(ot,{value:"evalRules",children:"# Eval Rules"}),a.jsx(ot,{value:"extractRules",children:"# Extract Rules"})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Direction"}),a.jsxs(_n,{value:N,onValueChange:F=>C(F),children:[a.jsx(bn,{className:"h-8 w-28 text-xs",children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"asc",children:"Ascending"}),a.jsx(ot,{value:"desc",children:"Descending"})]})]})]})]}),a.jsx(Ke,{children:a.jsxs(Ge,{className:"space-y-3 pt-6",children:[a.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",ve.length," of ",i.length," test case",i.length!==1?"s":"","."]}),I&&!Q&&a.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900",children:["Test case ",a.jsx("code",{className:"font-mono",children:I})," was not found."]}),i.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):ve.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No test cases match the current filters."}):a.jsx("div",{className:"grid gap-3",children:ve.map(F=>{const te=I===F.id,fe=`/libraries/test-cases/${encodeURIComponent(F.id)}`,Ee=ce(F.serverIds);return a.jsx("div",{className:`rounded-lg border p-3 ${te?"border-primary bg-primary/5":""}`,children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"space-y-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx(Tt,{to:fe,className:"font-medium truncate hover:underline",children:F.name||F.id}),a.jsx(He,{variant:"outline",className:"font-mono text-[10px]",children:F.id}),te&&a.jsx(He,{children:"Selected"})]}),a.jsxs("div",{className:"text-xs text-muted-foreground flex flex-wrap gap-x-3 gap-y-1",children:[a.jsxs("span",{children:[Ee.length," server",Ee.length!==1?"s":""]}),a.jsxs("span",{children:[F.evalRules.length," eval rule",F.evalRules.length!==1?"s":""]}),a.jsxs("span",{children:[F.extractRules.length," extract rule",F.extractRules.length!==1?"s":""]})]}),Ee.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1",children:Ee.map(Me=>a.jsx(He,{variant:"secondary",className:"text-[10px]",children:Me},`${F.id}-${Me}`))})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsxs(ne,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>z(F),children:[a.jsx($a,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{oe(F)},children:[a.jsx(Ps,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsx(ne,{type:"button",size:"sm",variant:te?"default":"outline",asChild:!0,children:a.jsxs(Tt,{to:fe,children:[a.jsx(dv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},F.id)})})]})})]}),Q&&A?a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(It,{className:"text-base",children:["Edit Test Case ·"," ",a.jsx("code",{className:"font-mono text-muted-foreground",children:Q.id})]}),a.jsx(He,{variant:"outline",className:`text-[10px] ${T==="saving"?"border-amber-300 text-amber-700":T==="saved"?"border-emerald-300 text-emerald-700":T==="error"?"border-destructive/40 text-destructive":T==="dirty"?"border-sky-300 text-sky-700":""}`,children:T==="saving"?"Saving...":T==="saved"?"Saved":T==="error"?"Save failed":T==="dirty"?"Unsaved changes":"Ready"})]}),T==="error"&&D&&a.jsx("div",{className:"text-[11px] text-destructive",children:D})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{oe(A,!0)},children:[a.jsx(Ps,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>z(A),children:[a.jsx($a,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]})]})]})}),a.jsx(Ge,{className:"pt-3",children:a.jsx(rN,{scenarios:[A],agents:c,servers:d,defaultAssistantAgentName:Pe,assistantInitialPromptByScenarioId:U&&A?.id?{[A.id]:U}:void 0,assistantAutoOpenNonceByScenarioId:A?.id&&X?{[A.id]:X}:void 0,onChange:F=>{const te=F[0];te&&(k(te),re(te))},allowAdd:!1})})]}):null,a.jsx(Bs,{open:!!M,onOpenChange:F=>!F&&z(null),children:a.jsxs(cs,{children:[a.jsxs(us,{children:[a.jsx(fs,{children:"Delete test case?"}),a.jsxs(ps,{children:["This will permanently remove"," ",a.jsx("span",{className:"font-medium",children:M?.name||M?.id})," ","from the library. This action cannot be undone."]})]}),a.jsxs(ds,{children:[a.jsx(ms,{children:"Cancel"}),a.jsx(hs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{M&&(_e(M),z(null))},children:"Delete Test Case"})]})]})})]})},dxe=()=>{const{source:e}=Ln(),{agents:t,reload:n,loading:r}=os(),[s,i]=m.useState(!1),[o,c]=m.useState(!1),[d,f]=m.useState(""),h=m.useMemo(()=>d||t[0]?.name||"",[d,t]),p=m.useCallback(async()=>{i(!0);try{const j=await e.getWorkspaceSettings();f(j?.scenarioAssistantAgentName??"")}catch(j){f(""),ke({title:"Could not load settings",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{i(!1)}},[e]);m.useEffect(()=>{p()},[p]);const g=async j=>{f(j),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:j||void 0}),ke({title:"Settings updated",description:j?`Default assistant agent set to ${j}.`:"Default assistant agent cleared (will use first available agent by default)."})}catch(y){ke({title:"Could not save settings",description:y instanceof Error?y.message:String(y),variant:"destructive"})}finally{c(!1)}},x=async()=>{await Promise.all([n(),p()])};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(yN,{className:"h-6 w-6"}),"Settings"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Workspace-level MCP Lab settings and defaults."})]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{x()},disabled:r||s,children:[a.jsx(ba,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),a.jsxs(Ke,{children:[a.jsxs(Rt,{className:"pb-3",children:[a.jsx(It,{className:"text-base",children:"Assistant Defaults"}),a.jsx(Hr,{children:"Default assistant agent used across assistant flows. If unset, MCP Lab uses the first available agent automatically."})]}),a.jsxs(Ge,{className:"grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ze,{className:"text-xs",children:"Default Assistant Agent"}),a.jsxs(_n,{value:h||"__none__",onValueChange:j=>{g(j==="__none__"?"":j)},disabled:o,children:[a.jsx(bn,{className:"h-9 text-sm",children:a.jsx(An,{placeholder:"Select assistant agent"})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"__none__",children:"None (use first agent)"}),t.map(j=>a.jsxs(ot,{value:j.id,children:[j.name||j.id," · ",j.model]},j.id))]})]}),a.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."})]}),a.jsx("div",{className:"text-xs text-muted-foreground",children:"Saved in workspace settings"})]})]})]})},fxe=Sl("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"}}),Zo=m.forwardRef(({className:e,variant:t,...n},r)=>a.jsx("div",{ref:r,role:"alert",className:Ce(fxe({variant:t}),e),...n}));Zo.displayName="Alert";const el=m.forwardRef(({className:e,...t},n)=>a.jsx("h5",{ref:n,className:Ce("mb-1 font-medium leading-none tracking-tight",e),...t}));el.displayName="AlertTitle";const tl=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Ce("text-sm [&_p]:leading-relaxed",e),...t}));tl.displayName="AlertDescription";const pxe="127.0.0.1",hxe=3011,mxe="/mcp",vxe=`http://${pxe}:${hxe}${mxe}`;function gxe(e){return navigator.clipboard.writeText(e)}function C6({text:e,label:t}){const[n,r]=m.useState(!1),s=async()=>{try{await gxe(e),r(!0),ke({title:"Copied",description:`${t} copied to clipboard.`}),window.setTimeout(()=>r(!1),1500)}catch(i){ke({title:"Copy failed",description:i instanceof Error?i.message:String(i),variant:"destructive"})}};return a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{s()},children:[a.jsx(Ps,{className:"mr-2 h-3.5 w-3.5"}),n?"Copied":"Copy"]})}function Hj({label:e,value:t,copyText:n,valueClassName:r=""}){return a.jsx("div",{className:"rounded-lg border bg-muted/20 p-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:e}),a.jsx("div",{className:`mt-1 break-all text-sm font-medium ${r}`,children:t})]}),n&&a.jsx(C6,{text:n,label:e})]})})}function d$({title:e,description:t,code:n,iconSrc:r}){return a.jsxs(Ke,{children:[a.jsxs(Rt,{className:"pb-3",children:[a.jsxs(It,{className:"flex items-center gap-2 text-base",children:[a.jsx("img",{src:r,alt:"","aria-hidden":"true",className:"h-4 w-4"}),e]}),a.jsx(Hr,{children:t})]}),a.jsxs(Ge,{className:"space-y-3",children:[a.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}),a.jsx("div",{className:"flex justify-end",children:a.jsx(C6,{text:n,label:e})})]})]})}const xxe=()=>{const{source:e}=Ln(),[t,n]=m.useState(!0),[r,s]=m.useState(null),i=m.useCallback(async()=>{n(!0);try{const p=await e.health();s(p)}catch(p){s(null),ke({title:"Could not load MCP connection info",description:p instanceof Error?p.message:String(p),variant:"destructive"})}finally{n(!1)}},[e]);m.useEffect(()=>{i()},[i]);const o=r?.mcp?.enabled?r.mcp:null,c=o?.directUrl??vxe,d=o?.transport??"streamable-http",f=m.useMemo(()=>JSON.stringify({mcpServers:{mcplab:{command:"npx",args:["mcp-remote",c]}}},null,2),[c]),h=m.useMemo(()=>JSON.stringify({name:"mcplab",transport:d,url:c},null,2),[c,d]);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(aS,{className:"h-6 w-6"}),"MCP Connection Info"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Copy the local MCPLab MCP server details into Claude Desktop or any MCP-capable client."})]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{i()},disabled:t,children:[a.jsx(ba,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),!o&&a.jsxs(Zo,{children:[a.jsx(aS,{className:"h-4 w-4"}),a.jsx(el,{children:"MCP server not reported"}),a.jsx(tl,{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."})]}),a.jsxs("div",{className:"grid gap-6 xl:grid-cols-[1.1fr_0.9fr]",children:[a.jsxs(Ke,{children:[a.jsxs(Rt,{className:"pb-3",children:[a.jsx(It,{className:"text-base",children:"Connection Details"}),a.jsx(Hr,{children:"The local server is exposed over streamable HTTP."})]}),a.jsx(Ge,{className:"space-y-3",children:a.jsxs("div",{className:"grid gap-3",children:[a.jsx(Hj,{label:"Direct MCP URL",value:c,copyText:c}),a.jsx(Hj,{label:"Transport",value:d}),a.jsx(Hj,{label:"Authentication",value:"none"})]})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(d$,{title:"Claude Desktop",description:"Use mcp-remote to bridge Claude Desktop to the local streamable HTTP MCP server.",code:f,iconSrc:"/icons/claude-color.svg"}),a.jsx(d$,{title:"OpenAI / MCP-capable client",description:"Use this endpoint block in any client or adapter that accepts a single MCP-over-HTTP server.",code:h,iconSrc:"/icons/openai.svg"})]})]})]})};var $g="Checkbox",[yxe]=gr($g),[bxe,c_]=yxe($g);function wxe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:i,form:o,name:c,onCheckedChange:d,required:f,value:h="on",internal_do_not_use_render:p}=e,[g,x]=ya({prop:n,defaultProp:s??!1,onChange:d,caller:$g}),[j,y]=m.useState(null),[b,N]=m.useState(null),C=m.useRef(!1),S=j?!!o||!!j.closest("form"):!0,E={checked:g,disabled:i,setChecked:x,control:j,setControl:y,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:C,required:f,defaultChecked:to(s)?!1:s,isFormControl:S,bubbleInput:b,setBubbleInput:N};return a.jsx(bxe,{scope:t,...E,children:jxe(p)?p(E):r})}var _6="CheckboxTrigger",A6=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:i,value:o,disabled:c,checked:d,required:f,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:g,isFormControl:x,bubbleInput:j}=c_(_6,e),y=Et(s,h),b=m.useRef(d);return m.useEffect(()=>{const N=i?.form;if(N){const C=()=>p(b.current);return N.addEventListener("reset",C),()=>N.removeEventListener("reset",C)}},[i,p]),a.jsx(tt.button,{type:"button",role:"checkbox","aria-checked":to(d)?"mixed":d,"aria-required":f,"data-state":O6(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:y,onKeyDown:Le(t,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:Le(n,N=>{p(C=>to(C)?!0:!C),j&&x&&(g.current=N.isPropagationStopped(),g.current||N.stopPropagation())})})});A6.displayName=_6;var u_=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:o,disabled:c,value:d,onCheckedChange:f,form:h,...p}=e;return a.jsx(wxe,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:c,required:o,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:g})=>a.jsxs(a.Fragment,{children:[a.jsx(A6,{...p,ref:t,__scopeCheckbox:n}),g&&a.jsx(T6,{__scopeCheckbox:n})]})})});u_.displayName=$g;var E6="CheckboxIndicator",k6=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=c_(E6,n);return a.jsx(Xn,{present:r||to(i.checked)||i.checked===!0,children:a.jsx(tt.span,{"data-state":O6(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});k6.displayName=E6;var P6="CheckboxBubbleInput",T6=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:o,required:c,disabled:d,name:f,value:h,form:p,bubbleInput:g,setBubbleInput:x}=c_(P6,e),j=Et(n,x),y=jg(i),b=vv(r);m.useEffect(()=>{const C=g;if(!C)return;const S=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(S,"checked").set,k=!s.current;if(y!==i&&A){const T=new Event("click",{bubbles:k});C.indeterminate=to(i),A.call(C,to(i)?!1:i),C.dispatchEvent(T)}},[g,y,i,s]);const N=m.useRef(to(i)?!1:i);return a.jsx(tt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??N.current,required:c,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});T6.displayName=P6;function jxe(e){return typeof e=="function"}function to(e){return e==="indeterminate"}function O6(e){return to(e)?"indeterminate":e?"checked":"unchecked"}const Jr=m.forwardRef(({className:e,...t},n)=>a.jsx(u_,{ref:n,className:Ce("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-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(k6,{className:Ce("flex items-center justify-center text-current"),children:a.jsx(Tc,{className:"h-4 w-4"})})}));Jr.displayName=u_.displayName;function Sxe(e,t=[]){let n=[];function r(i,o){const c=m.createContext(o);c.displayName=i+"Context";const d=n.length;n=[...n,o];const f=p=>{const{scope:g,children:x,...j}=p,y=g?.[e]?.[d]||c,b=m.useMemo(()=>j,Object.values(j));return a.jsx(y.Provider,{value:b,children:x})};f.displayName=i+"Provider";function h(p,g){const x=g?.[e]?.[d]||c,j=m.useContext(x);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const s=()=>{const i=n.map(o=>m.createContext(o));return function(c){const d=c?.[e]||i;return m.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return s.scopeName=e,[r,Nxe(s,...t)]}function Nxe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Cxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],R6=Cxe.reduce((e,t)=>{const n=_v(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:o,...c}=s,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),d_="Progress",f_=100,[_xe]=Sxe(d_),[Axe,Exe]=_xe(d_),I6=m.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=kxe,...o}=e;(s||s===0)&&!f$(s)&&console.error(Pxe(`${s}`,"Progress"));const c=f$(s)?s:f_;r!==null&&!p$(r,c)&&console.error(Txe(`${r}`,"Progress"));const d=p$(r,c)?r:null,f=iv(d)?i(d,c):void 0;return a.jsx(Axe,{scope:n,value:d,max:c,children:a.jsx(R6.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":iv(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":D6(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});I6.displayName=d_;var M6="ProgressIndicator",$6=m.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=Exe(M6,n);return a.jsx(R6.div,{"data-state":D6(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});$6.displayName=M6;function kxe(e,t){return`${Math.round(e/t*100)}%`}function D6(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function iv(e){return typeof e=="number"}function f$(e){return iv(e)&&!isNaN(e)&&e>0}function p$(e,t){return iv(e)&&!isNaN(e)&&e<=t&&e>=0}function Pxe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${f_}\`.`}function Txe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
136
|
-
- a positive number
|
|
137
|
-
- less than the value passed to \`max\` (or ${f_} if no \`max\` prop is set)
|
|
138
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
139
|
-
|
|
140
|
-
Defaulting to \`null\`.`}var L6=I6,Oxe=$6;const Dg=m.forwardRef(({className:e,value:t,...n},r)=>a.jsx(L6,{ref:r,className:Ce("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:a.jsx(Oxe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Dg.displayName=L6.displayName;function F6(e){const 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 h$(e){try{return JSON.stringify(e,null,2)}catch{return"[schema not serializable]"}}const zo=["critical","high","medium","low","info"];function Th(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 Rxe(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 m$(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tool"}function Kj({text:e}){return a.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-[11px] text-slate-800",children:[a.jsxs("div",{className:"mb-1 inline-flex items-center gap-1 font-medium text-slate-700",children:[a.jsx(U7,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),a.jsx("p",{children:e})]})}function Ixe({label:e,reason:t,variantClassName:n}){return a.jsx(ao,{delayDuration:0,children:a.jsxs(so,{children:[a.jsx(io,{asChild:!0,children:a.jsx(He,{variant:"outline",className:n,children:e})}),a.jsx(mi,{className:"max-w-sm text-xs",children:a.jsx("p",{children:t})})]})})}function p_(e){const t=[],n=(r,s)=>{t.push(`#### ${r}`),t.push("```json");try{t.push(JSON.stringify(s,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){const r=Object.entries(e.mcpServerVersions).map(([s,i])=>`${s}: ${i??"unknown"}`).join(", ");t.push(`- MCP Server Versions: ${r}`)}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(const r of e.servers){t.push(`## Server: ${r.serverName}`),r.warnings.length>0&&t.push(...r.warnings.map(s=>`- Warning: ${s}`),"");for(const s of r.tools){if(t.push(`### ${s.publicToolName}`),s.title&&t.push(`- Title: ${s.title}`),t.push(`- Safety: ${s.safetyClassification} (${s.classificationReason})`),s.inputSchema!==void 0&&n("Input schema",s.inputSchema),s.outputSchema!==void 0&&n("Output schema",s.outputSchema),s.metadataReview?.issues.length){t.push("#### Metadata issues");for(const i of s.metadataReview.issues)t.push(` - [${i.severity}] ${i.title}: ${i.detail}`)}if(s.deeperAnalysis)if(!s.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${s.deeperAnalysis.skippedReason??"unknown"})`);else{t.push(`- Deeper analysis sample calls: ${s.deeperAnalysis.sampleCalls.length}`);for(const i of s.deeperAnalysis.sampleCalls){t.push(` - Call ${i.callIndex}: ${i.ok?"ok":"error"}${i.durationMs?` (${i.durationMs}ms)`:""}`),i.error&&t.push(` - Error: ${i.error}`);for(const o of i.observations)t.push(` - ${o}`)}}if(s.overallRecommendations.length>0){t.push("#### Recommendations");for(const i of s.overallRecommendations)t.push(` - ${i}`)}if(s.metadataReview?.evalReadinessNotes.length){t.push("#### Agent/Eval readiness notes");for(const i of s.metadataReview.evalReadinessNotes)t.push(` - ${i}`)}t.push("")}}return`${t.join(`
|
|
141
|
-
`)}
|
|
142
|
-
`}function z6({report:e}){const[t,n]=wi(),[r,s]=m.useState([...zo]),[i,o]=m.useState(new Set),[c,d]=m.useState(""),[f,h]=m.useState(!1),p=t.get("groupBy")==="severity"?"severity":"tool",g=m.useRef(null),x=c.trim().toLowerCase(),j=m.useMemo(()=>new Set(r),[r]),y=O=>{s(D=>{const q=D.includes(O)?D.filter(U=>U!==O):[...D,O];return q.length===0?[...zo]:q})},b=O=>{const D=new URLSearchParams(t);O==="severity"?D.set("groupBy","severity"):D.delete("groupBy"),n(D,{replace:!0})},N=m.useMemo(()=>{const O={critical:[],high:[],medium:[],low:[],info:[]};for(const D of e.servers)for(const q of D.tools){const U=`tool-${m$(`${D.serverName}-${q.publicToolName}`)}`,B=`${D.serverName}::${q.publicToolName}`,X=q.publicToolName.split("::").pop()??q.publicToolName;for(const W of q.metadataReview?.issues??[]){const M=W.severity;O[M].push({key:`${B}-metadata-${W.id}`,toolAnchorId:U,toolLabel:B,toolDisplayName:X,sourceLabel:"Metadata review",issue:{id:W.id,title:W.title,detail:W.detail,severity:M,suggestion:W.suggestion}})}for(const W of q.deeperAnalysis?.sampleCalls??[])for(const M of W.issues){const z=M.severity;O[z].push({key:`${B}-call-${W.callIndex}-${M.id}`,toolAnchorId:U,toolLabel:B,toolDisplayName:X,sourceLabel:`Sample call ${W.callIndex}`,issue:{id:M.id,title:M.title,detail:M.detail,severity:z,suggestion:M.suggestion}})}}return O},[e.servers]),C=m.useMemo(()=>Array.from(new Set(e.servers.flatMap(O=>O.tools.map(D=>D.publicToolName)).map(O=>O.split("::").pop()??O))).sort((O,D)=>O.localeCompare(D)),[e.servers]),S=O=>x.length===0?!0:(O.toLowerCase().split("::").pop()??O.toLowerCase()).includes(x),E=O=>{if(!g.current)return;g.current.querySelectorAll("details").forEach(q=>{q.open=O})},A=()=>o(new Set(zo)),k=()=>o(new Set),T=O=>{o(D=>{const q=new Set(D);return q.has(O)?q.delete(O):q.add(O),q})};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[a.jsx(Ke,{children:a.jsxs(Ge,{className:"pt-6",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools analyzed"}),a.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsAnalyzed})]})}),a.jsx(Ke,{children:a.jsxs(Ge,{className:"pt-6",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools skipped"}),a.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsSkipped})]})}),a.jsx(Ke,{children:a.jsxs(Ge,{className:"pt-6",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Findings"}),a.jsx("div",{className:"text-2xl font-semibold",children:e.findings.length})]})})]}),a.jsxs(Ke,{children:[a.jsxs(Rt,{className:"pb-3",children:[a.jsx(It,{className:"text-base",children:"Analysis Overview"}),a.jsx(Hr,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),a.jsx(Ge,{children:a.jsxs("div",{className:"flex flex-wrap gap-2",children:[zo.filter(O=>e.summary.issueCounts[O]>0).map(O=>{const D=j.has(O);return a.jsx("button",{type:"button",onClick:()=>y(O),className:"rounded-full","aria-pressed":D,children:a.jsxs(He,{variant:"outline",className:`capitalize font-normal ${D?Th(O):Rxe(O)} ${D?"ring-1 ring-current":"opacity-70"}`,children:[O,": ",e.summary.issueCounts[O]]})},O)}),a.jsx(ne,{type:"button",size:"sm",variant:"ghost",onClick:()=>s([...zo]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),a.jsxs("div",{className:"space-y-0",children:[a.jsx(Eg,{value:p,onValueChange:O=>{(O==="tool"||O==="severity")&&b(O)},className:"min-w-0 px-3 pt-1",children:a.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2 border-b",children:[a.jsxs(Jf,{className:"h-auto justify-start rounded-none bg-transparent p-0",children:[a.jsx(ks,{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"}),a.jsx(ks,{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"})]}),a.jsxs("div",{className:"mb-2 flex min-w-0 items-center gap-2",children:[a.jsx("span",{className:"whitespace-nowrap text-xs text-muted-foreground",children:"Filter tools"}),a.jsxs(pl,{open:f,onOpenChange:h,children:[a.jsx(hl,{asChild:!0,children:a.jsxs(ne,{type:"button",variant:"outline",role:"combobox","aria-expanded":f,className:"h-8 w-[320px] max-w-full justify-between text-xs font-normal",children:[a.jsx("span",{className:"truncate text-left",children:c||"All tools"}),a.jsx(Qt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(co,{className:"w-[320px] p-0",align:"end",children:a.jsxs(vl,{children:[a.jsx(gl,{placeholder:"Search tools..."}),a.jsxs(xl,{children:[a.jsx(yl,{children:"No tools found."}),a.jsxs(bl,{children:[a.jsx(ma,{value:"all tools",onSelect:()=>{d(""),h(!1)},children:"All tools"}),C.map(O=>a.jsx(ma,{value:O,onSelect:()=>{d(O),h(!1)},children:O},O))]})]})]})})]}),p==="severity"&&a.jsxs(a.Fragment,{children:[a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:k,children:"Expand all"}),a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:A,children:"Collapse all"})]}),p==="tool"&&a.jsxs(a.Fragment,{children:[a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!0),children:"Expand all"}),a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!1),children:"Collapse all"})]})]})]})}),p==="severity"?a.jsx("div",{className:"space-y-4",children:zo.filter(O=>j.has(O)).map(O=>{const D=N[O].filter(U=>S(U.toolLabel));if(D.length===0)return null;const q=i.has(O);return a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx(It,{className:"text-base capitalize",children:O}),a.jsxs(Hr,{children:[D.length," finding(s)"]})]}),a.jsx("div",{className:"flex gap-2",children:a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>T(O),children:q?"Expand":"Collapse"})})]})}),!q&&a.jsx(Ge,{className:"space-y-2",children:D.map((U,B)=>a.jsxs("div",{className:"rounded border p-2 text-xs",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.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:B+1}),a.jsx("span",{className:"min-w-0 font-bold leading-tight",children:U.issue.title})]}),a.jsx(He,{variant:"outline",className:`shrink-0 text-[10px] ${Th(U.issue.severity)}`,children:U.issue.severity})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",U.issue.detail]}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px]",children:[a.jsx(He,{variant:"secondary",className:"font-normal",children:U.sourceLabel}),a.jsx(ne,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 font-mono text-[11px]",title:U.toolLabel,onClick:()=>{b("tool"),requestAnimationFrame(()=>{document.getElementById(U.toolAnchorId)?.scrollIntoView({behavior:"smooth",block:"start"})})},children:U.toolDisplayName})]}),U.issue.suggestion&&a.jsx(Kj,{text:U.issue.suggestion})]},U.key))})]},O)})}):a.jsx("div",{ref:g,className:"space-y-4",children:e.servers.map(O=>{const D=O.tools.filter(q=>{const U=`${O.serverName}::${q.publicToolName}`;if(!S(U))return!1;const B=[...q.metadataReview?.issues??[],...q.deeperAnalysis?.sampleCalls.flatMap(X=>X.issues)??[]];return B.length===0?r.length===zo.length:B.some(X=>j.has(X.severity))});return D.length===0?null:a.jsxs(Ke,{children:[a.jsxs(Rt,{className:"pb-3",children:[a.jsx(It,{className:"text-base",children:O.serverName}),a.jsxs(Hr,{children:["Discovered ",O.toolCountDiscovered," · Showing ",D.length," of"," ",O.toolCountAnalyzed," analyzed · Skipped ",O.toolCountSkipped]})]}),a.jsxs(Ge,{className:"space-y-3",children:[O.warnings.length>0&&a.jsxs(Zo,{children:[a.jsx(el,{children:"Warnings"}),a.jsx(tl,{children:a.jsx("ul",{className:"ml-4 list-disc space-y-1",children:O.warnings.map(q=>a.jsx("li",{children:q},`${O.serverName}-${q}`))})})]}),D.map(q=>{const U=q.publicToolName.split("::").pop()??q.publicToolName,B=F6(q.classificationReason),X=q.safetyClassification==="read_only"?"read-only":B?"write/delete":"unsafe/unknown",W=q.safetyClassification==="read_only"?"border-emerald-200 bg-emerald-50 text-emerald-700":B?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700";return a.jsxs("details",{id:`tool-${m$(`${O.serverName}-${q.publicToolName}`)}`,className:"group rounded-md border p-3",children:[a.jsx("summary",{className:"cursor-pointer list-none",children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("div",{className:"min-w-0 truncate font-mono text-sm",title:q.publicToolName,children:U}),a.jsx(Ixe,{label:X,reason:q.classificationReason,variantClassName:W})]}),a.jsx(Qt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),q.title&&a.jsx("p",{className:"text-sm text-foreground/85",children:q.title}),q.description&&a.jsx("p",{className:"text-xs text-muted-foreground",children:q.description})]})}),a.jsxs("div",{className:"mt-3 space-y-2",children:[(q.inputSchema!==void 0||q.outputSchema!==void 0)&&a.jsxs("details",{className:"group/schema rounded border bg-muted/10 p-2",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 text-xs font-medium",children:[a.jsx("span",{children:"Schemas"}),a.jsx(Qt,{className:"h-4 w-4 text-muted-foreground transition-transform group-open/schema:rotate-180"})]}),a.jsxs("div",{className:"mt-2 space-y-2",children:[q.inputSchema!==void 0&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:"Input schema"}),a.jsx("pre",{className:"max-h-52 overflow-auto rounded border bg-muted/20 p-2 text-[11px]",children:h$(q.inputSchema)})]}),q.outputSchema!==void 0&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:"Output schema"}),a.jsx("pre",{className:"max-h-52 overflow-auto rounded border bg-muted/20 p-2 text-[11px]",children:h$(q.outputSchema)})]})]})]}),q.metadataReview&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),q.metadataReview.issues.filter(M=>j.has(M.severity)).length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No metadata issues reported."}):a.jsx("div",{className:"space-y-1",children:q.metadataReview.issues.filter(M=>j.has(M.severity)).map((M,z)=>a.jsxs("div",{className:"rounded border p-2 text-xs",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.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:z+1}),a.jsx("span",{className:"min-w-0 font-bold leading-tight",children:M.title})]}),a.jsx(He,{variant:"outline",className:`shrink-0 text-[10px] ${Th(M.severity)}`,children:M.severity})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",M.detail]}),M.suggestion&&a.jsx(Kj,{text:M.suggestion})]},M.id))})]}),q.deeperAnalysis&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),q.deeperAnalysis.attempted?a.jsx("div",{className:"space-y-2",children:q.deeperAnalysis.sampleCalls.map(M=>a.jsxs("div",{className:"rounded border p-2 text-xs",children:[a.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[a.jsx(He,{variant:M.ok?"secondary":"destructive",className:"text-[10px]",children:M.ok?"ok":"error"}),a.jsxs("span",{children:["Call ",M.callIndex]}),M.durationMs!==void 0&&a.jsxs("span",{className:"text-muted-foreground",children:[M.durationMs,"ms"]})]}),M.error&&a.jsx("p",{className:"text-destructive",children:M.error}),M.observations.length>0&&a.jsxs("div",{className:"mt-2",children:[a.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"}),a.jsx("ul",{className:"ml-4 list-disc space-y-1",children:M.observations.map((z,K)=>a.jsx("li",{children:z},`${q.publicToolName}-obs-${M.callIndex}-${K}`))})]}),M.issues.filter(z=>j.has(z.severity)).length>0&&a.jsx("div",{className:"mt-2 space-y-1",children:M.issues.filter(z=>j.has(z.severity)).map((z,K)=>a.jsxs("div",{className:"rounded border p-2",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.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:K+1}),a.jsx("span",{className:"min-w-0 font-bold leading-tight",children:z.title})]}),a.jsx(He,{variant:"outline",className:`shrink-0 text-[10px] ${Th(z.severity)}`,children:z.severity})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",z.detail]}),z.suggestion&&a.jsx(Kj,{text:z.suggestion})]},`${M.callIndex}-${z.id}`))})]},`${q.publicToolName}-call-${M.callIndex}`))}):a.jsx("p",{className:"text-xs text-muted-foreground",children:q.deeperAnalysis.skippedReason??"Skipped"})]})]})]},q.publicToolName)})]})]},O.serverName)})})]})]})}function Mxe(e){let t=0;const n=new Set,r=new Set;for(const i of e){const o=typeof i.payload?.message=="string"?i.payload.message:"";if(!o)continue;const c=o.match(/\((\d+)\s+selected\s+of\s+\d+\s+discovered\)/i);c&&(t=Math.max(t,Number(c[1])||0));const d=o.match(/^Started\s+(.+)$/);d&&n.add(d[1]);const f=o.match(/^Finished\s+(.+)$/);f&&r.add(f[1])}const s=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:s}}const Gj="mcplab.toolAnalysis.activeJobId";function v$(e,t,n){const r=new Blob([t],{type:n}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=e,i.click(),URL.revokeObjectURL(s)}function g$({text:e}){return a.jsxs(so,{children:[a.jsx(io,{asChild:!0,children:a.jsx("button",{type:"button",className:"inline-flex h-4 w-4 items-center justify-center rounded text-muted-foreground hover:text-foreground",onClick:t=>t.preventDefault(),"aria-label":e,children:a.jsx(M7,{className:"h-3.5 w-3.5"})})}),a.jsx(mi,{className:"max-w-xs text-xs",children:a.jsx("p",{children:e})})]})}function $xe(e,t){const 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 Dxe({label:e,reason:t,variantClassName:n}){return a.jsx(ao,{delayDuration:0,children:a.jsxs(so,{children:[a.jsx(io,{asChild:!0,children:a.jsx(He,{variant:"outline",className:n,children:e})}),a.jsx(mi,{className:"max-w-sm text-xs",children:a.jsx("p",{children:t})})]})})}const Lxe=()=>{const{source:e}=Ln(),{servers:t,agents:n,loading:r,reload:s}=os(),[i,o]=m.useState(""),[c,d]=m.useState([]),[f,h]=m.useState(!1),[p,g]=m.useState([]),[x,j]=m.useState({}),[y,b]=m.useState(""),[N,C]=m.useState(!0),[S,E]=m.useState(!1),[A,k]=m.useState(2),[T,O]=m.useState(1),[D,q]=m.useState(1e4),[U,B]=m.useState(null),[X,W]=m.useState([]),[M,z]=m.useState(null),[K,V]=m.useState(null),[R,G]=m.useState(!1),[$,I]=m.useState("configure"),[ee,Q]=m.useState("idle"),[ie,ue]=m.useState(!1),re=m.useRef(null),je=m.useRef(null),pe=i||n[0]?.name||"",oe=m.useMemo(()=>Mxe(X),[X]);m.useEffect(()=>{let he=!0;return e.getWorkspaceSettings().then(Te=>{!he||!Te||o(Te.scenarioAssistantAgentName??"")}).catch(()=>{he&&o("")}),()=>{he=!1}},[e]),m.useEffect(()=>()=>{re.current?.()},[]),m.useEffect(()=>{const he=je.current;he&&requestAnimationFrame(()=>{he.scrollTop=he.scrollHeight})},[X.length]);const _e=()=>{try{sessionStorage.removeItem(Gj)}catch{}},ce=he=>{try{sessionStorage.setItem(Gj,he)}catch{}},de=he=>{re.current?.(),re.current=e.subscribeToolAnalysisJob(he,Te=>{if(W(Ie=>[...Ie,Te]),Te.type==="completed")e.getToolAnalysisResult(he).then(Ie=>{z(Ie.report),V(Ie.savedReportId??null)}).catch(Ie=>ke({title:"Could not load analysis report",description:Ie instanceof Error?Ie.message:String(Ie),variant:"destructive"})).finally(()=>{_e(),B(null),G(!1),Q("idle"),I("run")});else if(Te.type==="error"){const Ie=String(Te.payload?.message??"");_e(),Q(Ie.toLowerCase().includes("abort")?"stopped":"error"),B(null),G(!1)}})};m.useEffect(()=>{if(U||M)return;let he="";try{he=sessionStorage.getItem(Gj)??""}catch{he=""}if(he)return I("run"),Q("running"),G(!0),B(he),W([]),de(he),()=>{}},[e,U,M]);const ve=async()=>{if(c.length===0){g([]),j({});return}const he=c.filter(Te=>t.find(Ot=>Ot.id===Te)?.authType==="oauth2");try{he.length>0&&(ue(!0),await di({serverNames:he,source:e,onServerAuthStart:Te=>{ke({title:`OAuth login required for ${Te}`,description:"Complete login in the opened browser tab. Discovery will continue automatically."})}}))}catch(Te){ke({title:"OAuth login failed",description:Te instanceof Error?Te.message:String(Te),variant:"destructive"}),ue(!1);return}finally{ue(!1)}h(!0);try{const Te=await e.discoverToolsForAnalysis({serverNames:c});g(Te.servers),j(Ie=>{const Ot={};for(const Ht of Te.servers){const Ct=Ie[Ht.serverName]??[],ge=Ht.tools.map(Ve=>Ve.name),qe=Ct.filter(Ve=>ge.includes(Ve));Ot[Ht.serverName]=qe.length>0?qe:ge}return Ot})}catch(Te){ke({title:"Could not discover MCP tools",description:Te instanceof Error?Te.message:String(Te),variant:"destructive"})}finally{h(!1)}};m.useEffect(()=>{ve()},[c.join("|")]);const Pe=m.useMemo(()=>{const he=y.trim().toLowerCase();return he?p.map(Te=>({...Te,tools:Te.tools.filter(Ie=>Ie.name.toLowerCase().includes(he)||(Ie.description||"").toLowerCase().includes(he))})).filter(Te=>Te.tools.length>0):p},[p,y]),F=m.useMemo(()=>Object.values(x).reduce((he,Te)=>he+Te.length,0),[x]),te=c[0]??"",fe=async()=>{if(!N&&!S){ke({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){ke({title:"Select exactly one server",variant:"destructive"});return}if(F===0){ke({title:"Select at least one tool",variant:"destructive"});return}G(!0),W([]),z(null),V(null),I("run"),Q("running");try{const he=c[0];t.find(Ot=>Ot.id===he)?.authType==="oauth2"&&(ue(!0),await di({serverNames:[he],source:e,onServerAuthStart:Ot=>{ke({title:`OAuth login required for ${Ot}`,description:"Complete login in the opened browser tab. Analysis will continue automatically."})}}));const{jobId:Ie}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:x,maxParallelTools:A,modes:{metadataReview:N,deeperAnalysis:S},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:T,toolCallTimeoutMs:D}});B(Ie),ce(Ie),de(Ie)}catch(he){G(!1),Q("error"),I("run"),ke({title:"Could not start tool analysis",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{ue(!1)}},Ee=async()=>{if(!U)return;const he=U;try{const Te=await e.stopToolAnalysis(he);if(Te.status==="completed"){re.current?.(),re.current=null;const Ie=await e.getToolAnalysisResult(he);z(Ie.report),V(Ie.savedReportId??null),_e(),B(null),G(!1),Q("idle"),I("run"),ke({title:"Analysis already finished",description:"Showing the result overview."});return}if(Te.status==="stopped"){re.current?.(),re.current=null,_e(),B(null),G(!1),Q("stopped"),ke({title:"Analysis stopped"});return}if(Te.status==="error"){re.current?.(),re.current=null,_e(),B(null),G(!1),Q("error"),ke({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}ke({title:"Stopping analysis..."})}catch(Te){ke({title:"Could not stop analysis",description:Te instanceof Error?Te.message:String(Te),variant:"destructive"})}},Me=()=>{I("configure"),Q("idle"),B(null)},et=(he,Te)=>{d(Ie=>Te?[he]:Ie.filter(Ot=>Ot!==he))},st=(he,Te,Ie)=>{j(Ot=>{const Ht=new Set(Ot[he]??[]);return Ie?Ht.add(Te):Ht.delete(Te),{...Ot,[he]:Array.from(Ht)}})},xt=(he,Te)=>{j(Ie=>({...Ie,[he]:Te}))},qt=!0,Ut=U!==null||X.length>0||ee==="stopped"||ee==="error",xe=!!M,Ye=he=>{if(he==="configure"&&qt){I("configure");return}if(he==="run"&&Ut){I("run");return}he==="report"&&xe&&I("report")};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(uD,{className:"h-6 w-6"}),"Analyze MCP Tools"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Review MCP tools for schema quality, ergonomics, and agent/eval readiness."})]}),a.jsxs("div",{className:"hidden flex-wrap items-center gap-2 md:flex",children:[a.jsx("button",{type:"button",onClick:()=>Ye("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:a.jsx(He,{variant:$==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),a.jsx("button",{type:"button",onClick:()=>Ye("run"),disabled:!Ut,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:a.jsx(He,{variant:$==="run"?"default":"outline",className:Ut?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),a.jsx("button",{type:"button",onClick:()=>Ye("report"),disabled:!xe,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:a.jsx(He,{variant:$==="report"?"default":"outline",className:xe?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),$==="configure"&&a.jsxs(Ke,{children:[a.jsxs(Rt,{children:[a.jsx(It,{className:"text-base",children:"Run MCP analysis"}),a.jsx(Hr,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),a.jsxs(Ge,{className:"space-y-5",children:[!pe&&a.jsxs(Zo,{children:[a.jsx(el,{children:"No assistant agent available"}),a.jsxs(tl,{children:["Add a library agent in"," ",a.jsx(Tt,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",a.jsx(Tt,{to:"/settings",className:"underline",children:"Settings"}),"."]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(ze,{className:"text-xs",children:"Servers"}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{s()},disabled:r||ie,children:[a.jsx(ba,{className:"mr-2 h-4 w-4"}),"Refresh Servers"]})]}),a.jsx("div",{className:"grid gap-2 rounded-md border p-3 md:grid-cols-2",children:t.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No library servers configured."}):t.map(he=>{const Te=c.includes(he.id);return a.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[a.jsx(Jr,{checked:Te,onCheckedChange:Ie=>et(he.id,!!Ie)}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-medium",children:he.name||he.id}),he.url&&a.jsx("div",{className:"truncate text-xs text-muted-foreground",children:he.url})]})]},he.id)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Select exactly one MCP server for analysis."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ze,{className:"text-xs",children:"Filter visible tools"}),a.jsxs("div",{className:"relative",children:[a.jsx(xN,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),a.jsx(bt,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:y,onChange:he=>b(he.target.value)})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Filtering only changes what is shown; selected tools remain selected."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(ze,{className:"text-xs",children:te?`Tools for ${te}`:"Tools"}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{ve()},disabled:f||ie||c.length===0,children:[f&&a.jsx(Cr,{className:"mr-2 h-4 w-4 animate-spin"}),"Discover Tools"]})]}),a.jsx("div",{className:"space-y-3 rounded-md border p-3",children:c.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a server to discover tools."}):f&&p.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading tools..."}):Pe.length===0&&!f?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):Pe.map(he=>{const Te=new Set(x[he.serverName]??[]);return a.jsxs("div",{className:"rounded-md border p-3",children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[a.jsx("div",{className:"font-medium",children:he.serverName}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ne,{type:"button",size:"sm",variant:"ghost",onClick:()=>xt(he.serverName,he.tools.map(Ie=>Ie.name)),children:"Select all"}),a.jsx(ne,{type:"button",size:"sm",variant:"ghost",onClick:()=>xt(he.serverName,[]),children:"Clear"})]})]}),he.warnings.length>0&&a.jsx("div",{className:"mb-2 space-y-1",children:he.warnings.map(Ie=>a.jsx("div",{className:"text-xs text-amber-700",children:$xe(he.serverName,Ie)},`${he.serverName}-${Ie}`))}),a.jsx("div",{className:"grid gap-2",children:he.tools.map(Ie=>{const Ot=F6(Ie.classificationReason),Ht=Ie.safetyClassification==="read_only"?"read-only":Ot?"write/delete":"unsafe/unknown",Ct=Ie.safetyClassification==="read_only"?"border-emerald-200 bg-emerald-50 text-emerald-700":Ot?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700";return a.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[a.jsx(Jr,{checked:Te.has(Ie.name),onCheckedChange:ge=>st(he.serverName,Ie.name,!!ge)}),a.jsxs("div",{className:"min-w-0 space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"font-mono text-xs",children:Ie.name}),Ie.title&&a.jsx("span",{className:"text-xs text-muted-foreground",children:Ie.title}),a.jsx(Dxe,{label:Ht,reason:Ie.classificationReason,variantClassName:Ct}),Ie.inputSchema&&a.jsx(He,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: input"}),Ie.outputSchema&&a.jsx(He,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: output"})]}),Ie.description&&a.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ie.description})]})]},`${he.serverName}-${Ie.name}`)})})]},he.serverName)})}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",F]})]}),a.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[a.jsx("div",{className:"text-sm font-medium",children:"Analysis Modes"}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Jr,{checked:N,onCheckedChange:he=>C(!!he)}),a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",a.jsx(g$,{text:"No tool execution. Reviews tool names, descriptions, and schemas only."})]})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Jr,{checked:S,onCheckedChange:he=>E(!!he)}),a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",a.jsx(g$,{text:"Runs sample MCP tool calls automatically for read-only tools only (based on the safety allowlist)."})]})]}),a.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/20 p-3 md:grid-cols-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Max parallel tools"}),a.jsx(bt,{type:"number",min:1,max:8,value:A,onChange:he=>k(Math.max(1,Math.min(8,Number(he.target.value)||2))),className:"h-8"})]}),S?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Safety profile"}),a.jsx("div",{className:"text-sm",children:"Read-only allowlist only"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Sample calls per tool"}),a.jsx(bt,{type:"number",min:1,max:5,value:T,onChange:he=>O(Math.max(1,Math.min(5,Number(he.target.value)||1))),className:"h-8"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Tool call timeout (ms)"}),a.jsx(bt,{type:"number",min:1e3,max:6e4,step:500,value:D,onChange:he=>q(Math.max(1e3,Math.min(6e4,Number(he.target.value)||1e4))),className:"h-8"})]}),a.jsx("div",{className:"md:col-span-3 text-xs text-amber-700",children:"Deeper analysis may execute read-only MCP tools automatically."})]}):a.jsx("div",{className:"md:col-span-2 text-xs text-muted-foreground",children:"Deeper analysis is disabled. Only metadata/schema review will run."})]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:a.jsxs(ne,{type:"button",onClick:()=>{fe()},disabled:R||ie||!!U,children:[(R||!!U)&&a.jsx(Cr,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),$==="run"&&a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(It,{className:"flex items-center gap-2 text-base",children:a.jsx("span",{children:"Progress"})}),a.jsx(Hr,{children:U?"Live tool-analysis job events:":M?"Analysis finished. Review the summary below or open the saved report details.":ee==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":ee==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),U?a.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{Ee()},children:"Stop Analysis"}):a.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:Me,children:"Back to Configure Analysis"})]})}),a.jsxs(Ge,{className:"space-y-2",children:[U&&a.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:[a.jsx(Cr,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(oe.totalTools>0||U)&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[a.jsx("span",{children:oe.totalTools>0?`${oe.finishedTools}/${oe.totalTools} tools finished`:"Preparing analysis..."}),a.jsx("span",{children:oe.totalTools>0?`${oe.percent}%`:"0%"})]}),a.jsx(Dg,{value:oe.totalTools>0?oe.percent:0,className:"h-2"})]}),X.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:U?"Starting analysis...":"No progress events captured."}):a.jsx("div",{ref:je,className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:X.map((he,Te)=>a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(he.ts).toLocaleTimeString()}),a.jsx(He,{variant:"outline",className:"mr-2 text-[10px]",children:he.type}),a.jsx("span",{className:"break-all",children:typeof he.payload.message=="string"?he.payload.message:JSON.stringify(he.payload)})]},`${he.ts}-${Te}`))}),!U&&M&&a.jsx(Ke,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:a.jsxs(Ge,{className:"pt-4 space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-semibold",children:"Result overview"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[M.summary.toolsAnalyzed," tools analyzed, ",M.summary.toolsSkipped," ","skipped, across ",M.summary.serversAnalyzed," server",M.summary.serversAnalyzed!==1?"s":"","."]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[K&&a.jsx(ne,{asChild:!0,size:"sm",children:a.jsx(Tt,{to:`/tool-analysis-results/${K}`,children:"Open result details"})}),a.jsx(ne,{asChild:!0,size:"sm",variant:"outline",children:a.jsx(Tt,{to:"/tool-analysis-results",children:"View all results"})}),a.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>Ye("report"),children:"View inline report"})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[M.summary.issueCounts.critical>0&&a.jsxs(He,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",M.summary.issueCounts.critical]}),M.summary.issueCounts.high>0&&a.jsxs(He,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",M.summary.issueCounts.high]}),M.summary.issueCounts.medium>0&&a.jsxs(He,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",M.summary.issueCounts.medium]}),M.summary.issueCounts.low>0&&a.jsxs(He,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",M.summary.issueCounts.low]}),M.summary.issueCounts.info>0&&a.jsxs(He,{variant:"outline",children:["Info: ",M.summary.issueCounts.info]}),Object.values(M.summary.issueCounts).every(he=>he===0)&&a.jsx(He,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),$==="report"&&M&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-semibold",children:"Report"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[M.summary.toolsAnalyzed," tools analyzed across"," ",M.summary.serversAnalyzed," server",M.summary.serversAnalyzed!==1?"s":"","."]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:Me,children:"Back to Configure Analysis"}),K&&a.jsxs(a.Fragment,{children:[a.jsx(ne,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsx(Tt,{to:`/tool-analysis-results/${K}`,children:"Open saved report"})}),a.jsx(ne,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsx(Tt,{to:"/tool-analysis-results",children:"View all reports"})})]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>v$(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(M,null,2)}
|
|
143
|
-
`,"application/json"),children:[a.jsx(Oa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>v$(`tool-analysis-${Date.now()}.md`,p_(M),"text/markdown"),children:[a.jsx(Oa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),a.jsx(z6,{report:M})]})]})};function x$(e,t,n){const r=new Blob([t],{type:n}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=e,i.click(),URL.revokeObjectURL(s)}function Fxe(){const{source:e}=Ln(),[t,n]=m.useState([]),[r,s]=m.useState(!0),[i,o]=m.useState(null),[c,d]=m.useState(!1),[f,h]=m.useState("all"),[p,g]=m.useState(!1),x=async()=>{s(!0);try{n(await e.listToolAnalysisResults())}catch(S){ke({title:"Could not load tool analysis results",description:S instanceof Error?S.message:String(S),variant:"destructive"})}finally{s(!1)}};m.useEffect(()=>{x()},[]);const j=m.useMemo(()=>Array.from(new Set(t.flatMap(S=>S.serverNames))).sort((S,E)=>S.localeCompare(E)),[t]),y=m.useMemo(()=>f==="all"?t:t.filter(S=>S.serverNames.includes(f)),[t,f]),b=m.useMemo(()=>t.find(S=>S.reportId===i)??null,[t,i]),N=async()=>{if(i){d(!0);try{await e.deleteToolAnalysisSavedResult(i),n(S=>S.filter(E=>E.reportId!==i)),ke({title:"Tool analysis report deleted"}),o(null)}catch(S){ke({title:"Could not delete report",description:S instanceof Error?S.message:String(S),variant:"destructive"})}finally{d(!1)}}},C=async(S,E)=>{try{const A=await e.getToolAnalysisSavedResult(S);E==="json"?x$(`${S}.json`,`${JSON.stringify(A,null,2)}
|
|
144
|
-
`,"application/json"):x$(`${S}.md`,p_(A.report),"text/markdown")}catch(A){ke({title:"Could not export saved report",description:A instanceof Error?A.message:String(A),variant:"destructive"})}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(dD,{className:"h-6 w-6"}),"Tool Analysis Results"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse persisted Analyze MCP Tools reports."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP server"}),a.jsxs(pl,{open:p,onOpenChange:g,children:[a.jsx(hl,{asChild:!0,children:a.jsxs(ne,{type:"button",variant:"outline",role:"combobox","aria-expanded":p,className:"h-9 w-[240px] justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:f==="all"?"All servers":f}),a.jsx(Qt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(co,{className:"w-[240px] p-0",align:"start",children:a.jsxs(vl,{children:[a.jsx(gl,{placeholder:"Search MCP servers..."}),a.jsxs(xl,{children:[a.jsx(yl,{children:"No servers found."}),a.jsxs(bl,{children:[a.jsx(ma,{value:"all servers",onSelect:()=>{h("all"),g(!1)},children:"All servers"}),j.map(S=>a.jsx(ma,{value:S,onSelect:()=>{h(S),g(!1)},children:S},S))]})]})]})})]})]}),a.jsx(ne,{variant:"outline",onClick:()=>{x()},disabled:r,children:r?"Refreshing...":"Refresh"}),a.jsx(ne,{asChild:!0,variant:"outline",children:a.jsx(Tt,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),a.jsx(Ke,{children:a.jsx(Ge,{className:"p-0",children:r?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading tool analysis results..."}):t.length===0?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No saved tool analysis reports yet."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"border-b px-4 py-3",children:a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing"," ",a.jsx("span",{className:"font-medium text-foreground",children:y.length})," of"," ",a.jsx("span",{className:"font-medium text-foreground",children:t.length})," reports"]})}),y.length===0?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No reports for the selected MCP server."}):a.jsxs(Kr,{children:[a.jsx(Gr,{children:a.jsxs(Gt,{children:[a.jsx(it,{children:"Report ID"}),a.jsx(it,{children:"Evaluated"}),a.jsx(it,{children:"Timestamp"}),a.jsx(it,{children:"Issues"}),a.jsx(it,{children:"Modes"}),a.jsx(it,{className:"w-10"})]})}),a.jsx(Yr,{children:y.map(S=>a.jsxs(Gt,{children:[a.jsx(We,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(Tt,{to:`/tool-analysis-results/${S.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:S.reportId}),a.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[S.assistantAgentName," · ",S.assistantAgentModel]})]})}),a.jsx(We,{className:"text-[11px] text-muted-foreground",children:a.jsxs("div",{className:"space-y-0.5",children:[a.jsxs("div",{children:["Servers:"," ",a.jsx("span",{className:"font-medium text-foreground",children:S.serverNames.length})," ","· Tools:"," ",a.jsx("span",{className:"font-medium text-foreground",children:S.summary.toolsAnalyzed})," · ","Skipped:"," ",a.jsx("span",{className:"font-medium text-foreground",children:S.summary.toolsSkipped})]}),a.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[S.serverNames.slice(0,2).join(", "),S.serverNames.length>2?` +${S.serverNames.length-2}`:""]})]})}),a.jsx(We,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(yi,{className:"h-3 w-3"}),new Date(S.createdAt).toLocaleString()]})}),a.jsx(We,{children:a.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(E=>S.summary.issueCounts[E]>0?a.jsxs(He,{variant:"outline",className:"capitalize",children:[E,": ",S.summary.issueCounts[E]]},`${S.reportId}-${E}`):null),Object.values(S.summary.issueCounts).every(E=>E===0)&&a.jsx(He,{variant:"outline",children:"No issues"})]})}),a.jsx(We,{children:a.jsxs("div",{className:"flex flex-wrap gap-1",children:[S.modes.metadataReview&&a.jsx(He,{variant:"outline",children:"metadata"}),S.modes.deeperAnalysis&&a.jsx(He,{variant:"outline",children:"deeper"})]})}),a.jsx(We,{children:a.jsxs(Xf,{children:[a.jsx(Qf,{asChild:!0,children:a.jsx(ne,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(uv,{className:"h-4 w-4"})})}),a.jsxs(Cu,{align:"end",children:[a.jsx(Qr,{asChild:!0,children:a.jsx(Tt,{to:`/tool-analysis-results/${S.reportId}`,children:"View"})}),a.jsxs(Qr,{onSelect:()=>{C(S.reportId,"json")},children:[a.jsx(Oa,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),a.jsxs(Qr,{onSelect:()=>{C(S.reportId,"markdown")},children:[a.jsx(Oa,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),a.jsxs(Qr,{className:"text-destructive",onSelect:E=>{E.preventDefault(),o(S.reportId)},children:[a.jsx($a,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},S.reportId))})]})]})})}),a.jsx(Bs,{open:!!i,onOpenChange:S=>!S&&o(null),children:a.jsxs(cs,{children:[a.jsxs(us,{children:[a.jsx(fs,{children:"Delete tool analysis report?"}),a.jsx(ps,{children:b?`Delete saved report '${b.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),a.jsxs(ds,{children:[a.jsx(ms,{disabled:c,children:"Cancel"}),a.jsx(hs,{onClick:S=>{S.preventDefault(),N()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function y$(e,t,n){const r=new Blob([t],{type:n}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=e,i.click(),URL.revokeObjectURL(s)}function zxe(){const{id:e=""}=Nl(),t=La(),{source:n}=Ln(),[r,s]=m.useState(null),[i,o]=m.useState(!0),[c,d]=m.useState(!1),[f,h]=m.useState(!1),[p,g]=m.useState(!1);m.useEffect(()=>{let j=!0;return o(!0),d(!1),n.getToolAnalysisSavedResult(e).then(y=>{j&&s(y)}).catch(y=>{if(!j)return;const b=y instanceof Error?y.message:String(y);if(b.includes("(404)")){d(!0),s(null);return}ke({title:"Could not load saved tool analysis report",description:b,variant:"destructive"})}).finally(()=>{j&&o(!1)}),()=>{j=!1}},[e,n]);const x=async()=>{g(!0);try{await n.deleteToolAnalysisSavedResult(e),ke({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){ke({title:"Could not delete report",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{g(!1),h(!1)}};return i?a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading saved tool analysis report..."}):c||!r?a.jsxs("div",{className:"space-y-4",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Tool Analysis Result"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Saved report not found."}),a.jsx(ne,{asChild:!0,variant:"outline",children:a.jsx(Tt,{to:"/tool-analysis-results",children:"Back to Tool Analysis Results"})})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.reportId}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[a.jsx(yi,{className:"h-3 w-3 shrink-0"}),new Date(r.createdAt).toLocaleString()]})," ","· ",r.serverNames.join(", ")||"—"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.report.mcpServerVersions&&Object.keys(r.report.mcpServerVersions).length>0&&a.jsxs("span",{className:"inline-flex items-center align-middle rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] leading-none text-muted-foreground",children:[a.jsx("span",{className:"font-medium",children:"MCP:"}),a.jsx("span",{className:"ml-1 font-mono",children:Object.entries(r.report.mcpServerVersions).map(([j,y])=>`${j}: ${y??"unknown"}`).join(", ")})]}),a.jsx(ne,{asChild:!0,size:"sm",variant:"outline",children:a.jsx(Tt,{to:"/tool-analysis-results",children:"Back to results"})}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>y$(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
|
|
145
|
-
`,"application/json"),children:[a.jsx(Oa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>y$(`${r.reportId}.md`,p_(r.report),"text/markdown"),children:[a.jsx(Oa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[a.jsx($a,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),a.jsx(z6,{report:r.report}),a.jsx(Bs,{open:f,onOpenChange:h,children:a.jsxs(cs,{children:[a.jsxs(us,{children:[a.jsx(fs,{children:"Delete tool analysis report?"}),a.jsxs(ps,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),a.jsxs(ds,{children:[a.jsx(ms,{disabled:p,children:"Cancel"}),a.jsx(hs,{onClick:j=>{j.preventDefault(),x()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const Bxe=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}],qxe="resolve_target_metadata",Uxe="token_exchange",Wxe="resource_probe";function Er({text:e}){return a.jsx(ao,{delayDuration:200,children:a.jsxs(so,{children:[a.jsx(io,{type:"button",className:"inline-flex shrink-0 items-center",onClick:t=>t.preventDefault(),children:a.jsx(q7,{className:"h-3.5 w-3.5 text-muted-foreground/50 hover:text-muted-foreground"})}),a.jsx(mi,{className:"max-w-xs text-xs leading-relaxed",children:e})]})})}function b$(e){return navigator.clipboard.writeText(e)}function Yj(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function Xj(e){if(!e)return"No metadata payload captured.";try{return JSON.stringify(JSON.parse(e),null,2)}catch{return`Non-JSON response body:
|
|
146
|
-
${e}`}}function Vxe(e,t){const 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(const r of e.stepStates)n.push(`- ${r.title}: ${r.status}${r.outcomeSummary?` — ${r.outcomeSummary}`:""}`);if(n.push(""),n.push("## Validation Findings"),e.validations.length===0)n.push("- None");else for(const r of e.validations)n.push(`- [${r.severity}] ${r.title} (${r.stepId})`),n.push(` - ${r.detail}`),r.recommendation&&n.push(` - Recommendation: ${r.recommendation}`);n.push(""),n.push("## Event Log");for(const r of t){const s=typeof r.payload.message=="string"?r.payload.message:JSON.stringify(r.payload);n.push(`- ${new Date(r.ts).toLocaleTimeString()} [${r.type}] ${s}`)}return`${n.join(`
|
|
147
|
-
`)}
|
|
148
|
-
`}function Hxe(){const{source:e}=Ln(),{servers:t,reload:n,loading:r}=os(),[s,i]=m.useState("configure"),[o,c]=m.useState(""),[d,f]=m.useState("pre_registered"),[h,p]=m.useState("local_callback"),[g,x]=m.useState(!0),[j,y]=m.useState(!0),[b,N]=m.useState(!0),[C,S]=m.useState(""),[E,A]=m.useState(""),[k,T]=m.useState(""),[O,D]=m.useState(""),[q,U]=m.useState("__default__"),[B,X]=m.useState("{}"),[W,M]=m.useState(""),[z,K]=m.useState(""),[V,R]=m.useState(""),[G,$]=m.useState(""),[I,ee]=m.useState(""),[Q,ie]=m.useState(""),[ue,re]=m.useState(""),[je,pe]=m.useState(""),[oe,_e]=m.useState(null),[ce,de]=m.useState(null),[ve,Pe]=m.useState([]),[F,te]=m.useState(!1),[fe,Ee]=m.useState(!1),[Me,et]=m.useState(!1),[st,xt]=m.useState("all"),[qt,Ut]=m.useState("all"),[xe,Ye]=m.useState("inspector"),he=m.useRef(null),Te=m.useRef(null),Ie=m.useRef(!1),Ot=m.useRef(j);m.useEffect(()=>{Ot.current=j},[j]),m.useEffect(()=>()=>{he.current?.(),he.current=null},[]),m.useEffect(()=>{Te.current?.scrollIntoView({behavior:"smooth",block:"end"})},[ve.length]);const Ht=m.useMemo(()=>t.filter(se=>se.authType==="oauth2").slice().sort((se,Je)=>(se.name||se.id).localeCompare(Je.name||Je.id,void 0,{sensitivity:"base"})),[t]),Ct=Ht.find(se=>se.id===o);m.useEffect(()=>{o&&(Ht.some(se=>se.id===o)||c(""))},[Ht,o]),m.useEffect(()=>{Ct&&(Ct.oauthMode==="dcr"?(f("dcr"),T(""),D("")):(f("pre_registered"),T(Ct.oauthClientId??""),D(Ct.oauthClientSecret??"")),S(Ct.oauthScope??""),$(Ct.oauthAuthorizationUrl??""),ee(Ct.oauthTokenEndpoint??""))},[Ct?.id]);const ge=m.useMemo(()=>{const se=oe?.stepStates.length??0,Je=oe?.stepStates.filter(jt=>jt.status==="completed"||jt.status==="skipped").length??0,Nt=oe?.stepStates.filter(jt=>jt.status==="failed").length??0,ln=se>0?Math.round((Je+Nt)/se*100):0;return{total:se,completed:Je,failed:Nt,percent:ln}},[oe]),qe=m.useMemo(()=>{const se=oe?.network??[],Je=new Map,Nt=[],ln=jt=>`${jt.stepId}::${jt.label}::${jt.url}`;for(const jt of se){if(jt.phase==="request"){const $r=Nt.length;Nt.push({key:jt.id,stepId:jt.stepId,label:jt.label,method:jt.method,url:jt.url,request:jt});const Un=ln(jt),qs=Je.get(Un)??[];qs.push($r),Je.set(Un,qs);continue}const qn=ln(jt),xr=Je.get(qn),or=xr?.shift();if(typeof or=="number"){Nt[or]={...Nt[or],response:jt},xr&&xr.length>0?Je.set(qn,xr):Je.delete(qn);continue}Nt.push({key:jt.id,stepId:jt.stepId,label:jt.label,method:jt.method,url:jt.url,response:jt})}return Nt.filter(jt=>st!=="all"&&jt.stepId!==st?!1:qt==="error"?typeof jt.response?.status=="number"&&jt.response.status>=400:qt==="ok"?typeof jt.response?.status=="number"&&jt.response.status<400:!0)},[oe?.network,st,qt]),Ve=!!ce,St=!!(oe&&(oe.status==="completed"||oe.status==="error"||oe.status==="stopped")),Oe=m.useMemo(()=>{const se=new Map;return(oe?.stepStates??[]).forEach((Je,Nt)=>{se.set(Je.id,Nt+1)}),se},[oe?.stepStates]),Ze=m.useMemo(()=>{const se=(oe?.network??[]).filter(Je=>Je.phase==="response");return{resourceMetadata:se.find(Je=>Je.label==="Protected Resource Metadata"),authorizationServerMetadata:se.find(Je=>Je.label==="Authorization Server Metadata")}},[oe?.network]),we=m.useMemo(()=>{const se=new Map;for(const Je of oe?.network??[]){const Nt=se.get(Je.stepId)??{requests:[],responses:[]};Je.phase==="request"&&Nt.requests.push(Je),Je.phase==="response"&&Nt.responses.push(Je),se.set(Je.stepId,Nt)}return se},[oe?.network]),at=se=>{if(se==="configure"||se==="run"&&Ve||se==="report"&&St)return i(se)},wt=()=>{let se;if(d==="dcr"&&B.trim())try{se=JSON.parse(B)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Ct)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Ct.id,overrides:{authorizationServerMetadataUrl:V||void 0,authorizationEndpoint:G||void 0,tokenEndpoint:I||void 0,registrationEndpoint:Q||void 0,cimdUrl:W||void 0,resourceBaseUrl:ue||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:k.trim(),clientSecret:O.trim()||void 0,tokenEndpointAuthMethod:q==="__default__"?void 0:q||void 0}:void 0,dcr:d==="dcr"?{metadata:se,tokenEndpointAuthMethod:q==="__default__"?void 0:q||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:W||void 0,expectedClientId:z||void 0}:void 0},runtime:{redirectMode:h,scopes:C.split(/[,\s]+/).map(Je=>Je.trim()).filter(Boolean),resource:E.trim()||void 0,usePkce:b,codeChallengeMethod:"S256"},display:{showSensitiveValues:g}}},Dt=se=>{he.current?.(),he.current=e.subscribeOAuthDebuggerSession(se,Je=>{Pe(ln=>[...ln,Je]),(Je.type==="completed"||Je.type==="error"||Je.type==="stopped")&&te(!1),e.getOAuthDebuggerSession(se).then(ln=>{_e(ln.session),ln.session.uiHints.authorizationUrl&&Fn(`${Yj()}/api/oauth-debugger/sessions/${se}/authorize`),ln.session.status==="completed"&&i("report")}).catch(()=>{})})},Fn=se=>{!Ot.current||Ie.current||!se||(Ie.current=!0,window.open(se,"_blank","noopener,noreferrer"))},lt=async()=>{Ee(!0),Ie.current=!1;try{const se=wt(),Je=await e.createOAuthDebuggerSession(se);de(Je.sessionId),_e(Je.session),Pe([]),i("run"),Dt(Je.sessionId);const Nt=await e.startOAuthDebuggerSession(Je.sessionId);_e(Nt.session),te(!0),(Nt.session.status==="waiting_for_user"||Nt.session.status==="waiting_for_browser_callback")&&(te(!1),Nt.session.uiHints.authorizationUrl&&Fn(`${Yj()}/api/oauth-debugger/sessions/${Je.sessionId}/authorize`))}catch(se){ke({title:"Could not start OAuth Debugger session",description:se instanceof Error?se.message:String(se),variant:"destructive"})}finally{Ee(!1)}},zt=async()=>{if(ce)try{Ee(!0);const se=await e.submitOAuthDebuggerManualCallback(ce,{redirectUrl:je.trim()||void 0});_e(se.session),pe(""),te(!0)}catch(se){ke({title:"Could not submit callback",description:se instanceof Error?se.message:String(se),variant:"destructive"})}finally{Ee(!1)}},Jt=async()=>{if(ce){et(!0);try{const se=await e.stopOAuthDebuggerSession(ce);if(te(!1),se.status!=="running"){const Je=await e.getOAuthDebuggerSession(ce);_e(Je.session),Je.session.status==="completed"?i("report"):i("run")}}catch(se){ke({title:"Could not stop session",description:se instanceof Error?se.message:String(se),variant:"destructive"})}finally{et(!1)}}},dn=async()=>{he.current?.(),he.current=null,_e(null),de(null),Pe([]),te(!1),et(!1),Ee(!1),pe(""),xt("all"),Ut("all"),Ye("inspector"),i("run"),await lt()},mn=async se=>{if(!(!ce||!oe))try{const Je=await e.exportOAuthDebuggerSession(ce,se);let Nt="";const ln=se==="json"?"json":se==="raw"?"txt":"md";typeof Je=="string"?Nt=Je:Nt=`${JSON.stringify(Je,null,2)}
|
|
149
|
-
`;const jt=new Blob([Nt],{type:"text/plain;charset=utf-8"}),qn=URL.createObjectURL(jt),xr=document.createElement("a");xr.href=qn,xr.download=`oauth-debugger-${ce}.${ln}`,xr.click(),URL.revokeObjectURL(qn)}catch(Je){if(se==="markdown"){const Nt=Vxe(oe,ve),ln=new Blob([Nt],{type:"text/markdown;charset=utf-8"}),jt=URL.createObjectURL(ln),qn=document.createElement("a");qn.href=jt,qn.download=`oauth-debugger-${oe.id}.md`,qn.click(),URL.revokeObjectURL(jt);return}ke({title:"Export failed",description:Je instanceof Error?Je.message:String(Je),variant:"destructive"})}},Xt=ce?`${Yj()}/api/oauth-debugger/sessions/${ce}/authorize`:void 0,ir=se=>se==="error"?"destructive":se==="warning"?"outline":"secondary";return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"OAuth Debugger"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Step-by-step OAuth flow debugging for MCP servers (latest MCP authorization draft profile)."})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:Bxe.map(se=>{const Je=s===se.id,Nt=se.id==="configure"||se.id==="run"&&Ve||se.id==="report"&&St;return a.jsx("button",{type:"button",onClick:()=>Nt&&at(se.id),disabled:!Nt,className:"rounded-full",children:a.jsx(He,{variant:Je?"default":"outline",className:Nt?"":"opacity-50",children:se.label})},se.id)})})]}),s==="configure"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(It,{className:"text-base",children:"Target MCP Server"}),a.jsx(Hr,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),a.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[a.jsx(ba,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),a.jsx(Ge,{className:"space-y-3",children:a.jsxs("div",{className:"max-w-xl space-y-2",children:[a.jsx(ze,{children:"MCP Server"}),a.jsxs(_n,{value:o,onValueChange:c,children:[a.jsx(bn,{children:a.jsx(An,{placeholder:"Select an MCP server"})}),a.jsx(wn,{children:Ht.map(se=>a.jsx(ot,{value:se.id,children:se.name||se.id},se.id))})]}),Ht.length===0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["No MCP servers with OAuth configured found. Add OAuth 2.0 auth in"," ",a.jsx("a",{href:"/libraries/servers",className:"underline text-primary",children:"Manage Servers"}),"."]}),Ct&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:[Ct.transport," ·"," ",Ct.url||Ct.command||"No URL/command"," · ",a.jsxs("span",{className:"text-primary",children:[Ct.oauthMode==="dcr"?"DCR":"pre-registered"," fields pre-filled"]})]})]})})]}),a.jsxs(Ke,{children:[a.jsxs(Rt,{className:"pb-3",children:[a.jsx(It,{className:"text-base",children:"Client Registration Method"}),a.jsx(Hr,{children:"How your OAuth client is identified with the authorization server."})]}),a.jsxs(Ge,{className:"space-y-3",children:[a.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(se=>a.jsxs("button",{type:"button",onClick:()=>f(se.id),className:"rounded-md border p-3 text-left",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:`h-2.5 w-2.5 shrink-0 rounded-full ${d===se.id?"bg-primary":"bg-muted-foreground/30"}`}),a.jsx("span",{className:"text-sm font-medium",children:se.label})]}),a.jsx("p",{className:"mt-1 pl-5 text-xs text-muted-foreground",children:se.hint})]},se.id))}),a.jsx("div",{className:"grid gap-3 md:grid-cols-1",children:a.jsxs("div",{className:"max-w-md space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["Redirect mode",a.jsx(Er,{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."})]}),a.jsxs(_n,{value:h,onValueChange:se=>p(se),children:[a.jsx(bn,{children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"local_callback",children:"Local callback (recommended)"}),a.jsx(ot,{value:"manual",children:"Manual paste redirect URL"})]})]})]})}),d==="pre_registered"&&a.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["client_id",a.jsx(Er,{text:"The unique identifier for your application, issued by the authorization server when you registered the client."})]}),a.jsx(bt,{value:k,onChange:se=>T(se.target.value)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["client_secret",a.jsx(Er,{text:"Leave empty for public clients (e.g. SPAs or mobile apps). Required for confidential clients that authenticate with the token endpoint."})]}),a.jsx(bt,{value:O,onChange:se=>D(se.target.value),type:"password",placeholder:"optional"})]})]}),d==="cimd"&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["CIMD URL",a.jsx(Er,{text:"A publicly reachable URL hosting a JSON document that describes this client. The authorization server fetches it to identify the client."})]}),a.jsx(bt,{value:W,onChange:se=>M(se.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),a.jsxs(Ke,{children:[a.jsxs(Rt,{className:"pb-3",children:[a.jsx(It,{className:"text-base",children:"Runtime OAuth Inputs"}),a.jsx(Hr,{children:"Parameters sent in the authorization request."})]}),a.jsxs(Ge,{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Scopes"}),a.jsx(bt,{value:C,onChange:se=>S(se.target.value),placeholder:"openid profile email"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Space or comma separated. Leave empty to use scopes auto-discovered from the server metadata."})]}),a.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[a.jsx(Jr,{checked:b,onCheckedChange:se=>N(!!se)}),a.jsxs(ze,{className:"flex items-center gap-1",children:["Use PKCE (S256)",a.jsx(Er,{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."})]})]}),a.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[a.jsx(Jr,{checked:j,onCheckedChange:se=>y(!!se)}),a.jsx(ze,{children:"Auto-open browser when authorization URL is ready"})]})]})]}),a.jsxs("details",{className:"rounded-md border bg-card p-3 shadow-sm",children:[a.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Advanced"}),a.jsxs("div",{className:"mt-3 space-y-4",children:[a.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["Token endpoint auth method",a.jsx(Er,{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."})]}),a.jsxs(_n,{value:q,onValueChange:U,children:[a.jsx(bn,{children:a.jsx(An,{placeholder:"Server default (recommended)"})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"__default__",children:"Server default (let the server decide)"}),a.jsx(ot,{value:"client_secret_basic",children:"client_secret_basic — credentials in Authorization header"}),a.jsx(ot,{value:"client_secret_post",children:"client_secret_post — credentials in request body"}),a.jsx(ot,{value:"none",children:"none — public client, no secret"}),a.jsx(ot,{value:"private_key_jwt",children:"private_key_jwt — signed JWT assertion"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:'Use "server default" unless the server requires a specific method.'})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["Resource / audience",a.jsx(Er,{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."})]}),a.jsx(bt,{value:E,onChange:se=>A(se.target.value),placeholder:"https://api.example.com"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. Only needed for servers that use resource indicators."})]})]}),d==="dcr"&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["DCR metadata JSON",a.jsx(Er,{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.'})]}),a.jsx(Is,{value:B,onChange:se=>X(se.target.value),className:"min-h-32 font-mono text-xs"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional extra fields for the registration request body."})]}),d==="cimd"&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["Expected client_id",a.jsx(Er,{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."})]}),a.jsx(bt,{value:z,onChange:se=>K(se.target.value),placeholder:"optional"})]}),a.jsxs("div",{className:"rounded-md border bg-background p-3",children:[a.jsx("div",{className:"mb-1 text-sm font-medium",children:"Endpoint overrides"}),a.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."}),a.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["Authorization server metadata URL",a.jsx(Er,{text:"The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path."})]}),a.jsx(bt,{value:V,onChange:se=>R(se.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["Resource server base URL",a.jsx(Er,{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."})]}),a.jsx(bt,{value:ue,onChange:se=>re(se.target.value),placeholder:"https://resource.example.com"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["Authorization endpoint",a.jsx(Er,{text:"The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata."})]}),a.jsx(bt,{value:G,onChange:se=>$(se.target.value),placeholder:"https://.../authorize"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["Token endpoint",a.jsx(Er,{text:"The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically."})]}),a.jsx(bt,{value:I,onChange:se=>ee(se.target.value),placeholder:"https://.../token"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["Registration endpoint (DCR)",a.jsx(Er,{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."})]}),a.jsx(bt,{value:Q,onChange:se=>ie(se.target.value),placeholder:"https://.../register"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(ze,{className:"text-xs flex items-center gap-1",children:["CIMD URL override",a.jsx(Er,{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."})]}),a.jsx(bt,{value:W,onChange:se=>M(se.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),a.jsxs(Zo,{children:[a.jsx(Ny,{className:"h-4 w-4"}),a.jsx(el,{children:"Secrets display"}),a.jsxs(tl,{className:"space-y-2",children:[a.jsx("p",{children:"By default, full tokens and secrets are visible in the network inspector and exports — useful for debugging but not for sharing."}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Jr,{checked:!g,onCheckedChange:se=>x(se===!1)}),a.jsx(ze,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),a.jsx("div",{className:"flex justify-end",children:a.jsxs(ne,{type:"button",onClick:()=>{lt()},disabled:fe,children:[fe&&a.jsx(Cr,{className:"mr-2 h-4 w-4 animate-spin"}),"Start OAuth Debug Session"]})})]}),s==="run"&&a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"grid gap-4 xl:grid-cols-[1.2fr_1fr]",children:[a.jsxs(Ke,{className:"xl:col-span-1 min-w-0",children:[a.jsx(Rt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(It,{className:"text-base",children:"Progress"}),a.jsx(Hr,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[oe?.uiHints.authorizationUrl&&Xt&&a.jsx(ne,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsxs("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(qh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{dn()},disabled:fe,children:[a.jsx(ba,{className:"mr-2 h-4 w-4"}),"Restart"]}),ce&&a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{Jt()},disabled:Me||!ce,children:[(Me||F)&&Me&&a.jsx(Cr,{className:"mr-2 h-4 w-4 animate-spin"}),a.jsx(_d,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[a.jsxs("span",{children:[ge.completed+ge.failed,"/",ge.total," steps"]}),a.jsxs("span",{children:[ge.percent,"%"]})]}),a.jsx(Dg,{value:ge.percent,className:"h-2"})]}),oe?.status==="waiting_for_user"&&a.jsx(Ke,{children:a.jsxs(Ge,{className:"pt-4 space-y-2",children:[a.jsx("div",{className:"text-sm font-medium",children:"Manual callback required"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the authorization URL, complete authentication, then paste the final redirect URL here."}),a.jsx(Is,{value:je,onChange:se=>pe(se.target.value),placeholder:"Paste the final redirect URL (with code and state)",className:"min-h-24 text-xs font-mono"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(ne,{type:"button",size:"sm",onClick:()=>{zt()},disabled:fe||!je.trim(),children:[fe&&a.jsx(Cr,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),oe.uiHints.authorizationUrl&&Xt&&a.jsx(ne,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsx("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),oe?.status==="waiting_for_browser_callback"&&a.jsxs(Zo,{children:[a.jsx(Ny,{className:"h-4 w-4"}),a.jsx(el,{children:"Waiting for browser callback"}),a.jsxs(tl,{className:"space-y-1",children:[a.jsx("p",{className:"text-xs",children:"Complete the authorization flow in your browser. MCP Lab is listening for the callback at:"}),a.jsx("p",{className:"text-xs font-mono break-all",children:oe.uiHints.callbackUrl}),oe.uiHints.authorizationUrl&&Xt&&a.jsx("div",{className:"pt-2",children:a.jsx(ne,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsxs("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(qh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),a.jsx("div",{className:"space-y-2",children:oe?.stepStates.map(se=>{const Je=Oe.get(se.id),Nt=we.get(se.id),ln=se.id===Uxe||se.id===Wxe,jt=!!(Nt&&(Nt.requests.length>0||Nt.responses.length>0)),qn=ln&&se.status!=="pending"&&jt;return a.jsxs("div",{className:"rounded-md border p-3",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0 flex items-start gap-2",children:[a.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:Je}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"inline-flex items-center gap-1 text-sm font-medium",children:[a.jsx("span",{children:se.title}),se.status==="completed"&&a.jsx(si,{className:"h-4 w-4 shrink-0 text-emerald-600","aria-hidden":"true"})]}),a.jsx("div",{className:"text-xs text-muted-foreground",children:se.description})]})]}),a.jsx(He,{variant:se.status==="failed"?"destructive":se.status==="completed"?"outline":se.status==="active"?"secondary":"outline",className:se.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:se.status})]}),se.outcomeSummary&&a.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all whitespace-pre-line",children:se.outcomeSummary}),se.id===qxe&&a.jsxs("details",{className:"mt-3 rounded-md border bg-muted/20 p-3",children:[a.jsx("summary",{className:"cursor-pointer text-xs font-semibold text-muted-foreground",children:"OAuth Metadata Sources"}),a.jsxs("div",{className:"mt-3 space-y-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium",children:"Resource Metadata"}),a.jsxs("p",{className:"text-xs text-muted-foreground break-all",children:["From ",Ze.resourceMetadata?.url??"not captured"]}),a.jsx("pre",{className:"max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs",children:Xj(Ze.resourceMetadata?.bodyText)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium",children:"Authorization Server Metadata"}),a.jsxs("p",{className:"text-xs text-muted-foreground break-all",children:["From"," ",Ze.authorizationServerMetadata?.url??"not captured"]}),a.jsx("pre",{className:"max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs",children:Xj(Ze.authorizationServerMetadata?.bodyText)})]})]})]}),qn&&Nt&&a.jsxs("details",{className:"mt-3 rounded-md border bg-muted/20 p-3",children:[a.jsx("summary",{className:"cursor-pointer text-xs font-semibold text-muted-foreground",children:"Captured exchange details"}),a.jsx("div",{className:"mt-3 space-y-3",children:Array.from({length:Math.max(Nt.requests.length,Nt.responses.length)}).map((xr,or)=>{const $r=Nt.requests[or],Un=Nt.responses[or];return a.jsxs("div",{className:"rounded-md border bg-background p-2",children:[a.jsx("div",{className:"text-xs font-medium",children:$r?.label??Un?.label??`Exchange ${or+1}`}),a.jsxs("p",{className:"mt-1 text-xs text-muted-foreground break-all",children:[$r?.method?`${$r.method} `:"",$r?.url??Un?.url??"-"]}),typeof Un?.status=="number"&&a.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["HTTP ",Un.status]}),$r?.bodyText&&a.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded bg-muted p-2 text-xs",children:$r.bodyText}),Un?.bodyText&&a.jsx("pre",{className:"mt-2 max-h-48 overflow-auto rounded bg-muted p-2 text-xs",children:Xj(Un.bodyText)})]},`${se.id}-exchange-${or}`)})})]})]},se.id)})||a.jsx("p",{className:"text-sm text-muted-foreground",children:"No steps yet."})})]})]}),a.jsx("div",{className:"space-y-4 xl:col-span-1 min-w-0",children:a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(It,{className:"text-base",children:"Inspect"}),a.jsx(Hr,{children:"Live events and network requests/responses for the OAuth flow."})]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{mn("raw")},disabled:!ce||!oe,children:[a.jsx(Oa,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})}),a.jsx(Ge,{className:"space-y-3",children:a.jsxs(Eg,{value:xe,onValueChange:se=>Ye(se),className:"min-w-0",children:[a.jsxs(Jf,{className:"grid grid-cols-2",children:[a.jsx(ks,{value:"inspector",children:"Network Inspector"}),a.jsx(ks,{value:"events",children:"Live Debug"})]}),a.jsx(Cf,{value:"events",className:"mt-3",children:a.jsxs("div",{className:"max-h-64 space-y-1 overflow-auto rounded-md border bg-muted/10 p-3 text-xs",children:[ve.length===0?a.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):ve.map((se,Je)=>a.jsxs("div",{className:"break-all",children:[a.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(se.ts).toLocaleTimeString()}),a.jsx(He,{variant:"outline",className:"mr-2 text-[10px]",children:se.type}),typeof se.payload.message=="string"?se.payload.message:JSON.stringify(se.payload)]},`${se.ts}-${Je}`)),a.jsx("div",{ref:Te})]})}),a.jsxs(Cf,{value:"inspector",className:"space-y-3 mt-3",children:[a.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Filter by step"}),a.jsxs(_n,{value:st,onValueChange:xt,children:[a.jsx(bn,{className:"h-8",children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"all",children:"All steps"}),(oe?.stepStates??[]).map(se=>a.jsxs(ot,{value:se.id,children:[Oe.get(se.id),". ",se.title]},se.id))]})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Filter by status"}),a.jsxs(_n,{value:qt,onValueChange:Ut,children:[a.jsx(bn,{className:"h-8",children:a.jsx(An,{})}),a.jsxs(wn,{children:[a.jsx(ot,{value:"all",children:"All"}),a.jsx(ot,{value:"ok",children:"Successful responses"}),a.jsx(ot,{value:"error",children:"Error responses"})]})]})]})]}),a.jsx("div",{className:"max-h-[34rem] min-w-0 space-y-2 overflow-auto",children:qe.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):qe.map(se=>a.jsxs("details",{className:"rounded-md border p-3",children:[a.jsx("summary",{className:"cursor-pointer list-none",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0 flex items-start gap-2",children:[a.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:Oe.get(se.stepId)}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-sm font-medium",children:se.label}),a.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[se.method?`${se.method} `:"",se.url]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(He,{variant:"outline",children:"request"}),a.jsx(He,{variant:"outline",children:"response"}),typeof se.response?.status=="number"&&a.jsx(He,{variant:se.response.status>=400?"destructive":"secondary",children:se.response.status})]})]})}),a.jsxs("div",{className:"mt-3 space-y-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-xs font-medium",children:"Request Headers"}),a.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(se.request?.headers??{},null,2)})]}),se.request?.bodyText&&a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-xs font-medium",children:"Request Body"}),a.jsx("pre",{className:"max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:se.request.bodyText})]}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-xs font-medium",children:"Response Headers"}),a.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(se.response?.headers??{},null,2)})]}),se.response?.bodyText&&a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-xs font-medium",children:"Response Body"}),a.jsx("pre",{className:"max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:se.response.bodyText})]}),a.jsx("div",{className:"flex gap-2",children:a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{b$(JSON.stringify(se,null,2))},children:[a.jsx(Ps,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},se.key))})]})]})})]})})]})}),s==="report"&&oe&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-semibold",children:"Report / Export"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"OAuth debug session summary, validations, and trace exports."})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{mn("json")},children:[a.jsx(Oa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{mn("markdown")},children:[a.jsx(Oa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{mn("raw")},children:[a.jsx(Oa,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),a.jsxs(Zo,{children:[a.jsx(Ny,{className:"h-4 w-4"}),a.jsx(el,{children:"Secrets display mode"}),a.jsx(tl,{children:oe.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."})]}),a.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[a.jsx(Ke,{children:a.jsxs(Ge,{className:"pt-4",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),a.jsx("div",{className:"text-lg font-semibold",children:oe.status})]})}),a.jsx(Ke,{children:a.jsxs(Ge,{className:"pt-4",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),a.jsx("div",{className:"text-lg font-semibold",children:oe.networkSummary.requestCount})]})}),a.jsx(Ke,{children:a.jsxs(Ge,{className:"pt-4",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Network errors"}),a.jsx("div",{className:"text-lg font-semibold",children:oe.networkSummary.errorCount})]})}),a.jsx(Ke,{children:a.jsxs(Ge,{className:"pt-4",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Validation findings"}),a.jsx("div",{className:"text-lg font-semibold",children:oe.validations.length})]})})]}),a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Key values"})}),a.jsxs(Ge,{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx(ze,{className:"text-xs",children:"Issuer"}),a.jsx("p",{className:"text-sm break-all",children:oe.summary?.issuer||"-"})]}),a.jsxs("div",{children:[a.jsx(ze,{className:"text-xs",children:"Client ID"}),a.jsx("p",{className:"text-sm break-all",children:oe.summary?.clientId||"-"})]}),a.jsxs("div",{children:[a.jsx(ze,{className:"text-xs",children:"Redirect URI"}),a.jsx("p",{className:"text-sm break-all",children:oe.summary?.redirectUri||"-"})]}),a.jsxs("div",{children:[a.jsx(ze,{className:"text-xs",children:"Token endpoint status"}),a.jsx("p",{className:"text-sm",children:oe.summary?.tokenEndpointStatus??"-"})]}),a.jsxs("div",{children:[a.jsx(ze,{className:"text-xs",children:"Token type"}),a.jsx("p",{className:"text-sm",children:oe.summary?.tokenType||"-"})]}),a.jsxs("div",{children:[a.jsx(ze,{className:"text-xs",children:"Scopes granted"}),a.jsx("p",{className:"text-sm break-all",children:(oe.summary?.grantedScopes??[]).join(", ")||"-"})]}),a.jsxs("div",{children:[a.jsx(ze,{className:"text-xs",children:"Token validity"}),a.jsxs("p",{className:"text-sm",children:[typeof oe.summary?.accessTokenValidForSeconds=="number"?`${tN(oe.summary.accessTokenValidForSeconds)} remaining`:typeof oe.summary?.accessTokenExpiresInSeconds=="number"?`${tN(oe.summary.accessTokenExpiresInSeconds)} from issuance`:"No expiry advertised by token endpoint",oe.summary?.accessTokenExpiresAt?` (until ${new Date(oe.summary.accessTokenExpiresAt).toLocaleTimeString()})`:""]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Source:"," ",oe.summary?.accessTokenExpirySource==="expires_in"?"token endpoint expires_in":oe.summary?.accessTokenExpirySource==="jwt_exp"?"JWT exp claim":"not available"]})]}),a.jsxs("div",{children:[a.jsx(ze,{className:"text-xs",children:"Refresh option"}),a.jsx("p",{className:"text-sm",children:oe.summary?.refreshTokenAvailable?"Refresh token available (silent refresh possible)":"No refresh token in response (full login likely required after expiry)"})]}),oe.summary?.accessToken&&a.jsxs("div",{className:"md:col-span-2 space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Access token"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("code",{className:"flex-1 truncate rounded bg-muted px-2 py-1 text-xs font-mono text-muted-foreground",children:[oe.summary.accessToken.slice(0,48),"…"]}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",className:"shrink-0 h-7 px-2 text-xs",onClick:()=>{b$(oe.summary.accessToken)},children:[a.jsx(Ps,{className:"mr-1 h-3 w-3"}),"Copy token"]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:['Visible because "Hide sensitive values" is off. Use this token with the CLI via'," ",a.jsx("code",{className:"font-mono",children:"--oauth-token"}),"."]})]})]})]}),a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Validation findings"})}),a.jsx(Ge,{className:"space-y-2",children:oe.validations.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):oe.validations.map((se,Je)=>a.jsxs("div",{className:"rounded-md border p-3",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.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:Je+1}),a.jsx("span",{className:"font-bold",children:se.title})]}),a.jsx(He,{variant:ir(se.severity),children:se.severity})]}),a.jsxs("p",{className:"text-sm",children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",se.detail]}),se.recommendation&&a.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-xs",children:[a.jsx("div",{className:"mb-1 font-medium text-muted-foreground",children:"Suggested improvement"}),a.jsx("p",{children:se.recommendation})]}),a.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",se.stepId,se.specReference&&a.jsxs(a.Fragment,{children:[" · ",a.jsx("a",{href:se.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},se.id))})]})]})]})}function Kxe(e){const t=e.filter(n=>typeof n.sourcePath=="string"&&n.sourcePath.trim().length>0&&typeof n.relativePath=="string"&&n.relativePath.trim().length>0).map(n=>[n.sourcePath,n.relativePath]);return new Map(t)}function Gxe(e){const t=e.filter(n=>typeof n.sourcePath=="string"&&n.sourcePath.trim().length>0).map(n=>[n.sourcePath,n.configName?.trim()||n.name]);return new Map(t)}function Yxe(e,t){const n=new Map;for(const r of e){if(!r.sourcePath)continue;const s=new Map,i=r.scenarioEntries&&r.scenarioEntries.length>0?r.scenarioEntries:r.scenarios.map(o=>({kind:"inline",scenario:o}));for(const o of i){if(o.kind==="inline"){s.set(o.scenario.id,o.scenario.name?.trim()||o.scenario.id);continue}const c=t.find(d=>d.id===o.ref);s.set(o.ref,c?.name?.trim()||o.ref)}n.set(r.sourcePath,s)}return n}function w$(e,t){const n=t.get(e);if(n)return n;const r=e.replace(/\\/g,"/"),s="/evals/",i=r.lastIndexOf(s);if(i>=0)return r.slice(i+s.length);const o=r.split("/").filter(Boolean);return o.length<=1?r:o.slice(-3).join("/")}function j$(e,t,n){const r=t.get(n);if(!e||e.length===0){if(r&&r.size===1){const i=r.values().next().value;if(i)return i}return"All scenarios"}if(!r)return e.length===1?e[0]:`${e[0]} +${e.length-1}`;const s=e.map(i=>r.get(i)??i);return s.length===1?s[0]:`${s[0]} +${s.length-1}`}const Qj="mcplab.runEvaluation.activeJobId";function Xxe(e){return e.configName?.trim()||e.name}function Qxe(e){if(e.suitePath?.trim())return e.suitePath.trim();if(e.relativePath?.includes("/")){const t=e.relativePath.lastIndexOf("/");return e.relativePath.slice(0,t)}return null}const Jxe=()=>{const[e]=wi(),[t,n]=m.useState(""),[r,s]=m.useState("1"),[i,o]=m.useState(!1),[c,d]=m.useState(0),[f,h]=m.useState([]),[p,g]=m.useState(!1),[x,j]=m.useState(!1),[y,b]=m.useState(""),[N,C]=m.useState(null),[S,E]=m.useState([]),[A,k]=m.useState([]),[T,O]=m.useState(!0),[D,q]=m.useState(""),[U,B]=m.useState(""),[X,W]=m.useState(!1),[M,z]=m.useState([]),[K,V]=m.useState(null),[R,G]=m.useState(!1),[$,I]=m.useState(null),ee=m.useRef(null),Q=m.useRef(null),ie=m.useRef(!1),{configs:ue,reload:re}=Df(),{source:je}=Ln(),pe=Og("snapshots",!1),{agents:oe,scenarios:_e,servers:ce,reload:de}=os(),ve=y.trim(),Pe=ve?`/results/${encodeURIComponent(ve)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",F=ue.find(ge=>ge.id===t),te=m.useMemo(()=>Kxe(ue),[ue]),fe=m.useMemo(()=>Gxe(ue),[ue]),Ee=m.useMemo(()=>Yxe(ue,_e),[ue,_e]),Me=e.get("configId"),et=m.useMemo(()=>{if(!F)return[];const ge=new Map,qe=F.agentEntries&&F.agentEntries.length>0?F.agentEntries:F.agents.map(Ve=>({kind:"inline",agent:Ve}));for(const Ve of qe){if(Ve.kind==="inline"){const Oe=Ve.agent.id;ge.has(Oe)||ge.set(Oe,Ve.agent);continue}const St=oe.find(Oe=>Oe.id===Ve.ref);St&&!ge.has(St.id)&&ge.set(St.id,St)}for(const Ve of oe)ge.has(Ve.id)||ge.set(Ve.id,Ve);return Array.from(ge.values())},[F,oe]),st=m.useMemo(()=>{if(!F)return[];const ge=new Map,qe=F.scenarioEntries&&F.scenarioEntries.length>0?F.scenarioEntries:F.scenarios.map(Ve=>({kind:"inline",scenario:Ve}));for(const Ve of qe){if(Ve.kind==="inline"){ge.has(Ve.scenario.id)||ge.set(Ve.scenario.id,Ve.scenario);continue}const St=_e.find(Oe=>Oe.id===Ve.ref);St&&!ge.has(St.id)&&ge.set(St.id,St)}return Array.from(ge.values())},[F,_e]);m.useEffect(()=>{Me&&ue.some(ge=>ge.id===Me)&&n(Me)},[Me,ue]);const xt=m.useRef("");m.useEffect(()=>{const ge=F?`${F.id}::${F.sourcePath??""}`:"";if(ge===xt.current)return;if(xt.current=ge,!F){E([]),k([]);return}const qe=et.filter(Ve=>(F.runDefaults?.selectedAgentNames??[]).includes(Ve.id)).map(Ve=>Ve.id);E(qe.length>0?qe:et.map(Ve=>Ve.id)),k(st.map(Ve=>Ve.id)),O(!0)},[F?.id,F?.sourcePath,et,st]);const qt=async()=>{if(!F?.sourcePath){h(Oe=>[...Oe,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const ge=et.filter(Oe=>S.includes(Oe.id));if(ge.length===0){h(Oe=>[...Oe,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const qe=st.filter(Oe=>A.includes(Oe.id));if(qe.length===0){h(Oe=>[...Oe,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}const Ve=Array.from(new Set(qe.flatMap(Oe=>Oe.serverIds||[]).filter(Oe=>{const Ze=(F.servers??[]).find(at=>at.id===Oe),we=ce.find(at=>at.id===Oe);return(Ze||we)?.authType==="oauth2"})));try{Ve.length>0&&(G(!0),await di({serverNames:Ve,source:je,onServerAuthStart:Oe=>{h(Ze=>[...Ze,`[${new Date().toLocaleTimeString()}] OAuth login required for '${Oe}'. Complete the browser sign-in flow...`])}}),h(Oe=>[...Oe,`[${new Date().toLocaleTimeString()}] OAuth login completed for required server(s): ${Ve.join(", ")}.`]))}catch(Oe){const Ze=Oe instanceof Error?Oe.message:String(Oe);h(we=>[...we,`[${new Date().toLocaleTimeString()}] OAuth error: ${Ze}`]),G(!1);return}finally{G(!1)}o(!0),g(!1),j(!1),b("");const St=(F.serverEntries??[]).some(Oe=>Oe.kind==="referenced")||(F.agentEntries??[]).some(Oe=>Oe.kind==="referenced")||(F.scenarioEntries??[]).some(Oe=>Oe.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${F.name} mode=${St} agents=${ge.map(Oe=>Oe.name||Oe.id).join(", ")} tests=${qe.map(Oe=>Oe.id).join(", ")} runs=${Number(r)} snapshotEval=${pe&&T?"on":"off"}${D.trim()?` note=${D.trim()}`:""}`]),d(10);try{const{jobId:Oe}=await je.startRun({configPath:F.sourcePath,runsPerScenario:Number(r),agents:ge.map(Ze=>Ze.id),scenarioIds:qe.map(Ze=>Ze.id),applySnapshotEval:pe?T:!1,runNote:D.trim()?D.trim():void 0});C(Oe),Te(Oe),Ct(Oe),Ie()}catch(Oe){const Ze=Oe instanceof Error?Oe.message:String(Oe),we=Ze.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.":"";h(at=>[...at,`[${new Date().toLocaleTimeString()}] Error: ${Ze}${we}`]),o(!1),d(0),C(null),G(!1)}},Ut=()=>{qt()},xe=()=>{N&&je.stopRun(N),Q.current?.(),Q.current=null,he(),C(null),o(!1),g(!1),j(!0),h(ge=>[...ge,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),Ie()},Ye=async()=>{if(y){W(!0);try{const ge=await je.createSnapshotFromRun(y,U.trim()||void 0);ke({title:"Snapshot saved",description:`Created ${ge.name} (${ge.id})`}),U.trim()||B(ge.name)}catch(ge){ke({title:"Could not save snapshot",description:ge instanceof Error?ge.message:String(ge),variant:"destructive"})}finally{W(!1)}}};m.useEffect(()=>{ee.current&&(ee.current.scrollTop=ee.current.scrollHeight)},[f]),m.useEffect(()=>()=>{Q.current?.()},[]),m.useEffect(()=>{if(N||p)return;let ge="";try{ge=sessionStorage.getItem(Qj)??""}catch{ge=""}if(ge)return C(ge),o(!0),g(!1),j(!1),h(qe=>qe.length>0?qe:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),Ct(ge),()=>{}},[N,p]);const he=()=>{try{sessionStorage.removeItem(Qj)}catch{}},Te=ge=>{try{sessionStorage.setItem(Qj,ge)}catch{}},Ie=async()=>{try{const ge=await je.getRunQueue();z(ge.queued),V(ge.active);const qe=ge.queued.find(Ve=>Ve.status==="blocked_auth"&&Ve.blockedReason==="oauth_required");qe&&(qe.requiredServers??[]).length>0?I(Ve=>Ve?.jobId===qe.jobId?Ve:{jobId:qe.jobId,servers:qe.requiredServers}):ge.queued.some(Ve=>Ve.status==="blocked_auth")||I(null)}catch{}},Ot=()=>{re(),de()};m.useEffect(()=>{Ot(),Ie();const ge=()=>{Ot(),Ie()};return window.addEventListener("focus",ge),()=>{window.removeEventListener("focus",ge)}},[re,de]);const Ht=async ge=>{try{await je.removeQueuedRun(ge),z(qe=>qe.filter(Ve=>Ve.jobId!==ge))}catch(qe){const Ve=qe instanceof Error?qe.message:String(qe);if(Ve.includes("Use the /stop endpoint"))try{await je.stopRun(ge)}catch{}else ke({title:"Could not remove queued run",description:Ve,variant:"destructive"})}Ie()},Ct=ge=>{N===ge&&Q.current||(Q.current?.(),Q.current=je.subscribeRunJob(ge,qe=>{const Ve=new Date(qe.ts).toLocaleTimeString();if(qe.type==="queued"){h(St=>{const Oe=qe.payload.position?` (position ${qe.payload.position})`:"",Ze=`[${Ve}] Run queued${Oe}. Waiting for active run to finish...`;return St.includes(Ze)?St:[...St,Ze]}),d(5);return}if(qe.type==="oauth_required"){const St=Array.isArray(qe.payload.servers)?qe.payload.servers:[],Oe=String(qe.payload.jobId??"");I({jobId:Oe,servers:St}),h(Ze=>{const we=`[${Ve}] OAuth required for server(s): ${St.join(", ")}. Click "Connect & Resume" to authenticate.`;return Ze.includes(we)?Ze:[...Ze,we]});return}if(qe.type==="started"&&(I(null),ie.current=!1,o(!0),g(!1),j(!1),h(St=>{const Oe=`[${Ve}] Run started.`;return St.includes(Oe)?St:[...St,Oe]}),d(St=>Math.max(St,30)),Ie()),qe.type==="log"){const St=String(qe.payload.message??"").trim();St&&(h(Oe=>{const Ze=`[${Ve}] ${St}`;return Oe.includes(Ze)?Oe:[...Oe,Ze]}),d(Oe=>{const Ze=St.toLowerCase();if(Ze.startsWith("loading mcp evaluation config"))return Math.max(Oe,15);if(Ze.startsWith("loaded config"))return Math.max(Oe,20);if(Ze.startsWith("selected "))return Math.max(Oe,30);if(Ze.startsWith("using requested agents")||Ze.startsWith("using resolved default agents"))return Math.max(Oe,35);if(Ze.startsWith("expanded to "))return Math.max(Oe,45);if(Ze.startsWith("running evaluation"))return Math.max(Oe,50);const we=Ze.match(/^scenario (\d+)\/(\d+) finished:/);if(we){const at=Number(we[1]),wt=Number(we[2]);return Math.max(Oe,50+Math.round(at/wt*25))}return Ze.startsWith("evaluation execution finished")?Math.max(Oe,78):Ze.startsWith("applying snapshot evaluation policy")?Math.max(Oe,82):Ze.includes("snapshot evaluation applied")||Ze.includes("snapshot evaluation enabled")?Math.max(Oe,88):Ze.startsWith("writing results to ")?Math.max(Oe,94):Ze.startsWith("run finished:")?Math.max(Oe,98):Oe}))}if(qe.type==="completed"){const St=String(qe.payload.runId??"").trim();if(I(null),ie.current=!1,h(Oe=>{const Ze=`[${Ve}] Run completed.`;return Oe.includes(Ze)?Oe:[...Oe,Ze]}),qe.payload.snapshotEval&&typeof qe.payload.snapshotEval=="object"){const Oe=qe.payload.snapshotEval;h(Ze=>{const we=`[${Ve}] Snapshot eval (${Oe.mode??"warn"}) baseline=${Oe.baseline_snapshot_id??"-"} score=${Oe.overall_score??"-"} status=${Oe.status??"-"}`;return Ze.includes(we)?Ze:[...Ze,we]})}d(100),o(!1),g(!0),j(!1),b(St),he(),C(null),Q.current?.(),Q.current=null,Ie()}if(qe.type==="error"){const St=String(qe.payload.message??"Unknown error"),Oe=St.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.":"";I(null),ie.current=!1,h(Ze=>[...Ze,`[${Ve}] Error: ${St}${Oe}`]),o(!1),g(!1),j(!1),d(0),he(),C(null),Q.current?.(),Q.current=null,Ie()}}))};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(ii,{className:"h-6 w-6"}),"Run Evaluation"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Execute evaluation scenarios against MCP servers"})]}),a.jsx(Ke,{children:a.jsxs(Ge,{className:"pt-6 space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(ze,{children:"MCP Evaluation"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(_n,{value:t,onValueChange:n,children:[a.jsx(bn,{children:a.jsx(An,{placeholder:"Select a config"})}),a.jsx(wn,{children:ue.map(ge=>{const qe=Qxe(ge);return a.jsxs(ot,{value:ge.id,children:[a.jsx("span",{children:Xxe(ge)}),qe&&a.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",qe,")"]})]},ge.id)})})]}),a.jsx(ne,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:Ot,"aria-label":"Refresh configs",title:"Refresh configs",children:a.jsx(ba,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ze,{children:"Variance Runs"}),a.jsx(bt,{type:"number",min:"1",max:"10",value:r,onChange:ge=>s(ge.target.value)})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ze,{htmlFor:"run-note",children:"Run Note"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[D.length,"/500"]})]}),a.jsx(Is,{id:"run-note",value:D,onChange:ge=>q(ge.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),F&&a.jsxs("div",{className:"space-y-2",children:[pe&&F.snapshotEval?.enabled&&a.jsxs("div",{className:"rounded-md border bg-amber-500/10 p-2 text-xs text-amber-700 dark:text-amber-300",children:["Snapshot eval active (",F.snapshotEval.mode,") · baseline:"," ",a.jsx("span",{className:"font-mono",children:F.snapshotEval.baselineSnapshotId??"none"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ze,{children:"Agents"}),a.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[a.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E(et.map(ge=>ge.id)),children:"Select all"}),a.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E([]),children:"Clear"})]})]}),a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:et.map(ge=>{const qe=S.includes(ge.id);return a.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[a.jsx(Jr,{checked:qe,onCheckedChange:Ve=>{const St=Ve===!0;E(Oe=>St?[...Oe,ge.id]:Oe.filter(Ze=>Ze!==ge.id))}}),a.jsx("span",{children:ge.name||ge.id})]},ge.id)})}),et.length===0&&a.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."})]}),F&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ze,{children:"Tests"}),a.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[a.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>k(st.map(ge=>ge.id)),children:"Select all"}),a.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>k([]),children:"Clear"})]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.length," of ",st.length," selected"]}),a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:st.map(ge=>{const qe=A.includes(ge.id);return a.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[a.jsx(Jr,{checked:qe,onCheckedChange:Ve=>{const St=Ve===!0;k(Oe=>St?[...Oe,ge.id]:Oe.filter(Ze=>Ze!==ge.id))}}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block font-medium",children:ge.name||ge.id}),a.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:ge.id})]})]},ge.id)})})]}),pe&&a.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[a.jsx(Jr,{checked:T,onCheckedChange:ge=>O(ge===!0)}),a.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(ne,{onClick:Ut,disabled:!t||R||et.length>0&&S.length===0||st.length>0&&A.length===0,children:[a.jsx(ii,{className:"mr-2 h-4 w-4"}),K?"Queue Run":"Run"]}),i&&a.jsxs(ne,{variant:"destructive",onClick:xe,children:[a.jsx(_d,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(It,{className:"text-base",children:"Progress"}),a.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),a.jsxs(Ge,{className:"space-y-4",children:[a.jsx(Dg,{value:c,className:"h-2"}),$&&a.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:[a.jsxs("span",{className:"text-yellow-700 dark:text-yellow-400",children:["OAuth required for: ",a.jsx("strong",{children:$.servers.join(", ")})]}),a.jsx(ne,{size:"sm",variant:"outline",disabled:R,onClick:()=>{ie.current||(ie.current=!0,G(!0),di({serverNames:$.servers,source:je,onServerAuthStart:ge=>{h(qe=>[...qe,`[${new Date().toLocaleTimeString()}] OAuth sign-in opened for '${ge}'...`])}}).then(()=>je.resumeQueue()).then(()=>{const ge=$?.jobId;h(qe=>[...qe,`[${new Date().toLocaleTimeString()}] OAuth complete. Resuming run...`]),ge&&(C(ge),Te(ge),o(!0),g(!1),Ct(ge))}).catch(ge=>{const qe=ge instanceof Error?ge.message:String(ge);h(Ve=>[...Ve,`[${new Date().toLocaleTimeString()}] OAuth error: ${qe}`]),ie.current=!1}).finally(()=>{G(!1)}))},children:R?"Connecting...":"Connect & Resume"})]}),a.jsx("div",{ref:ee,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((ge,qe)=>a.jsx("div",{className:ge.includes("✓")?"text-success":ge.includes("aborted")?"text-destructive":"text-foreground",children:ge},qe))})]})]}),a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(It,{className:"inline-flex items-center gap-2 text-base",children:[a.jsx(yi,{className:"h-4 w-4"}),"Run Queue"]}),a.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>{Ie()},children:a.jsx(ba,{className:"h-3 w-3"})})]})}),a.jsx(Ge,{children:!K&&M.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No active or queued runs. Start a run above."}):a.jsxs("div",{className:"space-y-2",children:[K&&a.jsxs("div",{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 ${N===K.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{N!==K.jobId&&(C(K.jobId),Te(K.jobId),o(!0),g(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${K.jobId}...`]),d(10),Ct(K.jobId))},title:"Click to view progress",children:[a.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[a.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"}),a.jsx("span",{className:"text-xs font-bold",children:fe.get(K.runParams.configPath)||j$(K.runParams.scenarioIds,Ee,K.runParams.configPath)}),a.jsx("span",{className:"font-mono text-xs",children:w$(K.runParams.configPath,te)}),K.runParams.agents&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",K.runParams.agents.join(", ")]}),K.runParams.runNote&&a.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",K.runParams.runNote]})]}),a.jsxs(ne,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:ge=>{ge.stopPropagation(),K&&(je.stopRun(K.jobId),Ie())},title:"Stop running job",children:[a.jsx(_d,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),M.map((ge,qe)=>{const Ve=w$(ge.runParams.configPath,te),St=j$(ge.runParams.scenarioIds,Ee,ge.runParams.configPath),Oe=fe.get(ge.runParams.configPath)||St,Ze=ge.status==="blocked_auth";return a.jsxs("div",{className:`flex items-center justify-between rounded-md border p-2 text-sm ${Ze?"border-yellow-500/40 bg-yellow-500/5":""}`,children:[a.jsxs("div",{className:"min-w-0 flex items-center gap-2 flex-wrap",children:[Ze?a.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:["#",qe+1," Blocked"]}):a.jsxs("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:["#",qe+1," Queued"]}),a.jsx("span",{className:"text-xs font-bold",children:Oe}),a.jsx("span",{className:"font-mono text-xs",children:Ve}),Ze&&(ge.requiredServers??[]).length>0&&a.jsxs("span",{className:"text-xs text-yellow-700 dark:text-yellow-400",children:["OAuth: ",ge.requiredServers.join(", ")]}),!Ze&&ge.runParams.agents&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",ge.runParams.agents.join(", ")]}),ge.runParams.runNote&&a.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",ge.runParams.runNote]})]}),a.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[Ze&&a.jsx(ne,{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:R,onClick:()=>{if(ie.current)return;const we=ge.requiredServers??[];we.length!==0&&(ie.current=!0,I({jobId:ge.jobId,servers:we}),G(!0),di({serverNames:we,source:je,onServerAuthStart:at=>{h(wt=>[...wt,`[${new Date().toLocaleTimeString()}] OAuth sign-in opened for '${at}'...`])}}).then(()=>je.resumeQueue()).then(()=>{h(at=>[...at,`[${new Date().toLocaleTimeString()}] OAuth complete. Resuming run...`]),C(ge.jobId),Te(ge.jobId),o(!0),g(!1),Ct(ge.jobId)}).catch(at=>{const wt=at instanceof Error?at.message:String(at);h(Dt=>[...Dt,`[${new Date().toLocaleTimeString()}] OAuth error: ${wt}`]),ie.current=!1}).finally(()=>{G(!1)}))},children:R&&$?.jobId===ge.jobId?"Connecting...":"Connect & Resume"}),a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{Ht(ge.jobId)},title:"Remove from queue",children:a.jsx(rs,{className:"h-4 w-4"})})]})]},ge.jobId)})]})})]}),x&&!i&&!p&&a.jsx(Ke,{className:"border-amber-300/60 bg-amber-50/40",children:a.jsx(Ge,{className:"pt-6",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(_d,{className:"h-5 w-5 text-amber-700"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"font-medium",children:"Run stopped"}),a.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."})]}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx(ne,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),a.jsxs(ne,{type:"button",onClick:Ut,disabled:!t,children:[a.jsx(ii,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&a.jsx(Ke,{className:"border-success/50",children:a.jsxs(Ge,{className:"pt-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(si,{className:"h-6 w-6 text-success"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Evaluation Complete"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"All scenarios have been evaluated successfully."})]}),a.jsx(ne,{asChild:!0,className:"ml-auto",children:a.jsx(Tt,{to:Pe,children:ve?"View Results":"View Runs"})})]}),pe&&ve&&a.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(ze,{className:"text-xs",children:"Snapshot name (optional)"}),a.jsx(bt,{value:U,onChange:ge=>B(ge.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),a.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>{Ye()},disabled:X,children:X?"Saving...":"Save Snapshot"})]})]})})]})};function B6({title:e,description:t,expanded:n,onToggleExpanded:r,onHide:s,messages:i,pendingToolCalls:o,loading:c,input:d,onInputChange:f,onSend:h,onCancel:p,inputPlaceholder:g,snippets:x,snippetsLabel:j="Result Assistant Snippets",onSnippetSelect:y,onApproveToolCall:b,onDenyToolCall:N,chatEndRef:C,inputRef:S,renderMessage:E,renderMessageExtras:A,className:k="min-w-0 overflow-hidden xl:flex xl:h-full xl:min-h-0 xl:flex-col",contentClassName:T="flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1"}){return a.jsxs(Ke,{className:k,children:[a.jsx(Rt,{className:"border-b px-4 py-3",children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs(It,{className:"flex items-center gap-2 text-base",children:[a.jsx(Vr,{className:"h-4 w-4 text-amber-500"}),e]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:r,children:[n?a.jsx(sS,{className:"h-3.5 w-3.5"}):a.jsx(iS,{className:"h-3.5 w-3.5"}),n?"Compact":"Expand"]}),a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:s,children:"Hide"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:t})]})}),a.jsxs(Ge,{className:T,children:[a.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-muted/15 px-4 py-4",children:a.jsxs("div",{className:"space-y-3 pr-2",children:[i.map((O,D)=>{const q=O.role==="user",U=O.role==="assistant",B=O.role==="system",X=O.role==="tool",W=O.pendingToolCallId?o.find(z=>z.id===O.pendingToolCallId):void 0;return E?E({message:O,index:D,linkedPendingToolCall:W,isUser:q,isAssistant:U,isSystem:B,isTool:X}):U&&!!O.pendingToolCallId?a.jsxs("div",{className:"rounded-md border bg-background p-3",children:[a.jsx(Ma,{text:O.text,className:"text-sm"}),W&&a.jsx(Z1,{call:W,loading:c,onApprove:b,onDeny:N,className:"mt-3"})]},`${O.id??`${O.role}-${D}`}-tool`):a.jsx(n8,{message:O},O.id??`${O.role}-${D}`)}),A,c&&a.jsx(r8,{}),a.jsx("div",{ref:C})]})}),a.jsx("div",{className:"border-t bg-background px-4 py-3",children:a.jsx(a8,{input:d,onInputChange:f,onSend:h,onCancel:p,inputPlaceholder:g,snippets:x,snippetsLabel:j,onSnippetSelect:y,loading:c,inputRef:S})})]})]})}function yd(e){return e instanceof BN&&e.status===404}function q6(e){const{source:t,open:n,scope:r,runId:s,onSessionSync:i}=e,[o,c]=m.useState(null),[d,f]=m.useState([]),[h,p]=m.useState([]),[g,x]=m.useState(""),[j,y]=m.useState(!1),[b,N]=m.useState(!1),C=m.useRef(null),S=m.useRef(null),E=m.useRef(0),A=m.useRef(t),k=m.useRef(i),T=m.useRef(null),O=m.useRef(null);m.useEffect(()=>{C.current=o},[o]),m.useEffect(()=>{A.current=t},[t]),m.useEffect(()=>{k.current=i},[i]);const D=m.useCallback(()=>{const R=S.current;R&&R.controller.abort()},[]),q=m.useCallback((R,G)=>{c(G??R.id),f($=>$.length>R.messages.length?$:R.messages),p(R.pendingToolCalls),k.current?.(R)},[]),U=m.useCallback(async(R,G)=>{const $=G.session.id||R;q(G.session,$)},[q]),B=m.useCallback(()=>{const R=S.current;R&&(D(),x(R.prompt),y(!1),N(!1))},[D]),X=m.useCallback(async()=>{const R=g.trim();if(!R||r==="run"&&!s)return;const G=++E.current,$=new AbortController,I=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ee={id:I,role:"user",text:R,createdAt:new Date().toISOString()};S.current={id:G,controller:$,prompt:R},N(!0),x(""),f(Q=>[...Q,ee]),y(!0);try{let Q=o;if(!Q){const ie=r==="run"&&s?await t.createResultAssistantSession({runId:s,scope:"run"},$.signal):await t.createResultAssistantSession({scope:"all_runs"},$.signal);if($.signal.aborted||S.current?.id!==G)return;Q=ie.sessionId||ie.session.id,q(ie.session,Q),f(ue=>ue.some(je=>je.id===I)?[...ie.session.messages,ee]:ie.session.messages)}try{const ie=await t.sendResultAssistantMessage(Q,R,$.signal);if($.signal.aborted||S.current?.id!==G)return;await U(Q,ie)}catch(ie){if(eN(ie)||$.signal.aborted||S.current?.id!==G)return;if(!yd(ie))throw ie;const ue=r==="run"&&s?await t.createResultAssistantSession({runId:s,scope:"run"},$.signal):await t.createResultAssistantSession({scope:"all_runs"},$.signal);if($.signal.aborted||S.current?.id!==G)return;const re=ue.sessionId||ue.session.id;if(q(ue.session,re),f(pe=>pe.some(_e=>_e.id===I)?[...ue.session.messages,ee]:ue.session.messages),$.signal.aborted||S.current?.id!==G)return;const je=await t.sendResultAssistantMessage(re,R,$.signal);if($.signal.aborted||S.current?.id!==G)return;await U(re,je)}}catch(Q){if(eN(Q)||$.signal.aborted||S.current?.id!==G)return;f(ie=>ie.filter(ue=>ue.id!==I)),ke({title:"MCP Lab Assistant error",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}finally{S.current?.id===G&&(S.current=null,y(!1),N(!1))}},[g,r,s,o,t,q,U]),W=m.useCallback(async R=>{if(o){N(!1),y(!0);try{const G=await t.approveResultAssistantToolCall(o,R);await U(o,G)}catch(G){yd(G)&&(c(null),p([])),ke({title:"Could not approve assistant action",description:yd(G)?"Assistant session expired. Ask a new question to start a fresh session.":G instanceof Error?G.message:String(G),variant:"destructive"})}finally{y(!1)}}},[o,t,U]),M=m.useCallback(async R=>{if(o){N(!1),y(!0);try{const G=await t.denyResultAssistantToolCall(o,R);await U(o,G)}catch(G){yd(G)&&(c(null),p([])),ke({title:"Could not deny assistant action",description:yd(G)?"Assistant session expired. Ask a new question to start a fresh session.":G instanceof Error?G.message:String(G),variant:"destructive"})}finally{y(!1)}}},[o,t,U]),z=m.useCallback(()=>{D();const R=C.current;R&&t.closeResultAssistantSession(R).catch(()=>{}),C.current=null,c(null),f([]),p([]),x(""),N(!1)},[D,t]),K=m.useCallback(R=>{f(G=>G.length>0?G:[{id:`msg-${Date.now()}`,role:"assistant",text:R,createdAt:new Date().toISOString()}])},[]),V=m.useCallback(R=>{x(R),requestAnimationFrame(()=>O.current?.focus())},[]);return m.useEffect(()=>{if(!n)return;const R=window.setTimeout(()=>{T.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(R)},[n,d.length,j]),m.useEffect(()=>{const R=O.current;if(!R)return;R.style.height="0px";const G=Math.min(R.scrollHeight,160);R.style.height=`${Math.max(40,G)}px`},[g,n]),m.useEffect(()=>{if(!(!n||!o))return A.current.subscribeResultAssistantSessionEvents(o,R=>{q(R.payload.session,R.payload.sessionId)})},[n,o,q]),m.useEffect(()=>()=>{D();const R=C.current;R&&A.current.closeResultAssistantSession(R).catch(()=>{})},[D]),{assistantSessionId:o,assistantMessages:d,assistantPendingToolCalls:h,assistantInput:g,assistantLoading:j,assistantTurnCancelable:b,cancelAssistantTurn:B,assistantChatEndRef:T,assistantInputRef:O,setAssistantInput:x,setAssistantMessages:f,askAssistant:X,approveResultAssistantToolCall:W,denyResultAssistantToolCall:M,applyResultAssistantSnippet:V,ensureIntroMessage:K,resetAssistantSession:z}}function Bh(e){const t=String(e??"").trim();return t&&(t.split("::").pop()??t).replace(/^mcplab__/,"").replace(/^mcplab_/,"").replace(/_/g," ").replace(/\s+/g," ").trim()||"unknown_tool"}const Zxe=8,Oh=[{value:"15min",label:"Last 15min",durationMs:900*1e3},{value:"1h",label:"Last hour",durationMs:3600*1e3},{value:"24h",label:"Last 24 hours",durationMs:1440*60*1e3},{value:"7d",label:"Last 7 days",durationMs:10080*60*1e3},{value:"30d",label:"Last 30 days",durationMs:720*60*60*1e3}];function _f(e){if(!e.trim())return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Rh(e){const t=_f(e);return t?t.toLocaleString():""}function eye(e){const t=_f(e);if(!t)return e;const n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${n}-${r}-${s}`}function tye(e){const t=_f(e);return t?t.toLocaleDateString(void 0,{weekday:"long",month:"short",day:"numeric",year:"numeric"}):"Unknown day"}function nye(e){return e==="all"||e==="last"||e==="custom"}function rye(e){return e==="15min"||e==="1h"||e==="24h"||e==="7d"||e==="30d"}function aye(e){const t=e.get("time_filter"),n=e.get("time_preset");return{mode:nye(t)?t:"all",preset:rye(n)?n:"15min",start:e.get("time_start")??"",end:e.get("time_end")??""}}const sye=[{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."}],iye=()=>{const[e,t]=wi(),{source:n}=Ln(),r=aye(e),[s,i]=m.useState([]),[o,c]=m.useState(!1),[d,f]=m.useState(null),[h,p]=m.useState(!1),[g,x]=m.useState("timestamp"),[j,y]=m.useState("desc"),[b,N]=m.useState("all"),[C,S]=m.useState(!1),[E,A]=m.useState(r.mode),[k,T]=m.useState(r.preset),[O,D]=m.useState(r.start),[q,U]=m.useState(r.end),[B,X]=m.useState(!1),[W,M]=m.useState(!1),[z,K]=m.useState(!1),V=xe=>{if(g===xe){y(Ye=>Ye==="asc"?"desc":"asc");return}x(xe),y(xe==="timestamp"?"desc":"asc")},R=async()=>{c(!0);try{i(await n.listResults())}catch(xe){ke({title:"Could not load results",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}finally{c(!1)}};m.useEffect(()=>{let xe=!0;return c(!0),n.listResults().then(Ye=>{xe&&i(Ye)}).catch(Ye=>{xe&&ke({title:"Could not load results",description:Ye instanceof Error?Ye.message:String(Ye),variant:"destructive"})}).finally(()=>{xe&&c(!1)}),()=>{xe=!1}},[n]);const{assistantMessages:G,assistantPendingToolCalls:$,assistantInput:I,assistantLoading:ee,assistantTurnCancelable:Q,cancelAssistantTurn:ie,assistantChatEndRef:ue,assistantInputRef:re,setAssistantInput:je,askAssistant:pe,approveResultAssistantToolCall:oe,denyResultAssistantToolCall:_e,applyResultAssistantSnippet:ce,ensureIntroMessage:de}=q6({source:n,open:W,scope:"all_runs"}),ve=m.useMemo(()=>{const xe=new Map;return s.forEach(Ye=>{Ye.scenarios.forEach(he=>{const Te=String(he.scenarioName??"").trim(),Ie=String(he.scenarioId??"").trim();if(Ie){xe.set(Ie,Te||Ie);return}Te&&xe.set(Te,Te)})}),Array.from(xe.entries()).map(([Ye,he])=>({value:Ye,label:he})).sort((Ye,he)=>Ye.label.localeCompare(he.label))},[s]);m.useEffect(()=>{const xe=(e.get("scenario")??"").trim();if(xe){if(ve.some(Ye=>Ye.value===xe||Ye.label===xe)){N(xe);return}s.length>0&&N("all")}},[e,ve,s.length]),m.useEffect(()=>{const xe=new URLSearchParams(e);E==="all"?(xe.delete("time_filter"),xe.delete("time_preset"),xe.delete("time_start"),xe.delete("time_end")):E==="last"?(xe.set("time_filter","last"),xe.set("time_preset",k),xe.delete("time_start"),xe.delete("time_end")):(xe.set("time_filter","custom"),xe.delete("time_preset"),O.trim()?xe.set("time_start",O.trim()):xe.delete("time_start"),q.trim()?xe.set("time_end",q.trim()):xe.delete("time_end")),xe.toString()!==e.toString()&&t(xe,{replace:!0})},[e,t,q,E,k,O]);const Pe=m.useMemo(()=>{const xe=b==="all"?s:s.filter(Ht=>Ht.scenarios.some(Ct=>{const ge=String(Ct.scenarioName??"").trim(),qe=String(Ct.scenarioId??"").trim();return ge===b||qe===b}));if(E==="all")return xe;const Ye=Date.now();if(E==="last"){const Ht=Oh.find(ge=>ge.value===k)??Oh[0],Ct=Ye-Ht.durationMs;return xe.filter(ge=>{const qe=new Date(ge.timestamp).getTime();return qe>=Ct&&qe<=Ye})}const he=_f(O)?.getTime()??null,Te=_f(q)?.getTime()??null,Ie=he!==null&&Te!==null?Math.min(he,Te):he??null,Ot=he!==null&&Te!==null?Math.max(he,Te):Te??null;return xe.filter(Ht=>{const Ct=new Date(Ht.timestamp).getTime();return!(Number.isNaN(Ct)||Ie!==null&&Ct<Ie||Ot!==null&&Ct>Ot)})},[s,b,q,E,k,O]),F=m.useMemo(()=>b==="all"?"All scenarios":ve.find(Ye=>Ye.value===b||Ye.label===b)?.label??b,[b,ve]),te=m.useMemo(()=>{if(E==="all")return"All time";if(E==="last")return Oh.find(he=>he.value===k)?.label??"Last range";const xe=!!O.trim(),Ye=!!q.trim();return!xe&&!Ye?"Custom range":xe&&Ye?`${Rh(O)} - ${Rh(q)}`:xe?`From ${Rh(O)}`:`Until ${Rh(q)}`},[q,E,k,O]),fe=m.useMemo(()=>{const xe=(he,Te)=>he===null&&Te===null?0:he===null?1:Te===null?-1:j==="asc"?he-Te:Te-he;return[...Pe].sort((he,Te)=>{if(g==="toolTokens")return xe(he.toolTokenUsage?.totalTokens??null,Te.toolTokenUsage?.totalTokens??null);let Ie=0;return g==="id"&&(Ie=he.id.localeCompare(Te.id)),g==="timestamp"&&(Ie=new Date(he.timestamp).getTime()-new Date(Te.timestamp).getTime()),g==="passRate"&&(Ie=he.overallPassRate-Te.overallPassRate),g==="scenarios"&&(Ie=he.totalScenarios-Te.totalScenarios),g==="avgToolCalls"&&(Ie=he.avgToolCalls-Te.avgToolCalls),j==="asc"?Ie:-Ie})},[Pe,g,j]),Ee=m.useMemo(()=>{const xe=[];let Ye=null;for(const he of fe){const Te=eye(he.timestamp);Te!==Ye&&(xe.push({type:"day-separator",dayKey:Te,dayLabel:tye(he.timestamp)}),Ye=Te),xe.push({type:"run",run:he})}return xe},[fe]),Me=xe=>g!==xe?a.jsx(wc,{className:"h-3.5 w-3.5 text-muted-foreground"}):j==="asc"?a.jsx(Cs,{className:"h-3.5 w-3.5"}):a.jsx(Qt,{className:"h-3.5 w-3.5"}),et=xe=>{const Ye=xe.toolTokenUsage?.totalTokens;return typeof Ye=="number"?Ye.toLocaleString():"n/a"},st=()=>{A("all"),T("15min"),D(""),U("")},xt=m.useMemo(()=>{const xe=new Map;for(const Ye of fe)xe.set(Ye.id,BC(Ye));return xe},[fe]),qt=()=>{M(!0),de("Ask me to compare runs, explain regressions over time, or summarize historical drift patterns.")},Ut=async xe=>{p(!0);try{await n.deleteResult(xe),i(Ye=>Ye.filter(he=>he.id!==xe)),ke({title:"Run deleted",description:xe}),f(null)}catch(Ye){ke({title:"Could not delete run",description:Ye instanceof Error?Ye.message:String(Ye),variant:"destructive"})}finally{p(!1)}};return a.jsxs("div",{className:"space-y-6",children:[a.jsx(Bs,{open:d!==null,onOpenChange:xe=>{!xe&&!h&&f(null)},children:a.jsxs(cs,{children:[a.jsxs(us,{children:[a.jsx(fs,{children:"Delete run?"}),a.jsxs(ps,{children:["This will permanently remove the run artifacts from disk for"," ",a.jsx("span",{className:"font-mono",children:d??""}),"."]})]}),a.jsxs(ds,{children:[a.jsx(ms,{disabled:h,children:"Cancel"}),a.jsx(hs,{disabled:h||!d,onClick:xe=>{xe.preventDefault(),d&&Ut(d)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:h?"Deleting...":"Delete run"})]})]})}),a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(Pc,{className:"h-6 w-6"}),"Results"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse evaluation runs and open detailed results"})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(pl,{open:C,onOpenChange:S,children:[a.jsx(hl,{asChild:!0,children:a.jsxs(ne,{type:"button",variant:"outline",role:"combobox","aria-expanded":C,className:"w-[260px] justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:F}),a.jsx(Qt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(co,{className:"w-[260px] p-0",align:"start",children:a.jsxs(vl,{children:[a.jsx(gl,{placeholder:"Search scenarios..."}),a.jsxs(xl,{children:[a.jsx(yl,{children:"No scenarios found."}),a.jsxs(bl,{children:[a.jsx(ma,{value:"all scenarios",onSelect:()=>{N("all"),S(!1)},children:"All scenarios"}),ve.map(xe=>a.jsx(ma,{value:`${xe.label} ${xe.value}`,onSelect:()=>{N(xe.value),S(!1)},children:xe.label},xe.value))]})]})]})})]}),a.jsxs(pl,{open:B,onOpenChange:X,children:[a.jsx(hl,{asChild:!0,children:a.jsxs(ne,{type:"button",variant:"outline",role:"combobox","aria-expanded":B,className:"w-[320px] justify-between font-normal",children:[a.jsxs("span",{className:"flex min-w-0 items-center gap-2 truncate text-left",children:[a.jsx(I7,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"truncate",children:te})]}),a.jsx(Qt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsxs(co,{className:"w-[360px] p-0",align:"start",children:[a.jsxs("div",{className:"border-b px-3 py-2",children:[a.jsx("p",{className:"text-sm font-medium",children:"Date and time filter"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Filter runs by timestamp."})]}),a.jsxs("div",{className:"grid gap-1 p-2",children:[a.jsx(ne,{type:"button",variant:E==="all"?"secondary":"ghost",className:"justify-start",onClick:()=>{st(),X(!1)},children:"All time"}),Oh.map(xe=>a.jsx(ne,{type:"button",variant:E==="last"&&k===xe.value?"secondary":"ghost",className:"justify-start",onClick:()=>{A("last"),T(xe.value),X(!1)},children:xe.label},xe.value)),a.jsx(ne,{type:"button",variant:E==="custom"?"secondary":"ghost",className:"justify-start",onClick:()=>A("custom"),children:"Custom date time range"})]}),E==="custom"&&a.jsxs("div",{className:"space-y-3 border-t p-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(ze,{htmlFor:"results-time-filter-start",children:"Start"}),a.jsx(bt,{id:"results-time-filter-start",type:"datetime-local",value:O,onChange:xe=>D(xe.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ze,{htmlFor:"results-time-filter-end",children:"End"}),a.jsx(bt,{id:"results-time-filter-end",type:"datetime-local",value:q,onChange:xe=>U(xe.target.value)})]}),a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs(ne,{type:"button",variant:"ghost",size:"sm",className:"px-2",onClick:st,children:[a.jsx(rs,{className:"mr-1.5 h-3.5 w-3.5"}),"Clear"]}),a.jsx(ne,{type:"button",size:"sm",onClick:()=>X(!1),children:"Done"})]})]})]})]}),a.jsx(ne,{variant:"outline",onClick:()=>{R()},disabled:o,children:o?"Refreshing...":"Refresh"}),a.jsxs(ne,{type:"button",variant:"outline",className:"gap-1.5",onClick:qt,children:[a.jsx(Vr,{className:"h-4 w-4 text-amber-500"}),"MCP Lab Assistant"]})]})]}),a.jsxs("div",{className:`grid gap-6 ${W?z?"xl:grid-cols-[minmax(0,1fr)_52rem]":"xl:grid-cols-[minmax(0,1fr)_30rem]":"grid-cols-1"}`,children:[a.jsx(Ke,{children:a.jsx(Ge,{className:"p-0",children:a.jsxs(Kr,{children:[a.jsx(Gr,{children:a.jsxs(Gt,{children:[a.jsx(it,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>V("id"),children:["Run ID",Me("id")]})}),a.jsx(it,{children:"Evaluated"}),a.jsx(it,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>V("timestamp"),children:["Timestamp",Me("timestamp")]})}),a.jsx(it,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex w-full items-center justify-end gap-1 hover:text-foreground",onClick:()=>V("passRate"),children:["Pass Rate",Me("passRate")]})}),a.jsx(it,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>V("scenarios"),children:["Scenarios",Me("scenarios")]})}),a.jsx(it,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>V("avgToolCalls"),children:["Avg Tool Calls",Me("avgToolCalls")]})}),a.jsx(it,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>V("toolTokens"),children:["Tool Tokens",Me("toolTokens")]})}),a.jsx(it,{className:"w-10"})]})}),a.jsx(Yr,{children:Ee.map((xe,Ye)=>xe.type==="day-separator"?a.jsx(Gt,{className:"bg-muted/30 hover:bg-muted/30",children:a.jsx(We,{colSpan:Zxe,className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-border/70"}),a.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:xe.dayLabel}),a.jsx("div",{className:"h-px flex-1 bg-border/70"})]})})},`day-${xe.dayKey}-${Ye}`):a.jsxs(Gt,{children:[a.jsx(We,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(Tt,{to:`/results/${xe.run.id}`,className:"font-mono text-xs text-primary hover:underline",children:xe.run.id}),xe.run.runNote?a.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",xe.run.runNote]}):null]})}),a.jsx(We,{className:"text-[11px] text-muted-foreground",children:(()=>{const he=xt.get(xe.run.id)??{scenarioCount:0,agentCount:0,scopePreview:"n/a",modelSummary:""};return a.jsxs("div",{className:"space-y-0.5",children:[a.jsxs("div",{children:["Evaluated: ",he.scenarioCount," scenario",he.scenarioCount===1?"":"s"," · ",he.agentCount," agent",he.agentCount===1?"":"s",he.modelSummary?` · ${he.modelSummary}`:""]}),a.jsx("div",{className:"font-mono text-xs text-foreground/80",children:he.scopePreview})]})})()}),a.jsx(We,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(yi,{className:"h-3 w-3"}),new Date(xe.run.timestamp).toLocaleString()]})}),a.jsx(We,{className:"text-right",children:a.jsx(ni,{rate:xe.run.overallPassRate})}),a.jsx(We,{className:"text-right font-mono text-sm",children:xe.run.totalScenarios}),a.jsx(We,{className:"text-right font-mono text-sm",children:xe.run.avgToolCalls.toFixed(0)}),a.jsx(We,{className:"text-right font-mono text-sm",children:et(xe.run)}),a.jsx(We,{children:a.jsxs(Xf,{children:[a.jsx(Qf,{asChild:!0,children:a.jsx(ne,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(uv,{className:"h-4 w-4"})})}),a.jsxs(Cu,{align:"end",children:[a.jsx(Qr,{asChild:!0,children:a.jsxs(Tt,{to:`/results/${xe.run.id}`,children:[a.jsx(L7,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),a.jsxs(Qr,{children:[a.jsx(Oa,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),a.jsxs(Qr,{className:"text-destructive",onSelect:he=>{he.preventDefault();const Te=document.activeElement;Te instanceof HTMLElement&&Te.blur(),f(xe.run.id)},children:[a.jsx($a,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},xe.run.id))})]})})}),W&&a.jsx(B6,{title:"MCP Lab Assistant",description:"Analyze historical differences and trends across all result runs.",expanded:z,onToggleExpanded:()=>K(xe=>!xe),onHide:()=>M(!1),messages:G,pendingToolCalls:$,loading:ee,onCancel:Q?ie:void 0,input:I,onInputChange:je,onSend:()=>{pe()},inputPlaceholder:"Ask about historical run differences...",snippets:sye,onSnippetSelect:xe=>{M(!0),ce(xe)},onApproveToolCall:xe=>{oe(xe)},onDenyToolCall:xe=>{_e(xe)},chatEndRef:ue,inputRef:re,className:"min-w-0 overflow-hidden xl:flex xl:h-[calc(100vh-14rem)] xl:min-h-0 xl:flex-col",renderMessage:({message:xe,index:Ye,linkedPendingToolCall:he,isUser:Te,isAssistant:Ie,isSystem:Ot,isTool:Ht})=>{const Ct=Ie&&!!xe.pendingToolCallId;if(Ht&&/^(Approved|Denied) tool call\b/i.test(String(xe.text??"").trim()))return null;if(Ct){const ge=Bh(he?.tool??xe.toolRequestName??he?.publicToolName??xe.toolRequestPublicName??"unknown_tool");return a.jsxs("div",{className:"flex items-start gap-2",children:[a.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.jsx(Rr,{className:"h-3 w-3"})}),a.jsxs("details",{open:!!he,className:"group min-w-0 w-full max-w-[92%] overflow-hidden rounded-md border border-border/60 bg-background",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ts,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${ge}`}),a.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${he?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:he?"Needs approval":"Completed"})]})}),a.jsx(Qt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),a.jsx("div",{className:"min-w-0 space-y-2 border-t border-border/50 px-3 py-2",children:a.jsx(Ma,{text:xe.text,className:"text-sm"})})]})]},`${xe.id??`${xe.role}-${Ye}`}:tool`)}return a.jsxs("div",{className:`flex items-start gap-2 ${Te?"justify-end":"justify-start"}`,children:[!Te&&a.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:Ot?a.jsx(gN,{className:"h-3 w-3"}):a.jsx(Rr,{className:"h-3 w-3"})}),a.jsx("div",{className:`min-w-0 max-w-[92%] break-words rounded-md border p-3 text-sm ${Te?"border-primary/20 bg-primary/10":Ot?"border-amber-400/30 bg-amber-50/70":Ht?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:Te?a.jsx("p",{className:"whitespace-pre-wrap",children:xe.text}):a.jsx(Ma,{text:xe.text,className:"text-sm"})}),Te&&a.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:a.jsx(Oc,{className:"h-3 w-3"})})]},xe.id??`${xe.role}-${Ye}`)}})]})]})};function oye(e){const t=e.scenarios.reduce((c,d)=>c+d.runs.filter(f=>f.passed).length,0),n=e.totalRuns-t,r={};e.scenarios.forEach(c=>c.runs.forEach(d=>d.toolCalls.forEach(f=>{r[f.name]=(r[f.name]||0)+1})));const s=Object.keys(r),i=Object.values(r),o=e.scenarios.map(c=>`
|
|
150
|
-
<div class="scenario-card">
|
|
151
|
-
<div class="scenario-header" onclick="this.parentElement.classList.toggle('open')">
|
|
152
|
-
<span class="chevron">▶</span>
|
|
153
|
-
<span class="scenario-name">${Bo(c.scenarioName)}</span>
|
|
154
|
-
<span class="scenario-agent">${Bo(c.agentName)}</span>
|
|
155
|
-
<span class="mono">${c.runs.length} runs</span>
|
|
156
|
-
<span class="badge ${c.passRate>=.8?"badge-pass":c.passRate>=.5?"badge-warn":"badge-fail"}">${Math.round(c.passRate*100)}%</span>
|
|
157
|
-
<span class="mono">${c.avgToolCalls.toFixed(1)} avg tools</span>
|
|
158
|
-
</div>
|
|
159
|
-
<div class="scenario-detail">
|
|
160
|
-
${c.runs.map(d=>`
|
|
161
|
-
<div class="run-row">
|
|
162
|
-
<span class="run-status ${d.passed?"pass":"fail"}">${d.passed?"✓":"✗"}</span>
|
|
163
|
-
<span class="mono run-label">Run #${d.runIndex+1}</span>
|
|
164
|
-
<span class="mono run-duration">${d.duration}ms</span>
|
|
165
|
-
<div class="tool-pills">
|
|
166
|
-
${d.toolCalls.map(f=>`<span class="pill">${Bo(f.name)} <small>${f.duration}ms</small></span>`).join("")}
|
|
167
|
-
</div>
|
|
168
|
-
${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>Bo(f)).join(", ")}</div>`:""}
|
|
169
|
-
</div>`).join("")}
|
|
170
|
-
</div>
|
|
171
|
-
</div>`).join("");return`<!DOCTYPE html>
|
|
172
|
-
<html lang="en">
|
|
173
|
-
<head>
|
|
174
|
-
<meta charset="UTF-8">
|
|
175
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
176
|
-
<title>MCPLab Report — ${Bo(e.id)}</title>
|
|
177
|
-
<script src="https://cdn.jsdelivr.net/npm/chart.js@4"><\/script>
|
|
178
|
-
<style>
|
|
179
|
-
*{box-sizing:border-box;margin:0;padding:0}
|
|
180
|
-
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f9fafb;color:#1f2937;padding:2rem;max-width:1100px;margin:0 auto}
|
|
181
|
-
h1{font-size:1.5rem;font-weight:700}
|
|
182
|
-
.mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.8rem}
|
|
183
|
-
.header{display:flex;align-items:center;gap:1rem;margin-bottom:.25rem}
|
|
184
|
-
.sub{font-size:.75rem;color:#6b7280;margin-bottom:1.5rem}
|
|
185
|
-
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;margin-bottom:2rem}
|
|
186
|
-
.stat{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
187
|
-
.stat-label{font-size:.7rem;color:#6b7280;text-transform:uppercase;letter-spacing:.05em}
|
|
188
|
-
.stat-value{font-size:1.5rem;font-weight:700;margin-top:.25rem}
|
|
189
|
-
.charts{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-bottom:2rem}
|
|
190
|
-
.chart-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
191
|
-
.chart-card h3{font-size:.85rem;font-weight:600;margin-bottom:.75rem}
|
|
192
|
-
canvas{max-height:220px}
|
|
193
|
-
.scenario-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;margin-bottom:.75rem;overflow:hidden}
|
|
194
|
-
.scenario-header{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;cursor:pointer;font-size:.85rem}
|
|
195
|
-
.scenario-header:hover{background:#f9fafb}
|
|
196
|
-
.chevron{font-size:.6rem;transition:transform .15s;color:#9ca3af}
|
|
197
|
-
.scenario-card.open .chevron{transform:rotate(90deg)}
|
|
198
|
-
.scenario-name{font-weight:600;flex:1}
|
|
199
|
-
.scenario-agent{color:#6b7280;font-size:.8rem}
|
|
200
|
-
.scenario-detail{display:none;border-top:1px solid #e5e7eb;padding:.75rem 1rem;background:#fafafa}
|
|
201
|
-
.scenario-card.open .scenario-detail{display:block}
|
|
202
|
-
.run-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.5rem 0;border-bottom:1px solid #f3f4f6;font-size:.8rem}
|
|
203
|
-
.run-row:last-child{border-bottom:none}
|
|
204
|
-
.run-status{font-weight:700;font-size:1rem}
|
|
205
|
-
.run-status.pass{color:#059669}
|
|
206
|
-
.run-status.fail{color:#dc2626}
|
|
207
|
-
.run-duration{color:#6b7280}
|
|
208
|
-
.tool-pills{display:flex;flex-wrap:wrap;gap:.25rem}
|
|
209
|
-
.pill{background:#fef3c7;color:#92400e;padding:2px 8px;border-radius:9999px;font-size:.7rem;font-family:'JetBrains Mono',monospace}
|
|
210
|
-
.pill small{color:#b45309;margin-left:2px}
|
|
211
|
-
.failure-reasons{width:100%;color:#dc2626;font-size:.75rem;margin-top:.25rem}
|
|
212
|
-
.badge{padding:2px 10px;border-radius:9999px;font-size:.75rem;font-weight:600}
|
|
213
|
-
.badge-pass{background:#d1fae5;color:#065f46}
|
|
214
|
-
.badge-warn{background:#fef3c7;color:#92400e}
|
|
215
|
-
.badge-fail{background:#fee2e2;color:#991b1b}
|
|
216
|
-
.footer{text-align:center;color:#9ca3af;font-size:.7rem;margin-top:2rem;padding-top:1rem;border-top:1px solid #e5e7eb}
|
|
217
|
-
</style>
|
|
218
|
-
</head>
|
|
219
|
-
<body>
|
|
220
|
-
<div class="header">
|
|
221
|
-
<h1 class="mono">${Bo(e.id)}</h1>
|
|
222
|
-
<span class="badge ${e.overallPassRate>=.8?"badge-pass":e.overallPassRate>=.5?"badge-warn":"badge-fail"}">${Math.round(e.overallPassRate*100)}% pass</span>
|
|
223
|
-
</div>
|
|
224
|
-
<p class="sub">${new Date(e.timestamp).toLocaleString()} · Config hash: <span class="mono">${Bo(e.configHash)}</span></p>
|
|
225
|
-
|
|
226
|
-
<div class="stats">
|
|
227
|
-
<div class="stat"><div class="stat-label">Scenarios</div><div class="stat-value">${e.totalScenarios}</div></div>
|
|
228
|
-
<div class="stat"><div class="stat-label">Total Runs</div><div class="stat-value">${e.totalRuns}</div></div>
|
|
229
|
-
<div class="stat"><div class="stat-label">Pass Rate</div><div class="stat-value">${Math.round(e.overallPassRate*100)}%</div></div>
|
|
230
|
-
<div class="stat"><div class="stat-label">Avg Tool Calls</div><div class="stat-value">${e.avgToolCalls.toFixed(1)}</div></div>
|
|
231
|
-
<div class="stat"><div class="stat-label">Avg Latency</div><div class="stat-value">${e.avgLatency}ms</div></div>
|
|
232
|
-
</div>
|
|
233
|
-
|
|
234
|
-
<div class="charts">
|
|
235
|
-
<div class="chart-card"><h3>Pass / Fail</h3><canvas id="pieChart"></canvas></div>
|
|
236
|
-
<div class="chart-card"><h3>Tool Usage</h3><canvas id="barChart"></canvas></div>
|
|
237
|
-
</div>
|
|
238
|
-
|
|
239
|
-
<h2 style="font-size:1rem;font-weight:600;margin-bottom:.75rem">Scenarios</h2>
|
|
240
|
-
${o}
|
|
241
|
-
|
|
242
|
-
<div class="footer">Generated by MCPLab · ${new Date().toISOString()}</div>
|
|
243
|
-
|
|
244
|
-
<script>
|
|
245
|
-
new Chart(document.getElementById('pieChart'),{type:'doughnut',data:{labels:['Pass','Fail'],datasets:[{data:[${t},${n}],backgroundColor:['#059669','#dc2626'],borderWidth:0}]},options:{cutout:'60%',plugins:{legend:{position:'bottom',labels:{font:{size:11}}}}}});
|
|
246
|
-
new Chart(document.getElementById('barChart'),{type:'bar',data:{labels:${JSON.stringify(s)},datasets:[{data:${JSON.stringify(i)},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}}}}}});
|
|
247
|
-
<\/script>
|
|
248
|
-
</body>
|
|
249
|
-
</html>`}function Bo(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const lye="mcplab.resultAssistantScenarioHandoff",cye=[{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 S$(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function N$(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const uye=()=>{const{id:e}=Nl(),t=La(),[n]=wi(),{source:r}=Ln(),s=n.get("embed")==="1",i=Og("snapshots",!1),{configs:o}=Df(),{scenarios:c}=os(),[d,f]=m.useState(void 0),[h,p]=m.useState(!0),[g,x]=m.useState(!1),[j,y]=m.useState(""),[b,N]=m.useState(!1),[C,S]=m.useState(new Set),[E,A]=m.useState(new Set),[k,T]=m.useState([]),[O,D]=m.useState(""),[q,U]=m.useState(null),[B,X]=m.useState(!1),[W,M]=m.useState(""),[z,K]=m.useState(""),[V,R]=m.useState(!1),[G,$]=m.useState(!1),[I,ee]=m.useState(!1),[Q,ie]=m.useState("assistant"),[ue,re]=m.useState(null),[je,pe]=m.useState(!1),[oe,_e]=m.useState(""),[ce,de]=m.useState(""),[ve,Pe]=m.useState(!1),[F,te]=m.useState(!1),[fe,Ee]=m.useState(!1),[Me,et]=m.useState([]),[st,xt]=m.useState(!1),[qt,Ut]=m.useState(""),[xe,Ye]=m.useState(null),[he,Te]=m.useState(!1),[Ie,Ot]=m.useState(null),{assistantMessages:Ht,assistantPendingToolCalls:Ct,assistantInput:ge,assistantLoading:qe,assistantTurnCancelable:Ve,cancelAssistantTurn:St,assistantChatEndRef:Oe,assistantInputRef:Ze,setAssistantInput:we,askAssistant:at,approveResultAssistantToolCall:wt,denyResultAssistantToolCall:Dt,applyResultAssistantSnippet:Fn,ensureIntroMessage:lt,resetAssistantSession:zt}=q6({source:r,open:G,scope:"run",runId:e,onSessionSync:void 0}),Jt=m.useCallback(async(J,Ae)=>{xt(!0);try{const Be=(await r.listMarkdownReports()).filter(Zt=>{const $t=String(Zt.relativePath??""),fn=String(Zt.name??"");return $t.includes(J)||fn.includes(J)});if(et(Be),Ae&&Be.length>0){const Zt=Be.find($t=>$t.relativePath===Ae||$t.path===Ae||$t.relativePath.endsWith(Ae)||$t.path.endsWith(Ae));Zt&&Ut(Zt.relativePath)}return Be}catch{return et([]),[]}finally{xt(!1)}},[r]);m.useEffect(()=>{if(!e)return;let J=!0;return zt(),p(!0),r.getResult(e).then(Ae=>{J&&(f(Ae),y(Ae?.runNote??""),x(!1),p(!1))}),()=>{J=!1}},[e,r,zt]),m.useEffect(()=>{let J=!0;return r.listSnapshots().then(Ae=>{J&&T(Ae)}).catch(()=>{J&&T([])}),()=>{J=!1}},[r]),m.useEffect(()=>{if(!d?.id){et([]);return}let J=!0;return(async()=>{const Ae=await Jt(d.id)})(),()=>{J=!1}},[d?.id,Jt]),m.useEffect(()=>{if(Me.length===0){Ut(""),Ye(null),Ot(null);return}(!qt||!Me.some(J=>J.relativePath===qt))&&Ut(Me[0].relativePath)},[Me,qt]),m.useEffect(()=>{if(!G||Q!=="reports")return;if(!qt){Ye(null),Ot(null);return}let J=!0;return Te(!0),Ot(null),r.getMarkdownReport(qt).then(Ae=>{J&&Ye(Ae)}).catch(Ae=>{J&&(Ye(null),Ot(Ae instanceof Error?Ae.message:String(Ae)))}).finally(()=>{J&&Te(!1)}),()=>{J=!1}},[G,Q,qt,r]);const dn=n.get("configId")??"",mn=(n.get("agent")??"").trim(),Xt=m.useMemo(()=>{const J=dn?o.find(Ae=>Ae.id===dn):void 0;return J||(d?o.find(Ae=>Ae.id===d.configId):void 0)},[o,dn,d]),ir=m.useMemo(()=>{const J=d?.configName?.trim();if(J)return J;const Ae=d?.configPath?.trim();if(Ae)return Ae;const vt=Xt?.relativePath?.trim()||Xt?.name?.trim();return vt||d?.configId?.trim()||""},[d,Xt]),se=m.useMemo(()=>{const J=d?.configName?.trim();return J||Xt?.name?.trim()||""},[d,Xt]),Je=m.useMemo(()=>{const J=d?.configPath?.trim();return J||Xt?.relativePath?.trim()||""},[d,Xt]),Nt=m.useMemo(()=>{const J=new Map;if(Xt){for(const Ae of Xt.scenarios)J.set(Ae.id,Ae),Ae.name&&!J.has(Ae.name)&&J.set(Ae.name,Ae);for(const Ae of Xt.scenarioEntries??[]){if(Ae.kind!=="referenced")continue;const vt=c.find(Be=>Be.id===Ae.ref);vt&&(J.set(vt.id,vt),vt.name&&J.set(vt.name,vt),J.has(Ae.ref)||J.set(Ae.ref,vt))}}for(const Ae of c)J.has(Ae.id)||J.set(Ae.id,Ae),Ae.name&&!J.has(Ae.name)&&J.set(Ae.name,Ae);return J},[Xt,c]),ln=m.useMemo(()=>{if(!d?.snapshotEval?.baselineSnapshotId)return"";const J=o.filter(Ae=>Ae.snapshotEval?.baselineSnapshotId===d.snapshotEval?.baselineSnapshotId);return J.length===1?J[0].id:""},[o,d?.snapshotEval?.baselineSnapshotId]);m.useEffect(()=>{d?.snapshotEval?.baselineSnapshotId&&D(J=>J||d.snapshotEval.baselineSnapshotId)},[d?.snapshotEval?.baselineSnapshotId]),m.useEffect(()=>{if(dn&&o.some(J=>J.id===dn)){M(dn);return}ln&&M(J=>J||ln)},[dn,o,ln]);const{filteredScenarios:jt,filteredTotalRuns:qn,filteredPassCount:xr,displayPassRate:or,displayAvgToolCalls:$r,displayAvgLatency:Un,displayToolTokenUsage:qs}=m.useMemo(()=>{if(!d)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayToolTokenUsage:null};const J=mn?d.scenarios.filter($t=>$t.agentId===mn||$t.agentName===mn):d.scenarios,Ae=J.reduce(($t,fn)=>$t+fn.runs.length,0),vt=J.reduce(($t,fn)=>$t+fn.runs.filter(yr=>yr.passed).length,0),Be=J.reduce(($t,fn)=>$t+fn.runs.reduce((yr,vn)=>yr+vn.toolCalls.length,0),0),Zt=J.reduce(($t,fn)=>$t+fn.runs.reduce((yr,vn)=>yr+vn.duration,0),0);return{filteredScenarios:J,filteredTotalRuns:Ae,filteredPassCount:vt,displayPassRate:Ae===0?0:vt/Ae,displayAvgToolCalls:Ae===0?0:Be/Ae,displayAvgLatency:Ae===0?0:Math.round(Zt/Ae),displayToolTokenUsage:kY(J.map($t=>$t.toolTokenUsage))}},[d,mn]),H=m.useMemo(()=>{const J={};return jt.forEach(Ae=>Ae.runs.forEach(vt=>vt.toolCalls.forEach(Be=>{J[Be.name]=(J[Be.name]||0)+1}))),Object.entries(J).map(([Ae,vt])=>({name:Ae,count:vt})).sort((Ae,vt)=>vt.count-Ae.count)},[jt]);if(h)return a.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading result..."});if(!d)return a.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Result not found"});const Xe=Object.entries(d.mcpServerVersions??{}).map(([J,Ae])=>`${J}: ${Ae??"unknown"}`).join(", "),ft=xr,Vt=Math.max(0,qn-ft),Kt=[{name:"Pass",value:ft,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:Vt,color:"hsl(0, 72%, 51%)"}],Wn=J=>{S(Ae=>{const vt=new Set(Ae);return vt.has(J)?vt.delete(J):vt.add(J),vt})},tn=(J,Ae,vt,Be)=>`${J}:${Ae}:${vt}:${Be}`,$e=(J,Ae)=>`${J}::${Ae}`,yn=J=>{A(Ae=>{const vt=new Set(Ae);return vt.has(J)?vt.delete(J):vt.add(J),vt})},yt=J=>{const Ae=!J.endsWith(":conversation");return E.has(J)?!Ae:Ae},rn=new Map((q?.scenario_results??[]).map(J=>[J.scenario_id,J])),ta=async()=>{if(!(!d||!O)){X(!0);try{const J=await r.compareSnapshot(O,d.id);U(J)}finally{X(!1)}}},wo=async J=>{const Ae=J||d.snapshotEval?.baselineSnapshotId;if(Ae){D(Ae),X(!0);try{const vt=await r.compareSnapshot(Ae,d.id);U(vt)}catch(vt){ke({title:"Could not review drift",description:vt instanceof Error?vt.message:String(vt),variant:"destructive"})}finally{X(!1)}}},tp=async()=>{if(!W){ke({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}R(!0);try{const J=await r.generateSnapshotEvalBaseline(d.id,W,z.trim()||void 0);T(Ae=>[J.snapshot,...Ae.filter(vt=>vt.id!==J.snapshot.id)]),D(J.snapshot.id),ke({title:"Baseline updated",description:`${J.snapshot.name} is now linked to the selected config.`}),z.trim()||K(J.snapshot.name),d.snapshotEval?.applied&&wo(J.snapshot.id)}catch(J){ke({title:"Could not accept new baseline",description:J instanceof Error?J.message:String(J),variant:"destructive"})}finally{R(!1)}},Us=(J,Ae)=>{ie("assistant"),$(!0),re(Ae?.scenarioId??null),lt("Ask me to explain failures, tool usage, snapshot drift, or suggest what to inspect next in this result."),J&&we(J)},na=Ct.filter(J=>J.status==="pending"&&!Ht.some(Ae=>Ae.pendingToolCallId===J.id)),Lg=J=>{ie("reports"),$(!0)},ra=()=>{ie("note"),$(!0)},Fg=J=>{if(!d)return;if(!ue){ke({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const Ae=c.find(Be=>Be.id===ue)??c.find(Be=>Be.name===ue);if(!Ae){ke({title:"Scenario not found in library",description:`Could not find library scenario '${ue}' to open in Scenario Assistant.`,variant:"destructive"});return}const vt=[`I am sending a suggestion from the Result Assistant for scenario '${ue}' based on run '${d.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:",J].join(`
|
|
250
|
-
`);try{window.sessionStorage.setItem(lye,JSON.stringify({type:"result-assistant-handoff-v1",runId:d.id,configId:dn||d.configId||"",scenarioId:Ae.id,prompt:vt,sourceReply:J})),t(`/libraries/test-cases/${encodeURIComponent(Ae.id)}?assistantHandoff=1`)}catch(Be){ke({title:"Could not create handoff",description:Be instanceof Error?Be.message:String(Be),variant:"destructive"})}},np=J=>{d&&(Ee(!1),_e(J),de(S$(d.id)),Pe(!1),pe(!0))},zg=()=>{d&&(Ee(!0),_e(""),de(S$(d.id)),Pe(!1),pe(!0))},Rl=async()=>{if(!d)return;if(!oe.trim()){ke({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}te(!0);try{const Ae=await r.applyResultAssistantReport({runId:d.id,markdown:oe,outputPath:ce.trim()||void 0,overwrite:ve});ke({title:"Markdown report written",description:typeof Ae.path=="string"&&Ae.path?Ae.path:Ae.outputPath}),await Jt(d.id,typeof Ae.path=="string"&&Ae.path||Ae.outputPath||void 0),G&&ie("reports"),pe(!1)}catch(Ae){ke({title:"Could not write markdown report",description:Ae instanceof Error?Ae.message:String(Ae),variant:"destructive"})}finally{te(!1)}},Il=async J=>{try{await navigator.clipboard.writeText(J),ke({title:"Copied"})}catch(Ae){ke({title:"Could not copy",description:Ae instanceof Error?Ae.message:String(Ae),variant:"destructive"})}},jo=async()=>{if(d){N(!0);try{const J=j.trim();await r.updateRunNote(d.id,J||void 0),f(Ae=>Ae&&{...Ae,runNote:J||void 0}),y(J),x(!1),ke({title:"Run note saved"})}catch(J){ke({title:"Could not save run note",description:J instanceof Error?J.message:String(J),variant:"destructive"})}finally{N(!1)}}};return a.jsxs("div",{className:`${G?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[a.jsx("div",{className:`${G?"xl:shrink-0 xl:pb-6":"mb-6"}`,children:a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[!s&&a.jsx(ne,{variant:"ghost",size:"icon",asChild:!0,children:a.jsx(Tt,{to:"/results",children:a.jsx(nl,{className:"h-4 w-4"})})}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h1",{className:"text-2xl font-bold font-mono",children:d.id}),a.jsx(ni,{rate:or}),i&&d.snapshotEval?.applied&&a.jsxs(He,{variant:"outline",className:"text-xs",children:["Snapshot policy · ",d.snapshotEval.mode," · ",d.snapshotEval.status]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[a.jsx(D7,{className:"h-3 w-3 shrink-0"}),new Date(d.timestamp).toLocaleString()]}),a.jsx("span",{className:"mx-1",children:"·"}),mn?a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"inline-flex items-center align-middle",children:["Agent: ",mn]}),a.jsx("span",{className:"mx-1",children:"·"})]}):null,se?a.jsxs("span",{className:"inline-flex items-center align-middle",children:["Eval: ",a.jsx("span",{className:"ml-1 font-medium",children:se})]}):null,se&&Je?a.jsx("span",{className:"mx-1",children:"·"}):null,Je?a.jsxs("span",{className:"inline-flex items-center align-middle",children:["Path: ",a.jsx("span",{className:"ml-1 font-mono",children:Je})]}):null,!se&&!Je&&ir?a.jsxs("span",{className:"inline-flex items-center align-middle",children:["Config: ",a.jsx("span",{className:"ml-1 font-mono",children:ir})]}):null]}),i&&d.snapshotEval?.applied&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Baseline:"," ",a.jsx("span",{className:"font-mono",children:d.snapshotEval.baselineSnapshotId})," · score: ",d.snapshotEval.overallScore]})]})]}),a.jsxs("div",{className:"flex w-full min-w-0 items-center justify-between gap-2 sm:ml-auto sm:w-auto",children:[Xe?a.jsxs("span",{className:"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] text-muted-foreground",children:[a.jsx("span",{className:"font-medium",children:"MCP:"}),a.jsx("span",{className:"ml-1 min-w-0 truncate font-mono",children:Xe})]}):null,a.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-end gap-2",children:[i&&d.snapshotEval?.applied&&a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>{wo()},disabled:B,children:[a.jsx(vN,{className:"h-3.5 w-3.5"}),B?"Reviewing drift...":"Review Drift"]}),a.jsxs(ne,{variant:"outline",size:"sm",className:`max-w-full gap-1.5 ${s?"px-2":""}`,onClick:()=>{const J=oye(d),Ae=new Blob([J],{type:"text/html"}),vt=URL.createObjectURL(Ae),Be=document.createElement("a");Be.href=vt,Be.download=`mcplab-report-${d.id}.html`,Be.click(),URL.revokeObjectURL(vt)},"aria-label":"Download Report",title:"Download Report",children:[a.jsx(Oa,{className:"h-3.5 w-3.5"}),!s&&"Download Report"]}),a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>Lg(),disabled:st,children:[a.jsx(mc,{className:"h-3.5 w-3.5"}),st?"Reference Reports...":`Reference Reports${Me.length?` (${Me.length})`:""}`]}),a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>ra(),children:[a.jsx(mc,{className:"h-3.5 w-3.5"}),"Run Note"]}),a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>Us(),children:[a.jsx(Vr,{className:"h-4 w-4 text-amber-500"}),"MCP Lab Assistant"]})]})]})]})}),a.jsxs("div",{className:`grid gap-6 items-start ${G?I?"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:[a.jsxs("div",{className:`min-w-0 space-y-6 ${G?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[i&&d.snapshotEval?.applied&&a.jsxs(Ke,{className:"border-amber-500/30",children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Snapshot Drift Review"})}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[a.jsxs(He,{variant:"outline",children:["Mode: ",d.snapshotEval.mode]}),a.jsxs(He,{variant:"outline",children:["Status: ",d.snapshotEval.status]}),a.jsxs(He,{variant:"outline",children:["Overall score: ",d.snapshotEval.overallScore]}),a.jsxs(He,{variant:"outline",className:"font-mono",children:["Baseline: ",d.snapshotEval.baselineSnapshotId]})]}),d.snapshotEval.impactedScenarios.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Impacted scenarios: ",d.snapshotEval.impactedScenarios.join(", ")]}),a.jsxs("div",{className:"grid gap-3 lg:grid-cols-[1.2fr_1fr_auto] items-end",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Target config for baseline update"}),a.jsxs(_n,{value:W,onValueChange:M,children:[a.jsx(bn,{className:"h-8",children:a.jsx(An,{placeholder:"Select config to update"})}),a.jsx(wn,{children:o.map(J=>a.jsx(ot,{value:J.id,children:J.name},J.id))})]}),!W&&a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Tip: open results from the Run page to prefill the config automatically."})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"New snapshot name (optional)"}),a.jsx("div",{className:"relative",children:a.jsx("input",{value:z,onChange:J=>K(J.target.value),placeholder:`Snapshot ${d.id}`,className:"h-8 w-full rounded-md border bg-background px-2 text-xs"})})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{wo()},disabled:B,children:[a.jsx(ba,{className:`h-3.5 w-3.5 ${B?"animate-spin":""}`}),"Review Drift"]}),a.jsx(ne,{type:"button",size:"sm",className:"h-8",onClick:()=>{tp()},disabled:V||or!==1,children:V?"Accepting...":"Accept as New Baseline"})]})]}),or!==1&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"Baseline updates require a fully passing run (same rule as snapshot creation)."})]})]}),a.jsxs("div",{className:`grid gap-4 ${G?"grid-cols-3":"sm:grid-cols-2 lg:grid-cols-6"}`,children:[a.jsx(bs,{title:"Scenarios",value:jt.length,icon:rS}),a.jsx(bs,{title:"Total Runs",value:qn,icon:aD}),a.jsx(bs,{title:"Pass Rate",value:`${Math.round(or*100)}%`,icon:Pc}),a.jsx(bs,{title:"Avg Tool Calls",value:N$($r),icon:si}),a.jsx(bs,{title:"Avg Latency",value:`${Un}ms`,icon:fD}),a.jsx(bs,{title:"Tool Tokens",value:ca(qs?.totalTokens),icon:ts})]}),a.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-2",children:a.jsx(It,{className:"text-base",children:"Pass / Fail"})}),a.jsxs(Ge,{className:"flex items-center justify-center",children:[a.jsxs(bpe,{width:180,height:180,children:[a.jsx(Ci,{data:Kt,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:Kt.map((J,Ae)=>a.jsx(Hv,{fill:J.color},Ae))}),a.jsx(Wr,{})]}),a.jsxs("div",{className:"ml-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("div",{className:"h-3 w-3 rounded-full bg-success"}),ft," passed"]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("div",{className:"h-3 w-3 rounded-full bg-destructive"}),Vt," failed"]})]})]})]}),a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-2",children:a.jsx(It,{className:"text-base",children:"Tool Usage"})}),a.jsx(Ge,{children:a.jsx(cm,{width:"100%",height:180,children:a.jsxs(ype,{data:H,layout:"vertical",children:[a.jsx(oo,{type:"number",tick:{fontSize:11}}),a.jsx(lo,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),a.jsx(Wr,{}),a.jsx(Pl,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(It,{className:"text-base",children:"Scenarios"}),a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>Us("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[a.jsx(Vr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})]})}),a.jsxs(Ge,{className:"p-0",children:[i&&a.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-b p-3",children:[a.jsxs("div",{className:"min-w-60 space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Snapshot"}),a.jsxs(_n,{value:O,onValueChange:D,children:[a.jsx(bn,{className:"h-8",children:a.jsx(An,{placeholder:"Select snapshot"})}),a.jsx(wn,{children:k.map(J=>a.jsx(ot,{value:J.id,children:J.name},J.id))})]})]}),a.jsx(ne,{type:"button",variant:"outline",size:"sm",disabled:!O||B,onClick:()=>{ta()},children:B?"Comparing...":"Compare Snapshot"}),q&&a.jsxs(He,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",q.overall_score]})]}),a.jsxs(Kr,{children:[a.jsx(Gr,{children:a.jsxs(Gt,{children:[a.jsx(it,{className:"w-8"}),a.jsx(it,{children:"Scenario"}),a.jsx(it,{children:"Agent"}),a.jsx(it,{children:"Runs"}),a.jsx(it,{children:"Pass Rate"}),a.jsx(it,{children:"Tool Calls"}),a.jsx(it,{children:"Tool Tokens"}),a.jsx(it,{children:"Snapshot"})]})}),a.jsx(Yr,{children:jt.map(J=>{const Ae=$e(J.scenarioId,J.agentName),vt=J.scenarioName||J.scenarioId;return a.jsx(Za,{open:C.has(Ae),onOpenChange:()=>Wn(Ae),asChild:!0,children:a.jsxs(a.Fragment,{children:[a.jsx(Pa,{asChild:!0,children:a.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",children:[a.jsx(We,{children:a.jsx(Qt,{className:`h-4 w-4 transition-transform ${C.has(Ae)?"rotate-180":""}`})}),a.jsx(We,{className:"font-medium text-sm",children:J.scenarioName}),a.jsxs(We,{className:"text-sm",children:[a.jsx("div",{children:J.agentName}),(J.provider||J.model)&&a.jsx("div",{className:"text-xs text-muted-foreground",children:[J.provider?rv(J.provider):null,J.model].filter(Boolean).join(" · ")})]}),a.jsx(We,{className:"font-mono text-sm",children:J.runs.length}),a.jsx(We,{children:a.jsx(ni,{rate:J.passRate})}),a.jsx(We,{className:"font-mono text-sm",children:N$(J.avgToolCalls)}),a.jsx(We,{className:"font-mono text-sm",children:ca(J.toolTokenUsage?.totalTokens)}),a.jsx(We,{children:(()=>{const Be=rn.get(J.scenarioId);if(!Be)return a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const Zt=Be.status==="Match"?"bg-success/15 text-success":Be.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return a.jsxs(He,{variant:"outline",className:`text-xs ${Zt}`,children:[Be.status," · ",Be.score]})})()})]})}),a.jsx(es,{asChild:!0,children:a.jsx("tr",{children:a.jsx("td",{colSpan:8,className:"p-0",children:a.jsxs("div",{className:"bg-muted/30 p-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-card px-3 py-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-xs font-semibold",children:"Scenario details"}),a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[vt," · ",J.agentName," ·"," ",Math.round(J.passRate*100),"% pass rate ·"," ",ca(J.toolTokenUsage?.totalTokens)," tool tokens"]})]}),a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>Us(`Explain why scenario '${vt}' failed (agent: ${J.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:J.scenarioId}),children:[a.jsx(Vr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})]}),(()=>{const Be=rn.get(J.scenarioId);return!Be||Be.reasons.length===0?null:a.jsxs("div",{className:"rounded-md border bg-card p-2",children:[a.jsx("p",{className:"mb-1 text-xs font-semibold text-muted-foreground",children:"Snapshot reasons"}),a.jsxs("p",{className:"mb-1 text-[11px] text-muted-foreground",children:["Baseline agents: ",Be.baseline_agents.join(", ")||"—"," · observed agents: ",Be.observed_agents.join(", ")||"—"]}),a.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:Be.reasons.map((Zt,$t)=>a.jsxs("li",{children:["• ",Zt]},$t))})]})})(),J.runs.map(Be=>a.jsxs("div",{className:"flex items-start gap-3 rounded-md border bg-card p-3 text-sm",children:[a.jsx("div",{className:"mt-0.5",children:Be.passed?a.jsx(si,{className:"h-4 w-4 text-success"}):a.jsx(jc,{className:"h-4 w-4 text-destructive"})}),a.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const Zt=Nt.get(J.scenarioId),$t=Zt?pye(Zt.evalRules,Be.failureReasons):[],fn=$t.filter(vn=>vn.status==="failed"),yr=$t.filter(vn=>vn.status==="passed");return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Run #",Be.runIndex+1]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[Be.duration,"ms"]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[ca(Be.toolTokenUsage?.totalTokens)," ","tool tokens"]}),!Be.passed&&a.jsx(He,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),Be.failureReasons.length>0&&a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-2",children:[a.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-destructive",children:[a.jsx(jc,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),a.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:Be.failureReasons.map((vn,en)=>a.jsxs("li",{children:["• ",E$(vn)]},en))})]}),$t.length>0&&a.jsx(Za,{open:yt(tn(J.scenarioId,J.agentName,Be.runIndex,"checks")),onOpenChange:()=>yn(tn(J.scenarioId,J.agentName,Be.runIndex,"checks")),children:a.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[a.jsx(Pa,{asChild:!0,children:a.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center gap-2 text-left",children:[a.jsx(Qt,{className:`h-3.5 w-3.5 transition-transform ${yt(tn(J.scenarioId,J.agentName,Be.runIndex,"checks"))?"rotate-180":""}`}),a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),a.jsxs(He,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[yr.length," passed"]}),a.jsxs(He,{variant:"outline",className:`h-5 text-[10px] ${fn.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[fn.length," failed"]})]})}),a.jsx(es,{children:a.jsx("div",{className:"space-y-1",children:$t.map((vn,en)=>a.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${vn.status==="failed"?"border-destructive/20 bg-destructive/5":"border-success/20 bg-success/5"}`,children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[vn.status==="failed"?a.jsx(jc,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):a.jsx(si,{className:"h-3.5 w-3.5 shrink-0 text-success"}),a.jsx("span",{className:"font-medium",children:mye(vn.rule)})]}),vn.failureReason&&a.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:E$(vn.failureReason)})]}),a.jsx(He,{variant:"outline",className:`shrink-0 text-[10px] ${vn.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:vn.status})]},`${vn.rule.type}-${vn.rule.value??vn.rule.path??""}-${en}`))})})]})})]})})(),a.jsx(Za,{open:yt(tn(J.scenarioId,J.agentName,Be.runIndex,"extracts")),onOpenChange:()=>yn(tn(J.scenarioId,J.agentName,Be.runIndex,"extracts")),children:a.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[a.jsx(Pa,{asChild:!0,children:a.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[a.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[a.jsx(Qt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${yt(tn(J.scenarioId,J.agentName,Be.runIndex,"extracts"))?"rotate-180":""}`}),a.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[a.jsx(rS,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),a.jsxs(He,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(Be.extractedValues??{}).length," ","total"]})]})}),a.jsx(es,{children:Object.keys(Be.extractedValues??{}).length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No extracted values captured for this run."}):a.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(Be.extractedValues??{}).map(([Zt,$t])=>a.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5 text-xs",children:[a.jsx("div",{className:"mb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:Zt}),a.jsx("div",{className:"font-mono break-all text-foreground",children:$t===null?"null":String($t)})]},Zt))})})]})}),a.jsx(Za,{open:yt(tn(J.scenarioId,J.agentName,Be.runIndex,"tools")),onOpenChange:()=>yn(tn(J.scenarioId,J.agentName,Be.runIndex,"tools")),children:a.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[a.jsx(Pa,{asChild:!0,children:a.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[a.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[a.jsx(Qt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${yt(tn(J.scenarioId,J.agentName,Be.runIndex,"tools"))?"rotate-180":""}`}),a.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[a.jsx(ts,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),a.jsxs(He,{variant:"outline",className:"h-5 text-[10px]",children:[Be.toolCalls.length," total"]})]})}),a.jsx(es,{children:Be.toolCalls.length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool calls captured for this run."}):a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"flex flex-wrap gap-1",children:a.jsx(ao,{delayDuration:0,children:Be.toolCalls.map((Zt,$t)=>{const fn=Be.conversation.filter(vn=>vn.kind==="tool_call")[$t]?.estimatedTokens,yr=typeof fn?.totalTokens=="number";return a.jsxs(so,{children:[a.jsx(io,{asChild:!0,children:a.jsxs(He,{variant:"outline",className:"font-mono text-xs bg-background",children:[a.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",$t+1]}),Zt.name,a.jsxs("span",{className:"ml-1 text-muted-foreground",children:[Zt.duration,"ms"]}),yr&&a.jsxs("span",{className:"ml-1 text-muted-foreground",children:["·"," ",ca(fn?.totalTokens),"tok"]})]})}),yr&&a.jsx(mi,{className:"text-xs",children:`${Zt.name} · tokens total: ${ca(fn?.totalTokens)} · in: ${ca(fn?.inputTokens)} · out: ${ca(fn?.outputTokens)}`})]},$t)})})}),a.jsxs("div",{className:"rounded-md border bg-background p-2",children:[a.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Tool token estimate"}),a.jsx(He,{variant:"outline",className:"h-5 text-[10px]",children:"estimated"})]}),Object.keys(Be.toolTokenUsageByTool??{}).length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"n/a"}):a.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(Be.toolTokenUsageByTool??{}).map(([Zt,$t])=>a.jsxs("div",{className:"rounded border bg-muted/30 px-2 py-1.5 text-xs",children:[a.jsx("div",{className:"font-mono text-[11px]",children:Zt}),a.jsxs("div",{className:"text-muted-foreground",children:["total:"," ",ca($t.totalTokens)," ","· in:"," ",ca($t.inputTokens)," ","· out:"," ",ca($t.outputTokens)]})]},Zt))})]})]})})]})}),a.jsx(Za,{open:yt(tn(J.scenarioId,J.agentName,Be.runIndex,"final")),onOpenChange:()=>yn(tn(J.scenarioId,J.agentName,Be.runIndex,"final")),children:a.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[a.jsx(Pa,{asChild:!0,children:a.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[a.jsx(Qt,{className:`h-3.5 w-3.5 transition-transform ${yt(tn(J.scenarioId,J.agentName,Be.runIndex,"final"))?"rotate-180":""}`}),a.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[a.jsx(Rr,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),a.jsx(es,{children:a.jsx(cN,{text:Be.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),a.jsx(Za,{open:yt(tn(J.scenarioId,J.agentName,Be.runIndex,"conversation")),onOpenChange:()=>yn(tn(J.scenarioId,J.agentName,Be.runIndex,"conversation")),children:a.jsxs("div",{className:"rounded-md border bg-muted/10 p-2",children:[a.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[a.jsx(Pa,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[a.jsx(Qt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${yt(tn(J.scenarioId,J.agentName,Be.runIndex,"conversation"))?"rotate-180":""}`}),a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Conversation trace"})]})}),a.jsx("div",{className:"flex flex-wrap gap-2",children:a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Us(`Explain Run #${Be.runIndex+1} for scenario '${vt}'. It ${Be.passed?"passed":"failed"} in ${Be.duration}ms. Focus on the tool sequence and ${Be.passed?"why it passed":"what caused the failure"}.`,{scenarioId:J.scenarioId}),children:[a.jsx(Vr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})})]}),a.jsx(es,{children:a.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:Be.conversation.length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):Be.conversation.map(Zt=>a.jsx(dye,{item:Zt,fallbackUserPrompt:Nt.get(J.scenarioId)?.prompt},Zt.id))})}),!yt(tn(J.scenarioId,J.agentName,Be.runIndex,"conversation"))&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},Be.runIndex))]})})})})]})},Ae)})})]})]})]})]}),G&&a.jsxs("div",{className:"min-w-0 space-y-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[a.jsx(Eg,{value:Q,onValueChange:J=>ie(J),className:"min-w-0 -mb-px px-3 pt-1",children:a.jsxs(Jf,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[a.jsx(ks,{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"}),a.jsx(ks,{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"}),a.jsx(ks,{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"})]})}),Q==="assistant"?a.jsx(B6,{title:"MCP Lab Assistant",description:"Ask questions about this run result, failures, tool usage, and snapshot drift.",expanded:I,onToggleExpanded:()=>ee(J=>!J),onHide:()=>$(!1),messages:Ht,pendingToolCalls:Ct,loading:qe,onCancel:Ve?St:void 0,input:ge,onInputChange:we,onSend:()=>{at()},inputPlaceholder:"Ask about this result...",snippets:cye,onSnippetSelect:Fn,onApproveToolCall:J=>{wt(J)},onDenyToolCall:J=>{Dt(J)},chatEndRef:Oe,inputRef:Ze,className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",renderMessage:({message:J,index:Ae,linkedPendingToolCall:vt,isUser:Be,isAssistant:Zt,isSystem:$t,isTool:fn})=>{const yr=Zt&&!!J.pendingToolCallId;if(fn&&/^(Approved|Denied) tool call\\b/i.test(String(J.text??"").trim()))return null;const vn=vt?.tool??J.toolRequestName,en=vt?.publicToolName??J.toolRequestPublicName,Eu=Zt&&!yr&&fye(J.text,!!ue);if(yr){const So=vt?.status==="pending",ap=Bh(vn??en??"unknown_tool");return a.jsxs("div",{className:"flex items-start gap-2",children:[a.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.jsx(Rr,{className:"h-3 w-3"})}),a.jsxs("details",{open:!!vt,className:"group min-w-0 w-full max-w-[92%] overflow-hidden rounded-md border border-border/60 bg-background",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ts,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${ap}`}),a.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${So?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:So?"Needs approval":"Completed"})]})}),a.jsx(Qt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),a.jsxs("div",{className:"min-w-0 space-y-2 border-t border-border/50 px-3 py-2",children:[a.jsx(Ma,{text:J.text,className:"text-sm"}),So&&vt&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"max-h-40 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded border bg-muted/50 p-2 text-xs",children:a.jsx("code",{className:"break-words",children:JSON.stringify(vt.arguments??{},null,2)})}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:qe,onClick:()=>{Dt(vt.id)},children:"Deny"}),a.jsx(ne,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:qe,onClick:()=>{wt(vt.id)},children:"Approve"})]})]})]})]})]},`${J.id??`${J.role}-${Ae}`}:${vt?"pending":"completed"}`)}const rp=Be||Zt&&!fn&&!$t;return a.jsxs("div",{className:`flex items-start gap-2 ${Be?"justify-end":"justify-start"}`,children:[!Be&&a.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:$t?a.jsx(gN,{className:"h-3 w-3"}):a.jsx(Rr,{className:"h-3 w-3"})}),a.jsxs("div",{className:"relative max-w-[92%]",children:[a.jsxs("div",{className:`max-w-full rounded-md border p-3 text-sm ${Be?"border-primary/20 bg-primary/10":$t?"border-amber-400/30 bg-amber-50/70":fn?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(Be||$t)&&a.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${Be?"text-right":""}`,children:fn?"Tool":"Assistant"}),Be?a.jsx("p",{className:"whitespace-pre-wrap",children:J.text}):a.jsx(Ma,{text:J.text,className:"text-sm"}),Eu&&a.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Fg(J.text),children:[a.jsx(Vr,{className:"h-4 w-4 text-amber-500"}),"Send to Scenario Assistant"]}),a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>np(J.text),children:[a.jsx(ts,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!Eu&&Zt&&!yr&&a.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>np(J.text),children:[a.jsx(ts,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),rp&&a.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{Il(J.text)},"aria-label":"Copy message",title:"Copy message",children:a.jsx(Ps,{className:"h-3.5 w-3.5"})})]}),Be&&a.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:a.jsx(Oc,{className:"h-3 w-3"})})]},J.id??`${J.role}-${Ae}`)},renderMessageExtras:na.length>0?a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Pending actions (approve/deny)"}),na.map(J=>a.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"break-all font-mono text-xs font-semibold",children:Bh(J.publicToolName)}),a.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[J.server,"::",Bh(J.tool)]})]}),a.jsx(Qt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),a.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[a.jsx("pre",{className:"max-h-48 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded border bg-muted/50 p-2 text-xs",children:a.jsx("code",{className:"break-words",children:JSON.stringify(J.arguments??{},null,2)})}),a.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[a.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:qe,onClick:()=>{Dt(J.id)},children:"Deny"}),a.jsx(ne,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:qe,onClick:()=>{wt(J.id)},children:"Approve"})]})]})]},J.id))]}):null}):Q==="reports"?a.jsxs(Ke,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[a.jsx(Rt,{className:"border-b px-4 py-3",children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs(It,{className:"flex items-center gap-2 text-base",children:[a.jsx(mc,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ee(J=>!J),children:[I?a.jsx(sS,{className:"h-3.5 w-3.5"}):a.jsx(iS,{className:"h-3.5 w-3.5"}),I?"Compact":"Expand"]}),a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>$(!1),children:"Hide"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Review markdown reports for this run while keeping the result visible."})]})}),a.jsxs(Ge,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(st||Me.length===0||Me.length>1)&&a.jsx("div",{className:"border-b px-4 py-3",children:st?a.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):Me.length===0?a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"No reference reports for this run yet."}),a.jsxs(ne,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>zg(),children:[a.jsx(fi,{className:"h-3.5 w-3.5"}),"New Report"]})]}):a.jsx("div",{className:"space-y-2",children:Me.length>1?a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Selected report"}),a.jsxs(_n,{value:qt,onValueChange:Ut,children:[a.jsx(bn,{className:"h-8",children:a.jsx(An,{placeholder:"Select a report"})}),a.jsx(wn,{children:Me.map(J=>a.jsx(ot,{value:J.relativePath,children:J.name},J.path))})]})]}):null})}),a.jsx(s_,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:Me.length===0?a.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):he?a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(Cr,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):Ie?a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",Ie]}):xe?a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"rounded-md border bg-background p-3",children:[a.jsx("p",{className:"font-mono text-xs font-semibold",children:xe.name}),a.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:xe.relativePath}),a.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(xe.mtime).toLocaleString()})]}),a.jsx("div",{className:"rounded-md border bg-background p-3",children:a.jsx(Ma,{text:xe.content,className:"text-sm"})})]}):a.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):a.jsxs(Ke,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[a.jsx(Rt,{className:"border-b px-4 py-3",children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs(It,{className:"flex items-center gap-2 text-base",children:[a.jsx(mc,{className:"h-4 w-4 text-muted-foreground"}),"Run Note"]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ee(J=>!J),children:[I?a.jsx(sS,{className:"h-3.5 w-3.5"}):a.jsx(iS,{className:"h-3.5 w-3.5"}),I?"Compact":"Expand"]}),a.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>$(!1),children:"Hide"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Add context for this run, such as server version or environment details."})]})}),a.jsx(Ge,{className:"flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1",children:g?a.jsxs("div",{className:"w-full max-w-xl space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-xs font-medium",children:"Run note"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[j.length,"/500"]})]}),a.jsx(Is,{value:j,onChange:J=>y(J.target.value.slice(0,500)),placeholder:"Optional context for this run",rows:3,className:"min-h-20 resize"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ne,{size:"sm",onClick:()=>{jo()},disabled:b,children:b?"Saving...":"Save note"}),a.jsx(ne,{size:"sm",variant:"outline",onClick:()=>{y(d.runNote??""),x(!1)},disabled:b,children:"Cancel"})]})]}):a.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:[a.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[a.jsx("span",{className:"text-muted-foreground",children:"Run note:"}),a.jsx("span",{className:`break-words ${d.runNote?"text-foreground":"text-muted-foreground"}`,children:d.runNote||"none"})]}),a.jsx(ne,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>x(!0),children:d.runNote?"Edit":"Add note"})]})})]})]}),a.jsx(Bs,{open:je,onOpenChange:J=>!F&&pe(J),children:a.jsxs(cs,{className:"max-w-2xl",children:[a.jsxs(us,{children:[a.jsx(fs,{children:fe?"Create markdown report":"Approve MCP action: write markdown report"}),a.jsx(ps,{children:fe?"Write a custom markdown report and save it to the workspace.":a.jsxs(a.Fragment,{children:["This will call ",a.jsx("code",{children:"mcplab_write_markdown_report"})," via the local MCPLab MCP server."]})})]}),a.jsxs("div",{className:"space-y-3",children:[!fe&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),a.jsx(bt,{value:ce,onChange:J=>de(J.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:F})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Jr,{checked:ve,onCheckedChange:J=>Pe(J===!0),disabled:F}),a.jsx("span",{children:"Overwrite if file exists"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:fe?"Markdown content":"Markdown preview (to be written)"}),a.jsx(Is,{value:oe,onChange:J=>_e(J.target.value),rows:10,className:"font-mono text-xs",disabled:F})]})]}),a.jsxs(ds,{children:[a.jsx(ms,{disabled:F,children:"Cancel"}),a.jsx(hs,{onClick:J=>{J.preventDefault(),Rl()},disabled:F,children:F?"Writing...":fe?"Save Report":"Approve & Write"})]})]})})]})]})};function dye({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=C$(e,"input");return a.jsx(A$,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=C$(e,"output"),f=e.ok?a.jsx(si,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):a.jsx(jc,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return a.jsx(A$,{variant:e.ok?"result_ok":"result_error",title:`Tool result · ${e.toolName||"unknown"} · ${e.ok?"ok":"error"}${typeof e.durationMs=="number"?` · ${e.durationMs}ms`:""}${d}`,text:e.text,icon:f})}const n=e.kind==="user_prompt",r=_$(e.text,e.kind),s=t?_$(t,"user_prompt"):"",i=n&&!r&&s?s:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?Oc:Rr;return a.jsxs("div",{className:`flex items-start gap-2 text-xs ${n?"justify-end":"justify-start"}`,children:[!n&&a.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:a.jsx(c,{className:"h-3 w-3"})}),a.jsxs("div",{className:`max-w-[90%] rounded-md p-2 ${n?"bg-primary/10":"bg-muted/50"}`,children:[a.jsx("p",{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?"text-right":""}`,children:o}),n?a.jsx(cN,{text:i,maxLength:280,className:"text-xs"}):a.jsx(cN,{text:i,maxLength:500,className:"text-xs"})]}),n&&a.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:a.jsx(c,{className:"h-3 w-3"})})]})}function C$(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · ${ca(n)} tokens`}function _$(e,t){const r=String(e??"").replace(/^\s+/,"");return t==="user_prompt"?r.replace(/^user:\s*/i,""):t==="assistant_final"||t==="assistant_thought"?r.replace(/^assistant:\s*/i,""):r}function fye(e,t){if(!t)return!1;const n=String(e??"").toLowerCase();if(!n.trim())return!1;const r=["check","checks","rule","rules","regex","pattern","value capture","extract rule","update","change","replace","modify","adjust","use ","set "],s=["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(h=>n.includes(h))&&!s.some(h=>n.includes(h)))return!1;const o=r.some(h=>n.includes(h)),c=s.some(h=>n.includes(h)),d=/(^|\n)\s*[-*]\s+/.test(e)||/(^|\n)\s*\d+\.\s+/.test(e),f=/["'`][^"'`\n]{2,}["'`]/.test(e);return o&&(c||d||f)}function A$({variant:e,title:t,text:n,icon:r}){const[s,i]=m.useState(!1),o={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"};return a.jsx(Za,{open:s,onOpenChange:i,children:a.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[a.jsx(Pa,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-2 text-left",children:[a.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[11px]",children:[r??a.jsx(ts,{className:"h-3.5 w-3.5"}),a.jsx("span",{children:t})]}),a.jsx("span",{className:"text-[11px] font-semibold",children:s?"Hide content":"Show content"})]})}),a.jsx(es,{children:a.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function cN({text:e,maxLength:t,className:n}){const[r,s]=m.useState(!1),i=e.length>t,o=r||!i?e:`${e.slice(0,t)}...`;return a.jsxs("div",{children:[a.jsx(Ma,{text:o,className:n}),i&&a.jsx("button",{type:"button",className:"mt-1 text-[11px] font-medium text-primary hover:underline",onClick:()=>s(c=>!c),children:r?"Show less":"Show all"})]})}function pye(e,t){return e.map(n=>{const r=hye(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function hye(e,t){const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:e.type==="response_contains"?`Contains assertion failed: ${e.value}`:e.type==="response_not_contains"?`Not-contains assertion failed: ${e.value}`:e.type==="response_starts_with"?`Starts-with assertion failed: ${e.value}`:e.type==="response_ends_with"?`Ends-with assertion failed: ${e.value}`:e.type==="response_equals"?`Equals assertion failed: ${e.value}`:e.type==="response_regex"?`Regex assertion failed: ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals assertion failed: ${e.path}`:`JSONPath assertion failed: ${e.path}`:e.type==="response_jsonpath_exists"?`JSONPath assertion failed: ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not-exists assertion failed: ${e.path}`:"",r=t.find(s=>s===n);if(r)return r;if(e.type==="response_regex")return t.find(s=>s.startsWith("Regex assertion failed:")&&s.includes(e.value??""));if(e.type==="response_jsonpath"||e.type==="response_jsonpath_exists"||e.type==="response_jsonpath_not_exists")return t.find(s=>s.includes(e.path??""))}function mye(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`: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 equals · ${e.path} == ${String(e.equals)}`:`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_exists"?`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not exists · ${e.path}`:`${e.type} · ${e.value}`}function E$(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const Jj=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"];function vye(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function gye(e){const t=e.find(n=>n.provider&&n.model)??e.find(n=>n.provider||n.model);return{provider:t?.provider,model:t?.model}}const xye=()=>{const{source:e}=Ln(),[t,n]=wi(),r=t.get("mode")==="within-run"?"within-run":"runs",[s,i]=m.useState([]),[o,c]=m.useState(!1),[d,f]=m.useState(new Set),[h,p]=m.useState("timestamp"),[g,x]=m.useState("desc"),[j,y]=m.useState("all"),[b,N]=m.useState(!1),C=t.get("runId")??"",S=(t.get("agents")??"").split(",").map(F=>F.trim()).filter(Boolean),E=t.get("scenario")??"all",[A,k]=m.useState(C),[T,O]=m.useState(S),[D,q]=m.useState(E),[U,B]=m.useState(!1),X=async()=>{c(!0);try{i(await e.listResults())}catch(F){ke({title:"Could not load results",description:F instanceof Error?F.message:String(F),variant:"destructive"})}finally{c(!1)}};m.useEffect(()=>{let F=!0;return c(!0),e.listResults().then(te=>{F&&i(te)}).catch(te=>{F&&ke({title:"Could not load results",description:te instanceof Error?te.message:String(te),variant:"destructive"})}).finally(()=>{F&&c(!1)}),()=>{F=!1}},[e]);const W=F=>{if(h===F){x(te=>te==="asc"?"desc":"asc");return}p(F),x(F==="timestamp"?"desc":"asc")},M=F=>{f(te=>{const fe=new Set(te);return fe.has(F)?fe.delete(F):fe.add(F),fe})},z=m.useMemo(()=>{const F=new Set;return s.forEach(te=>{te.scenarios.forEach(fe=>{const Ee=String(fe.scenarioName??"").trim(),Me=String(fe.scenarioId??"").trim(),et=Ee||Me;et&&F.add(et)})}),Array.from(F).sort((te,fe)=>te.localeCompare(fe))},[s]),K=m.useMemo(()=>j==="all"?s:s.filter(F=>F.scenarios.some(te=>{const fe=String(te.scenarioName??"").trim(),Ee=String(te.scenarioId??"").trim();return(fe||Ee)===j})),[s,j]),V=m.useMemo(()=>[...K].sort((F,te)=>{let fe=0;return h==="id"&&(fe=F.id.localeCompare(te.id)),h==="timestamp"&&(fe=new Date(F.timestamp).getTime()-new Date(te.timestamp).getTime()),h==="passRate"&&(fe=F.overallPassRate-te.overallPassRate),h==="scenarios"&&(fe=F.totalScenarios-te.totalScenarios),g==="asc"?fe:-fe}),[K,h,g]),R=m.useMemo(()=>V.filter(F=>d.has(F.id)),[V,d]),G=F=>h!==F?a.jsx(wc,{className:"h-3.5 w-3.5 text-muted-foreground"}):g==="asc"?a.jsx(Cs,{className:"h-3.5 w-3.5"}):a.jsx(Qt,{className:"h-3.5 w-3.5"}),$=m.useMemo(()=>{const F=new Map;for(const te of V)F.set(te.id,BC(te));return F},[V]),I=F=>{const te=Array.from(new Set(F.scenarios.map(fe=>fe.agentId).filter(Boolean)));return te.slice(0,Math.min(2,te.length))},ee=F=>{const te=I(F);k(F.id),O(te),q("all");const fe=new URLSearchParams(t);fe.set("mode","within-run"),fe.set("runId",F.id),te.length>0?fe.set("agents",te.join(",")):fe.delete("agents"),fe.delete("scenario"),n(fe,{replace:!0})},Q=m.useMemo(()=>[...new Set(R.flatMap(F=>F.scenarios.map(te=>te.scenarioId)))],[R]),ie=m.useMemo(()=>{const F=new Map;for(const te of R)for(const fe of te.scenarios){const Ee=String(fe.scenarioId??"").trim();if(!Ee)continue;const Me=String(fe.scenarioName??"").trim();F.set(Ee,Me||Ee)}return F},[R]),ue=m.useMemo(()=>s.find(F=>F.id===A),[s,A]),re=m.useMemo(()=>{if(!ue)return[];const F=new Map;for(const te of ue.scenarios)F.set(te.agentId,te.agentName||te.agentId);return Array.from(F.entries()).map(([te,fe])=>({id:te,name:fe})).sort((te,fe)=>te.name.localeCompare(fe.name))},[ue]),je=m.useMemo(()=>{if(!ue)return[];const F=new Set;for(const te of ue.scenarios){const fe=String(te.scenarioName??"").trim(),Ee=String(te.scenarioId??"").trim(),Me=fe||Ee;Me&&F.add(Me)}return Array.from(F).sort((te,fe)=>te.localeCompare(fe))},[ue]),pe=m.useMemo(()=>T.join(","),[T]);m.useEffect(()=>{if(r==="within-run"){const F=t.get("runId")??"",te=(t.get("agents")??"").split(",").map(Ee=>Ee.trim()).filter(Boolean),fe=t.get("scenario")??"all";k(Ee=>Ee===F?Ee:F),O(Ee=>vye(Ee,te)?Ee:te),q(Ee=>Ee===fe?Ee:fe)}},[r,t]),m.useEffect(()=>{if(r!=="within-run"||s.length===0)return;let F=A;(!F||!s.some(xt=>xt.id===F))&&(F=s[0].id);const te=s.find(xt=>xt.id===F),fe=(()=>{if(!te)return[];const xt=new Map;for(const qt of te.scenarios)xt.set(qt.agentId,qt.agentName||qt.agentId);return Array.from(xt.keys())})(),Ee=new Set(fe);let Me=pe.split(",").map(xt=>xt.trim()).filter(xt=>!!xt).filter(xt=>Ee.has(xt));Me.length===0&&fe.length>0&&(Me=fe.slice(0,Math.min(2,fe.length)));const et=(()=>{if(!te)return new Set;const xt=new Set;for(const qt of te.scenarios){const Ut=String(qt.scenarioName??"").trim(),xe=String(qt.scenarioId??"").trim(),Ye=Ut||xe;Ye&&xt.add(Ye)}return new Set(xt)})(),st=D!=="all"&&!et.has(D)?"all":D;F!==A&&k(F),Me.join(",")!==pe&&O(Me),st!==D&&q(st)},[r,s,A,pe,D]),m.useEffect(()=>{const F=new URLSearchParams(t);r==="within-run"?(F.set("mode","within-run"),A?F.set("runId",A):F.delete("runId"),T.length>0?F.set("agents",T.join(",")):F.delete("agents"),D!=="all"?F.set("scenario",D):F.delete("scenario")):(F.delete("mode"),F.delete("runId"),F.delete("agents"),F.delete("scenario"));const te=t.toString(),fe=F.toString();te!==fe&&n(F,{replace:!0})},[r,A,T,D,t,n]);const oe=m.useMemo(()=>{if(!ue)return[];const F=new Map;for(const fe of ue.scenarios){const Ee=String(fe.scenarioId??"").trim(),Me=String(fe.scenarioName??"").trim(),et=Me||Ee;if(!Ee&&!et)continue;const st=Ee||et,xt=F.get(st);if(xt){xt.byAgent[fe.agentId]=fe;continue}F.set(st,{scenarioId:Ee||et,scenarioName:Me,displayLabel:et||Ee,byAgent:{[fe.agentId]:fe}})}const te=Array.from(F.values()).sort((fe,Ee)=>{const Me=(fe.displayLabel||fe.scenarioId).toLowerCase(),et=(Ee.displayLabel||Ee.scenarioId).toLowerCase();return Me.localeCompare(et)});return D==="all"?te:te.filter(fe=>fe.displayLabel===D)},[ue,D]),_e=m.useMemo(()=>{const F=new Map(re.map(te=>[te.id,te]));return T.map(te=>F.get(te)).filter(te=>!!te)},[T,re]),ce=m.useMemo(()=>{if(!ue||_e.length!==2)return null;const[F,te]=_e;return{left:F,right:te,link:`/compare/results?left=${encodeURIComponent(ue.id)}&right=${encodeURIComponent(ue.id)}&leftConfig=${encodeURIComponent(ue.configId)}&rightConfig=${encodeURIComponent(ue.configId)}&leftAgent=${encodeURIComponent(F.id)}&rightAgent=${encodeURIComponent(te.id)}`}},[ue,_e]),de=m.useMemo(()=>!ue||_e.length===0?[]:_e.map(F=>{const te=oe.map(Ut=>Ut.byAgent[F.id]).filter(Ut=>!!Ut),fe=te.flatMap(Ut=>Ut.runs),Ee=fe.length,Me=fe.filter(Ut=>Ut.passed).length,et=fe.reduce((Ut,xe)=>Ut+xe.toolCalls.length,0),st=fe.reduce((Ut,xe)=>Ut+xe.duration,0),{provider:xt,model:qt}=gye(te);return{agentId:F.id,agentName:F.name,provider:xt,model:qt,passRate:Ee===0?0:Me/Ee,totalRuns:Ee,avgToolCalls:Ee===0?0:et/Ee,avgLatency:Ee===0?0:st/Ee}}),[ue,_e,oe]),ve=F=>{O(te=>te.includes(F)?te.filter(fe=>fe!==F):[...te,F])},Pe=F=>a.jsxs("div",{className:"min-w-0 rounded border bg-muted/20 px-2 py-1.5",children:[a.jsxs("div",{className:"text-xs",children:[a.jsxs("span",{className:"font-mono",children:["#",F.runIndex+1]})," ",a.jsx("span",{className:F.passed?"text-emerald-700":"text-destructive",children:F.passed?"PASS":"FAIL"})," ","· tools: ",F.toolCalls.length," · ",F.duration,"ms"]}),!F.passed&&F.failureReasons.length>0&&a.jsx("div",{className:"mt-1 max-h-16 overflow-y-auto whitespace-pre-wrap break-all pr-1 text-[11px] text-muted-foreground",children:F.failureReasons.join("; ")})]},F.runIndex);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(vN,{className:"h-6 w-6"}),"Compare Runs"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:r==="runs"?"Select 2–5 runs to compare":"Compare agents side-by-side within one run"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[r==="within-run"&&a.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>{const F=new URLSearchParams(t);F.delete("mode"),F.delete("runId"),F.delete("agents"),F.delete("scenario"),n(F,{replace:!0})},children:[a.jsx(sD,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]}),r==="runs"&&a.jsxs(pl,{open:b,onOpenChange:N,children:[a.jsx(hl,{asChild:!0,children:a.jsxs(ne,{type:"button",variant:"outline",role:"combobox","aria-expanded":b,className:"w-[260px] justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:j==="all"?"All scenarios":j}),a.jsx(Qt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(co,{className:"w-[260px] p-0",align:"start",children:a.jsxs(vl,{children:[a.jsx(gl,{placeholder:"Search scenarios..."}),a.jsxs(xl,{children:[a.jsx(yl,{children:"No scenarios found."}),a.jsxs(bl,{children:[a.jsx(ma,{value:"all scenarios",onSelect:()=>{y("all"),N(!1)},children:"All scenarios"}),z.map(F=>a.jsx(ma,{value:F,onSelect:()=>{y(F),N(!1)},children:F},F))]})]})]})})]}),a.jsx(ne,{variant:"outline",onClick:()=>{X()},disabled:o,children:o?"Refreshing...":"Refresh"})]})]}),r==="within-run"&&a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Within One Run Controls"})}),a.jsxs(Ge,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Run"}),a.jsxs(_n,{value:A,onValueChange:k,children:[a.jsx(bn,{children:a.jsx(An,{placeholder:"Select run"})}),a.jsx(wn,{children:s.map(F=>a.jsx(ot,{value:F.id,children:F.id},F.id))})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Scenario filter"}),a.jsxs(pl,{open:U,onOpenChange:B,children:[a.jsx(hl,{asChild:!0,children:a.jsxs(ne,{type:"button",variant:"outline",role:"combobox","aria-expanded":U,className:"w-full justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:D==="all"?"All scenarios":D}),a.jsx(Qt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(co,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:a.jsxs(vl,{children:[a.jsx(gl,{placeholder:"Search scenarios..."}),a.jsxs(xl,{children:[a.jsx(yl,{children:"No scenarios found."}),a.jsxs(bl,{children:[a.jsx(ma,{value:"all scenarios",onSelect:()=>{q("all"),B(!1)},children:"All scenarios"}),je.map(F=>a.jsx(ma,{value:F,onSelect:()=>{q(F),B(!1)},children:F},F))]})]})]})})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Agents (select 2+)"}),a.jsxs("div",{className:"flex flex-wrap gap-3 rounded-md border p-3",children:[re.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available for selected run."}),re.map(F=>a.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[a.jsx(Jr,{checked:T.includes(F.id),onCheckedChange:()=>ve(F.id)}),a.jsx("span",{children:F.name})]},F.id))]})]})]})]}),r==="runs"&&a.jsx(Ke,{children:a.jsx(Ge,{className:"p-0",children:a.jsxs(Kr,{containerClassName:"max-h-[36rem] overflow-auto",children:[a.jsx(Gr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(it,{className:"w-10"}),a.jsx(it,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>W("id"),children:["Run ID",G("id")]})}),a.jsx(it,{children:"Evaluated"}),a.jsx(it,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>W("timestamp"),children:["Timestamp",G("timestamp")]})}),a.jsx(it,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex w-full items-center justify-end gap-1 hover:text-foreground",onClick:()=>W("passRate"),children:["Pass Rate",G("passRate")]})}),a.jsx(it,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>W("scenarios"),children:["Scenarios",G("scenarios")]})}),a.jsx(it,{className:"text-right",children:"Agents"}),a.jsx(it,{className:"w-[140px] text-right",children:"Action"})]})}),a.jsx(Yr,{children:V.map(F=>a.jsxs(Gt,{children:[a.jsx(We,{children:a.jsx(Jr,{checked:d.has(F.id),onCheckedChange:()=>M(F.id),disabled:!d.has(F.id)&&d.size>=5})}),a.jsx(We,{className:"font-mono text-xs",children:F.id}),a.jsx(We,{className:"text-[11px] text-muted-foreground",children:(()=>{const te=$.get(F.id)??{scenarioCount:0,agentCount:0,scopePreview:"n/a",modelSummary:""};return a.jsxs("div",{className:"space-y-0.5",children:[a.jsxs("div",{children:["Evaluated: ",te.scenarioCount," scenario",te.scenarioCount===1?"":"s"," · ",te.agentCount," agent",te.agentCount===1?"":"s",te.modelSummary?` · ${te.modelSummary}`:""]}),a.jsx("div",{className:"font-mono text-xs text-foreground/80",children:te.scopePreview})]})})()}),a.jsx(We,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(yi,{className:"h-3 w-3"}),new Date(F.timestamp).toLocaleString()]})}),a.jsx(We,{className:"text-right",children:a.jsx(ni,{rate:F.overallPassRate})}),a.jsx(We,{className:"text-right font-mono text-sm",children:F.totalScenarios}),a.jsx(We,{className:"text-right font-mono text-sm",children:$.get(F.id)?.agentCount??0}),a.jsx(We,{className:"text-right",children:($.get(F.id)?.agentCount??0)>1?a.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>ee(F),children:"Compare agents"}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})]},F.id))})]})})}),r==="runs"&&R.length<2&&a.jsx(Ke,{children:a.jsxs(Ge,{className:"py-12 text-center",children:[a.jsx("p",{className:"text-sm font-medium",children:"No runs selected"}),a.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Select 2–5 runs from the table above to start a comparison."})]})}),r==="runs"&&R.length>=2&&a.jsxs(a.Fragment,{children:[R.length===2&&a.jsx(Ke,{children:a.jsx(Ge,{className:"pt-6",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"Need a deeper comparison?"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the two selected runs in a dedicated side-by-side full result compare view."})]}),a.jsx(ne,{asChild:!0,size:"sm",children:a.jsx(Tt,{to:`/compare/results?left=${encodeURIComponent(R[0].id)}&right=${encodeURIComponent(R[1].id)}&leftConfig=${encodeURIComponent(R[0].configId)}&rightConfig=${encodeURIComponent(R[1].configId)}`,children:"Compare full results"})})]})})}),a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Summary Comparison"})}),a.jsx(Ge,{className:"max-h-[24rem] overflow-auto p-0",children:a.jsxs(Kr,{className:"table-fixed",children:[a.jsx(Gr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(it,{className:"w-[220px]",children:"Metric"}),R.map((F,te)=>a.jsx(it,{style:{color:Jj[te]},className:"font-mono text-xs",children:F.id},F.id))]})}),a.jsxs(Yr,{children:[a.jsxs(Gt,{children:[a.jsx(We,{className:"font-medium text-right",children:"Pass Rate"}),R.map(F=>a.jsx(We,{className:"text-right",children:a.jsx(ni,{rate:F.overallPassRate})},F.id))]}),a.jsxs(Gt,{children:[a.jsx(We,{className:"font-medium",children:"Total Runs"}),R.map(F=>a.jsx(We,{className:"font-mono",children:F.totalRuns},F.id))]}),a.jsxs(Gt,{children:[a.jsx(We,{className:"font-medium",children:"Tool Calls"}),R.map(F=>a.jsx(We,{className:"font-mono",children:F.avgToolCalls.toFixed(1)},F.id))]}),a.jsxs(Gt,{children:[a.jsx(We,{className:"font-medium",children:"Avg Latency"}),R.map(F=>a.jsxs(We,{className:"font-mono",children:[F.avgLatency,"ms"]},F.id))]})]})]})})]}),a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Scenario Breakdown"})}),a.jsx(Ge,{className:"max-h-[26rem] overflow-auto p-0",children:a.jsxs(Kr,{className:"table-fixed",children:[a.jsx(Gr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(it,{className:"w-[220px]",children:"Scenario"}),R.map((F,te)=>a.jsx(it,{style:{color:Jj[te]},className:"font-mono text-xs",children:F.id},F.id))]})}),a.jsx(Yr,{children:Q.map(F=>a.jsxs(Gt,{children:[a.jsx(We,{className:"font-medium text-sm",children:ie.get(F)??F}),R.map(te=>{const fe=te.scenarios.find(Ee=>Ee.scenarioId===F);return a.jsx(We,{className:"text-right",children:fe?a.jsx(ni,{rate:fe.passRate}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},te.id)})]},F))})]})})]})]}),r==="runs"&&R.length>=2&&a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Pass Rate Trend"})}),a.jsx(Ge,{className:"h-72",children:a.jsx(cm,{width:"100%",height:"100%",children:a.jsxs(V1,{data:R.map((F,te)=>({idx:te+1,runId:F.id,passRate:Number((F.overallPassRate*100).toFixed(1))})),children:[a.jsx(oo,{dataKey:"idx",tickFormatter:F=>String(F)}),a.jsx(lo,{unit:"%",domain:[0,100]}),a.jsx(Wr,{formatter:F=>[`${F}%`,"Pass Rate"],labelFormatter:F=>`Run ${F}`}),a.jsx(Xo,{}),a.jsx(ul,{type:"monotone",dataKey:"passRate",stroke:Jj[0],strokeWidth:2.5,dot:!0})]})})})]}),r==="within-run"&&ue&&_e.length<2&&a.jsx(Ke,{children:a.jsx(Ge,{className:"pt-6 text-sm text-muted-foreground",children:"Select at least 2 agents to compare side-by-side within this run."})}),r==="within-run"&&ue&&_e.length>=2&&a.jsxs(a.Fragment,{children:[a.jsx(Ke,{children:a.jsx(Ge,{className:"pt-6",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"Need full result details?"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:ce?"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."})]}),a.jsx(ne,{asChild:!0,size:"sm",children:ce?a.jsx(Tt,{to:ce.link,children:"Compare full results"}):a.jsx(Tt,{to:`/results/${encodeURIComponent(ue.id)}${ue.configId?`?configId=${encodeURIComponent(ue.configId)}`:""}`,children:"Open full result"})})]})})}),a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Agent Summary"})}),a.jsx(Ge,{className:"max-h-[24rem] overflow-auto p-0",children:a.jsxs(Kr,{children:[a.jsx(Gr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(it,{children:"Metric"}),de.map(F=>a.jsxs(it,{children:[a.jsx("div",{className:"font-medium text-sm",children:F.agentName}),(F.provider||F.model)&&a.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[F.provider?rv(F.provider):null,F.model].filter(Boolean).join(" · ")})]},F.agentId))]})}),a.jsxs(Yr,{children:[a.jsxs(Gt,{children:[a.jsx(We,{className:"font-medium text-right",children:"Pass Rate"}),de.map(F=>a.jsx(We,{className:"text-right",children:a.jsx(ni,{rate:F.passRate})},F.agentId))]}),a.jsxs(Gt,{children:[a.jsx(We,{className:"font-medium",children:"Total Runs"}),de.map(F=>a.jsx(We,{className:"font-mono",children:F.totalRuns},F.agentId))]}),a.jsxs(Gt,{children:[a.jsx(We,{className:"font-medium",children:"Avg Tool Calls"}),de.map(F=>a.jsx(We,{className:"font-mono",children:F.avgToolCalls.toFixed(1)},F.agentId))]}),a.jsxs(Gt,{children:[a.jsx(We,{className:"font-medium",children:"Avg Latency"}),de.map(F=>a.jsxs(We,{className:"font-mono",children:[Math.round(F.avgLatency),"ms"]},F.agentId))]})]})]})})]}),a.jsxs(Ke,{children:[a.jsx(Rt,{className:"pb-3",children:a.jsx(It,{className:"text-base",children:"Scenario × Agent Matrix"})}),a.jsx(Ge,{className:"max-h-[34rem] overflow-auto p-0",children:a.jsxs(Kr,{className:"table-fixed",children:[a.jsx(Gr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(it,{className:"w-[260px]",children:"Scenario"}),_e.map(F=>{const te=de.find(fe=>fe.agentId===F.id);return a.jsxs(it,{children:[a.jsx("div",{className:"font-medium text-sm",children:F.name}),(te?.provider||te?.model)&&a.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[te.provider?rv(te.provider):null,te.model].filter(Boolean).join(" · ")})]},F.id)})]})}),a.jsx(Yr,{children:oe.map(F=>a.jsxs(Gt,{children:[a.jsx(We,{className:"font-medium text-sm",children:F.displayLabel}),_e.map(te=>{const fe=F.byAgent[te.id];return fe?a.jsx(We,{className:"min-w-0 align-top",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"text-xs text-muted-foreground",children:[a.jsx(ni,{rate:fe.passRate})," ",a.jsxs("span",{className:"ml-2",children:["runs: ",fe.runs.length]})," · calls:"," ",fe.avgToolCalls.toFixed(1)," · latency:"," ",Math.round(fe.avgDuration),"ms"]}),fe.runs.length>0?a.jsx("div",{className:"space-y-1.5",children:fe.runs.map(Ee=>Pe(Ee))}):a.jsx("div",{className:"text-xs text-muted-foreground",children:"No runs captured."})]})},te.id):a.jsx(We,{children:a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},te.id)})]},F.scenarioId))})]})})]})]})]})},k$=(e,t,n)=>{const r=new URLSearchParams;return t&&r.set("configId",t),n&&r.set("agent",n),r.set("embed","1"),`/results/${encodeURIComponent(e)}?${r.toString()}`},P$=(e,t,n)=>{const r=new URLSearchParams;t&&r.set("configId",t),n&&r.set("agent",n);const s=r.toString();return`/results/${encodeURIComponent(e)}${s?`?${s}`:""}`},yye=()=>{const[e]=wi(),t=e.get("left")??"",n=e.get("right")??"",r=e.get("leftConfig"),s=e.get("rightConfig"),i=e.get("leftAgent"),o=e.get("rightAgent"),c=i?`${t} · ${i}`:t,d=o?`${n} · ${o}`:n;return!t||!n?a.jsxs(Ke,{children:[a.jsx(Rt,{children:a.jsx(It,{className:"text-base",children:"Full Result Compare"})}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Select exactly two runs in Compare and use the “Compare full results” action."}),a.jsx(ne,{asChild:!0,variant:"outline",children:a.jsx(Tt,{to:"/compare",children:"Back to Compare"})})]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Full Result Compare"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:i||o?"Side-by-side Result Detail views for deep inspection, filtered by selected agents.":"Side-by-side Result Detail views for deep inspection."})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(ne,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs(Tt,{to:"/compare",children:[a.jsx(sD,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),a.jsx(ne,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs("a",{href:P$(t,r,i),target:"_blank",rel:"noreferrer",children:["Open Left",a.jsx(qh,{className:"ml-1.5 h-3.5 w-3.5"})]})}),a.jsx(ne,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs("a",{href:P$(n,s,o),target:"_blank",rel:"noreferrer",children:["Open Right",a.jsx(qh,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[a.jsxs(Ke,{className:"overflow-hidden",children:[a.jsx(Rt,{className:"py-3",children:a.jsx(It,{className:"text-sm font-mono",children:c})}),a.jsx(Ge,{className:"p-0",children:a.jsx("iframe",{title:`Result ${c}`,src:k$(t,r,i),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),a.jsxs(Ke,{className:"overflow-hidden",children:[a.jsx(Rt,{className:"py-3",children:a.jsx(It,{className:"text-sm font-mono",children:d})}),a.jsx(Ge,{className:"p-0",children:a.jsx("iframe",{title:`Result ${d}`,src:k$(n,s,o),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function bye(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function wye(){const{source:e}=Ln(),[t,n]=m.useState([]),[r,s]=m.useState(!0),[i,o]=m.useState(null),[c,d]=m.useState(!1),f=async()=>{s(!0);try{n(await e.listMarkdownReports())}catch(x){ke({title:"Could not load markdown reports",description:x instanceof Error?x.message:String(x),variant:"destructive"})}finally{s(!1)}};m.useEffect(()=>{f()},[]);const h=m.useMemo(()=>t[0],[t]),p=m.useMemo(()=>t.find(x=>x.relativePath===i)??null,[t,i]),g=async()=>{if(i){d(!0);try{await e.deleteMarkdownReport(i),n(x=>x.filter(j=>j.relativePath!==i)),ke({title:"Markdown report deleted"}),o(null)}catch(x){ke({title:"Could not delete markdown report",description:x instanceof Error?x.message:String(x),variant:"destructive"})}finally{d(!1)}}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(mc,{className:"h-6 w-6"}),"Markdown Reports"]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Browse Markdown files under ",a.jsx("code",{children:"mcplab/reports"}),"."]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ne,{variant:"outline",onClick:()=>{f()},children:"Refresh"}),h?a.jsx(ne,{asChild:!0,variant:"outline",children:a.jsx(Tt,{to:`/markdown-reports/view?path=${encodeURIComponent(h.relativePath)}`,children:"Open latest"})}):null]})]}),a.jsx(Ke,{children:a.jsx(Ge,{className:"p-0",children:r?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading markdown reports..."}):t.length===0?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No markdown reports found yet."}):a.jsxs(Kr,{children:[a.jsx(Gr,{children:a.jsxs(Gt,{children:[a.jsx(it,{children:"Report"}),a.jsx(it,{children:"Result"}),a.jsx(it,{children:"Folder"}),a.jsx(it,{children:"Timestamp"}),a.jsx(it,{className:"w-10"})]})}),a.jsx(Yr,{children:t.map(x=>a.jsxs(Gt,{children:[a.jsx(We,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(Tt,{to:`/markdown-reports/view?path=${encodeURIComponent(x.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:x.name}),a.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:x.relativePath})]})}),a.jsx(We,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=bye(x.relativePath);return j?a.jsx(Tt,{to:`/results/${encodeURIComponent(j)}`,className:"text-primary hover:underline",children:j}):a.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),a.jsx(We,{className:"text-xs text-muted-foreground font-mono",children:x.relativePath.includes("/")?x.relativePath.slice(0,x.relativePath.lastIndexOf("/")):"."}),a.jsx(We,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(yi,{className:"h-3 w-3"}),new Date(x.mtime).toLocaleString()]})}),a.jsx(We,{children:a.jsxs(Xf,{children:[a.jsx(Qf,{asChild:!0,children:a.jsx(ne,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(uv,{className:"h-4 w-4"})})}),a.jsxs(Cu,{align:"end",children:[a.jsx(Qr,{asChild:!0,children:a.jsx(Tt,{to:`/markdown-reports/view?path=${encodeURIComponent(x.relativePath)}`,children:"View"})}),a.jsxs(Qr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(x.relativePath)},children:[a.jsx($a,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},x.path))})]})})}),a.jsx(Bs,{open:!!i,onOpenChange:x=>!x&&o(null),children:a.jsxs(cs,{children:[a.jsxs(us,{children:[a.jsx(fs,{children:"Delete markdown report?"}),a.jsx(ps,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),a.jsxs(ds,{children:[a.jsx(ms,{disabled:c,children:"Cancel"}),a.jsx(hs,{onClick:x=>{x.preventDefault(),g()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function jye(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Sye(e){const 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 Nye(){const{source:e}=Ln(),[t]=wi(),n=(t.get("path")??"").trim(),[r,s]=m.useState(null),[i,o]=m.useState(!0),[c,d]=m.useState(!1),[f,h]=m.useState(!1);if(m.useEffect(()=>{let g=!0;if(s(null),d(!1),!n){o(!1);return}return o(!0),e.getMarkdownReport(n).then(x=>{g&&s(x)}).catch(x=>{if(!g)return;const j=x instanceof Error?x.message:String(x);if(j.includes("(404)")){d(!0);return}ke({title:"Could not load markdown report",description:j,variant:"destructive"})}).finally(()=>{g&&o(!1)}),()=>{g=!1}},[n,e]),!n)return a.jsxs("div",{className:"space-y-4",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Missing report path."}),a.jsx(ne,{asChild:!0,variant:"outline",children:a.jsx(Tt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});if(i)return a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown report..."});if(c||!r)return a.jsxs("div",{className:"space-y-4",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Report not found."}),a.jsx(ne,{asChild:!0,variant:"outline",children:a.jsx(Tt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=Sye(r);return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.name}),a.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[a.jsx("span",{className:"font-mono",children:r.relativePath}),a.jsx("span",{"aria-hidden":!0,children:"·"}),a.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[a.jsx(yi,{className:"h-3 w-3 shrink-0"}),new Date(r.mtime).toLocaleString()]}),a.jsx("span",{"aria-hidden":!0,children:"·"}),a.jsx("span",{children:jye(r.sizeBytes)})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[p?a.jsxs(a.Fragment,{children:[a.jsx(ne,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),a.jsx(ne,{asChild:!0,variant:"outline",size:"sm",children:a.jsx(Tt,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,a.jsx(ne,{asChild:!0,variant:"outline",size:"sm",children:a.jsx(Tt,{to:"/markdown-reports",children:"Back to reports"})})]})]}),a.jsx(Ke,{children:a.jsx(Ge,{className:"pt-6",children:a.jsx(Ma,{text:r.content,variant:"assistant"})})}),p?a.jsx(G5,{open:f,onOpenChange:h,children:a.jsxs(zN,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[a.jsx(X5,{className:"border-b px-4 py-3 pr-12",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs(Q5,{className:"text-base",children:["Result ",p]}),a.jsx(ne,{asChild:!0,variant:"outline",size:"sm",children:a.jsx(Tt,{to:`/results/${encodeURIComponent(p)}`,target:"_blank",rel:"noreferrer",children:"Open full page"})})]})}),a.jsx("div",{className:"h-[calc(100vh-64px)]",children:a.jsx("iframe",{title:`Result ${p}`,src:`/results/${encodeURIComponent(p)}?embed=1`,className:"h-full w-full border-0"})})]})}):null]})}const Cye=()=>{const e=Ds();return m.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),a.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),a.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},_ye=new EH;function Aye(){const{scenarioId:e}=Nl();return a.jsx(v5,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const Eye=()=>a.jsx(PH,{client:_ye,children:a.jsx(ao,{children:a.jsx(WY,{children:a.jsx(GY,{children:a.jsxs(KY,{children:[a.jsx(O9,{}),a.jsx(uW,{}),a.jsx(TK,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:a.jsxs(jK,{children:[a.jsxs(gn,{element:a.jsx(HY,{}),children:[a.jsx(gn,{path:"/",element:a.jsx(wpe,{})}),a.jsx(gn,{path:"/mcp-evaluations",element:a.jsx(Bme,{})}),a.jsx(gn,{path:"/mcp-evaluations/:id",element:a.jsx(e$,{})}),a.jsx(gn,{path:"/mcp-evaluations/:id/:tab",element:a.jsx(e$,{})}),a.jsx(gn,{path:"/tool-analysis",element:a.jsx(Lxe,{})}),a.jsx(gn,{path:"/tool-analysis-results",element:a.jsx(Fxe,{})}),a.jsx(gn,{path:"/tool-analysis-results/:id",element:a.jsx(zxe,{})}),a.jsx(gn,{path:"/oauth-debugger",element:a.jsx(Hxe,{})}),a.jsx(gn,{path:"/libraries/servers",element:a.jsx(Zve,{})}),a.jsx(gn,{path:"/libraries/servers/:serverId",element:a.jsx(ege,{})}),a.jsx(gn,{path:"/libraries/agents",element:a.jsx(tge,{})}),a.jsx(gn,{path:"/libraries/agents/:agentName",element:a.jsx(uxe,{})}),a.jsx(gn,{path:"/libraries/test-cases",element:a.jsx(u$,{})}),a.jsx(gn,{path:"/libraries/test-cases/:testCaseId",element:a.jsx(u$,{})}),a.jsx(gn,{path:"/libraries/scenarios",element:a.jsx(v5,{to:"/libraries/test-cases",replace:!0})}),a.jsx(gn,{path:"/libraries/scenarios/:scenarioId",element:a.jsx(Aye,{})}),a.jsx(gn,{path:"/settings",element:a.jsx(dxe,{})}),a.jsx(gn,{path:"/settings/mcp",element:a.jsx(xxe,{})}),a.jsx(gn,{path:"/run",element:a.jsx(Jxe,{})}),a.jsx(gn,{path:"/results",element:a.jsx(iye,{})}),a.jsx(gn,{path:"/results/:id",element:a.jsx(uye,{})}),a.jsx(gn,{path:"/markdown-reports",element:a.jsx(wye,{})}),a.jsx(gn,{path:"/markdown-reports/view",element:a.jsx(Nye,{})}),a.jsx(gn,{path:"/compare",element:a.jsx(xye,{})}),a.jsx(gn,{path:"/compare/results",element:a.jsx(yye,{})})]}),a.jsx(gn,{path:"*",element:a.jsx(Cye,{})})]})})]})})})})});kU.createRoot(document.getElementById("root")).render(a.jsx(Eye,{}));
|