@inspectr/mcplab 1.12.0 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
function dU(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 o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{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 o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var eh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function un(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dy={exports:{}},od={},fy={exports:{}},Kt={};var EE;function fU(){if(EE)return Kt;EE=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"),o=Symbol.for("react.provider"),i=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 x(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,b={};function y(D,I,ne){this.props=D,this.context=I,this.refs=b,this.updater=ne||g}y.prototype.isReactComponent={},y.prototype.setState=function(D,I){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,I,"setState")},y.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=y.prototype;function C(D,I,ne){this.props=D,this.context=I,this.refs=b,this.updater=ne||g}var N=C.prototype=new S;N.constructor=C,j(N,y.prototype),N.isPureReactComponent=!0;var E=Array.isArray,A=Object.prototype.hasOwnProperty,k={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function T(D,I,ne){var te,de={},he=null,V=null;if(I!=null)for(te in I.ref!==void 0&&(V=I.ref),I.key!==void 0&&(he=""+I.key),I)A.call(I,te)&&!O.hasOwnProperty(te)&&(de[te]=I[te]);var ue=arguments.length-2;if(ue===1)de.children=ne;else if(1<ue){for(var Q=Array(ue),Z=0;Z<ue;Z++)Q[Z]=arguments[Z+2];de.children=Q}if(D&&D.defaultProps)for(te in ue=D.defaultProps,ue)de[te]===void 0&&(de[te]=ue[te]);return{$$typeof:e,type:D,key:he,ref:V,props:de,_owner:k.current}}function $(D,I){return{$$typeof:e,type:D.type,key:I,ref:D.ref,props:D.props,_owner:D._owner}}function B(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function q(D){var I={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ne){return I[ne]})}var F=/\/+/g;function H(D,I){return typeof D=="object"&&D!==null&&D.key!=null?q(""+D.key):I.toString(36)}function U(D,I,ne,te,de){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var V=!1;if(D===null)V=!0;else switch(he){case"string":case"number":V=!0;break;case"object":switch(D.$$typeof){case e:case t:V=!0}}if(V)return V=D,de=de(V),D=te===""?"."+H(V,0):te,E(de)?(ne="",D!=null&&(ne=D.replace(F,"$&/")+"/"),U(de,I,ne,"",function(Z){return Z})):de!=null&&(B(de)&&(de=$(de,ne+(!de.key||V&&V.key===de.key?"":(""+de.key).replace(F,"$&/")+"/")+D)),I.push(de)),1;if(V=0,te=te===""?".":te+":",E(D))for(var ue=0;ue<D.length;ue++){he=D[ue];var Q=te+H(he,ue);V+=U(he,I,ne,Q,de)}else if(Q=x(D),typeof Q=="function")for(D=Q.call(D),ue=0;!(he=D.next()).done;)he=he.value,Q=te+H(he,ue++),V+=U(he,I,ne,Q,de);else if(he==="object")throw I=String(D),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.");return V}function R(D,I,ne){if(D==null)return D;var te=[],de=0;return U(D,te,"","",function(he){return I.call(ne,he,de++)}),te}function W(D){if(D._status===-1){var I=D._result;I=I(),I.then(function(ne){(D._status===0||D._status===-1)&&(D._status=1,D._result=ne)},function(ne){(D._status===0||D._status===-1)&&(D._status=2,D._result=ne)}),D._status===-1&&(D._status=0,D._result=I)}if(D._status===1)return D._result.default;throw D._result}var X={current:null},G={transition:null},z={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:G,ReactCurrentOwner:k};function J(){throw Error("act(...) is not supported in production builds of React.")}return Kt.Children={map:R,forEach:function(D,I,ne){R(D,function(){I.apply(this,arguments)},ne)},count:function(D){var I=0;return R(D,function(){I++}),I},toArray:function(D){return R(D,function(I){return I})||[]},only:function(D){if(!B(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Kt.Component=y,Kt.Fragment=n,Kt.Profiler=s,Kt.PureComponent=C,Kt.StrictMode=r,Kt.Suspense=d,Kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=z,Kt.act=J,Kt.cloneElement=function(D,I,ne){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var te=j({},D.props),de=D.key,he=D.ref,V=D._owner;if(I!=null){if(I.ref!==void 0&&(he=I.ref,V=k.current),I.key!==void 0&&(de=""+I.key),D.type&&D.type.defaultProps)var ue=D.type.defaultProps;for(Q in I)A.call(I,Q)&&!O.hasOwnProperty(Q)&&(te[Q]=I[Q]===void 0&&ue!==void 0?ue[Q]:I[Q])}var Q=arguments.length-2;if(Q===1)te.children=ne;else if(1<Q){ue=Array(Q);for(var Z=0;Z<Q;Z++)ue[Z]=arguments[Z+2];te.children=ue}return{$$typeof:e,type:D.type,key:de,ref:he,props:te,_owner:V}},Kt.createContext=function(D){return D={$$typeof:i,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:o,_context:D},D.Consumer=D},Kt.createElement=T,Kt.createFactory=function(D){var I=T.bind(null,D);return I.type=D,I},Kt.createRef=function(){return{current:null}},Kt.forwardRef=function(D){return{$$typeof:c,render:D}},Kt.isValidElement=B,Kt.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:W}},Kt.memo=function(D,I){return{$$typeof:f,type:D,compare:I===void 0?null:I}},Kt.startTransition=function(D){var I=G.transition;G.transition={};try{D()}finally{G.transition=I}},Kt.unstable_act=J,Kt.useCallback=function(D,I){return X.current.useCallback(D,I)},Kt.useContext=function(D){return X.current.useContext(D)},Kt.useDebugValue=function(){},Kt.useDeferredValue=function(D){return X.current.useDeferredValue(D)},Kt.useEffect=function(D,I){return X.current.useEffect(D,I)},Kt.useId=function(){return X.current.useId()},Kt.useImperativeHandle=function(D,I,ne){return X.current.useImperativeHandle(D,I,ne)},Kt.useInsertionEffect=function(D,I){return X.current.useInsertionEffect(D,I)},Kt.useLayoutEffect=function(D,I){return X.current.useLayoutEffect(D,I)},Kt.useMemo=function(D,I){return X.current.useMemo(D,I)},Kt.useReducer=function(D,I,ne){return X.current.useReducer(D,I,ne)},Kt.useRef=function(D){return X.current.useRef(D)},Kt.useState=function(D){return X.current.useState(D)},Kt.useSyncExternalStore=function(D,I,ne){return X.current.useSyncExternalStore(D,I,ne)},Kt.useTransition=function(){return X.current.useTransition()},Kt.version="18.3.1",Kt}var kE;function rN(){return kE||(kE=1,fy.exports=fU()),fy.exports}var PE;function pU(){if(PE)return od;PE=1;var e=rN(),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,o={key:!0,ref:!0,__self:!0,__source:!0};function i(c,d,f){var h,p={},x=null,g=null;f!==void 0&&(x=""+f),d.key!==void 0&&(x=""+d.key),d.ref!==void 0&&(g=d.ref);for(h in d)r.call(d,h)&&!o.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:x,ref:g,props:p,_owner:s.current}}return od.Fragment=n,od.jsx=i,od.jsxs=i,od}var OE;function hU(){return OE||(OE=1,dy.exports=pU()),dy.exports}var a=hU(),th={},py={exports:{}},Dr={},hy={exports:{}},my={};var TE;function mU(){return TE||(TE=1,(function(e){function t(G,z){var J=G.length;G.push(z);e:for(;0<J;){var D=J-1>>>1,I=G[D];if(0<s(I,z))G[D]=z,G[J]=I,J=D;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var z=G[0],J=G.pop();if(J!==z){G[0]=J;e:for(var D=0,I=G.length,ne=I>>>1;D<ne;){var te=2*(D+1)-1,de=G[te],he=te+1,V=G[he];if(0>s(de,J))he<I&&0>s(V,de)?(G[D]=V,G[he]=J,D=he):(G[D]=de,G[te]=J,D=te);else if(he<I&&0>s(V,J))G[D]=V,G[he]=J,D=he;else break e}}return z}function s(G,z){var J=G.sortIndex-z.sortIndex;return J!==0?J:G.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,c=i.now();e.unstable_now=function(){return i.now()-c}}var d=[],f=[],h=1,p=null,x=3,g=!1,j=!1,b=!1,y=typeof setTimeout=="function"?setTimeout:null,S=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 N(G){for(var z=n(f);z!==null;){if(z.callback===null)r(f);else if(z.startTime<=G)r(f),z.sortIndex=z.expirationTime,t(d,z);else break;z=n(f)}}function E(G){if(b=!1,N(G),!j)if(n(d)!==null)j=!0,W(A);else{var z=n(f);z!==null&&X(E,z.startTime-G)}}function A(G,z){j=!1,b&&(b=!1,S(T),T=-1),g=!0;var J=x;try{for(N(z),p=n(d);p!==null&&(!(p.expirationTime>z)||G&&!q());){var D=p.callback;if(typeof D=="function"){p.callback=null,x=p.priorityLevel;var I=D(p.expirationTime<=z);z=e.unstable_now(),typeof I=="function"?p.callback=I:p===n(d)&&r(d),N(z)}else r(d);p=n(d)}if(p!==null)var ne=!0;else{var te=n(f);te!==null&&X(E,te.startTime-z),ne=!1}return ne}finally{p=null,x=J,g=!1}}var k=!1,O=null,T=-1,$=5,B=-1;function q(){return!(e.unstable_now()-B<$)}function F(){if(O!==null){var G=e.unstable_now();B=G;var z=!0;try{z=O(!0,G)}finally{z?H():(k=!1,O=null)}}else k=!1}var H;if(typeof C=="function")H=function(){C(F)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,R=U.port2;U.port1.onmessage=F,H=function(){R.postMessage(null)}}else H=function(){y(F,0)};function W(G){O=G,k||(k=!0,H())}function X(G,z){T=y(function(){G(e.unstable_now())},z)}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(G){G.callback=null},e.unstable_continueExecution=function(){j||g||(j=!0,W(A))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(G){switch(x){case 1:case 2:case 3:var z=3;break;default:z=x}var J=x;x=z;try{return G()}finally{x=J}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,z){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var J=x;x=G;try{return z()}finally{x=J}},e.unstable_scheduleCallback=function(G,z,J){var D=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?D+J:D):J=D,G){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=J+I,G={id:h++,callback:z,priorityLevel:G,startTime:J,expirationTime:I,sortIndex:-1},J>D?(G.sortIndex=J,t(f,G),n(d)===null&&G===n(f)&&(b?(S(T),T=-1):b=!0,X(E,J-D))):(G.sortIndex=I,t(d,G),j||g||(j=!0,W(A))),G},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(G){var z=x;return function(){var J=x;x=z;try{return G.apply(this,arguments)}finally{x=J}}}})(my)),my}var RE;function vU(){return RE||(RE=1,hy.exports=mU()),hy.exports}var IE;function gU(){if(IE)return Dr;IE=1;var e=rN(),t=vU();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 o(l,u){i(l,u),i(l+"Capture",u)}function i(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 x(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function g(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"||g(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 b(l,u,v,w,_,P,M){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=M}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){y[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var u=l[0];y[u]=new b(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){y[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){y[l]=new b(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){y[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){y[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){y[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){y[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){y[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([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(S,C);y[u]=new b(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(S,C);y[u]=new b(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(S,C);y[u]=new b(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){y[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),y.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){y[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function N(l,u,v,w){var _=y.hasOwnProperty(u)?y[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?x(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"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),B=Symbol.for("react.provider"),q=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),G=Symbol.iterator;function z(l){return l===null||typeof l!="object"?null:(l=G&&l[G]||l["@@iterator"],typeof l=="function"?l:null)}var J=Object.assign,D;function I(l){if(D===void 0)try{throw Error()}catch(v){var u=v.stack.trim().match(/\n( *(at )?)/);D=u&&u[1]||""}return`
|
|
2
|
-
`+D+l}var ne=!1;function te(l,u){if(!l||ne)return"";ne=!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(ye){var w=ye}Reflect.construct(l,[],u)}else{try{u.call()}catch(ye){w=ye}l.call(u.prototype)}else{try{throw Error()}catch(ye){w=ye}l()}}catch(ye){if(ye&&w&&typeof ye.stack=="string"){for(var _=ye.stack.split(`
|
|
3
|
-
`),P=w.stack.split(`
|
|
4
|
-
`),M=_.length-1,ee=P.length-1;1<=M&&0<=ee&&_[M]!==P[ee];)ee--;for(;1<=M&&0<=ee;M--,ee--)if(_[M]!==P[ee]){if(M!==1||ee!==1)do if(M--,ee--,0>ee||_[M]!==P[ee]){var ie=`
|
|
5
|
-
`+_[M].replace(" at new "," at ");return l.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",l.displayName)),ie}while(1<=M&&0<=ee);break}}}finally{ne=!1,Error.prepareStackTrace=v}return(l=l?l.displayName||l.name:"")?I(l):""}function de(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=te(l.type,!1),l;case 11:return l=te(l.type.render,!1),l;case 1:return l=te(l.type,!0),l;default:return""}}function he(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 O:return"Fragment";case k:return"Portal";case $:return"Profiler";case T:return"StrictMode";case H:return"Suspense";case U:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case q:return(l.displayName||"Context")+".Consumer";case B:return(l._context.displayName||"Context")+".Provider";case F:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case R:return u=l.displayName||null,u!==null?u:he(l.type)||"Memo";case W:u=l._payload,l=l._init;try{return he(l(u))}catch{}}return null}function V(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 he(u);case 8:return u===T?"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 ue(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function Q(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Z(l){var u=Q(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(M){w=""+M,P.call(this,M)}}),Object.defineProperty(l,u,{enumerable:v.enumerable}),{getValue:function(){return w},setValue:function(M){w=""+M},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function fe(l){l._valueTracker||(l._valueTracker=Z(l))}function ae(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var v=u.getValue(),w="";return l&&(w=Q(l)?l.checked?"true":"false":l.value),l=w,l!==v?(u.setValue(l),!0):!1}function Re(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 _e(l,u){var v=u.checked;return J({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??l._wrapperState.initialChecked})}function Me(l,u){var v=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;v=ue(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 L(l,u){u=u.checked,u!=null&&N(l,"checked",u,!1)}function oe(l,u){L(l,u);var v=ue(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,ue(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function pe(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"||Re(l.ownerDocument)!==l)&&(v==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+v&&(l.defaultValue=""+v))}var Xe=Array.isArray;function ht(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=""+ue(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 gt(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return J({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function mt(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(Xe(v)){if(1<v.length)throw Error(n(93));v=v[0]}u=v}u==null&&(u=""),v=u}l._wrapperState={initialValue:ue(v)}}function Vt(l,u){var v=ue(u.value),w=ue(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 qt(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function Ft(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 zt(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?Ft(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Ne,et=(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(Ne=Ne||document.createElement("div"),Ne.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=Ne.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function Ke(l,u){if(u){var v=l.firstChild;if(v&&v===l.lastChild&&v.nodeType===3){v.nodeValue=u;return}}l.textContent=u}var ve={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},ze=["Webkit","ms","Moz","O"];Object.keys(ve).forEach(function(l){ze.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),ve[u]=ve[l]})});function $e(l,u,v){return u==null||typeof u=="boolean"||u===""?"":v||typeof u!="number"||u===0||ve.hasOwnProperty(l)&&ve[l]?(""+u).trim():u+"px"}function Qe(l,u){l=l.style;for(var v in u)if(u.hasOwnProperty(v)){var w=v.indexOf("--")===0,_=$e(v,u[v],w);v==="float"&&(v="cssFloat"),w?l.setProperty(v,_):l[v]=_}}var Ce=J({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 qe(l,u){if(u){if(Ce[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 Xt(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 gn=null;function be(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var At=null,$t=null,Ut=null;function nn(l){if(l=Vu(l)){if(typeof At!="function")throw Error(n(280));var u=l.stateNode;u&&(u=mp(u),At(l.stateNode,l.type,u))}}function kn(l){$t?Ut?Ut.push(l):Ut=[l]:$t=l}function pt(){if($t){var l=$t,u=Ut;if(Ut=$t=null,nn(l),u)for(l=0;l<u.length;l++)nn(u[l])}}function Rt(l,u){return l(u)}function Bt(){}var rn=!1;function qn(l,u,v){if(rn)return l(u,v);rn=!0;try{return Rt(l,u,v)}finally{rn=!1,($t!==null||Ut!==null)&&(Bt(),pt())}}function ce(l,u){var v=l.stateNode;if(v===null)return null;var w=mp(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 st=!1;if(c)try{var Nt={};Object.defineProperty(Nt,"passive",{get:function(){st=!0}}),window.addEventListener("test",Nt,Nt),window.removeEventListener("test",Nt,Nt)}catch{st=!1}function on(l,u,v,w,_,P,M,ee,ie){var ye=Array.prototype.slice.call(arguments,3);try{u.apply(v,ye)}catch(Oe){this.onError(Oe)}}var xt=!1,Tn=null,Ln=!1,Da=null,So={onError:function(l){xt=!0,Tn=l}};function No(l,u,v,w,_,P,M,ee,ie){xt=!1,Tn=null,on.apply(So,arguments)}function Fs(l,u,v,w,_,P,M,ee,ie){if(No.apply(this,arguments),xt){if(xt){var ye=Tn;xt=!1,Tn=null}else throw Error(n(198));Ln||(Ln=!0,Da=ye)}}function Xr(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 yi(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 K(l){if(Xr(l)!==l)throw Error(n(188))}function ge(l){var u=l.alternate;if(!u){if(u=Xr(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 K(_),l;if(P===w)return K(_),u;P=P.sibling}throw Error(n(188))}if(v.return!==w.return)v=_,w=P;else{for(var M=!1,ee=_.child;ee;){if(ee===v){M=!0,v=_,w=P;break}if(ee===w){M=!0,w=_,v=P;break}ee=ee.sibling}if(!M){for(ee=P.child;ee;){if(ee===v){M=!0,v=P,w=_;break}if(ee===w){M=!0,w=P,v=_;break}ee=ee.sibling}if(!M)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 De(l){return l=ge(l),l!==null?ct(l):null}function ct(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=ct(l);if(u!==null)return u;l=l.sibling}return null}var Dt=t.unstable_scheduleCallback,Et=t.unstable_cancelCallback,Fn=t.unstable_shouldYield,Yn=t.unstable_requestPaint,ke=t.unstable_now,Rn=t.unstable_getCurrentPriorityLevel,jt=t.unstable_ImmediatePriority,Jt=t.unstable_UserBlockingPriority,Qr=t.unstable_NormalPriority,_u=t.unstable_LowPriority,Zf=t.unstable_IdlePriority,bi=null,va=null;function Rg(l){if(va&&typeof va.onCommitFiberRoot=="function")try{va.onCommitFiberRoot(bi,l,void 0,(l.current.flags&128)===128)}catch{}}var Jr=Math.clz32?Math.clz32:Se,Ig=Math.log,re=Math.LN2;function Se(l){return l>>>=0,l===0?32:31-(Ig(l)/re|0)|0}var dt=64,Le=4194304;function Ht(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 Ot(l,u){var v=l.pendingLanes;if(v===0)return 0;var w=0,_=l.suspendedLanes,P=l.pingedLanes,M=v&268435455;if(M!==0){var ee=M&~_;ee!==0?w=Ht(ee):(P&=M,P!==0&&(w=Ht(P)))}else M=v&~_,M!==0?w=Ht(M):P!==0&&(w=Ht(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-Jr(u),_=1<<v,w|=l[v],u&=~_;return w}function Nn(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 mr(l,u){for(var v=l.suspendedLanes,w=l.pingedLanes,_=l.expirationTimes,P=l.pendingLanes;0<P;){var M=31-Jr(P),ee=1<<M,ie=_[M];ie===-1?((ee&v)===0||(ee&w)!==0)&&(_[M]=Nn(ee,u)):ie<=u&&(l.expiredLanes|=ee),P&=~ee}}function dn(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Co(){var l=dt;return dt<<=1,(dt&4194240)===0&&(dt=64),l}function Pl(l){for(var u=[],v=0;31>v;v++)u.push(l);return u}function wi(l,u,v){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Jr(u),l[u]=v}function Au(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-Jr(v),P=1<<_;u[_]=0,w[_]=-1,l[_]=-1,v&=~P}}function Eu(l,u){var v=l.entangledLanes|=u;for(l=l.entanglements;v;){var w=31-Jr(v),_=1<<w;_&u|l[w]&u&&(l[w]|=u),v&=~_}}var ln=0;function o_(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var i_,Mg,l_,c_,u_,$g=!1,ep=[],_o=null,Ao=null,Eo=null,ku=new Map,Pu=new Map,ko=[],R6="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 d_(l,u){switch(l){case"focusin":case"focusout":_o=null;break;case"dragenter":case"dragleave":Ao=null;break;case"mouseover":case"mouseout":Eo=null;break;case"pointerover":case"pointerout":ku.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pu.delete(u.pointerId)}}function Ou(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&&Mg(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,_!==null&&u.indexOf(_)===-1&&u.push(_),l)}function I6(l,u,v,w,_){switch(u){case"focusin":return _o=Ou(_o,l,u,v,w,_),!0;case"dragenter":return Ao=Ou(Ao,l,u,v,w,_),!0;case"mouseover":return Eo=Ou(Eo,l,u,v,w,_),!0;case"pointerover":var P=_.pointerId;return ku.set(P,Ou(ku.get(P)||null,l,u,v,w,_)),!0;case"gotpointercapture":return P=_.pointerId,Pu.set(P,Ou(Pu.get(P)||null,l,u,v,w,_)),!0}return!1}function f_(l){var u=ji(l.target);if(u!==null){var v=Xr(u);if(v!==null){if(u=v.tag,u===13){if(u=yi(v),u!==null){l.blockedOn=u,u_(l.priority,function(){l_(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 tp(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var v=Lg(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(v===null){v=l.nativeEvent;var w=new v.constructor(v.type,v);gn=w,v.target.dispatchEvent(w),gn=null}else return u=Vu(v),u!==null&&Mg(u),l.blockedOn=v,!1;u.shift()}return!0}function p_(l,u,v){tp(l)&&v.delete(u)}function M6(){$g=!1,_o!==null&&tp(_o)&&(_o=null),Ao!==null&&tp(Ao)&&(Ao=null),Eo!==null&&tp(Eo)&&(Eo=null),ku.forEach(p_),Pu.forEach(p_)}function Tu(l,u){l.blockedOn===u&&(l.blockedOn=null,$g||($g=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,M6)))}function Ru(l){function u(_){return Tu(_,l)}if(0<ep.length){Tu(ep[0],l);for(var v=1;v<ep.length;v++){var w=ep[v];w.blockedOn===l&&(w.blockedOn=null)}}for(_o!==null&&Tu(_o,l),Ao!==null&&Tu(Ao,l),Eo!==null&&Tu(Eo,l),ku.forEach(u),Pu.forEach(u),v=0;v<ko.length;v++)w=ko[v],w.blockedOn===l&&(w.blockedOn=null);for(;0<ko.length&&(v=ko[0],v.blockedOn===null);)f_(v),v.blockedOn===null&&ko.shift()}var Ol=E.ReactCurrentBatchConfig,np=!0;function $6(l,u,v,w){var _=ln,P=Ol.transition;Ol.transition=null;try{ln=1,Dg(l,u,v,w)}finally{ln=_,Ol.transition=P}}function D6(l,u,v,w){var _=ln,P=Ol.transition;Ol.transition=null;try{ln=4,Dg(l,u,v,w)}finally{ln=_,Ol.transition=P}}function Dg(l,u,v,w){if(np){var _=Lg(l,u,v,w);if(_===null)tx(l,u,w,rp,v),d_(l,w);else if(I6(_,l,u,v,w))w.stopPropagation();else if(d_(l,w),u&4&&-1<R6.indexOf(l)){for(;_!==null;){var P=Vu(_);if(P!==null&&i_(P),P=Lg(l,u,v,w),P===null&&tx(l,u,w,rp,v),P===_)break;_=P}_!==null&&w.stopPropagation()}else tx(l,u,w,null,v)}}var rp=null;function Lg(l,u,v,w){if(rp=null,l=be(w),l=ji(l),l!==null)if(u=Xr(l),u===null)l=null;else if(v=u.tag,v===13){if(l=yi(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 rp=l,null}function h_(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(Rn()){case jt:return 1;case Jt:return 4;case Qr:case _u:return 16;case Zf:return 536870912;default:return 16}default:return 16}}var Po=null,Fg=null,ap=null;function m_(){if(ap)return ap;var l,u=Fg,v=u.length,w,_="value"in Po?Po.value:Po.textContent,P=_.length;for(l=0;l<v&&u[l]===_[l];l++);var M=v-l;for(w=1;w<=M&&u[v-w]===_[P-w];w++);return ap=_.slice(l,1<w?1-w:void 0)}function sp(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 op(){return!0}function v_(){return!1}function Zr(l){function u(v,w,_,P,M){this._reactName=v,this._targetInst=_,this.type=w,this.nativeEvent=P,this.target=M,this.currentTarget=null;for(var ee in l)l.hasOwnProperty(ee)&&(v=l[ee],this[ee]=v?v(P):P[ee]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?op:v_,this.isPropagationStopped=v_,this}return J(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=op)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=op)},persist:function(){},isPersistent:op}),u}var Tl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zg=Zr(Tl),Iu=J({},Tl,{view:0,detail:0}),L6=Zr(Iu),Bg,qg,Mu,ip=J({},Iu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wg,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"?(Bg=l.screenX-Mu.screenX,qg=l.screenY-Mu.screenY):qg=Bg=0,Mu=l),Bg)},movementY:function(l){return"movementY"in l?l.movementY:qg}}),g_=Zr(ip),F6=J({},ip,{dataTransfer:0}),z6=Zr(F6),B6=J({},Iu,{relatedTarget:0}),Ug=Zr(B6),q6=J({},Tl,{animationName:0,elapsedTime:0,pseudoElement:0}),U6=Zr(q6),W6=J({},Tl,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),V6=Zr(W6),H6=J({},Tl,{data:0}),x_=Zr(H6),K6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G6={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"},Y6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function X6(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=Y6[l])?!!u[l]:!1}function Wg(){return X6}var Q6=J({},Iu,{key:function(l){if(l.key){var u=K6[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=sp(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?G6[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wg,charCode:function(l){return l.type==="keypress"?sp(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?sp(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),J6=Zr(Q6),Z6=J({},ip,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),y_=Zr(Z6),eq=J({},Iu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wg}),tq=Zr(eq),nq=J({},Tl,{propertyName:0,elapsedTime:0,pseudoElement:0}),rq=Zr(nq),aq=J({},ip,{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}),sq=Zr(aq),oq=[9,13,27,32],Vg=c&&"CompositionEvent"in window,$u=null;c&&"documentMode"in document&&($u=document.documentMode);var iq=c&&"TextEvent"in window&&!$u,b_=c&&(!Vg||$u&&8<$u&&11>=$u),w_=" ",j_=!1;function S_(l,u){switch(l){case"keyup":return oq.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N_(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Rl=!1;function lq(l,u){switch(l){case"compositionend":return N_(u);case"keypress":return u.which!==32?null:(j_=!0,w_);case"textInput":return l=u.data,l===w_&&j_?null:l;default:return null}}function cq(l,u){if(Rl)return l==="compositionend"||!Vg&&S_(l,u)?(l=m_(),ap=Fg=Po=null,Rl=!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 b_&&u.locale!=="ko"?null:u.data;default:return null}}var uq={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 C_(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!uq[l.type]:u==="textarea"}function __(l,u,v,w){kn(w),u=fp(u,"onChange"),0<u.length&&(v=new zg("onChange","change",null,v,w),l.push({event:v,listeners:u}))}var Du=null,Lu=null;function dq(l){W_(l,0)}function lp(l){var u=Ll(l);if(ae(u))return l}function fq(l,u){if(l==="change")return u}var A_=!1;if(c){var Hg;if(c){var Kg="oninput"in document;if(!Kg){var E_=document.createElement("div");E_.setAttribute("oninput","return;"),Kg=typeof E_.oninput=="function"}Hg=Kg}else Hg=!1;A_=Hg&&(!document.documentMode||9<document.documentMode)}function k_(){Du&&(Du.detachEvent("onpropertychange",P_),Lu=Du=null)}function P_(l){if(l.propertyName==="value"&&lp(Lu)){var u=[];__(u,Lu,l,be(l)),qn(dq,u)}}function pq(l,u,v){l==="focusin"?(k_(),Du=u,Lu=v,Du.attachEvent("onpropertychange",P_)):l==="focusout"&&k_()}function hq(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return lp(Lu)}function mq(l,u){if(l==="click")return lp(u)}function vq(l,u){if(l==="input"||l==="change")return lp(u)}function gq(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var La=typeof Object.is=="function"?Object.is:gq;function Fu(l,u){if(La(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,_)||!La(l[_],u[_]))return!1}return!0}function O_(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function T_(l,u){var v=O_(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=O_(v)}}function R_(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?R_(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function I_(){for(var l=window,u=Re();u instanceof l.HTMLIFrameElement;){try{var v=typeof u.contentWindow.location.href=="string"}catch{v=!1}if(v)l=u.contentWindow;else break;u=Re(l.document)}return u}function Gg(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 xq(l){var u=I_(),v=l.focusedElem,w=l.selectionRange;if(u!==v&&v&&v.ownerDocument&&R_(v.ownerDocument.documentElement,v)){if(w!==null&&Gg(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=_),_=T_(v,P);var M=T_(v,w);_&&M&&(l.rangeCount!==1||l.anchorNode!==_.node||l.anchorOffset!==_.offset||l.focusNode!==M.node||l.focusOffset!==M.offset)&&(u=u.createRange(),u.setStart(_.node,_.offset),l.removeAllRanges(),P>w?(l.addRange(u),l.extend(M.node,M.offset)):(u.setEnd(M.node,M.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 yq=c&&"documentMode"in document&&11>=document.documentMode,Il=null,Yg=null,zu=null,Xg=!1;function M_(l,u,v){var w=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Xg||Il==null||Il!==Re(w)||(w=Il,"selectionStart"in w&&Gg(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=fp(Yg,"onSelect"),0<w.length&&(u=new zg("onSelect","select",null,u,v),l.push({event:u,listeners:w}),u.target=Il)))}function cp(l,u){var v={};return v[l.toLowerCase()]=u.toLowerCase(),v["Webkit"+l]="webkit"+u,v["Moz"+l]="moz"+u,v}var Ml={animationend:cp("Animation","AnimationEnd"),animationiteration:cp("Animation","AnimationIteration"),animationstart:cp("Animation","AnimationStart"),transitionend:cp("Transition","TransitionEnd")},Qg={},$_={};c&&($_=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function up(l){if(Qg[l])return Qg[l];if(!Ml[l])return l;var u=Ml[l],v;for(v in u)if(u.hasOwnProperty(v)&&v in $_)return Qg[l]=u[v];return l}var D_=up("animationend"),L_=up("animationiteration"),F_=up("animationstart"),z_=up("transitionend"),B_=new Map,q_="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 Oo(l,u){B_.set(l,u),o(u,[l])}for(var Jg=0;Jg<q_.length;Jg++){var Zg=q_[Jg],bq=Zg.toLowerCase(),wq=Zg[0].toUpperCase()+Zg.slice(1);Oo(bq,"on"+wq)}Oo(D_,"onAnimationEnd"),Oo(L_,"onAnimationIteration"),Oo(F_,"onAnimationStart"),Oo("dblclick","onDoubleClick"),Oo("focusin","onFocus"),Oo("focusout","onBlur"),Oo(z_,"onTransitionEnd"),i("onMouseEnter",["mouseout","mouseover"]),i("onMouseLeave",["mouseout","mouseover"]),i("onPointerEnter",["pointerout","pointerover"]),i("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var 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(" "),jq=new Set("cancel close invalid load scroll toggle".split(" ").concat(Bu));function U_(l,u,v){var w=l.type||"unknown-event";l.currentTarget=v,Fs(w,u,void 0,l),l.currentTarget=null}function W_(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 M=w.length-1;0<=M;M--){var ee=w[M],ie=ee.instance,ye=ee.currentTarget;if(ee=ee.listener,ie!==P&&_.isPropagationStopped())break e;U_(_,ee,ye),P=ie}else for(M=0;M<w.length;M++){if(ee=w[M],ie=ee.instance,ye=ee.currentTarget,ee=ee.listener,ie!==P&&_.isPropagationStopped())break e;U_(_,ee,ye),P=ie}}}if(Ln)throw l=Da,Ln=!1,Da=null,l}function Cn(l,u){var v=u[ix];v===void 0&&(v=u[ix]=new Set);var w=l+"__bubble";v.has(w)||(V_(u,l,2,!1),v.add(w))}function ex(l,u,v){var w=0;u&&(w|=4),V_(v,l,w,u)}var dp="_reactListening"+Math.random().toString(36).slice(2);function qu(l){if(!l[dp]){l[dp]=!0,r.forEach(function(v){v!=="selectionchange"&&(jq.has(v)||ex(v,!1,l),ex(v,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[dp]||(u[dp]=!0,ex("selectionchange",!1,u))}}function V_(l,u,v,w){switch(h_(u)){case 1:var _=$6;break;case 4:_=D6;break;default:_=Dg}v=_.bind(null,u,v,l),_=void 0,!st||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 tx(l,u,v,w,_){var P=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var M=w.tag;if(M===3||M===4){var ee=w.stateNode.containerInfo;if(ee===_||ee.nodeType===8&&ee.parentNode===_)break;if(M===4)for(M=w.return;M!==null;){var ie=M.tag;if((ie===3||ie===4)&&(ie=M.stateNode.containerInfo,ie===_||ie.nodeType===8&&ie.parentNode===_))return;M=M.return}for(;ee!==null;){if(M=ji(ee),M===null)return;if(ie=M.tag,ie===5||ie===6){w=P=M;continue e}ee=ee.parentNode}}w=w.return}qn(function(){var ye=P,Oe=be(v),Ie=[];e:{var Pe=B_.get(l);if(Pe!==void 0){var Ze=zg,ot=l;switch(l){case"keypress":if(sp(v)===0)break e;case"keydown":case"keyup":Ze=J6;break;case"focusin":ot="focus",Ze=Ug;break;case"focusout":ot="blur",Ze=Ug;break;case"beforeblur":case"afterblur":Ze=Ug;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":Ze=g_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ze=z6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ze=tq;break;case D_:case L_:case F_:Ze=U6;break;case z_:Ze=rq;break;case"scroll":Ze=L6;break;case"wheel":Ze=sq;break;case"copy":case"cut":case"paste":Ze=V6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ze=y_}var ut=(u&4)!==0,Un=!ut&&l==="scroll",me=ut?Pe!==null?Pe+"Capture":null:Pe;ut=[];for(var le=ye,xe;le!==null;){xe=le;var Be=xe.stateNode;if(xe.tag===5&&Be!==null&&(xe=Be,me!==null&&(Be=ce(le,me),Be!=null&&ut.push(Uu(le,Be,xe)))),Un)break;le=le.return}0<ut.length&&(Pe=new Ze(Pe,ot,null,v,Oe),Ie.push({event:Pe,listeners:ut}))}}if((u&7)===0){e:{if(Pe=l==="mouseover"||l==="pointerover",Ze=l==="mouseout"||l==="pointerout",Pe&&v!==gn&&(ot=v.relatedTarget||v.fromElement)&&(ji(ot)||ot[zs]))break e;if((Ze||Pe)&&(Pe=Oe.window===Oe?Oe:(Pe=Oe.ownerDocument)?Pe.defaultView||Pe.parentWindow:window,Ze?(ot=v.relatedTarget||v.toElement,Ze=ye,ot=ot?ji(ot):null,ot!==null&&(Un=Xr(ot),ot!==Un||ot.tag!==5&&ot.tag!==6)&&(ot=null)):(Ze=null,ot=ye),Ze!==ot)){if(ut=g_,Be="onMouseLeave",me="onMouseEnter",le="mouse",(l==="pointerout"||l==="pointerover")&&(ut=y_,Be="onPointerLeave",me="onPointerEnter",le="pointer"),Un=Ze==null?Pe:Ll(Ze),xe=ot==null?Pe:Ll(ot),Pe=new ut(Be,le+"leave",Ze,v,Oe),Pe.target=Un,Pe.relatedTarget=xe,Be=null,ji(Oe)===ye&&(ut=new ut(me,le+"enter",ot,v,Oe),ut.target=xe,ut.relatedTarget=Un,Be=ut),Un=Be,Ze&&ot)t:{for(ut=Ze,me=ot,le=0,xe=ut;xe;xe=$l(xe))le++;for(xe=0,Be=me;Be;Be=$l(Be))xe++;for(;0<le-xe;)ut=$l(ut),le--;for(;0<xe-le;)me=$l(me),xe--;for(;le--;){if(ut===me||me!==null&&ut===me.alternate)break t;ut=$l(ut),me=$l(me)}ut=null}else ut=null;Ze!==null&&H_(Ie,Pe,Ze,ut,!1),ot!==null&&Un!==null&&H_(Ie,Un,ot,ut,!0)}}e:{if(Pe=ye?Ll(ye):window,Ze=Pe.nodeName&&Pe.nodeName.toLowerCase(),Ze==="select"||Ze==="input"&&Pe.type==="file")var ft=fq;else if(C_(Pe))if(A_)ft=vq;else{ft=hq;var yt=pq}else(Ze=Pe.nodeName)&&Ze.toLowerCase()==="input"&&(Pe.type==="checkbox"||Pe.type==="radio")&&(ft=mq);if(ft&&(ft=ft(l,ye))){__(Ie,ft,v,Oe);break e}yt&&yt(l,Pe,ye),l==="focusout"&&(yt=Pe._wrapperState)&&yt.controlled&&Pe.type==="number"&&Ee(Pe,"number",Pe.value)}switch(yt=ye?Ll(ye):window,l){case"focusin":(C_(yt)||yt.contentEditable==="true")&&(Il=yt,Yg=ye,zu=null);break;case"focusout":zu=Yg=Il=null;break;case"mousedown":Xg=!0;break;case"contextmenu":case"mouseup":case"dragend":Xg=!1,M_(Ie,v,Oe);break;case"selectionchange":if(yq)break;case"keydown":case"keyup":M_(Ie,v,Oe)}var bt;if(Vg)e:{switch(l){case"compositionstart":var Tt="onCompositionStart";break e;case"compositionend":Tt="onCompositionEnd";break e;case"compositionupdate":Tt="onCompositionUpdate";break e}Tt=void 0}else Rl?S_(l,v)&&(Tt="onCompositionEnd"):l==="keydown"&&v.keyCode===229&&(Tt="onCompositionStart");Tt&&(b_&&v.locale!=="ko"&&(Rl||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&Rl&&(bt=m_()):(Po=Oe,Fg="value"in Po?Po.value:Po.textContent,Rl=!0)),yt=fp(ye,Tt),0<yt.length&&(Tt=new x_(Tt,l,null,v,Oe),Ie.push({event:Tt,listeners:yt}),bt?Tt.data=bt:(bt=N_(v),bt!==null&&(Tt.data=bt)))),(bt=iq?lq(l,v):cq(l,v))&&(ye=fp(ye,"onBeforeInput"),0<ye.length&&(Oe=new x_("onBeforeInput","beforeinput",null,v,Oe),Ie.push({event:Oe,listeners:ye}),Oe.data=bt))}W_(Ie,u)})}function Uu(l,u,v){return{instance:l,listener:u,currentTarget:v}}function fp(l,u){for(var v=u+"Capture",w=[];l!==null;){var _=l,P=_.stateNode;_.tag===5&&P!==null&&(_=P,P=ce(l,v),P!=null&&w.unshift(Uu(l,P,_)),P=ce(l,u),P!=null&&w.push(Uu(l,P,_))),l=l.return}return w}function $l(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function H_(l,u,v,w,_){for(var P=u._reactName,M=[];v!==null&&v!==w;){var ee=v,ie=ee.alternate,ye=ee.stateNode;if(ie!==null&&ie===w)break;ee.tag===5&&ye!==null&&(ee=ye,_?(ie=ce(v,P),ie!=null&&M.unshift(Uu(v,ie,ee))):_||(ie=ce(v,P),ie!=null&&M.push(Uu(v,ie,ee)))),v=v.return}M.length!==0&&l.push({event:u,listeners:M})}var Sq=/\r\n?/g,Nq=/\u0000|\uFFFD/g;function K_(l){return(typeof l=="string"?l:""+l).replace(Sq,`
|
|
6
|
-
`).replace(Nq,"")}function pp(l,u,v){if(u=K_(u),K_(l)!==u&&v)throw Error(n(425))}function hp(){}var nx=null,rx=null;function ax(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 sx=typeof setTimeout=="function"?setTimeout:void 0,Cq=typeof clearTimeout=="function"?clearTimeout:void 0,G_=typeof Promise=="function"?Promise:void 0,_q=typeof queueMicrotask=="function"?queueMicrotask:typeof G_<"u"?function(l){return G_.resolve(null).then(l).catch(Aq)}:sx;function Aq(l){setTimeout(function(){throw l})}function ox(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 To(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 Y_(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 Dl=Math.random().toString(36).slice(2),fs="__reactFiber$"+Dl,Wu="__reactProps$"+Dl,zs="__reactContainer$"+Dl,ix="__reactEvents$"+Dl,Eq="__reactListeners$"+Dl,kq="__reactHandles$"+Dl;function ji(l){var u=l[fs];if(u)return u;for(var v=l.parentNode;v;){if(u=v[zs]||v[fs]){if(v=u.alternate,u.child!==null||v!==null&&v.child!==null)for(l=Y_(l);l!==null;){if(v=l[fs])return v;l=Y_(l)}return u}l=v,v=l.parentNode}return null}function Vu(l){return l=l[fs]||l[zs],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Ll(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function mp(l){return l[Wu]||null}var lx=[],Fl=-1;function Ro(l){return{current:l}}function _n(l){0>Fl||(l.current=lx[Fl],lx[Fl]=null,Fl--)}function xn(l,u){Fl++,lx[Fl]=l.current,l.current=u}var Io={},vr=Ro(Io),Tr=Ro(!1),Si=Io;function zl(l,u){var v=l.type.contextTypes;if(!v)return Io;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 Rr(l){return l=l.childContextTypes,l!=null}function vp(){_n(Tr),_n(vr)}function X_(l,u,v){if(vr.current!==Io)throw Error(n(168));xn(vr,u),xn(Tr,v)}function Q_(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,V(l)||"Unknown",_));return J({},v,w)}function gp(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Io,Si=vr.current,xn(vr,l),xn(Tr,Tr.current),!0}function J_(l,u,v){var w=l.stateNode;if(!w)throw Error(n(169));v?(l=Q_(l,u,Si),w.__reactInternalMemoizedMergedChildContext=l,_n(Tr),_n(vr),xn(vr,l)):_n(Tr),xn(Tr,v)}var Bs=null,xp=!1,cx=!1;function Z_(l){Bs===null?Bs=[l]:Bs.push(l)}function Pq(l){xp=!0,Z_(l)}function Mo(){if(!cx&&Bs!==null){cx=!0;var l=0,u=ln;try{var v=Bs;for(ln=1;l<v.length;l++){var w=v[l];do w=w(!0);while(w!==null)}Bs=null,xp=!1}catch(_){throw Bs!==null&&(Bs=Bs.slice(l+1)),Dt(jt,Mo),_}finally{ln=u,cx=!1}}return null}var Bl=[],ql=0,yp=null,bp=0,ga=[],xa=0,Ni=null,qs=1,Us="";function Ci(l,u){Bl[ql++]=bp,Bl[ql++]=yp,yp=l,bp=u}function eA(l,u,v){ga[xa++]=qs,ga[xa++]=Us,ga[xa++]=Ni,Ni=l;var w=qs;l=Us;var _=32-Jr(w)-1;w&=~(1<<_),v+=1;var P=32-Jr(u)+_;if(30<P){var M=_-_%5;P=(w&(1<<M)-1).toString(32),w>>=M,_-=M,qs=1<<32-Jr(u)+_|v<<_|w,Us=P+l}else qs=1<<P|v<<_|w,Us=l}function ux(l){l.return!==null&&(Ci(l,1),eA(l,1,0))}function dx(l){for(;l===yp;)yp=Bl[--ql],Bl[ql]=null,bp=Bl[--ql],Bl[ql]=null;for(;l===Ni;)Ni=ga[--xa],ga[xa]=null,Us=ga[--xa],ga[xa]=null,qs=ga[--xa],ga[xa]=null}var ea=null,ta=null,Pn=!1,Fa=null;function tA(l,u){var v=ja(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 nA(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,ea=l,ta=To(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,ea=l,ta=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(v=Ni!==null?{id:qs,overflow:Us}:null,l.memoizedState={dehydrated:u,treeContext:v,retryLane:1073741824},v=ja(18,null,null,0),v.stateNode=u,v.return=l,l.child=v,ea=l,ta=null,!0):!1;default:return!1}}function fx(l){return(l.mode&1)!==0&&(l.flags&128)===0}function px(l){if(Pn){var u=ta;if(u){var v=u;if(!nA(l,u)){if(fx(l))throw Error(n(418));u=To(v.nextSibling);var w=ea;u&&nA(l,u)?tA(w,v):(l.flags=l.flags&-4097|2,Pn=!1,ea=l)}}else{if(fx(l))throw Error(n(418));l.flags=l.flags&-4097|2,Pn=!1,ea=l}}}function rA(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;ea=l}function wp(l){if(l!==ea)return!1;if(!Pn)return rA(l),Pn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!ax(l.type,l.memoizedProps)),u&&(u=ta)){if(fx(l))throw aA(),Error(n(418));for(;u;)tA(l,u),u=To(u.nextSibling)}if(rA(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){ta=To(l.nextSibling);break e}u--}else v!=="$"&&v!=="$!"&&v!=="$?"||u++}l=l.nextSibling}ta=null}}else ta=ea?To(l.stateNode.nextSibling):null;return!0}function aA(){for(var l=ta;l;)l=To(l.nextSibling)}function Ul(){ta=ea=null,Pn=!1}function hx(l){Fa===null?Fa=[l]:Fa.push(l)}var Oq=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(M){var ee=_.refs;M===null?delete ee[P]:ee[P]=M},u._stringRef=P,u)}if(typeof l!="string")throw Error(n(284));if(!v._owner)throw Error(n(290,l))}return l}function jp(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function sA(l){var u=l._init;return u(l._payload)}function oA(l){function u(me,le){if(l){var xe=me.deletions;xe===null?(me.deletions=[le],me.flags|=16):xe.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=Uo(me,le),me.index=0,me.sibling=null,me}function P(me,le,xe){return me.index=xe,l?(xe=me.alternate,xe!==null?(xe=xe.index,xe<le?(me.flags|=2,le):xe):(me.flags|=2,le)):(me.flags|=1048576,le)}function M(me){return l&&me.alternate===null&&(me.flags|=2),me}function ee(me,le,xe,Be){return le===null||le.tag!==6?(le=sy(xe,me.mode,Be),le.return=me,le):(le=_(le,xe),le.return=me,le)}function ie(me,le,xe,Be){var ft=xe.type;return ft===O?Oe(me,le,xe.props.children,Be,xe.key):le!==null&&(le.elementType===ft||typeof ft=="object"&&ft!==null&&ft.$$typeof===W&&sA(ft)===le.type)?(Be=_(le,xe.props),Be.ref=Hu(me,le,xe),Be.return=me,Be):(Be=Hp(xe.type,xe.key,xe.props,null,me.mode,Be),Be.ref=Hu(me,le,xe),Be.return=me,Be)}function ye(me,le,xe,Be){return le===null||le.tag!==4||le.stateNode.containerInfo!==xe.containerInfo||le.stateNode.implementation!==xe.implementation?(le=oy(xe,me.mode,Be),le.return=me,le):(le=_(le,xe.children||[]),le.return=me,le)}function Oe(me,le,xe,Be,ft){return le===null||le.tag!==7?(le=Ri(xe,me.mode,Be,ft),le.return=me,le):(le=_(le,xe),le.return=me,le)}function Ie(me,le,xe){if(typeof le=="string"&&le!==""||typeof le=="number")return le=sy(""+le,me.mode,xe),le.return=me,le;if(typeof le=="object"&&le!==null){switch(le.$$typeof){case A:return xe=Hp(le.type,le.key,le.props,null,me.mode,xe),xe.ref=Hu(me,null,le),xe.return=me,xe;case k:return le=oy(le,me.mode,xe),le.return=me,le;case W:var Be=le._init;return Ie(me,Be(le._payload),xe)}if(Xe(le)||z(le))return le=Ri(le,me.mode,xe,null),le.return=me,le;jp(me,le)}return null}function Pe(me,le,xe,Be){var ft=le!==null?le.key:null;if(typeof xe=="string"&&xe!==""||typeof xe=="number")return ft!==null?null:ee(me,le,""+xe,Be);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case A:return xe.key===ft?ie(me,le,xe,Be):null;case k:return xe.key===ft?ye(me,le,xe,Be):null;case W:return ft=xe._init,Pe(me,le,ft(xe._payload),Be)}if(Xe(xe)||z(xe))return ft!==null?null:Oe(me,le,xe,Be,null);jp(me,xe)}return null}function Ze(me,le,xe,Be,ft){if(typeof Be=="string"&&Be!==""||typeof Be=="number")return me=me.get(xe)||null,ee(le,me,""+Be,ft);if(typeof Be=="object"&&Be!==null){switch(Be.$$typeof){case A:return me=me.get(Be.key===null?xe:Be.key)||null,ie(le,me,Be,ft);case k:return me=me.get(Be.key===null?xe:Be.key)||null,ye(le,me,Be,ft);case W:var yt=Be._init;return Ze(me,le,xe,yt(Be._payload),ft)}if(Xe(Be)||z(Be))return me=me.get(xe)||null,Oe(le,me,Be,ft,null);jp(le,Be)}return null}function ot(me,le,xe,Be){for(var ft=null,yt=null,bt=le,Tt=le=0,ir=null;bt!==null&&Tt<xe.length;Tt++){bt.index>Tt?(ir=bt,bt=null):ir=bt.sibling;var Zt=Pe(me,bt,xe[Tt],Be);if(Zt===null){bt===null&&(bt=ir);break}l&&bt&&Zt.alternate===null&&u(me,bt),le=P(Zt,le,Tt),yt===null?ft=Zt:yt.sibling=Zt,yt=Zt,bt=ir}if(Tt===xe.length)return v(me,bt),Pn&&Ci(me,Tt),ft;if(bt===null){for(;Tt<xe.length;Tt++)bt=Ie(me,xe[Tt],Be),bt!==null&&(le=P(bt,le,Tt),yt===null?ft=bt:yt.sibling=bt,yt=bt);return Pn&&Ci(me,Tt),ft}for(bt=w(me,bt);Tt<xe.length;Tt++)ir=Ze(bt,me,Tt,xe[Tt],Be),ir!==null&&(l&&ir.alternate!==null&&bt.delete(ir.key===null?Tt:ir.key),le=P(ir,le,Tt),yt===null?ft=ir:yt.sibling=ir,yt=ir);return l&&bt.forEach(function(Wo){return u(me,Wo)}),Pn&&Ci(me,Tt),ft}function ut(me,le,xe,Be){var ft=z(xe);if(typeof ft!="function")throw Error(n(150));if(xe=ft.call(xe),xe==null)throw Error(n(151));for(var yt=ft=null,bt=le,Tt=le=0,ir=null,Zt=xe.next();bt!==null&&!Zt.done;Tt++,Zt=xe.next()){bt.index>Tt?(ir=bt,bt=null):ir=bt.sibling;var Wo=Pe(me,bt,Zt.value,Be);if(Wo===null){bt===null&&(bt=ir);break}l&&bt&&Wo.alternate===null&&u(me,bt),le=P(Wo,le,Tt),yt===null?ft=Wo:yt.sibling=Wo,yt=Wo,bt=ir}if(Zt.done)return v(me,bt),Pn&&Ci(me,Tt),ft;if(bt===null){for(;!Zt.done;Tt++,Zt=xe.next())Zt=Ie(me,Zt.value,Be),Zt!==null&&(le=P(Zt,le,Tt),yt===null?ft=Zt:yt.sibling=Zt,yt=Zt);return Pn&&Ci(me,Tt),ft}for(bt=w(me,bt);!Zt.done;Tt++,Zt=xe.next())Zt=Ze(bt,me,Tt,Zt.value,Be),Zt!==null&&(l&&Zt.alternate!==null&&bt.delete(Zt.key===null?Tt:Zt.key),le=P(Zt,le,Tt),yt===null?ft=Zt:yt.sibling=Zt,yt=Zt);return l&&bt.forEach(function(uU){return u(me,uU)}),Pn&&Ci(me,Tt),ft}function Un(me,le,xe,Be){if(typeof xe=="object"&&xe!==null&&xe.type===O&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case A:e:{for(var ft=xe.key,yt=le;yt!==null;){if(yt.key===ft){if(ft=xe.type,ft===O){if(yt.tag===7){v(me,yt.sibling),le=_(yt,xe.props.children),le.return=me,me=le;break e}}else if(yt.elementType===ft||typeof ft=="object"&&ft!==null&&ft.$$typeof===W&&sA(ft)===yt.type){v(me,yt.sibling),le=_(yt,xe.props),le.ref=Hu(me,yt,xe),le.return=me,me=le;break e}v(me,yt);break}else u(me,yt);yt=yt.sibling}xe.type===O?(le=Ri(xe.props.children,me.mode,Be,xe.key),le.return=me,me=le):(Be=Hp(xe.type,xe.key,xe.props,null,me.mode,Be),Be.ref=Hu(me,le,xe),Be.return=me,me=Be)}return M(me);case k:e:{for(yt=xe.key;le!==null;){if(le.key===yt)if(le.tag===4&&le.stateNode.containerInfo===xe.containerInfo&&le.stateNode.implementation===xe.implementation){v(me,le.sibling),le=_(le,xe.children||[]),le.return=me,me=le;break e}else{v(me,le);break}else u(me,le);le=le.sibling}le=oy(xe,me.mode,Be),le.return=me,me=le}return M(me);case W:return yt=xe._init,Un(me,le,yt(xe._payload),Be)}if(Xe(xe))return ot(me,le,xe,Be);if(z(xe))return ut(me,le,xe,Be);jp(me,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"?(xe=""+xe,le!==null&&le.tag===6?(v(me,le.sibling),le=_(le,xe),le.return=me,me=le):(v(me,le),le=sy(xe,me.mode,Be),le.return=me,me=le),M(me)):v(me,le)}return Un}var Wl=oA(!0),iA=oA(!1),Sp=Ro(null),Np=null,Vl=null,mx=null;function vx(){mx=Vl=Np=null}function gx(l){var u=Sp.current;_n(Sp),l._currentValue=u}function xx(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 Hl(l,u){Np=l,mx=Vl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(Ir=!0),l.firstContext=null)}function ya(l){var u=l._currentValue;if(mx!==l)if(l={context:l,memoizedValue:u,next:null},Vl===null){if(Np===null)throw Error(n(308));Vl=l,Np.dependencies={lanes:0,firstContext:l}}else Vl=Vl.next=l;return u}var _i=null;function yx(l){_i===null?_i=[l]:_i.push(l)}function lA(l,u,v,w){var _=u.interleaved;return _===null?(v.next=v,yx(u)):(v.next=_.next,_.next=v),u.interleaved=v,Ws(l,w)}function Ws(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 $o=!1;function bx(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cA(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 Vs(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function Do(l,u,v){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(Qt&2)!==0){var _=w.pending;return _===null?u.next=u:(u.next=_.next,_.next=u),w.pending=u,Ws(l,v)}return _=w.interleaved,_===null?(u.next=u,yx(w)):(u.next=_.next,_.next=u),w.interleaved=u,Ws(l,v)}function Cp(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,Eu(l,v)}}function uA(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 M={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};P===null?_=P=M:P=P.next=M,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 _p(l,u,v,w){var _=l.updateQueue;$o=!1;var P=_.firstBaseUpdate,M=_.lastBaseUpdate,ee=_.shared.pending;if(ee!==null){_.shared.pending=null;var ie=ee,ye=ie.next;ie.next=null,M===null?P=ye:M.next=ye,M=ie;var Oe=l.alternate;Oe!==null&&(Oe=Oe.updateQueue,ee=Oe.lastBaseUpdate,ee!==M&&(ee===null?Oe.firstBaseUpdate=ye:ee.next=ye,Oe.lastBaseUpdate=ie))}if(P!==null){var Ie=_.baseState;M=0,Oe=ye=ie=null,ee=P;do{var Pe=ee.lane,Ze=ee.eventTime;if((w&Pe)===Pe){Oe!==null&&(Oe=Oe.next={eventTime:Ze,lane:0,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null});e:{var ot=l,ut=ee;switch(Pe=u,Ze=v,ut.tag){case 1:if(ot=ut.payload,typeof ot=="function"){Ie=ot.call(Ze,Ie,Pe);break e}Ie=ot;break e;case 3:ot.flags=ot.flags&-65537|128;case 0:if(ot=ut.payload,Pe=typeof ot=="function"?ot.call(Ze,Ie,Pe):ot,Pe==null)break e;Ie=J({},Ie,Pe);break e;case 2:$o=!0}}ee.callback!==null&&ee.lane!==0&&(l.flags|=64,Pe=_.effects,Pe===null?_.effects=[ee]:Pe.push(ee))}else Ze={eventTime:Ze,lane:Pe,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null},Oe===null?(ye=Oe=Ze,ie=Ie):Oe=Oe.next=Ze,M|=Pe;if(ee=ee.next,ee===null){if(ee=_.shared.pending,ee===null)break;Pe=ee,ee=Pe.next,Pe.next=null,_.lastBaseUpdate=Pe,_.shared.pending=null}}while(!0);if(Oe===null&&(ie=Ie),_.baseState=ie,_.firstBaseUpdate=ye,_.lastBaseUpdate=Oe,u=_.shared.interleaved,u!==null){_=u;do M|=_.lane,_=_.next;while(_!==u)}else P===null&&(_.shared.lanes=0);ki|=M,l.lanes=M,l.memoizedState=Ie}}function dA(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={},ps=Ro(Ku),Gu=Ro(Ku),Yu=Ro(Ku);function Ai(l){if(l===Ku)throw Error(n(174));return l}function wx(l,u){switch(xn(Yu,u),xn(Gu,l),xn(ps,Ku),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:zt(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=zt(u,l)}_n(ps),xn(ps,u)}function Kl(){_n(ps),_n(Gu),_n(Yu)}function fA(l){Ai(Yu.current);var u=Ai(ps.current),v=zt(u,l.type);u!==v&&(xn(Gu,l),xn(ps,v))}function jx(l){Gu.current===l&&(_n(ps),_n(Gu))}var In=Ro(0);function Ap(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 Sx=[];function Nx(){for(var l=0;l<Sx.length;l++)Sx[l]._workInProgressVersionPrimary=null;Sx.length=0}var Ep=E.ReactCurrentDispatcher,Cx=E.ReactCurrentBatchConfig,Ei=0,Mn=null,Xn=null,sr=null,kp=!1,Xu=!1,Qu=0,Tq=0;function gr(){throw Error(n(321))}function _x(l,u){if(u===null)return!1;for(var v=0;v<u.length&&v<l.length;v++)if(!La(l[v],u[v]))return!1;return!0}function Ax(l,u,v,w,_,P){if(Ei=P,Mn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,Ep.current=l===null||l.memoizedState===null?$q:Dq,l=v(w,_),Xu){P=0;do{if(Xu=!1,Qu=0,25<=P)throw Error(n(301));P+=1,sr=Xn=null,u.updateQueue=null,Ep.current=Lq,l=v(w,_)}while(Xu)}if(Ep.current=Tp,u=Xn!==null&&Xn.next!==null,Ei=0,sr=Xn=Mn=null,kp=!1,u)throw Error(n(300));return l}function Ex(){var l=Qu!==0;return Qu=0,l}function hs(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sr===null?Mn.memoizedState=sr=l:sr=sr.next=l,sr}function ba(){if(Xn===null){var l=Mn.alternate;l=l!==null?l.memoizedState:null}else l=Xn.next;var u=sr===null?Mn.memoizedState:sr.next;if(u!==null)sr=u,Xn=l;else{if(l===null)throw Error(n(310));Xn=l,l={memoizedState:Xn.memoizedState,baseState:Xn.baseState,baseQueue:Xn.baseQueue,queue:Xn.queue,next:null},sr===null?Mn.memoizedState=sr=l:sr=sr.next=l}return sr}function Ju(l,u){return typeof u=="function"?u(l):u}function kx(l){var u=ba(),v=u.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=l;var w=Xn,_=w.baseQueue,P=v.pending;if(P!==null){if(_!==null){var M=_.next;_.next=P.next,P.next=M}w.baseQueue=_=P,v.pending=null}if(_!==null){P=_.next,w=w.baseState;var ee=M=null,ie=null,ye=P;do{var Oe=ye.lane;if((Ei&Oe)===Oe)ie!==null&&(ie=ie.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),w=ye.hasEagerState?ye.eagerState:l(w,ye.action);else{var Ie={lane:Oe,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};ie===null?(ee=ie=Ie,M=w):ie=ie.next=Ie,Mn.lanes|=Oe,ki|=Oe}ye=ye.next}while(ye!==null&&ye!==P);ie===null?M=w:ie.next=ee,La(w,u.memoizedState)||(Ir=!0),u.memoizedState=w,u.baseState=M,u.baseQueue=ie,v.lastRenderedState=w}if(l=v.interleaved,l!==null){_=l;do P=_.lane,Mn.lanes|=P,ki|=P,_=_.next;while(_!==l)}else _===null&&(v.lanes=0);return[u.memoizedState,v.dispatch]}function Px(l){var u=ba(),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 M=_=_.next;do P=l(P,M.action),M=M.next;while(M!==_);La(P,u.memoizedState)||(Ir=!0),u.memoizedState=P,u.baseQueue===null&&(u.baseState=P),v.lastRenderedState=P}return[P,w]}function pA(){}function hA(l,u){var v=Mn,w=ba(),_=u(),P=!La(w.memoizedState,_);if(P&&(w.memoizedState=_,Ir=!0),w=w.queue,Ox(gA.bind(null,v,w,l),[l]),w.getSnapshot!==u||P||sr!==null&&sr.memoizedState.tag&1){if(v.flags|=2048,Zu(9,vA.bind(null,v,w,_,u),void 0,null),or===null)throw Error(n(349));(Ei&30)!==0||mA(v,u,_)}return _}function mA(l,u,v){l.flags|=16384,l={getSnapshot:u,value:v},u=Mn.updateQueue,u===null?(u={lastEffect:null,stores:null},Mn.updateQueue=u,u.stores=[l]):(v=u.stores,v===null?u.stores=[l]:v.push(l))}function vA(l,u,v,w){u.value=v,u.getSnapshot=w,xA(u)&&yA(l)}function gA(l,u,v){return v(function(){xA(u)&&yA(l)})}function xA(l){var u=l.getSnapshot;l=l.value;try{var v=u();return!La(l,v)}catch{return!0}}function yA(l){var u=Ws(l,1);u!==null&&Ua(u,l,1,-1)}function bA(l){var u=hs();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=Mq.bind(null,Mn,l),[u.memoizedState,l]}function Zu(l,u,v,w){return l={tag:l,create:u,destroy:v,deps:w,next:null},u=Mn.updateQueue,u===null?(u={lastEffect:null,stores:null},Mn.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 wA(){return ba().memoizedState}function Pp(l,u,v,w){var _=hs();Mn.flags|=l,_.memoizedState=Zu(1|u,v,void 0,w===void 0?null:w)}function Op(l,u,v,w){var _=ba();w=w===void 0?null:w;var P=void 0;if(Xn!==null){var M=Xn.memoizedState;if(P=M.destroy,w!==null&&_x(w,M.deps)){_.memoizedState=Zu(u,v,P,w);return}}Mn.flags|=l,_.memoizedState=Zu(1|u,v,P,w)}function jA(l,u){return Pp(8390656,8,l,u)}function Ox(l,u){return Op(2048,8,l,u)}function SA(l,u){return Op(4,2,l,u)}function NA(l,u){return Op(4,4,l,u)}function CA(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 _A(l,u,v){return v=v!=null?v.concat([l]):null,Op(4,4,CA.bind(null,u,l),v)}function Tx(){}function AA(l,u){var v=ba();u=u===void 0?null:u;var w=v.memoizedState;return w!==null&&u!==null&&_x(u,w[1])?w[0]:(v.memoizedState=[l,u],l)}function EA(l,u){var v=ba();u=u===void 0?null:u;var w=v.memoizedState;return w!==null&&u!==null&&_x(u,w[1])?w[0]:(l=l(),v.memoizedState=[l,u],l)}function kA(l,u,v){return(Ei&21)===0?(l.baseState&&(l.baseState=!1,Ir=!0),l.memoizedState=v):(La(v,u)||(v=Co(),Mn.lanes|=v,ki|=v,l.baseState=!0),u)}function Rq(l,u){var v=ln;ln=v!==0&&4>v?v:4,l(!0);var w=Cx.transition;Cx.transition={};try{l(!1),u()}finally{ln=v,Cx.transition=w}}function PA(){return ba().memoizedState}function Iq(l,u,v){var w=Bo(l);if(v={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null},OA(l))TA(u,v);else if(v=lA(l,u,v,w),v!==null){var _=Sr();Ua(v,l,w,_),RA(v,u,w)}}function Mq(l,u,v){var w=Bo(l),_={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null};if(OA(l))TA(u,_);else{var P=l.alternate;if(l.lanes===0&&(P===null||P.lanes===0)&&(P=u.lastRenderedReducer,P!==null))try{var M=u.lastRenderedState,ee=P(M,v);if(_.hasEagerState=!0,_.eagerState=ee,La(ee,M)){var ie=u.interleaved;ie===null?(_.next=_,yx(u)):(_.next=ie.next,ie.next=_),u.interleaved=_;return}}catch{}v=lA(l,u,_,w),v!==null&&(_=Sr(),Ua(v,l,w,_),RA(v,u,w))}}function OA(l){var u=l.alternate;return l===Mn||u!==null&&u===Mn}function TA(l,u){Xu=kp=!0;var v=l.pending;v===null?u.next=u:(u.next=v.next,v.next=u),l.pending=u}function RA(l,u,v){if((v&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,v|=w,u.lanes=v,Eu(l,v)}}var Tp={readContext:ya,useCallback:gr,useContext:gr,useEffect:gr,useImperativeHandle:gr,useInsertionEffect:gr,useLayoutEffect:gr,useMemo:gr,useReducer:gr,useRef:gr,useState:gr,useDebugValue:gr,useDeferredValue:gr,useTransition:gr,useMutableSource:gr,useSyncExternalStore:gr,useId:gr,unstable_isNewReconciler:!1},$q={readContext:ya,useCallback:function(l,u){return hs().memoizedState=[l,u===void 0?null:u],l},useContext:ya,useEffect:jA,useImperativeHandle:function(l,u,v){return v=v!=null?v.concat([l]):null,Pp(4194308,4,CA.bind(null,u,l),v)},useLayoutEffect:function(l,u){return Pp(4194308,4,l,u)},useInsertionEffect:function(l,u){return Pp(4,2,l,u)},useMemo:function(l,u){var v=hs();return u=u===void 0?null:u,l=l(),v.memoizedState=[l,u],l},useReducer:function(l,u,v){var w=hs();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=Iq.bind(null,Mn,l),[w.memoizedState,l]},useRef:function(l){var u=hs();return l={current:l},u.memoizedState=l},useState:bA,useDebugValue:Tx,useDeferredValue:function(l){return hs().memoizedState=l},useTransition:function(){var l=bA(!1),u=l[0];return l=Rq.bind(null,l[1]),hs().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,v){var w=Mn,_=hs();if(Pn){if(v===void 0)throw Error(n(407));v=v()}else{if(v=u(),or===null)throw Error(n(349));(Ei&30)!==0||mA(w,u,v)}_.memoizedState=v;var P={value:v,getSnapshot:u};return _.queue=P,jA(gA.bind(null,w,P,l),[l]),w.flags|=2048,Zu(9,vA.bind(null,w,P,v,u),void 0,null),v},useId:function(){var l=hs(),u=or.identifierPrefix;if(Pn){var v=Us,w=qs;v=(w&~(1<<32-Jr(w)-1)).toString(32)+v,u=":"+u+"R"+v,v=Qu++,0<v&&(u+="H"+v.toString(32)),u+=":"}else v=Tq++,u=":"+u+"r"+v.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},Dq={readContext:ya,useCallback:AA,useContext:ya,useEffect:Ox,useImperativeHandle:_A,useInsertionEffect:SA,useLayoutEffect:NA,useMemo:EA,useReducer:kx,useRef:wA,useState:function(){return kx(Ju)},useDebugValue:Tx,useDeferredValue:function(l){var u=ba();return kA(u,Xn.memoizedState,l)},useTransition:function(){var l=kx(Ju)[0],u=ba().memoizedState;return[l,u]},useMutableSource:pA,useSyncExternalStore:hA,useId:PA,unstable_isNewReconciler:!1},Lq={readContext:ya,useCallback:AA,useContext:ya,useEffect:Ox,useImperativeHandle:_A,useInsertionEffect:SA,useLayoutEffect:NA,useMemo:EA,useReducer:Px,useRef:wA,useState:function(){return Px(Ju)},useDebugValue:Tx,useDeferredValue:function(l){var u=ba();return Xn===null?u.memoizedState=l:kA(u,Xn.memoizedState,l)},useTransition:function(){var l=Px(Ju)[0],u=ba().memoizedState;return[l,u]},useMutableSource:pA,useSyncExternalStore:hA,useId:PA,unstable_isNewReconciler:!1};function za(l,u){if(l&&l.defaultProps){u=J({},u),l=l.defaultProps;for(var v in l)u[v]===void 0&&(u[v]=l[v]);return u}return u}function Rx(l,u,v,w){u=l.memoizedState,v=v(w,u),v=v==null?u:J({},u,v),l.memoizedState=v,l.lanes===0&&(l.updateQueue.baseState=v)}var Rp={isMounted:function(l){return(l=l._reactInternals)?Xr(l)===l:!1},enqueueSetState:function(l,u,v){l=l._reactInternals;var w=Sr(),_=Bo(l),P=Vs(w,_);P.payload=u,v!=null&&(P.callback=v),u=Do(l,P,_),u!==null&&(Ua(u,l,_,w),Cp(u,l,_))},enqueueReplaceState:function(l,u,v){l=l._reactInternals;var w=Sr(),_=Bo(l),P=Vs(w,_);P.tag=1,P.payload=u,v!=null&&(P.callback=v),u=Do(l,P,_),u!==null&&(Ua(u,l,_,w),Cp(u,l,_))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var v=Sr(),w=Bo(l),_=Vs(v,w);_.tag=2,u!=null&&(_.callback=u),u=Do(l,_,w),u!==null&&(Ua(u,l,w,v),Cp(u,l,w))}};function IA(l,u,v,w,_,P,M){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,P,M):u.prototype&&u.prototype.isPureReactComponent?!Fu(v,w)||!Fu(_,P):!0}function MA(l,u,v){var w=!1,_=Io,P=u.contextType;return typeof P=="object"&&P!==null?P=ya(P):(_=Rr(u)?Si:vr.current,w=u.contextTypes,P=(w=w!=null)?zl(l,_):Io),u=new u(v,P),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Rp,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=_,l.__reactInternalMemoizedMaskedChildContext=P),u}function $A(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&&Rp.enqueueReplaceState(u,u.state,null)}function Ix(l,u,v,w){var _=l.stateNode;_.props=v,_.state=l.memoizedState,_.refs={},bx(l);var P=u.contextType;typeof P=="object"&&P!==null?_.context=ya(P):(P=Rr(u)?Si:vr.current,_.context=zl(l,P)),_.state=l.memoizedState,P=u.getDerivedStateFromProps,typeof P=="function"&&(Rx(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&&Rp.enqueueReplaceState(_,_.state,null),_p(l,v,_,w),_.state=l.memoizedState),typeof _.componentDidMount=="function"&&(l.flags|=4194308)}function Gl(l,u){try{var v="",w=u;do v+=de(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 Mx(l,u,v){return{value:l,source:null,stack:v??null,digest:u??null}}function $x(l,u){try{console.error(u.value)}catch(v){setTimeout(function(){throw v})}}var Fq=typeof WeakMap=="function"?WeakMap:Map;function DA(l,u,v){v=Vs(-1,v),v.tag=3,v.payload={element:null};var w=u.value;return v.callback=function(){zp||(zp=!0,Qx=w),$x(l,u)},v}function LA(l,u,v){v=Vs(-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(){$x(l,u)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(v.callback=function(){$x(l,u),typeof w!="function"&&(Fo===null?Fo=new Set([this]):Fo.add(this));var M=u.stack;this.componentDidCatch(u.value,{componentStack:M!==null?M:""})}),v}function FA(l,u,v){var w=l.pingCache;if(w===null){w=l.pingCache=new Fq;var _=new Set;w.set(u,_)}else _=w.get(u),_===void 0&&(_=new Set,w.set(u,_));_.has(v)||(_.add(v),l=Zq.bind(null,l,u,v),u.then(l,l))}function zA(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 BA(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=Vs(-1,1),u.tag=2,Do(v,u,1))),v.lanes|=1),l):(l.flags|=65536,l.lanes=_,l)}var zq=E.ReactCurrentOwner,Ir=!1;function jr(l,u,v,w){u.child=l===null?iA(u,null,v,w):Wl(u,l.child,v,w)}function qA(l,u,v,w,_){v=v.render;var P=u.ref;return Hl(u,_),w=Ax(l,u,v,w,P,_),v=Ex(),l!==null&&!Ir?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~_,Hs(l,u,_)):(Pn&&v&&ux(u),u.flags|=1,jr(l,u,w,_),u.child)}function UA(l,u,v,w,_){if(l===null){var P=v.type;return typeof P=="function"&&!ay(P)&&P.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(u.tag=15,u.type=P,WA(l,u,P,w,_)):(l=Hp(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 M=P.memoizedProps;if(v=v.compare,v=v!==null?v:Fu,v(M,w)&&l.ref===u.ref)return Hs(l,u,_)}return u.flags|=1,l=Uo(P,w),l.ref=u.ref,l.return=u,u.child=l}function WA(l,u,v,w,_){if(l!==null){var P=l.memoizedProps;if(Fu(P,w)&&l.ref===u.ref)if(Ir=!1,u.pendingProps=w=P,(l.lanes&_)!==0)(l.flags&131072)!==0&&(Ir=!0);else return u.lanes=l.lanes,Hs(l,u,_)}return Dx(l,u,v,w,_)}function VA(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},xn(Xl,na),na|=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,xn(Xl,na),na|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=P!==null?P.baseLanes:v,xn(Xl,na),na|=w}else P!==null?(w=P.baseLanes|v,u.memoizedState=null):w=v,xn(Xl,na),na|=w;return jr(l,u,_,v),u.child}function HA(l,u){var v=u.ref;(l===null&&v!==null||l!==null&&l.ref!==v)&&(u.flags|=512,u.flags|=2097152)}function Dx(l,u,v,w,_){var P=Rr(v)?Si:vr.current;return P=zl(u,P),Hl(u,_),v=Ax(l,u,v,w,P,_),w=Ex(),l!==null&&!Ir?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~_,Hs(l,u,_)):(Pn&&w&&ux(u),u.flags|=1,jr(l,u,v,_),u.child)}function KA(l,u,v,w,_){if(Rr(v)){var P=!0;gp(u)}else P=!1;if(Hl(u,_),u.stateNode===null)Mp(l,u),MA(u,v,w),Ix(u,v,w,_),w=!0;else if(l===null){var M=u.stateNode,ee=u.memoizedProps;M.props=ee;var ie=M.context,ye=v.contextType;typeof ye=="object"&&ye!==null?ye=ya(ye):(ye=Rr(v)?Si:vr.current,ye=zl(u,ye));var Oe=v.getDerivedStateFromProps,Ie=typeof Oe=="function"||typeof M.getSnapshotBeforeUpdate=="function";Ie||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(ee!==w||ie!==ye)&&$A(u,M,w,ye),$o=!1;var Pe=u.memoizedState;M.state=Pe,_p(u,w,M,_),ie=u.memoizedState,ee!==w||Pe!==ie||Tr.current||$o?(typeof Oe=="function"&&(Rx(u,v,Oe,w),ie=u.memoizedState),(ee=$o||IA(u,v,ee,w,Pe,ie,ye))?(Ie||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(u.flags|=4194308)):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=ie),M.props=w,M.state=ie,M.context=ye,w=ee):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{M=u.stateNode,cA(l,u),ee=u.memoizedProps,ye=u.type===u.elementType?ee:za(u.type,ee),M.props=ye,Ie=u.pendingProps,Pe=M.context,ie=v.contextType,typeof ie=="object"&&ie!==null?ie=ya(ie):(ie=Rr(v)?Si:vr.current,ie=zl(u,ie));var Ze=v.getDerivedStateFromProps;(Oe=typeof Ze=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(ee!==Ie||Pe!==ie)&&$A(u,M,w,ie),$o=!1,Pe=u.memoizedState,M.state=Pe,_p(u,w,M,_);var ot=u.memoizedState;ee!==Ie||Pe!==ot||Tr.current||$o?(typeof Ze=="function"&&(Rx(u,v,Ze,w),ot=u.memoizedState),(ye=$o||IA(u,v,ye,w,Pe,ot,ie)||!1)?(Oe||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(w,ot,ie),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(w,ot,ie)),typeof M.componentDidUpdate=="function"&&(u.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof M.componentDidUpdate!="function"||ee===l.memoizedProps&&Pe===l.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||ee===l.memoizedProps&&Pe===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=ot),M.props=w,M.state=ot,M.context=ie,w=ye):(typeof M.componentDidUpdate!="function"||ee===l.memoizedProps&&Pe===l.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||ee===l.memoizedProps&&Pe===l.memoizedState||(u.flags|=1024),w=!1)}return Lx(l,u,v,w,P,_)}function Lx(l,u,v,w,_,P){HA(l,u);var M=(u.flags&128)!==0;if(!w&&!M)return _&&J_(u,v,!1),Hs(l,u,P);w=u.stateNode,zq.current=u;var ee=M&&typeof v.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&M?(u.child=Wl(u,l.child,null,P),u.child=Wl(u,null,ee,P)):jr(l,u,ee,P),u.memoizedState=w.state,_&&J_(u,v,!0),u.child}function GA(l){var u=l.stateNode;u.pendingContext?X_(l,u.pendingContext,u.pendingContext!==u.context):u.context&&X_(l,u.context,!1),wx(l,u.containerInfo)}function YA(l,u,v,w,_){return Ul(),hx(_),u.flags|=256,jr(l,u,v,w),u.child}var Fx={dehydrated:null,treeContext:null,retryLane:0};function zx(l){return{baseLanes:l,cachePool:null,transitions:null}}function XA(l,u,v){var w=u.pendingProps,_=In.current,P=!1,M=(u.flags&128)!==0,ee;if((ee=M)||(ee=l!==null&&l.memoizedState===null?!1:(_&2)!==0),ee?(P=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(_|=1),xn(In,_&1),l===null)return px(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):(M=w.children,l=w.fallback,P?(w=u.mode,P=u.child,M={mode:"hidden",children:M},(w&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=M):P=Kp(M,w,0,null),l=Ri(l,w,v,null),P.return=u,l.return=u,P.sibling=l,u.child=P,u.child.memoizedState=zx(v),u.memoizedState=Fx,l):Bx(u,M));if(_=l.memoizedState,_!==null&&(ee=_.dehydrated,ee!==null))return Bq(l,u,M,w,ee,_,v);if(P){P=w.fallback,M=u.mode,_=l.child,ee=_.sibling;var ie={mode:"hidden",children:w.children};return(M&1)===0&&u.child!==_?(w=u.child,w.childLanes=0,w.pendingProps=ie,u.deletions=null):(w=Uo(_,ie),w.subtreeFlags=_.subtreeFlags&14680064),ee!==null?P=Uo(ee,P):(P=Ri(P,M,v,null),P.flags|=2),P.return=u,w.return=u,w.sibling=P,u.child=w,w=P,P=u.child,M=l.child.memoizedState,M=M===null?zx(v):{baseLanes:M.baseLanes|v,cachePool:null,transitions:M.transitions},P.memoizedState=M,P.childLanes=l.childLanes&~v,u.memoizedState=Fx,w}return P=l.child,l=P.sibling,w=Uo(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 Bx(l,u){return u=Kp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function Ip(l,u,v,w){return w!==null&&hx(w),Wl(u,l.child,null,v),l=Bx(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function Bq(l,u,v,w,_,P,M){if(v)return u.flags&256?(u.flags&=-257,w=Mx(Error(n(422))),Ip(l,u,M,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(P=w.fallback,_=u.mode,w=Kp({mode:"visible",children:w.children},_,0,null),P=Ri(P,_,M,null),P.flags|=2,w.return=u,P.return=u,w.sibling=P,u.child=w,(u.mode&1)!==0&&Wl(u,l.child,null,M),u.child.memoizedState=zx(M),u.memoizedState=Fx,P);if((u.mode&1)===0)return Ip(l,u,M,null);if(_.data==="$!"){if(w=_.nextSibling&&_.nextSibling.dataset,w)var ee=w.dgst;return w=ee,P=Error(n(419)),w=Mx(P,w,void 0),Ip(l,u,M,w)}if(ee=(M&l.childLanes)!==0,Ir||ee){if(w=or,w!==null){switch(M&-M){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|M))!==0?0:_,_!==0&&_!==P.retryLane&&(P.retryLane=_,Ws(l,_),Ua(w,l,_,-1))}return ry(),w=Mx(Error(n(421))),Ip(l,u,M,w)}return _.data==="$?"?(u.flags|=128,u.child=l.child,u=eU.bind(null,l),_._reactRetry=u,null):(l=P.treeContext,ta=To(_.nextSibling),ea=u,Pn=!0,Fa=null,l!==null&&(ga[xa++]=qs,ga[xa++]=Us,ga[xa++]=Ni,qs=l.id,Us=l.overflow,Ni=u),u=Bx(u,w.children),u.flags|=4096,u)}function QA(l,u,v){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),xx(l.return,u,v)}function qx(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 JA(l,u,v){var w=u.pendingProps,_=w.revealOrder,P=w.tail;if(jr(l,u,w.children,v),w=In.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&&QA(l,v,u);else if(l.tag===19)QA(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(xn(In,w),(u.mode&1)===0)u.memoizedState=null;else switch(_){case"forwards":for(v=u.child,_=null;v!==null;)l=v.alternate,l!==null&&Ap(l)===null&&(_=v),v=v.sibling;v=_,v===null?(_=u.child,u.child=null):(_=v.sibling,v.sibling=null),qx(u,!1,_,v,P);break;case"backwards":for(v=null,_=u.child,u.child=null;_!==null;){if(l=_.alternate,l!==null&&Ap(l)===null){u.child=_;break}l=_.sibling,_.sibling=v,v=_,_=l}qx(u,!0,v,null,P);break;case"together":qx(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Mp(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Hs(l,u,v){if(l!==null&&(u.dependencies=l.dependencies),ki|=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=Uo(l,l.pendingProps),u.child=v,v.return=u;l.sibling!==null;)l=l.sibling,v=v.sibling=Uo(l,l.pendingProps),v.return=u;v.sibling=null}return u.child}function qq(l,u,v){switch(u.tag){case 3:GA(u),Ul();break;case 5:fA(u);break;case 1:Rr(u.type)&&gp(u);break;case 4:wx(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,_=u.memoizedProps.value;xn(Sp,w._currentValue),w._currentValue=_;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(xn(In,In.current&1),u.flags|=128,null):(v&u.child.childLanes)!==0?XA(l,u,v):(xn(In,In.current&1),l=Hs(l,u,v),l!==null?l.sibling:null);xn(In,In.current&1);break;case 19:if(w=(v&u.childLanes)!==0,(l.flags&128)!==0){if(w)return JA(l,u,v);u.flags|=128}if(_=u.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),xn(In,In.current),w)break;return null;case 22:case 23:return u.lanes=0,VA(l,u,v)}return Hs(l,u,v)}var ZA,Ux,eE,tE;ZA=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}},Ux=function(){},eE=function(l,u,v,w){var _=l.memoizedProps;if(_!==w){l=u.stateNode,Ai(ps.current);var P=null;switch(v){case"input":_=_e(l,_),w=_e(l,w),P=[];break;case"select":_=J({},_,{value:void 0}),w=J({},w,{value:void 0}),P=[];break;case"textarea":_=gt(l,_),w=gt(l,w),P=[];break;default:typeof _.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=hp)}qe(v,w);var M;v=null;for(ye in _)if(!w.hasOwnProperty(ye)&&_.hasOwnProperty(ye)&&_[ye]!=null)if(ye==="style"){var ee=_[ye];for(M in ee)ee.hasOwnProperty(M)&&(v||(v={}),v[M]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(s.hasOwnProperty(ye)?P||(P=[]):(P=P||[]).push(ye,null));for(ye in w){var ie=w[ye];if(ee=_?.[ye],w.hasOwnProperty(ye)&&ie!==ee&&(ie!=null||ee!=null))if(ye==="style")if(ee){for(M in ee)!ee.hasOwnProperty(M)||ie&&ie.hasOwnProperty(M)||(v||(v={}),v[M]="");for(M in ie)ie.hasOwnProperty(M)&&ee[M]!==ie[M]&&(v||(v={}),v[M]=ie[M])}else v||(P||(P=[]),P.push(ye,v)),v=ie;else ye==="dangerouslySetInnerHTML"?(ie=ie?ie.__html:void 0,ee=ee?ee.__html:void 0,ie!=null&&ee!==ie&&(P=P||[]).push(ye,ie)):ye==="children"?typeof ie!="string"&&typeof ie!="number"||(P=P||[]).push(ye,""+ie):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(s.hasOwnProperty(ye)?(ie!=null&&ye==="onScroll"&&Cn("scroll",l),P||ee===ie||(P=[])):(P=P||[]).push(ye,ie))}v&&(P=P||[]).push("style",v);var ye=P;(u.updateQueue=ye)&&(u.flags|=4)}},tE=function(l,u,v,w){v!==w&&(u.flags|=4)};function ed(l,u){if(!Pn)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 xr(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 Uq(l,u,v){var w=u.pendingProps;switch(dx(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xr(u),null;case 1:return Rr(u.type)&&vp(),xr(u),null;case 3:return w=u.stateNode,Kl(),_n(Tr),_n(vr),Nx(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(wp(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Fa!==null&&(ey(Fa),Fa=null))),Ux(l,u),xr(u),null;case 5:jx(u);var _=Ai(Yu.current);if(v=u.type,l!==null&&u.stateNode!=null)eE(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 xr(u),null}if(l=Ai(ps.current),wp(u)){w=u.stateNode,v=u.type;var P=u.memoizedProps;switch(w[fs]=u,w[Wu]=P,l=(u.mode&1)!==0,v){case"dialog":Cn("cancel",w),Cn("close",w);break;case"iframe":case"object":case"embed":Cn("load",w);break;case"video":case"audio":for(_=0;_<Bu.length;_++)Cn(Bu[_],w);break;case"source":Cn("error",w);break;case"img":case"image":case"link":Cn("error",w),Cn("load",w);break;case"details":Cn("toggle",w);break;case"input":Me(w,P),Cn("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!P.multiple},Cn("invalid",w);break;case"textarea":mt(w,P),Cn("invalid",w)}qe(v,P),_=null;for(var M in P)if(P.hasOwnProperty(M)){var ee=P[M];M==="children"?typeof ee=="string"?w.textContent!==ee&&(P.suppressHydrationWarning!==!0&&pp(w.textContent,ee,l),_=["children",ee]):typeof ee=="number"&&w.textContent!==""+ee&&(P.suppressHydrationWarning!==!0&&pp(w.textContent,ee,l),_=["children",""+ee]):s.hasOwnProperty(M)&&ee!=null&&M==="onScroll"&&Cn("scroll",w)}switch(v){case"input":fe(w),pe(w,P,!0);break;case"textarea":fe(w),qt(w);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(w.onclick=hp)}w=_,u.updateQueue=w,w!==null&&(u.flags|=4)}else{M=_.nodeType===9?_:_.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Ft(v)),l==="http://www.w3.org/1999/xhtml"?v==="script"?(l=M.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=M.createElement(v,{is:w.is}):(l=M.createElement(v),v==="select"&&(M=l,w.multiple?M.multiple=!0:w.size&&(M.size=w.size))):l=M.createElementNS(l,v),l[fs]=u,l[Wu]=w,ZA(l,u,!1,!1),u.stateNode=l;e:{switch(M=Xt(v,w),v){case"dialog":Cn("cancel",l),Cn("close",l),_=w;break;case"iframe":case"object":case"embed":Cn("load",l),_=w;break;case"video":case"audio":for(_=0;_<Bu.length;_++)Cn(Bu[_],l);_=w;break;case"source":Cn("error",l),_=w;break;case"img":case"image":case"link":Cn("error",l),Cn("load",l),_=w;break;case"details":Cn("toggle",l),_=w;break;case"input":Me(l,w),_=_e(l,w),Cn("invalid",l);break;case"option":_=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},_=J({},w,{value:void 0}),Cn("invalid",l);break;case"textarea":mt(l,w),_=gt(l,w),Cn("invalid",l);break;default:_=w}qe(v,_),ee=_;for(P in ee)if(ee.hasOwnProperty(P)){var ie=ee[P];P==="style"?Qe(l,ie):P==="dangerouslySetInnerHTML"?(ie=ie?ie.__html:void 0,ie!=null&&et(l,ie)):P==="children"?typeof ie=="string"?(v!=="textarea"||ie!=="")&&Ke(l,ie):typeof ie=="number"&&Ke(l,""+ie):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(s.hasOwnProperty(P)?ie!=null&&P==="onScroll"&&Cn("scroll",l):ie!=null&&N(l,P,ie,M))}switch(v){case"input":fe(l),pe(l,w,!1);break;case"textarea":fe(l),qt(l);break;case"option":w.value!=null&&l.setAttribute("value",""+ue(w.value));break;case"select":l.multiple=!!w.multiple,P=w.value,P!=null?ht(l,!!w.multiple,P,!1):w.defaultValue!=null&&ht(l,!!w.multiple,w.defaultValue,!0);break;default:typeof _.onClick=="function"&&(l.onclick=hp)}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 xr(u),null;case 6:if(l&&u.stateNode!=null)tE(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(v=Ai(Yu.current),Ai(ps.current),wp(u)){if(w=u.stateNode,v=u.memoizedProps,w[fs]=u,(P=w.nodeValue!==v)&&(l=ea,l!==null))switch(l.tag){case 3:pp(w.nodeValue,v,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&pp(w.nodeValue,v,(l.mode&1)!==0)}P&&(u.flags|=4)}else w=(v.nodeType===9?v:v.ownerDocument).createTextNode(w),w[fs]=u,u.stateNode=w}return xr(u),null;case 13:if(_n(In),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Pn&&ta!==null&&(u.mode&1)!==0&&(u.flags&128)===0)aA(),Ul(),u.flags|=98560,P=!1;else if(P=wp(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[fs]=u}else Ul(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;xr(u),P=!1}else Fa!==null&&(ey(Fa),Fa=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||(In.current&1)!==0?Qn===0&&(Qn=3):ry())),u.updateQueue!==null&&(u.flags|=4),xr(u),null);case 4:return Kl(),Ux(l,u),l===null&&qu(u.stateNode.containerInfo),xr(u),null;case 10:return gx(u.type._context),xr(u),null;case 17:return Rr(u.type)&&vp(),xr(u),null;case 19:if(_n(In),P=u.memoizedState,P===null)return xr(u),null;if(w=(u.flags&128)!==0,M=P.rendering,M===null)if(w)ed(P,!1);else{if(Qn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(M=Ap(l),M!==null){for(u.flags|=128,ed(P,!1),w=M.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,M=P.alternate,M===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=M.childLanes,P.lanes=M.lanes,P.child=M.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=M.memoizedProps,P.memoizedState=M.memoizedState,P.updateQueue=M.updateQueue,P.type=M.type,l=M.dependencies,P.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),v=v.sibling;return xn(In,In.current&1|2),u.child}l=l.sibling}P.tail!==null&&ke()>Ql&&(u.flags|=128,w=!0,ed(P,!1),u.lanes=4194304)}else{if(!w)if(l=Ap(M),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"&&!M.alternate&&!Pn)return xr(u),null}else 2*ke()-P.renderingStartTime>Ql&&v!==1073741824&&(u.flags|=128,w=!0,ed(P,!1),u.lanes=4194304);P.isBackwards?(M.sibling=u.child,u.child=M):(v=P.last,v!==null?v.sibling=M:u.child=M,P.last=M)}return P.tail!==null?(u=P.tail,P.rendering=u,P.tail=u.sibling,P.renderingStartTime=ke(),u.sibling=null,v=In.current,xn(In,w?v&1|2:v&1),u):(xr(u),null);case 22:case 23:return ny(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(na&1073741824)!==0&&(xr(u),u.subtreeFlags&6&&(u.flags|=8192)):xr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function Wq(l,u){switch(dx(u),u.tag){case 1:return Rr(u.type)&&vp(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return Kl(),_n(Tr),_n(vr),Nx(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return jx(u),null;case 13:if(_n(In),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));Ul()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return _n(In),null;case 4:return Kl(),null;case 10:return gx(u.type._context),null;case 22:case 23:return ny(),null;case 24:return null;default:return null}}var $p=!1,yr=!1,Vq=typeof WeakSet=="function"?WeakSet:Set,nt=null;function Yl(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 Wx(l,u,v){try{v()}catch(w){zn(l,u,w)}}var nE=!1;function Hq(l,u){if(nx=np,l=I_(),Gg(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 M=0,ee=-1,ie=-1,ye=0,Oe=0,Ie=l,Pe=null;t:for(;;){for(var Ze;Ie!==v||_!==0&&Ie.nodeType!==3||(ee=M+_),Ie!==P||w!==0&&Ie.nodeType!==3||(ie=M+w),Ie.nodeType===3&&(M+=Ie.nodeValue.length),(Ze=Ie.firstChild)!==null;)Pe=Ie,Ie=Ze;for(;;){if(Ie===l)break t;if(Pe===v&&++ye===_&&(ee=M),Pe===P&&++Oe===w&&(ie=M),(Ze=Ie.nextSibling)!==null)break;Ie=Pe,Pe=Ie.parentNode}Ie=Ze}v=ee===-1||ie===-1?null:{start:ee,end:ie}}else v=null}v=v||{start:0,end:0}}else v=null;for(rx={focusedElem:l,selectionRange:v},np=!1,nt=u;nt!==null;)if(u=nt,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,nt=l;else for(;nt!==null;){u=nt;try{var ot=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(ot!==null){var ut=ot.memoizedProps,Un=ot.memoizedState,me=u.stateNode,le=me.getSnapshotBeforeUpdate(u.elementType===u.type?ut:za(u.type,ut),Un);me.__reactInternalSnapshotBeforeUpdate=le}break;case 3:var xe=u.stateNode.containerInfo;xe.nodeType===1?xe.textContent="":xe.nodeType===9&&xe.documentElement&&xe.removeChild(xe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Be){zn(u,u.return,Be)}if(l=u.sibling,l!==null){l.return=u.return,nt=l;break}nt=u.return}return ot=nE,nE=!1,ot}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&&Wx(u,v,P)}_=_.next}while(_!==w)}}function Dp(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 Vx(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 rE(l){var u=l.alternate;u!==null&&(l.alternate=null,rE(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[fs],delete u[Wu],delete u[ix],delete u[Eq],delete u[kq])),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 aE(l){return l.tag===5||l.tag===3||l.tag===4}function sE(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||aE(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 Hx(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=hp));else if(w!==4&&(l=l.child,l!==null))for(Hx(l,u,v),l=l.sibling;l!==null;)Hx(l,u,v),l=l.sibling}function Kx(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(Kx(l,u,v),l=l.sibling;l!==null;)Kx(l,u,v),l=l.sibling}var dr=null,Ba=!1;function Lo(l,u,v){for(v=v.child;v!==null;)oE(l,u,v),v=v.sibling}function oE(l,u,v){if(va&&typeof va.onCommitFiberUnmount=="function")try{va.onCommitFiberUnmount(bi,v)}catch{}switch(v.tag){case 5:yr||Yl(v,u);case 6:var w=dr,_=Ba;dr=null,Lo(l,u,v),dr=w,Ba=_,dr!==null&&(Ba?(l=dr,v=v.stateNode,l.nodeType===8?l.parentNode.removeChild(v):l.removeChild(v)):dr.removeChild(v.stateNode));break;case 18:dr!==null&&(Ba?(l=dr,v=v.stateNode,l.nodeType===8?ox(l.parentNode,v):l.nodeType===1&&ox(l,v),Ru(l)):ox(dr,v.stateNode));break;case 4:w=dr,_=Ba,dr=v.stateNode.containerInfo,Ba=!0,Lo(l,u,v),dr=w,Ba=_;break;case 0:case 11:case 14:case 15:if(!yr&&(w=v.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){_=w=w.next;do{var P=_,M=P.destroy;P=P.tag,M!==void 0&&((P&2)!==0||(P&4)!==0)&&Wx(v,u,M),_=_.next}while(_!==w)}Lo(l,u,v);break;case 1:if(!yr&&(Yl(v,u),w=v.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=v.memoizedProps,w.state=v.memoizedState,w.componentWillUnmount()}catch(ee){zn(v,u,ee)}Lo(l,u,v);break;case 21:Lo(l,u,v);break;case 22:v.mode&1?(yr=(w=yr)||v.memoizedState!==null,Lo(l,u,v),yr=w):Lo(l,u,v);break;default:Lo(l,u,v)}}function iE(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var v=l.stateNode;v===null&&(v=l.stateNode=new Vq),u.forEach(function(w){var _=tU.bind(null,l,w);v.has(w)||(v.add(w),w.then(_,_))})}}function qa(l,u){var v=u.deletions;if(v!==null)for(var w=0;w<v.length;w++){var _=v[w];try{var P=l,M=u,ee=M;e:for(;ee!==null;){switch(ee.tag){case 5:dr=ee.stateNode,Ba=!1;break e;case 3:dr=ee.stateNode.containerInfo,Ba=!0;break e;case 4:dr=ee.stateNode.containerInfo,Ba=!0;break e}ee=ee.return}if(dr===null)throw Error(n(160));oE(P,M,_),dr=null,Ba=!1;var ie=_.alternate;ie!==null&&(ie.return=null),_.return=null}catch(ye){zn(_,u,ye)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)lE(u,l),u=u.sibling}function lE(l,u){var v=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(qa(u,l),ms(l),w&4){try{td(3,l,l.return),Dp(3,l)}catch(ut){zn(l,l.return,ut)}try{td(5,l,l.return)}catch(ut){zn(l,l.return,ut)}}break;case 1:qa(u,l),ms(l),w&512&&v!==null&&Yl(v,v.return);break;case 5:if(qa(u,l),ms(l),w&512&&v!==null&&Yl(v,v.return),l.flags&32){var _=l.stateNode;try{Ke(_,"")}catch(ut){zn(l,l.return,ut)}}if(w&4&&(_=l.stateNode,_!=null)){var P=l.memoizedProps,M=v!==null?v.memoizedProps:P,ee=l.type,ie=l.updateQueue;if(l.updateQueue=null,ie!==null)try{ee==="input"&&P.type==="radio"&&P.name!=null&&L(_,P),Xt(ee,M);var ye=Xt(ee,P);for(M=0;M<ie.length;M+=2){var Oe=ie[M],Ie=ie[M+1];Oe==="style"?Qe(_,Ie):Oe==="dangerouslySetInnerHTML"?et(_,Ie):Oe==="children"?Ke(_,Ie):N(_,Oe,Ie,ye)}switch(ee){case"input":oe(_,P);break;case"textarea":Vt(_,P);break;case"select":var Pe=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!P.multiple;var Ze=P.value;Ze!=null?ht(_,!!P.multiple,Ze,!1):Pe!==!!P.multiple&&(P.defaultValue!=null?ht(_,!!P.multiple,P.defaultValue,!0):ht(_,!!P.multiple,P.multiple?[]:"",!1))}_[Wu]=P}catch(ut){zn(l,l.return,ut)}}break;case 6:if(qa(u,l),ms(l),w&4){if(l.stateNode===null)throw Error(n(162));_=l.stateNode,P=l.memoizedProps;try{_.nodeValue=P}catch(ut){zn(l,l.return,ut)}}break;case 3:if(qa(u,l),ms(l),w&4&&v!==null&&v.memoizedState.isDehydrated)try{Ru(u.containerInfo)}catch(ut){zn(l,l.return,ut)}break;case 4:qa(u,l),ms(l);break;case 13:qa(u,l),ms(l),_=l.child,_.flags&8192&&(P=_.memoizedState!==null,_.stateNode.isHidden=P,!P||_.alternate!==null&&_.alternate.memoizedState!==null||(Xx=ke())),w&4&&iE(l);break;case 22:if(Oe=v!==null&&v.memoizedState!==null,l.mode&1?(yr=(ye=yr)||Oe,qa(u,l),yr=ye):qa(u,l),ms(l),w&8192){if(ye=l.memoizedState!==null,(l.stateNode.isHidden=ye)&&!Oe&&(l.mode&1)!==0)for(nt=l,Oe=l.child;Oe!==null;){for(Ie=nt=Oe;nt!==null;){switch(Pe=nt,Ze=Pe.child,Pe.tag){case 0:case 11:case 14:case 15:td(4,Pe,Pe.return);break;case 1:Yl(Pe,Pe.return);var ot=Pe.stateNode;if(typeof ot.componentWillUnmount=="function"){w=Pe,v=Pe.return;try{u=w,ot.props=u.memoizedProps,ot.state=u.memoizedState,ot.componentWillUnmount()}catch(ut){zn(w,v,ut)}}break;case 5:Yl(Pe,Pe.return);break;case 22:if(Pe.memoizedState!==null){dE(Ie);continue}}Ze!==null?(Ze.return=Pe,nt=Ze):dE(Ie)}Oe=Oe.sibling}e:for(Oe=null,Ie=l;;){if(Ie.tag===5){if(Oe===null){Oe=Ie;try{_=Ie.stateNode,ye?(P=_.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(ee=Ie.stateNode,ie=Ie.memoizedProps.style,M=ie!=null&&ie.hasOwnProperty("display")?ie.display:null,ee.style.display=$e("display",M))}catch(ut){zn(l,l.return,ut)}}}else if(Ie.tag===6){if(Oe===null)try{Ie.stateNode.nodeValue=ye?"":Ie.memoizedProps}catch(ut){zn(l,l.return,ut)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===l)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===l)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===l)break e;Oe===Ie&&(Oe=null),Ie=Ie.return}Oe===Ie&&(Oe=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:qa(u,l),ms(l),w&4&&iE(l);break;case 21:break;default:qa(u,l),ms(l)}}function ms(l){var u=l.flags;if(u&2){try{e:{for(var v=l.return;v!==null;){if(aE(v)){var w=v;break e}v=v.return}throw Error(n(160))}switch(w.tag){case 5:var _=w.stateNode;w.flags&32&&(Ke(_,""),w.flags&=-33);var P=sE(l);Kx(l,P,_);break;case 3:case 4:var M=w.stateNode.containerInfo,ee=sE(l);Hx(l,ee,M);break;default:throw Error(n(161))}}catch(ie){zn(l,l.return,ie)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function Kq(l,u,v){nt=l,cE(l)}function cE(l,u,v){for(var w=(l.mode&1)!==0;nt!==null;){var _=nt,P=_.child;if(_.tag===22&&w){var M=_.memoizedState!==null||$p;if(!M){var ee=_.alternate,ie=ee!==null&&ee.memoizedState!==null||yr;ee=$p;var ye=yr;if($p=M,(yr=ie)&&!ye)for(nt=_;nt!==null;)M=nt,ie=M.child,M.tag===22&&M.memoizedState!==null?fE(_):ie!==null?(ie.return=M,nt=ie):fE(_);for(;P!==null;)nt=P,cE(P),P=P.sibling;nt=_,$p=ee,yr=ye}uE(l)}else(_.subtreeFlags&8772)!==0&&P!==null?(P.return=_,nt=P):uE(l)}}function uE(l){for(;nt!==null;){var u=nt;if((u.flags&8772)!==0){var v=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:yr||Dp(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!yr)if(v===null)w.componentDidMount();else{var _=u.elementType===u.type?v.memoizedProps:za(u.type,v.memoizedProps);w.componentDidUpdate(_,v.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var P=u.updateQueue;P!==null&&dA(u,P,w);break;case 3:var M=u.updateQueue;if(M!==null){if(v=null,u.child!==null)switch(u.child.tag){case 5:v=u.child.stateNode;break;case 1:v=u.child.stateNode}dA(u,M,v)}break;case 5:var ee=u.stateNode;if(v===null&&u.flags&4){v=ee;var ie=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":ie.autoFocus&&v.focus();break;case"img":ie.src&&(v.src=ie.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var ye=u.alternate;if(ye!==null){var Oe=ye.memoizedState;if(Oe!==null){var Ie=Oe.dehydrated;Ie!==null&&Ru(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yr||u.flags&512&&Vx(u)}catch(Pe){zn(u,u.return,Pe)}}if(u===l){nt=null;break}if(v=u.sibling,v!==null){v.return=u.return,nt=v;break}nt=u.return}}function dE(l){for(;nt!==null;){var u=nt;if(u===l){nt=null;break}var v=u.sibling;if(v!==null){v.return=u.return,nt=v;break}nt=u.return}}function fE(l){for(;nt!==null;){var u=nt;try{switch(u.tag){case 0:case 11:case 15:var v=u.return;try{Dp(4,u)}catch(ie){zn(u,v,ie)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var _=u.return;try{w.componentDidMount()}catch(ie){zn(u,_,ie)}}var P=u.return;try{Vx(u)}catch(ie){zn(u,P,ie)}break;case 5:var M=u.return;try{Vx(u)}catch(ie){zn(u,M,ie)}}}catch(ie){zn(u,u.return,ie)}if(u===l){nt=null;break}var ee=u.sibling;if(ee!==null){ee.return=u.return,nt=ee;break}nt=u.return}}var Gq=Math.ceil,Lp=E.ReactCurrentDispatcher,Gx=E.ReactCurrentOwner,wa=E.ReactCurrentBatchConfig,Qt=0,or=null,Vn=null,fr=0,na=0,Xl=Ro(0),Qn=0,nd=null,ki=0,Fp=0,Yx=0,rd=null,Mr=null,Xx=0,Ql=1/0,Ks=null,zp=!1,Qx=null,Fo=null,Bp=!1,zo=null,qp=0,ad=0,Jx=null,Up=-1,Wp=0;function Sr(){return(Qt&6)!==0?ke():Up!==-1?Up:Up=ke()}function Bo(l){return(l.mode&1)===0?1:(Qt&2)!==0&&fr!==0?fr&-fr:Oq.transition!==null?(Wp===0&&(Wp=Co()),Wp):(l=ln,l!==0||(l=window.event,l=l===void 0?16:h_(l.type)),l)}function Ua(l,u,v,w){if(50<ad)throw ad=0,Jx=null,Error(n(185));wi(l,v,w),((Qt&2)===0||l!==or)&&(l===or&&((Qt&2)===0&&(Fp|=v),Qn===4&&qo(l,fr)),$r(l,w),v===1&&Qt===0&&(u.mode&1)===0&&(Ql=ke()+500,xp&&Mo()))}function $r(l,u){var v=l.callbackNode;mr(l,u);var w=Ot(l,l===or?fr:0);if(w===0)v!==null&&Et(v),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(v!=null&&Et(v),u===1)l.tag===0?Pq(hE.bind(null,l)):Z_(hE.bind(null,l)),_q(function(){(Qt&6)===0&&Mo()}),v=null;else{switch(o_(w)){case 1:v=jt;break;case 4:v=Jt;break;case 16:v=Qr;break;case 536870912:v=Zf;break;default:v=Qr}v=jE(v,pE.bind(null,l))}l.callbackPriority=u,l.callbackNode=v}}function pE(l,u){if(Up=-1,Wp=0,(Qt&6)!==0)throw Error(n(327));var v=l.callbackNode;if(Jl()&&l.callbackNode!==v)return null;var w=Ot(l,l===or?fr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=Vp(l,w);else{u=w;var _=Qt;Qt|=2;var P=vE();(or!==l||fr!==u)&&(Ks=null,Ql=ke()+500,Oi(l,u));do try{Qq();break}catch(ee){mE(l,ee)}while(!0);vx(),Lp.current=P,Qt=_,Vn!==null?u=0:(or=null,fr=0,u=Qn)}if(u!==0){if(u===2&&(_=dn(l),_!==0&&(w=_,u=Zx(l,_))),u===1)throw v=nd,Oi(l,0),qo(l,w),$r(l,ke()),v;if(u===6)qo(l,w);else{if(_=l.current.alternate,(w&30)===0&&!Yq(_)&&(u=Vp(l,w),u===2&&(P=dn(l),P!==0&&(w=P,u=Zx(l,P))),u===1))throw v=nd,Oi(l,0),qo(l,w),$r(l,ke()),v;switch(l.finishedWork=_,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:Ti(l,Mr,Ks);break;case 3:if(qo(l,w),(w&130023424)===w&&(u=Xx+500-ke(),10<u)){if(Ot(l,0)!==0)break;if(_=l.suspendedLanes,(_&w)!==w){Sr(),l.pingedLanes|=l.suspendedLanes&_;break}l.timeoutHandle=sx(Ti.bind(null,l,Mr,Ks),u);break}Ti(l,Mr,Ks);break;case 4:if(qo(l,w),(w&4194240)===w)break;for(u=l.eventTimes,_=-1;0<w;){var M=31-Jr(w);P=1<<M,M=u[M],M>_&&(_=M),w&=~P}if(w=_,w=ke()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*Gq(w/1960))-w,10<w){l.timeoutHandle=sx(Ti.bind(null,l,Mr,Ks),w);break}Ti(l,Mr,Ks);break;case 5:Ti(l,Mr,Ks);break;default:throw Error(n(329))}}}return $r(l,ke()),l.callbackNode===v?pE.bind(null,l):null}function Zx(l,u){var v=rd;return l.current.memoizedState.isDehydrated&&(Oi(l,u).flags|=256),l=Vp(l,u),l!==2&&(u=Mr,Mr=v,u!==null&&ey(u)),l}function ey(l){Mr===null?Mr=l:Mr.push.apply(Mr,l)}function Yq(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(!La(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 qo(l,u){for(u&=~Yx,u&=~Fp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var v=31-Jr(u),w=1<<v;l[v]=-1,u&=~w}}function hE(l){if((Qt&6)!==0)throw Error(n(327));Jl();var u=Ot(l,0);if((u&1)===0)return $r(l,ke()),null;var v=Vp(l,u);if(l.tag!==0&&v===2){var w=dn(l);w!==0&&(u=w,v=Zx(l,w))}if(v===1)throw v=nd,Oi(l,0),qo(l,u),$r(l,ke()),v;if(v===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,Ti(l,Mr,Ks),$r(l,ke()),null}function ty(l,u){var v=Qt;Qt|=1;try{return l(u)}finally{Qt=v,Qt===0&&(Ql=ke()+500,xp&&Mo())}}function Pi(l){zo!==null&&zo.tag===0&&(Qt&6)===0&&Jl();var u=Qt;Qt|=1;var v=wa.transition,w=ln;try{if(wa.transition=null,ln=1,l)return l()}finally{ln=w,wa.transition=v,Qt=u,(Qt&6)===0&&Mo()}}function ny(){na=Xl.current,_n(Xl)}function Oi(l,u){l.finishedWork=null,l.finishedLanes=0;var v=l.timeoutHandle;if(v!==-1&&(l.timeoutHandle=-1,Cq(v)),Vn!==null)for(v=Vn.return;v!==null;){var w=v;switch(dx(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&vp();break;case 3:Kl(),_n(Tr),_n(vr),Nx();break;case 5:jx(w);break;case 4:Kl();break;case 13:_n(In);break;case 19:_n(In);break;case 10:gx(w.type._context);break;case 22:case 23:ny()}v=v.return}if(or=l,Vn=l=Uo(l.current,null),fr=na=u,Qn=0,nd=null,Yx=Fp=ki=0,Mr=rd=null,_i!==null){for(u=0;u<_i.length;u++)if(v=_i[u],w=v.interleaved,w!==null){v.interleaved=null;var _=w.next,P=v.pending;if(P!==null){var M=P.next;P.next=_,w.next=M}v.pending=w}_i=null}return l}function mE(l,u){do{var v=Vn;try{if(vx(),Ep.current=Tp,kp){for(var w=Mn.memoizedState;w!==null;){var _=w.queue;_!==null&&(_.pending=null),w=w.next}kp=!1}if(Ei=0,sr=Xn=Mn=null,Xu=!1,Qu=0,Gx.current=null,v===null||v.return===null){Qn=1,nd=u,Vn=null;break}e:{var P=l,M=v.return,ee=v,ie=u;if(u=fr,ee.flags|=32768,ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var ye=ie,Oe=ee,Ie=Oe.tag;if((Oe.mode&1)===0&&(Ie===0||Ie===11||Ie===15)){var Pe=Oe.alternate;Pe?(Oe.updateQueue=Pe.updateQueue,Oe.memoizedState=Pe.memoizedState,Oe.lanes=Pe.lanes):(Oe.updateQueue=null,Oe.memoizedState=null)}var Ze=zA(M);if(Ze!==null){Ze.flags&=-257,BA(Ze,M,ee,P,u),Ze.mode&1&&FA(P,ye,u),u=Ze,ie=ye;var ot=u.updateQueue;if(ot===null){var ut=new Set;ut.add(ie),u.updateQueue=ut}else ot.add(ie);break e}else{if((u&1)===0){FA(P,ye,u),ry();break e}ie=Error(n(426))}}else if(Pn&&ee.mode&1){var Un=zA(M);if(Un!==null){(Un.flags&65536)===0&&(Un.flags|=256),BA(Un,M,ee,P,u),hx(Gl(ie,ee));break e}}P=ie=Gl(ie,ee),Qn!==4&&(Qn=2),rd===null?rd=[P]:rd.push(P),P=M;do{switch(P.tag){case 3:P.flags|=65536,u&=-u,P.lanes|=u;var me=DA(P,ie,u);uA(P,me);break e;case 1:ee=ie;var le=P.type,xe=P.stateNode;if((P.flags&128)===0&&(typeof le.getDerivedStateFromError=="function"||xe!==null&&typeof xe.componentDidCatch=="function"&&(Fo===null||!Fo.has(xe)))){P.flags|=65536,u&=-u,P.lanes|=u;var Be=LA(P,ee,u);uA(P,Be);break e}}P=P.return}while(P!==null)}xE(v)}catch(ft){u=ft,Vn===v&&v!==null&&(Vn=v=v.return);continue}break}while(!0)}function vE(){var l=Lp.current;return Lp.current=Tp,l===null?Tp:l}function ry(){(Qn===0||Qn===3||Qn===2)&&(Qn=4),or===null||(ki&268435455)===0&&(Fp&268435455)===0||qo(or,fr)}function Vp(l,u){var v=Qt;Qt|=2;var w=vE();(or!==l||fr!==u)&&(Ks=null,Oi(l,u));do try{Xq();break}catch(_){mE(l,_)}while(!0);if(vx(),Qt=v,Lp.current=w,Vn!==null)throw Error(n(261));return or=null,fr=0,Qn}function Xq(){for(;Vn!==null;)gE(Vn)}function Qq(){for(;Vn!==null&&!Fn();)gE(Vn)}function gE(l){var u=wE(l.alternate,l,na);l.memoizedProps=l.pendingProps,u===null?xE(l):Vn=u,Gx.current=null}function xE(l){var u=l;do{var v=u.alternate;if(l=u.return,(u.flags&32768)===0){if(v=Uq(v,u,na),v!==null){Vn=v;return}}else{if(v=Wq(v,u),v!==null){v.flags&=32767,Vn=v;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Qn=6,Vn=null;return}}if(u=u.sibling,u!==null){Vn=u;return}Vn=u=l}while(u!==null);Qn===0&&(Qn=5)}function Ti(l,u,v){var w=ln,_=wa.transition;try{wa.transition=null,ln=1,Jq(l,u,v,w)}finally{wa.transition=_,ln=w}return null}function Jq(l,u,v,w){do Jl();while(zo!==null);if((Qt&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(Au(l,P),l===or&&(Vn=or=null,fr=0),(v.subtreeFlags&2064)===0&&(v.flags&2064)===0||Bp||(Bp=!0,jE(Qr,function(){return Jl(),null})),P=(v.flags&15990)!==0,(v.subtreeFlags&15990)!==0||P){P=wa.transition,wa.transition=null;var M=ln;ln=1;var ee=Qt;Qt|=4,Gx.current=null,Hq(l,v),lE(v,l),xq(rx),np=!!nx,rx=nx=null,l.current=v,Kq(v),Yn(),Qt=ee,ln=M,wa.transition=P}else l.current=v;if(Bp&&(Bp=!1,zo=l,qp=_),P=l.pendingLanes,P===0&&(Fo=null),Rg(v.stateNode),$r(l,ke()),u!==null)for(w=l.onRecoverableError,v=0;v<u.length;v++)_=u[v],w(_.value,{componentStack:_.stack,digest:_.digest});if(zp)throw zp=!1,l=Qx,Qx=null,l;return(qp&1)!==0&&l.tag!==0&&Jl(),P=l.pendingLanes,(P&1)!==0?l===Jx?ad++:(ad=0,Jx=l):ad=0,Mo(),null}function Jl(){if(zo!==null){var l=o_(qp),u=wa.transition,v=ln;try{if(wa.transition=null,ln=16>l?16:l,zo===null)var w=!1;else{if(l=zo,zo=null,qp=0,(Qt&6)!==0)throw Error(n(331));var _=Qt;for(Qt|=4,nt=l.current;nt!==null;){var P=nt,M=P.child;if((nt.flags&16)!==0){var ee=P.deletions;if(ee!==null){for(var ie=0;ie<ee.length;ie++){var ye=ee[ie];for(nt=ye;nt!==null;){var Oe=nt;switch(Oe.tag){case 0:case 11:case 15:td(8,Oe,P)}var Ie=Oe.child;if(Ie!==null)Ie.return=Oe,nt=Ie;else for(;nt!==null;){Oe=nt;var Pe=Oe.sibling,Ze=Oe.return;if(rE(Oe),Oe===ye){nt=null;break}if(Pe!==null){Pe.return=Ze,nt=Pe;break}nt=Ze}}}var ot=P.alternate;if(ot!==null){var ut=ot.child;if(ut!==null){ot.child=null;do{var Un=ut.sibling;ut.sibling=null,ut=Un}while(ut!==null)}}nt=P}}if((P.subtreeFlags&2064)!==0&&M!==null)M.return=P,nt=M;else e:for(;nt!==null;){if(P=nt,(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,nt=me;break e}nt=P.return}}var le=l.current;for(nt=le;nt!==null;){M=nt;var xe=M.child;if((M.subtreeFlags&2064)!==0&&xe!==null)xe.return=M,nt=xe;else e:for(M=le;nt!==null;){if(ee=nt,(ee.flags&2048)!==0)try{switch(ee.tag){case 0:case 11:case 15:Dp(9,ee)}}catch(ft){zn(ee,ee.return,ft)}if(ee===M){nt=null;break e}var Be=ee.sibling;if(Be!==null){Be.return=ee.return,nt=Be;break e}nt=ee.return}}if(Qt=_,Mo(),va&&typeof va.onPostCommitFiberRoot=="function")try{va.onPostCommitFiberRoot(bi,l)}catch{}w=!0}return w}finally{ln=v,wa.transition=u}}return!1}function yE(l,u,v){u=Gl(v,u),u=DA(l,u,1),l=Do(l,u,1),u=Sr(),l!==null&&(wi(l,1,u),$r(l,u))}function zn(l,u,v){if(l.tag===3)yE(l,l,v);else for(;u!==null;){if(u.tag===3){yE(u,l,v);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(Fo===null||!Fo.has(w))){l=Gl(v,l),l=LA(u,l,1),u=Do(u,l,1),l=Sr(),u!==null&&(wi(u,1,l),$r(u,l));break}}u=u.return}}function Zq(l,u,v){var w=l.pingCache;w!==null&&w.delete(u),u=Sr(),l.pingedLanes|=l.suspendedLanes&v,or===l&&(fr&v)===v&&(Qn===4||Qn===3&&(fr&130023424)===fr&&500>ke()-Xx?Oi(l,0):Yx|=v),$r(l,u)}function bE(l,u){u===0&&((l.mode&1)===0?u=1:(u=Le,Le<<=1,(Le&130023424)===0&&(Le=4194304)));var v=Sr();l=Ws(l,u),l!==null&&(wi(l,u,v),$r(l,v))}function eU(l){var u=l.memoizedState,v=0;u!==null&&(v=u.retryLane),bE(l,v)}function tU(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),bE(l,v)}var wE;wE=function(l,u,v){if(l!==null)if(l.memoizedProps!==u.pendingProps||Tr.current)Ir=!0;else{if((l.lanes&v)===0&&(u.flags&128)===0)return Ir=!1,qq(l,u,v);Ir=(l.flags&131072)!==0}else Ir=!1,Pn&&(u.flags&1048576)!==0&&eA(u,bp,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;Mp(l,u),l=u.pendingProps;var _=zl(u,vr.current);Hl(u,v),_=Ax(null,u,w,l,_,v);var P=Ex();return u.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Rr(w)?(P=!0,gp(u)):P=!1,u.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,bx(u),_.updater=Rp,u.stateNode=_,_._reactInternals=u,Ix(u,w,l,v),u=Lx(null,u,w,!0,P,v)):(u.tag=0,Pn&&P&&ux(u),jr(null,u,_,v),u=u.child),u;case 16:w=u.elementType;e:{switch(Mp(l,u),l=u.pendingProps,_=w._init,w=_(w._payload),u.type=w,_=u.tag=rU(w),l=za(w,l),_){case 0:u=Dx(null,u,w,l,v);break e;case 1:u=KA(null,u,w,l,v);break e;case 11:u=qA(null,u,w,l,v);break e;case 14:u=UA(null,u,w,za(w.type,l),v);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:za(w,_),Dx(l,u,w,_,v);case 1:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:za(w,_),KA(l,u,w,_,v);case 3:e:{if(GA(u),l===null)throw Error(n(387));w=u.pendingProps,P=u.memoizedState,_=P.element,cA(l,u),_p(u,w,null,v);var M=u.memoizedState;if(w=M.element,P.isDehydrated)if(P={element:w,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},u.updateQueue.baseState=P,u.memoizedState=P,u.flags&256){_=Gl(Error(n(423)),u),u=YA(l,u,w,v,_);break e}else if(w!==_){_=Gl(Error(n(424)),u),u=YA(l,u,w,v,_);break e}else for(ta=To(u.stateNode.containerInfo.firstChild),ea=u,Pn=!0,Fa=null,v=iA(u,null,w,v),u.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Ul(),w===_){u=Hs(l,u,v);break e}jr(l,u,w,v)}u=u.child}return u;case 5:return fA(u),l===null&&px(u),w=u.type,_=u.pendingProps,P=l!==null?l.memoizedProps:null,M=_.children,ax(w,_)?M=null:P!==null&&ax(w,P)&&(u.flags|=32),HA(l,u),jr(l,u,M,v),u.child;case 6:return l===null&&px(u),null;case 13:return XA(l,u,v);case 4:return wx(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=Wl(u,null,w,v):jr(l,u,w,v),u.child;case 11:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:za(w,_),qA(l,u,w,_,v);case 7:return jr(l,u,u.pendingProps,v),u.child;case 8:return jr(l,u,u.pendingProps.children,v),u.child;case 12:return jr(l,u,u.pendingProps.children,v),u.child;case 10:e:{if(w=u.type._context,_=u.pendingProps,P=u.memoizedProps,M=_.value,xn(Sp,w._currentValue),w._currentValue=M,P!==null)if(La(P.value,M)){if(P.children===_.children&&!Tr.current){u=Hs(l,u,v);break e}}else for(P=u.child,P!==null&&(P.return=u);P!==null;){var ee=P.dependencies;if(ee!==null){M=P.child;for(var ie=ee.firstContext;ie!==null;){if(ie.context===w){if(P.tag===1){ie=Vs(-1,v&-v),ie.tag=2;var ye=P.updateQueue;if(ye!==null){ye=ye.shared;var Oe=ye.pending;Oe===null?ie.next=ie:(ie.next=Oe.next,Oe.next=ie),ye.pending=ie}}P.lanes|=v,ie=P.alternate,ie!==null&&(ie.lanes|=v),xx(P.return,v,u),ee.lanes|=v;break}ie=ie.next}}else if(P.tag===10)M=P.type===u.type?null:P.child;else if(P.tag===18){if(M=P.return,M===null)throw Error(n(341));M.lanes|=v,ee=M.alternate,ee!==null&&(ee.lanes|=v),xx(M,v,u),M=P.sibling}else M=P.child;if(M!==null)M.return=P;else for(M=P;M!==null;){if(M===u){M=null;break}if(P=M.sibling,P!==null){P.return=M.return,M=P;break}M=M.return}P=M}jr(l,u,_.children,v),u=u.child}return u;case 9:return _=u.type,w=u.pendingProps.children,Hl(u,v),_=ya(_),w=w(_),u.flags|=1,jr(l,u,w,v),u.child;case 14:return w=u.type,_=za(w,u.pendingProps),_=za(w.type,_),UA(l,u,w,_,v);case 15:return WA(l,u,u.type,u.pendingProps,v);case 17:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:za(w,_),Mp(l,u),u.tag=1,Rr(w)?(l=!0,gp(u)):l=!1,Hl(u,v),MA(u,w,_),Ix(u,w,_,v),Lx(null,u,w,!0,l,v);case 19:return JA(l,u,v);case 22:return VA(l,u,v)}throw Error(n(156,u.tag))};function jE(l,u){return Dt(l,u)}function nU(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 ja(l,u,v,w){return new nU(l,u,v,w)}function ay(l){return l=l.prototype,!(!l||!l.isReactComponent)}function rU(l){if(typeof l=="function")return ay(l)?1:0;if(l!=null){if(l=l.$$typeof,l===F)return 11;if(l===R)return 14}return 2}function Uo(l,u){var v=l.alternate;return v===null?(v=ja(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 Hp(l,u,v,w,_,P){var M=2;if(w=l,typeof l=="function")ay(l)&&(M=1);else if(typeof l=="string")M=5;else e:switch(l){case O:return Ri(v.children,_,P,u);case T:M=8,_|=8;break;case $:return l=ja(12,v,u,_|2),l.elementType=$,l.lanes=P,l;case H:return l=ja(13,v,u,_),l.elementType=H,l.lanes=P,l;case U:return l=ja(19,v,u,_),l.elementType=U,l.lanes=P,l;case X:return Kp(v,_,P,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case B:M=10;break e;case q:M=9;break e;case F:M=11;break e;case R:M=14;break e;case W:M=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=ja(M,v,u,_),u.elementType=l,u.type=w,u.lanes=P,u}function Ri(l,u,v,w){return l=ja(7,l,w,u),l.lanes=v,l}function Kp(l,u,v,w){return l=ja(22,l,w,u),l.elementType=X,l.lanes=v,l.stateNode={isHidden:!1},l}function sy(l,u,v){return l=ja(6,l,null,u),l.lanes=v,l}function oy(l,u,v){return u=ja(4,l.children!==null?l.children:[],l.key,u),u.lanes=v,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function aU(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=Pl(0),this.expirationTimes=Pl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pl(0),this.identifierPrefix=w,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function iy(l,u,v,w,_,P,M,ee,ie){return l=new aU(l,u,v,ee,ie),u===1?(u=1,P===!0&&(u|=8)):u=0,P=ja(3,null,null,u),l.current=P,P.stateNode=l,P.memoizedState={element:w,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},bx(P),l}function sU(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 SE(l){if(!l)return Io;l=l._reactInternals;e:{if(Xr(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(Rr(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(Rr(v))return Q_(l,v,u)}return u}function NE(l,u,v,w,_,P,M,ee,ie){return l=iy(v,w,!0,l,_,P,M,ee,ie),l.context=SE(null),v=l.current,w=Sr(),_=Bo(v),P=Vs(w,_),P.callback=u??null,Do(v,P,_),l.current.lanes=_,wi(l,_,w),$r(l,w),l}function Gp(l,u,v,w){var _=u.current,P=Sr(),M=Bo(_);return v=SE(v),u.context===null?u.context=v:u.pendingContext=v,u=Vs(P,M),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=Do(_,u,M),l!==null&&(Ua(l,_,M,P),Cp(l,_,M)),M}function Yp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function CE(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var v=l.retryLane;l.retryLane=v!==0&&v<u?v:u}}function ly(l,u){CE(l,u),(l=l.alternate)&&CE(l,u)}function oU(){return null}var _E=typeof reportError=="function"?reportError:function(l){console.error(l)};function cy(l){this._internalRoot=l}Xp.prototype.render=cy.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));Gp(l,u,null,null)},Xp.prototype.unmount=cy.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;Pi(function(){Gp(null,l,null,null)}),u[zs]=null}};function Xp(l){this._internalRoot=l}Xp.prototype.unstable_scheduleHydration=function(l){if(l){var u=c_();l={blockedOn:null,target:l,priority:u};for(var v=0;v<ko.length&&u!==0&&u<ko[v].priority;v++);ko.splice(v,0,l),v===0&&f_(l)}};function uy(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Qp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function AE(){}function iU(l,u,v,w,_){if(_){if(typeof w=="function"){var P=w;w=function(){var ye=Yp(M);P.call(ye)}}var M=NE(u,w,l,0,null,!1,!1,"",AE);return l._reactRootContainer=M,l[zs]=M.current,qu(l.nodeType===8?l.parentNode:l),Pi(),M}for(;_=l.lastChild;)l.removeChild(_);if(typeof w=="function"){var ee=w;w=function(){var ye=Yp(ie);ee.call(ye)}}var ie=iy(l,0,!1,null,null,!1,!1,"",AE);return l._reactRootContainer=ie,l[zs]=ie.current,qu(l.nodeType===8?l.parentNode:l),Pi(function(){Gp(u,ie,v,w)}),ie}function Jp(l,u,v,w,_){var P=v._reactRootContainer;if(P){var M=P;if(typeof _=="function"){var ee=_;_=function(){var ie=Yp(M);ee.call(ie)}}Gp(u,M,l,_)}else M=iU(v,u,l,_,w);return Yp(M)}i_=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var v=Ht(u.pendingLanes);v!==0&&(Eu(u,v|1),$r(u,ke()),(Qt&6)===0&&(Ql=ke()+500,Mo()))}break;case 13:Pi(function(){var w=Ws(l,1);if(w!==null){var _=Sr();Ua(w,l,1,_)}}),ly(l,1)}},Mg=function(l){if(l.tag===13){var u=Ws(l,134217728);if(u!==null){var v=Sr();Ua(u,l,134217728,v)}ly(l,134217728)}},l_=function(l){if(l.tag===13){var u=Bo(l),v=Ws(l,u);if(v!==null){var w=Sr();Ua(v,l,u,w)}ly(l,u)}},c_=function(){return ln},u_=function(l,u){var v=ln;try{return ln=l,u()}finally{ln=v}},At=function(l,u,v){switch(u){case"input":if(oe(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 _=mp(w);if(!_)throw Error(n(90));ae(w),oe(w,_)}}}break;case"textarea":Vt(l,v);break;case"select":u=v.value,u!=null&&ht(l,!!v.multiple,u,!1)}},Rt=ty,Bt=Pi;var lU={usingClientEntryPoint:!1,Events:[Vu,Ll,mp,kn,pt,ty]},sd={findFiberByHostInstance:ji,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},cU={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=De(l),l===null?null:l.stateNode},findFiberByHostInstance:sd.findFiberByHostInstance||oU,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 Zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zp.isDisabled&&Zp.supportsFiber)try{bi=Zp.inject(cU),va=Zp}catch{}}return Dr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lU,Dr.createPortal=function(l,u){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uy(u))throw Error(n(200));return sU(l,u,null,v)},Dr.createRoot=function(l,u){if(!uy(l))throw Error(n(299));var v=!1,w="",_=_E;return u!=null&&(u.unstable_strictMode===!0&&(v=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(_=u.onRecoverableError)),u=iy(l,1,!1,null,null,v,!1,w,_),l[zs]=u.current,qu(l.nodeType===8?l.parentNode:l),new cy(u)},Dr.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=De(u),l=l===null?null:l.stateNode,l},Dr.flushSync=function(l){return Pi(l)},Dr.hydrate=function(l,u,v){if(!Qp(u))throw Error(n(200));return Jp(null,l,u,!0,v)},Dr.hydrateRoot=function(l,u,v){if(!uy(l))throw Error(n(405));var w=v!=null&&v.hydratedSources||null,_=!1,P="",M=_E;if(v!=null&&(v.unstable_strictMode===!0&&(_=!0),v.identifierPrefix!==void 0&&(P=v.identifierPrefix),v.onRecoverableError!==void 0&&(M=v.onRecoverableError)),u=NE(u,null,l,1,v??null,_,!1,P,M),l[zs]=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 Xp(u)},Dr.render=function(l,u,v){if(!Qp(u))throw Error(n(200));return Jp(null,l,u,!1,v)},Dr.unmountComponentAtNode=function(l){if(!Qp(l))throw Error(n(40));return l._reactRootContainer?(Pi(function(){Jp(null,null,l,!1,function(){l._reactRootContainer=null,l[zs]=null})}),!0):!1},Dr.unstable_batchedUpdates=ty,Dr.unstable_renderSubtreeIntoContainer=function(l,u,v,w){if(!Qp(v))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return Jp(l,u,v,!1,w)},Dr.version="18.3.1-next-f1338f8080-20240426",Dr}var ME;function j$(){if(ME)return py.exports;ME=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(),py.exports=gU(),py.exports}var $E;function xU(){if($E)return th;$E=1;var e=j$();return th.createRoot=e.createRoot,th.hydrateRoot=e.hydrateRoot,th}var yU=xU(),m=rN();const Y=un(m),tv=dU({__proto__:null,default:Y},[m]),bU=1,wU=1e6;let vy=0;function jU(){return vy=(vy+1)%Number.MAX_SAFE_INTEGER,vy.toString()}const gy=new Map,DE=e=>{if(gy.has(e))return;const t=setTimeout(()=>{gy.delete(e),Cd({type:"REMOVE_TOAST",toastId:e})},wU);gy.set(e,t)},SU=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,bU)};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?DE(n):e.toasts.forEach(r=>{DE(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)}}},Ah=[];let Eh={toasts:[]};function Cd(e){Eh=SU(Eh,e),Ah.forEach(t=>{t(Eh)})}function Ae({...e}){const t=jU(),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 NU(){const[e,t]=m.useState(Eh);return m.useEffect(()=>(Ah.push(t),()=>{const n=Ah.indexOf(t);n>-1&&Ah.splice(n,1)}),[e]),{...e,toast:Ae,dismiss:n=>Cd({type:"DISMISS_TOAST",toastId:n})}}var iu=j$();const S$=un(iu);function Te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function LE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pr(...e){return t=>{let n=!1;const r=e.map(s=>{const o=LE(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():LE(e[s],null)}}}}function wt(...e){return m.useCallback(Pr(...e),e)}function CU(e,t){const n=m.createContext(t),r=o=>{const{children:i,...c}=o,d=m.useMemo(()=>c,Object.values(c));return a.jsx(n.Provider,{value:d,children:i})};r.displayName=e+"Provider";function s(o){const i=m.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function hr(e,t=[]){let n=[];function r(o,i){const c=m.createContext(i),d=n.length;n=[...n,i];const f=p=>{const{scope:x,children:g,...j}=p,b=x?.[e]?.[d]||c,y=m.useMemo(()=>j,Object.values(j));return a.jsx(b.Provider,{value:y,children:g})};f.displayName=o+"Provider";function h(p,x){const g=x?.[e]?.[d]||c,j=m.useContext(g);if(j)return j;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,h]}const s=()=>{const o=n.map(i=>m.createContext(i));return function(c){const d=c?.[e]||o;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(o){const i=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(o)[`__scope${f}`];return{...c,...p}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function FE(e){const t=AU(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(kU);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,{...i,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function AU(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=OU(s),c=PU(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Pr(r,i):i),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EU=Symbol("radix.slottable");function kU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EU}function PU(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{const d=o(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function OU(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 Cf(e){const t=e+"CollectionProvider",[n,r]=hr(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=b=>{const{scope:y,children:S}=b,C=Y.useRef(null),N=Y.useRef(new Map).current;return a.jsx(s,{scope:y,itemMap:N,collectionRef:C,children:S})};i.displayName=t;const c=e+"CollectionSlot",d=FE(c),f=Y.forwardRef((b,y)=>{const{scope:S,children:C}=b,N=o(c,S),E=wt(y,N.collectionRef);return a.jsx(d,{ref:E,children:C})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",x=FE(h),g=Y.forwardRef((b,y)=>{const{scope:S,children:C,...N}=b,E=Y.useRef(null),A=wt(y,E),k=o(h,S);return Y.useEffect(()=>(k.itemMap.set(E,{ref:E,...N}),()=>{k.itemMap.delete(E)})),a.jsx(x,{[p]:"",ref:A,children:C})});g.displayName=h;function j(b){const y=o(e+"CollectionConsumer",b);return Y.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const N=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((k,O)=>N.indexOf(k.ref.current)-N.indexOf(O.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:f,ItemSlot:g},j,r]}function TU(e){const t=RU(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(MU);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,{...i,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function RU(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=DU(s),c=$U(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Pr(r,i):i),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var IU=Symbol("radix.slottable");function MU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===IU}function $U(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{const d=o(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function DU(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 LU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=LU.reduce((e,t)=>{const n=TU(`Primitive.${t}`),r=m.forwardRef((s,o)=>{const{asChild:i,...c}=s,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function aN(e,t){e&&iu.flushSync(()=>e.dispatchEvent(t))}function Wn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>t.current?.(...n),[])}function FU(e,t=globalThis?.document){const n=Wn(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 zU="DismissableLayer",Kj="dismissableLayer.update",BU="dismissableLayer.pointerDownOutside",qU="dismissableLayer.focusOutside",zE,N$=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xl=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:c,...d}=e,f=m.useContext(N$),[h,p]=m.useState(null),x=h?.ownerDocument??globalThis?.document,[,g]=m.useState({}),j=wt(t,O=>p(O)),b=Array.from(f.layers),[y]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(y),C=h?b.indexOf(h):-1,N=f.layersWithOutsidePointerEventsDisabled.size>0,E=C>=S,A=WU(O=>{const T=O.target,$=[...f.branches].some(B=>B.contains(T));!E||$||(s?.(O),i?.(O),O.defaultPrevented||c?.())},x),k=VU(O=>{const T=O.target;[...f.branches].some(B=>B.contains(T))||(o?.(O),i?.(O),O.defaultPrevented||c?.())},x);return FU(O=>{C===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},x),m.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(zE=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),BE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=zE)}},[h,x,n,f]),m.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),BE())},[h,f]),m.useEffect(()=>{const O=()=>g({});return document.addEventListener(Kj,O),()=>document.removeEventListener(Kj,O)},[]),a.jsx(Ye.div,{...d,ref:j,style:{pointerEvents:N?E?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,A.onPointerDownCapture)})});xl.displayName=zU;var UU="DismissableLayerBranch",C$=m.forwardRef((e,t)=>{const n=m.useContext(N$),r=m.useRef(null),s=wt(t,r);return m.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),a.jsx(Ye.div,{...e,ref:s})});C$.displayName=UU;function WU(e,t=globalThis?.document){const n=Wn(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let d=function(){_$(BU,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},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function VU(e,t=globalThis?.document){const n=Wn(e),r=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!r.current&&_$(qU,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function BE(){const e=new CustomEvent(Kj);document.dispatchEvent(e)}function _$(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?aN(s,o):s.dispatchEvent(o)}var HU=xl,KU=C$,rr=globalThis?.document?m.useLayoutEffect:()=>{},GU="Portal",yl=m.forwardRef((e,t)=>{const{container:n,...r}=e,[s,o]=m.useState(!1);rr(()=>o(!0),[]);const i=n||s&&globalThis?.document?.body;return i?S$.createPortal(a.jsx(Ye.div,{...r,ref:t}),i):null});yl.displayName=GU;function YU(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Gn=e=>{const{present:t,children:n}=e,r=XU(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=wt(r.ref,QU(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:o}):null};Gn.displayName="Presence";function XU(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),o=m.useRef("none"),i=e?"mounted":"unmounted",[c,d]=YU(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const f=nh(r.current);o.current=c==="mounted"?f:"none"},[c]),rr(()=>{const f=r.current,h=s.current;if(h!==e){const x=o.current,g=nh(f);e?d("MOUNT"):g==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&x!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),rr(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=g=>{const b=nh(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&b&&(d("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},x=g=>{g.target===t&&(o.current=nh(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",x),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 nh(e){return e?.animationName||"none"}function QU(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 JU=tv[" useInsertionEffect ".trim().toString()]||rr;function ha({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,i]=ZU({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=e7(h)?h(e):h;p!==e&&i.current?.(p)}else o(h)},[c,e,o,i]);return[d,f]}function ZU({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),o=m.useRef(t);return JU(()=>{o.current=t},[t]),m.useEffect(()=>{s.current!==n&&(o.current?.(n),s.current=n)},[n,s]),[n,r,o]}function e7(e){return typeof e=="function"}var A$=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"}),t7="VisuallyHidden",nv=m.forwardRef((e,t)=>a.jsx(Ye.span,{...e,ref:t,style:{...A$,...e.style}}));nv.displayName=t7;var n7=nv,sN="ToastProvider",[oN,r7,a7]=Cf("Toast"),[E$]=hr("Toast",[a7]),[s7,rv]=E$(sN),k$=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=e,[c,d]=m.useState(null),[f,h]=m.useState(0),p=m.useRef(!1),x=m.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${sN}\`. Expected non-empty \`string\`.`),a.jsx(oN.Provider,{scope:t,children:a.jsx(s7,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:o,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:m.useCallback(()=>h(g=>g+1),[]),onToastRemove:m.useCallback(()=>h(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:x,children:i})})};k$.displayName=sN;var P$="ToastViewport",o7=["F8"],Gj="toast.viewportPause",Yj="toast.viewportResume",O$=m.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=o7,label:s="Notifications ({hotkey})",...o}=e,i=rv(P$,n),c=r7(n),d=m.useRef(null),f=m.useRef(null),h=m.useRef(null),p=m.useRef(null),x=wt(t,p,i.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=i.toastCount>0;m.useEffect(()=>{const y=S=>{r.length!==0&&r.every(N=>S[N]||S.code===N)&&p.current?.focus()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),m.useEffect(()=>{const y=d.current,S=p.current;if(j&&y&&S){const C=()=>{if(!i.isClosePausedRef.current){const k=new CustomEvent(Gj);S.dispatchEvent(k),i.isClosePausedRef.current=!0}},N=()=>{if(i.isClosePausedRef.current){const k=new CustomEvent(Yj);S.dispatchEvent(k),i.isClosePausedRef.current=!1}},E=k=>{!y.contains(k.relatedTarget)&&N()},A=()=>{y.contains(document.activeElement)||N()};return y.addEventListener("focusin",C),y.addEventListener("focusout",E),y.addEventListener("pointermove",C),y.addEventListener("pointerleave",A),window.addEventListener("blur",C),window.addEventListener("focus",N),()=>{y.removeEventListener("focusin",C),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",C),y.removeEventListener("pointerleave",A),window.removeEventListener("blur",C),window.removeEventListener("focus",N)}}},[j,i.isClosePausedRef]);const b=m.useCallback(({tabbingDirection:y})=>{const C=c().map(N=>{const E=N.ref.current,A=[E,...y7(E)];return y==="forwards"?A:A.reverse()});return(y==="forwards"?C.reverse():C).flat()},[c]);return m.useEffect(()=>{const y=p.current;if(y){const S=C=>{const N=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!N){const A=document.activeElement,k=C.shiftKey;if(C.target===y&&k){f.current?.focus();return}const $=b({tabbingDirection:k?"backwards":"forwards"}),B=$.findIndex(q=>q===A);xy($.slice(B+1))?C.preventDefault():k?f.current?.focus():h.current?.focus()}};return y.addEventListener("keydown",S),()=>y.removeEventListener("keydown",S)}},[c,b]),a.jsxs(KU,{ref:d,role:"region","aria-label":s.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&a.jsx(Xj,{ref:f,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"forwards"});xy(y)}}),a.jsx(oN.Slot,{scope:n,children:a.jsx(Ye.ol,{tabIndex:-1,...o,ref:x})}),j&&a.jsx(Xj,{ref:h,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"backwards"});xy(y)}})]})});O$.displayName=P$;var T$="ToastFocusProxy",Xj=m.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,o=rv(T$,n);return a.jsx(nv,{tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{const c=i.relatedTarget;!o.viewport?.contains(c)&&r()}})});Xj.displayName=T$;var _f="Toast",i7="toast.swipeStart",l7="toast.swipeMove",c7="toast.swipeCancel",u7="toast.swipeEnd",R$=m.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:o,...i}=e,[c,d]=ha({prop:r,defaultProp:s??!0,onChange:o,caller:_f});return a.jsx(Gn,{present:n||c,children:a.jsx(p7,{open:c,...i,ref:t,onClose:()=>d(!1),onPause:Wn(e.onPause),onResume:Wn(e.onResume),onSwipeStart:Te(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Te(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:Te(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:Te(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)})})})});R$.displayName=_f;var[d7,f7]=E$(_f,{onClose(){}}),p7=m.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:c,onPause:d,onResume:f,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:x,onSwipeEnd:g,...j}=e,b=rv(_f,n),[y,S]=m.useState(null),C=wt(t,U=>S(U)),N=m.useRef(null),E=m.useRef(null),A=s||b.duration,k=m.useRef(0),O=m.useRef(A),T=m.useRef(0),{onToastAdd:$,onToastRemove:B}=b,q=Wn(()=>{y?.contains(document.activeElement)&&b.viewport?.focus(),i()}),F=m.useCallback(U=>{!U||U===1/0||(window.clearTimeout(T.current),k.current=new Date().getTime(),T.current=window.setTimeout(q,U))},[q]);m.useEffect(()=>{const U=b.viewport;if(U){const R=()=>{F(O.current),f?.()},W=()=>{const X=new Date().getTime()-k.current;O.current=O.current-X,window.clearTimeout(T.current),d?.()};return U.addEventListener(Gj,W),U.addEventListener(Yj,R),()=>{U.removeEventListener(Gj,W),U.removeEventListener(Yj,R)}}},[b.viewport,A,d,f,F]),m.useEffect(()=>{o&&!b.isClosePausedRef.current&&F(A)},[o,A,b.isClosePausedRef,F]),m.useEffect(()=>($(),()=>B()),[$,B]);const H=m.useMemo(()=>y?z$(y):null,[y]);return b.viewport?a.jsxs(a.Fragment,{children:[H&&a.jsx(h7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:H}),a.jsx(d7,{scope:n,onClose:q,children:iu.createPortal(a.jsx(oN.ItemSlot,{scope:n,children:a.jsx(HU,{asChild:!0,onEscapeKeyDown:Te(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||q(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(Ye.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Te(e.onKeyDown,U=>{U.key==="Escape"&&(c?.(U.nativeEvent),U.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:Te(e.onPointerDown,U=>{U.button===0&&(N.current={x:U.clientX,y:U.clientY})}),onPointerMove:Te(e.onPointerMove,U=>{if(!N.current)return;const R=U.clientX-N.current.x,W=U.clientY-N.current.y,X=!!E.current,G=["left","right"].includes(b.swipeDirection),z=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,J=G?z(0,R):0,D=G?0:z(0,W),I=U.pointerType==="touch"?10:2,ne={x:J,y:D},te={originalEvent:U,delta:ne};X?(E.current=ne,rh(l7,p,te,{discrete:!1})):qE(ne,b.swipeDirection,I)?(E.current=ne,rh(i7,h,te,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(R)>I||Math.abs(W)>I)&&(N.current=null)}),onPointerUp:Te(e.onPointerUp,U=>{const R=E.current,W=U.target;if(W.hasPointerCapture(U.pointerId)&&W.releasePointerCapture(U.pointerId),E.current=null,N.current=null,R){const X=U.currentTarget,G={originalEvent:U,delta:R};qE(R,b.swipeDirection,b.swipeThreshold)?rh(u7,g,G,{discrete:!0}):rh(c7,x,G,{discrete:!0}),X.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),h7=e=>{const{__scopeToast:t,children:n,...r}=e,s=rv(_f,t),[o,i]=m.useState(!1),[c,d]=m.useState(!1);return g7(()=>i(!0)),m.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:a.jsx(yl,{asChild:!0,children:a.jsx(nv,{...r,children:o&&a.jsxs(a.Fragment,{children:[s.label," ",n]})})})},m7="ToastTitle",I$=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(Ye.div,{...r,ref:t})});I$.displayName=m7;var v7="ToastDescription",M$=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(Ye.div,{...r,ref:t})});M$.displayName=v7;var $$="ToastAction",D$=m.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?a.jsx(F$,{altText:n,asChild:!0,children:a.jsx(iN,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${$$}\`. Expected non-empty \`string\`.`),null)});D$.displayName=$$;var L$="ToastClose",iN=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=f7(L$,n);return a.jsx(F$,{asChild:!0,children:a.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,s.onClose)})})});iN.displayName=L$;var F$=m.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return a.jsx(Ye.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function z$(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),x7(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...z$(r))}}),t}function rh(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?aN(s,o):s.dispatchEvent(o)}var qE=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),o=r>s;return t==="left"||t==="right"?o&&r>n:!o&&s>n};function g7(e=()=>{}){const t=Wn(e);rr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function x7(e){return e.nodeType===e.ELEMENT_NODE}function y7(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 xy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var b7=k$,B$=O$,q$=R$,U$=I$,W$=M$,V$=D$,H$=iN;function K$(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=K$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Lt(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=K$(e))&&(r&&(r+=" "),r+=t);return r}const UE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,WE=Lt,bl=(e,t)=>n=>{var r;if(t?.variants==null)return WE(e,n?.class,n?.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(f=>{const h=n?.[f],p=o?.[f];if(h===null)return null;const x=UE(h)||UE(p);return s[f][x]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,x]=h;return x===void 0||(f[p]=x),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:x,...g}=h;return Object.entries(g).every(j=>{let[b,y]=j;return Array.isArray(y)?y.includes({...o,...c}[b]):{...o,...c}[b]===y})?[...f,p,x]:f},[]);return WE(e,i,d,n?.class,n?.className)};const w7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),G$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var j7={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 S7=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...c},d)=>m.createElement("svg",{ref:d,...j7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:G$("lucide",s),...c},[...i.map(([f,h])=>m.createElement(f,h)),...Array.isArray(o)?o:[o]]));const it=(e,t)=>{const n=m.forwardRef(({className:r,...s},o)=>m.createElement(S7,{ref:o,iconNode:t,className:G$(`lucide-${w7(e)}`,r),...s}));return n.displayName=`${e}`,n};const Y$=it("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 X$=it("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 el=it("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const kr=it("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 _c=it("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 Ac=it("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Yt=it("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const lN=it("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const ws=it("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const gc=it("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const yy=it("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 Jo=it("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const N7=it("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 xc=it("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 C7=it("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const _7=it("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);const mo=it("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const _s=it("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 Q$=it("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 Ea=it("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 av=it("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 $h=it("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 A7=it("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 J$=it("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 VE=it("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 Z$=it("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 E7=it("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 cN=it("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 k7=it("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 P7=it("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 O7=it("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 Qj=it("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 eD=it("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 T7=it("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 Jj=it("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 R7=it("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 wr=it("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const tD=it("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 I7=it("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 nD=it("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 dc=it("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 M7=it("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const Zj=it("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 eS=it("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 sv=it("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 to=it("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const io=it("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const uN=it("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 ma=it("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 $7=it("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 dN=it("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const D7=it("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 fN=it("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 L7=it("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 zr=it("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 kh=it("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const rD=it("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 Ta=it("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 Ph=it("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 F7=it("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 Ec=it("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 aD=it("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 Ja=it("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 As=it("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pN="-",z7=e=>{const t=q7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const c=i.split(pN);return c[0]===""&&c.length!==1&&c.shift(),sD(c,t)||B7(i)},getConflictingClassGroupIds:(i,c)=>{const d=n[i]||[];return c&&r[i]?[...d,...r[i]]:d}}},sD=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?sD(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(pN);return t.validators.find(({validator:i})=>i(o))?.classGroupId},HE=/^\[(.+)\]$/,B7=e=>{if(HE.test(e)){const t=HE.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},q7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return W7(Object.entries(e.classGroups),n).forEach(([o,i])=>{tS(i,r,o,t)}),r},tS=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:KE(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(U7(s)){tS(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{tS(i,KE(t,o),n,r)})})},KE=(e,t)=>{let n=e;return t.split(pN).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},U7=e=>e.isThemeGetter,W7=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,c])=>[t+i,c])):o);return[n,s]}):e,V7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}},oD="!",H7=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,i=c=>{const d=[];let f=0,h=0,p;for(let y=0;y<c.length;y++){let S=c[y];if(f===0){if(S===s&&(r||c.slice(y,y+o)===t)){d.push(c.slice(h,y)),h=y+o;continue}if(S==="/"){p=y;continue}}S==="["?f++:S==="]"&&f--}const x=d.length===0?c:c.substring(h),g=x.startsWith(oD),j=g?x.substring(1):x,b=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:g,baseClassName:j,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:i}):i},K7=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},G7=e=>({cache:V7(e.cacheSize),parseClassName:H7(e),...z7(e)}),Y7=/\s+/,X7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],i=e.trim().split(Y7);let c="";for(let d=i.length-1;d>=0;d-=1){const f=i[d],{modifiers:h,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:g}=n(f);let j=!!g,b=r(j?x.substring(0,g):x);if(!b){if(!j){c=f+(c.length>0?" "+c:c);continue}if(b=r(x),!b){c=f+(c.length>0?" "+c:c);continue}j=!1}const y=K7(h).join(":"),S=p?y+oD:y,C=S+b;if(o.includes(C))continue;o.push(C);const N=s(b,j);for(let E=0;E<N.length;++E){const A=N[E];o.push(S+A)}c=f+(c.length>0?" "+c:c)}return c};function Q7(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=iD(t))&&(r&&(r+=" "),r+=n);return r}const iD=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=iD(e[r]))&&(n&&(n+=" "),n+=t);return n};function J7(e,...t){let n,r,s,o=i;function i(d){const f=t.reduce((h,p)=>p(h),e());return n=G7(f),r=n.cache.get,s=n.cache.set,o=c,c(d)}function c(d){const f=r(d);if(f)return f;const h=X7(d,n);return s(d,h),h}return function(){return o(Q7.apply(null,arguments))}}const An=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},lD=/^\[(?:([a-z-]+):)?(.+)\]$/i,Z7=/^\d+\/\d+$/,e9=new Set(["px","full","screen"]),t9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,n9=/\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$/,r9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,a9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,s9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gs=e=>yc(e)||e9.has(e)||Z7.test(e),Vo=e=>lu(e,"length",p9),yc=e=>!!e&&!Number.isNaN(Number(e)),by=e=>lu(e,"number",yc),id=e=>!!e&&Number.isInteger(Number(e)),o9=e=>e.endsWith("%")&&yc(e.slice(0,-1)),Wt=e=>lD.test(e),Ho=e=>t9.test(e),i9=new Set(["length","size","percentage"]),l9=e=>lu(e,i9,cD),c9=e=>lu(e,"position",cD),u9=new Set(["image","url"]),d9=e=>lu(e,u9,m9),f9=e=>lu(e,"",h9),ld=()=>!0,lu=(e,t,n)=>{const r=lD.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},p9=e=>n9.test(e)&&!r9.test(e),cD=()=>!1,h9=e=>a9.test(e),m9=e=>s9.test(e),v9=()=>{const e=An("colors"),t=An("spacing"),n=An("blur"),r=An("brightness"),s=An("borderColor"),o=An("borderRadius"),i=An("borderSpacing"),c=An("borderWidth"),d=An("contrast"),f=An("grayscale"),h=An("hueRotate"),p=An("invert"),x=An("gap"),g=An("gradientColorStops"),j=An("gradientColorStopPositions"),b=An("inset"),y=An("margin"),S=An("opacity"),C=An("padding"),N=An("saturate"),E=An("scale"),A=An("sepia"),k=An("skew"),O=An("space"),T=An("translate"),$=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",Wt,t],F=()=>[Wt,t],H=()=>["",Gs,Vo],U=()=>["auto",yc,Wt],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",Wt],J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[yc,Wt];return{cacheSize:500,separator:":",theme:{colors:[ld],spacing:[Gs,Vo],blur:["none","",Ho,Wt],brightness:D(),borderColor:[e],borderRadius:["none","","full",Ho,Wt],borderSpacing:F(),borderWidth:H(),contrast:D(),grayscale:z(),hueRotate:D(),invert:z(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[o9,Vo],inset:q(),margin:q(),opacity:D(),padding:F(),saturate:D(),scale:D(),sepia:z(),skew:D(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Wt]}],container:["container"],columns:[{columns:[Ho]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"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:[...R(),Wt]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",id,Wt]}],basis:[{basis:q()}],"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:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",id,Wt]}],"grid-cols":[{"grid-cols":[ld]}],"col-start-end":[{col:["auto",{span:["full",id,Wt]},Wt]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[ld]}],"row-start-end":[{row:["auto",{span:[id,Wt]},Wt]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"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:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"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:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"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:[Ho]},Ho]}],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",Ho,Vo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",by]}],"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",yc,by]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gs,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":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gs,Vo]}],"underline-offset":[{"underline-offset":["auto",Gs,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:F()}],"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":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),c9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",l9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},d9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"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":[S]}],"border-style":[{border:[...W(),"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":[S]}],"divide-style":[{divide:W()}],"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:["",...W()]}],"outline-offset":[{"outline-offset":[Gs,Wt]}],"outline-w":[{outline:[Gs,Vo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Gs,Vo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ho,f9]}],"shadow-color":[{shadow:[ld]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ho,Wt]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[N]}],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":[S]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Wt]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",Wt]}],delay:[{delay:D()}],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:[id,Wt]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"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":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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:[Gs,Vo,by]}],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"]}}},g9=J7(v9);function je(...e){return g9(Lt(e))}const x9=b7,uD=m.forwardRef(({className:e,...t},n)=>a.jsx(B$,{ref:n,className:je("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}));uD.displayName=B$.displayName;const y9=bl("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"}}),dD=m.forwardRef(({className:e,variant:t,...n},r)=>a.jsx(q$,{ref:r,className:je(y9({variant:t}),e),...n}));dD.displayName=q$.displayName;const b9=m.forwardRef(({className:e,...t},n)=>a.jsx(V$,{ref:n,className:je("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}));b9.displayName=V$.displayName;const fD=m.forwardRef(({className:e,...t},n)=>a.jsx(H$,{ref:n,className:je("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(As,{className:"h-4 w-4"})}));fD.displayName=H$.displayName;const pD=m.forwardRef(({className:e,...t},n)=>a.jsx(U$,{ref:n,className:je("text-sm font-semibold",e),...t}));pD.displayName=U$.displayName;const hD=m.forwardRef(({className:e,...t},n)=>a.jsx(W$,{ref:n,className:je("text-sm opacity-90",e),...t}));hD.displayName=W$.displayName;function w9(){const{toasts:e}=NU();return a.jsxs(x9,{children:[e.map(function({id:t,title:n,description:r,action:s,...o}){return a.jsxs(dD,{...o,children:[a.jsxs("div",{className:"grid gap-1",children:[n&&a.jsx(pD,{children:n}),r&&a.jsx(hD,{children:r})]}),s,a.jsx(fD,{})]},t)}),a.jsx(uD,{})]})}var GE=["light","dark"],j9="(prefers-color-scheme: dark)",S9=m.createContext(void 0),N9={setTheme:e=>{},themes:[]},C9=()=>{var e;return(e=m.useContext(S9))!=null?e:N9};m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:o,value:i,attrs:c,nonce:d})=>{let f=o==="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?GE.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",x=(j,b=!1,y=!0)=>{let S=i?i[j]:j,C=b?j+"|| ''":`'${S}'`,N="";return s&&y&&!b&&GE.includes(j)&&(N+=`d.style.colorScheme = '${j}';`),n==="class"?b||S?N+=`c.add(${C})`:N+="null":S&&(N+=`d[s](n,${C})`),N},g=e?`!function(){${h}${x(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${j9}',m=window.matchMedia(t);if(m.media!==t||m.matches){${x("dark")}}else{${x("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${x(i?"x[e]":"e",!0)}}${f?"":"else{"+x(o,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${x(i?"x[e]":"e",!0)}}else{${x(o,!1,!1)};}${p}}catch(t){}}();`;return m.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:g}})});var _9=e=>{switch(e){case"success":return k9;case"info":return O9;case"warning":return P9;case"error":return T9;default:return null}},A9=Array(12).fill(0),E9=({visible:e,className:t})=>Y.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Y.createElement("div",{className:"sonner-spinner"},A9.map((n,r)=>Y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),k9=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"})),P9=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"})),O9=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"})),T9=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"})),R9=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"})),I9=()=>{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},nS=1,M9=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:nS++,o=this.toasts.find(c=>c.id===s),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...e,id:s,title:n}),{...c,...e,id:s,dismissible:i,title:n}):c):this.addToast({title:n,...r,dismissible:i,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,o,i=r.then(async d=>{if(o=["resolve",d],Y.isValidElement(d))s=!1,this.create({id:n,type:"default",message:d});else if(D9(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(o=["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)=>i.then(()=>o[0]==="reject"?f(o[1]):d(o[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||nS++;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}},Lr=new M9,$9=(e,t)=>{let n=t?.id||nS++;return Lr.addToast({title:e,...t,id:n}),n},D9=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",L9=$9,F9=()=>Lr.toasts,z9=()=>Lr.getActiveToasts();Object.assign(L9,{success:Lr.success,info:Lr.info,warning:Lr.warning,error:Lr.error,custom:Lr.custom,message:Lr.message,promise:Lr.promise,dismiss:Lr.dismiss,loading:Lr.loading},{getHistory:F9,getToasts:z9});function B9(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))}B9(`: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 ah(e){return e.label!==void 0}var q9=3,U9="32px",W9="16px",YE=4e3,V9=356,H9=14,K9=20,G9=200;function Wa(...e){return e.filter(Boolean).join(" ")}function Y9(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var X9=e=>{var t,n,r,s,o,i,c,d,f,h,p;let{invert:x,toast:g,unstyled:j,interacting:b,setHeights:y,visibleToasts:S,heights:C,index:N,toasts:E,expanded:A,removeToast:k,defaultRichColors:O,closeButton:T,style:$,cancelButtonStyle:B,actionButtonStyle:q,className:F="",descriptionClassName:H="",duration:U,position:R,gap:W,loadingIcon:X,expandByDefault:G,classNames:z,icons:J,closeButtonAriaLabel:D="Close toast",pauseWhenPageIsHidden:I}=e,[ne,te]=Y.useState(null),[de,he]=Y.useState(null),[V,ue]=Y.useState(!1),[Q,Z]=Y.useState(!1),[fe,ae]=Y.useState(!1),[Re,_e]=Y.useState(!1),[Me,L]=Y.useState(!1),[oe,pe]=Y.useState(0),[Ee,Xe]=Y.useState(0),ht=Y.useRef(g.duration||U||YE),gt=Y.useRef(null),mt=Y.useRef(null),Vt=N===0,qt=N+1<=S,Ft=g.type,zt=g.dismissible!==!1,Ne=g.className||"",et=g.descriptionClassName||"",Ke=Y.useMemo(()=>C.findIndex(pt=>pt.toastId===g.id)||0,[C,g.id]),ve=Y.useMemo(()=>{var pt;return(pt=g.closeButton)!=null?pt:T},[g.closeButton,T]),ze=Y.useMemo(()=>g.duration||U||YE,[g.duration,U]),$e=Y.useRef(0),Qe=Y.useRef(0),Ce=Y.useRef(0),qe=Y.useRef(null),[Xt,gn]=R.split("-"),be=Y.useMemo(()=>C.reduce((pt,Rt,Bt)=>Bt>=Ke?pt:pt+Rt.height,0),[C,Ke]),At=I9(),$t=g.invert||x,Ut=Ft==="loading";Qe.current=Y.useMemo(()=>Ke*W+be,[Ke,be]),Y.useEffect(()=>{ht.current=ze},[ze]),Y.useEffect(()=>{ue(!0)},[]),Y.useEffect(()=>{let pt=mt.current;if(pt){let Rt=pt.getBoundingClientRect().height;return Xe(Rt),y(Bt=>[{toastId:g.id,height:Rt,position:g.position},...Bt]),()=>y(Bt=>Bt.filter(rn=>rn.toastId!==g.id))}},[y,g.id]),Y.useLayoutEffect(()=>{if(!V)return;let pt=mt.current,Rt=pt.style.height;pt.style.height="auto";let Bt=pt.getBoundingClientRect().height;pt.style.height=Rt,Xe(Bt),y(rn=>rn.find(qn=>qn.toastId===g.id)?rn.map(qn=>qn.toastId===g.id?{...qn,height:Bt}:qn):[{toastId:g.id,height:Bt,position:g.position},...rn])},[V,g.title,g.description,y,g.id]);let nn=Y.useCallback(()=>{Z(!0),pe(Qe.current),y(pt=>pt.filter(Rt=>Rt.toastId!==g.id)),setTimeout(()=>{k(g)},G9)},[g,k,y,Qe]);Y.useEffect(()=>{if(g.promise&&Ft==="loading"||g.duration===1/0||g.type==="loading")return;let pt;return A||b||I&&At?(()=>{if(Ce.current<$e.current){let Rt=new Date().getTime()-$e.current;ht.current=ht.current-Rt}Ce.current=new Date().getTime()})():ht.current!==1/0&&($e.current=new Date().getTime(),pt=setTimeout(()=>{var Rt;(Rt=g.onAutoClose)==null||Rt.call(g,g),nn()},ht.current)),()=>clearTimeout(pt)},[A,b,g,Ft,I,At,nn]),Y.useEffect(()=>{g.delete&&nn()},[nn,g.delete]);function kn(){var pt,Rt,Bt;return J!=null&&J.loading?Y.createElement("div",{className:Wa(z?.loader,(pt=g?.classNames)==null?void 0:pt.loader,"sonner-loader"),"data-visible":Ft==="loading"},J.loading):X?Y.createElement("div",{className:Wa(z?.loader,(Rt=g?.classNames)==null?void 0:Rt.loader,"sonner-loader"),"data-visible":Ft==="loading"},X):Y.createElement(E9,{className:Wa(z?.loader,(Bt=g?.classNames)==null?void 0:Bt.loader),visible:Ft==="loading"})}return Y.createElement("li",{tabIndex:0,ref:mt,className:Wa(F,Ne,z?.toast,(t=g?.classNames)==null?void 0:t.toast,z?.default,z?.[Ft],(n=g?.classNames)==null?void 0:n[Ft]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:O,"data-styled":!(g.jsx||g.unstyled||j),"data-mounted":V,"data-promise":!!g.promise,"data-swiped":Me,"data-removed":Q,"data-visible":qt,"data-y-position":Xt,"data-x-position":gn,"data-index":N,"data-front":Vt,"data-swiping":fe,"data-dismissible":zt,"data-type":Ft,"data-invert":$t,"data-swipe-out":Re,"data-swipe-direction":de,"data-expanded":!!(A||G&&V),style:{"--index":N,"--toasts-before":N,"--z-index":E.length-N,"--offset":`${Q?oe:Qe.current}px`,"--initial-height":G?"auto":`${Ee}px`,...$,...g.style},onDragEnd:()=>{ae(!1),te(null),qe.current=null},onPointerDown:pt=>{Ut||!zt||(gt.current=new Date,pe(Qe.current),pt.target.setPointerCapture(pt.pointerId),pt.target.tagName!=="BUTTON"&&(ae(!0),qe.current={x:pt.clientX,y:pt.clientY}))},onPointerUp:()=>{var pt,Rt,Bt,rn;if(Re||!zt)return;qe.current=null;let qn=Number(((pt=mt.current)==null?void 0:pt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ce=Number(((Rt=mt.current)==null?void 0:Rt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),st=new Date().getTime()-((Bt=gt.current)==null?void 0:Bt.getTime()),Nt=ne==="x"?qn:ce,on=Math.abs(Nt)/st;if(Math.abs(Nt)>=K9||on>.11){pe(Qe.current),(rn=g.onDismiss)==null||rn.call(g,g),he(ne==="x"?qn>0?"right":"left":ce>0?"down":"up"),nn(),_e(!0),L(!1);return}ae(!1),te(null)},onPointerMove:pt=>{var Rt,Bt,rn,qn;if(!qe.current||!zt||((Rt=window.getSelection())==null?void 0:Rt.toString().length)>0)return;let ce=pt.clientY-qe.current.y,st=pt.clientX-qe.current.x,Nt=(Bt=e.swipeDirections)!=null?Bt:Y9(R);!ne&&(Math.abs(st)>1||Math.abs(ce)>1)&&te(Math.abs(st)>Math.abs(ce)?"x":"y");let on={x:0,y:0};ne==="y"?(Nt.includes("top")||Nt.includes("bottom"))&&(Nt.includes("top")&&ce<0||Nt.includes("bottom")&&ce>0)&&(on.y=ce):ne==="x"&&(Nt.includes("left")||Nt.includes("right"))&&(Nt.includes("left")&&st<0||Nt.includes("right")&&st>0)&&(on.x=st),(Math.abs(on.x)>0||Math.abs(on.y)>0)&&L(!0),(rn=mt.current)==null||rn.style.setProperty("--swipe-amount-x",`${on.x}px`),(qn=mt.current)==null||qn.style.setProperty("--swipe-amount-y",`${on.y}px`)}},ve&&!g.jsx?Y.createElement("button",{"aria-label":D,"data-disabled":Ut,"data-close-button":!0,onClick:Ut||!zt?()=>{}:()=>{var pt;nn(),(pt=g.onDismiss)==null||pt.call(g,g)},className:Wa(z?.closeButton,(s=g?.classNames)==null?void 0:s.closeButton)},(o=J?.close)!=null?o:R9):null,g.jsx||m.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:Y.createElement(Y.Fragment,null,Ft||g.icon||g.promise?Y.createElement("div",{"data-icon":"",className:Wa(z?.icon,(i=g?.classNames)==null?void 0:i.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||kn():null,g.type!=="loading"?g.icon||J?.[Ft]||_9(Ft):null):null,Y.createElement("div",{"data-content":"",className:Wa(z?.content,(c=g?.classNames)==null?void 0:c.content)},Y.createElement("div",{"data-title":"",className:Wa(z?.title,(d=g?.classNames)==null?void 0:d.title)},typeof g.title=="function"?g.title():g.title),g.description?Y.createElement("div",{"data-description":"",className:Wa(H,et,z?.description,(f=g?.classNames)==null?void 0:f.description)},typeof g.description=="function"?g.description():g.description):null),m.isValidElement(g.cancel)?g.cancel:g.cancel&&ah(g.cancel)?Y.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||B,onClick:pt=>{var Rt,Bt;ah(g.cancel)&&zt&&((Bt=(Rt=g.cancel).onClick)==null||Bt.call(Rt,pt),nn())},className:Wa(z?.cancelButton,(h=g?.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,m.isValidElement(g.action)?g.action:g.action&&ah(g.action)?Y.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||q,onClick:pt=>{var Rt,Bt;ah(g.action)&&((Bt=(Rt=g.action).onClick)==null||Bt.call(Rt,pt),!pt.defaultPrevented&&nn())},className:Wa(z?.actionButton,(p=g?.classNames)==null?void 0:p.actionButton)},g.action.label):null))};function XE(){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 Q9(e,t){let n={};return[e,t].forEach((r,s)=>{let o=s===1,i=o?"--mobile-offset":"--offset",c=o?W9:U9;function d(f){["top","right","bottom","left"].forEach(h=>{n[`${i}-${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[`${i}-${f}`]=c:n[`${i}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}var J9=m.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:i,className:c,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:x,style:g,visibleToasts:j=q9,toastOptions:b,dir:y=XE(),gap:S=H9,loadingIcon:C,icons:N,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:A}=e,[k,O]=Y.useState([]),T=Y.useMemo(()=>Array.from(new Set([r].concat(k.filter(I=>I.position).map(I=>I.position)))),[k,r]),[$,B]=Y.useState([]),[q,F]=Y.useState(!1),[H,U]=Y.useState(!1),[R,W]=Y.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=Y.useRef(null),G=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=Y.useRef(null),J=Y.useRef(!1),D=Y.useCallback(I=>{O(ne=>{var te;return(te=ne.find(de=>de.id===I.id))!=null&&te.delete||Lr.dismiss(I.id),ne.filter(({id:de})=>de!==I.id)})},[]);return Y.useEffect(()=>Lr.subscribe(I=>{if(I.dismiss){O(ne=>ne.map(te=>te.id===I.id?{...te,delete:!0}:te));return}setTimeout(()=>{S$.flushSync(()=>{O(ne=>{let te=ne.findIndex(de=>de.id===I.id);return te!==-1?[...ne.slice(0,te),{...ne[te],...I},...ne.slice(te+1)]:[I,...ne]})})})}),[]),Y.useEffect(()=>{if(h!=="system"){W(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:ne})=>{W(ne?"dark":"light")})}catch{I.addListener(({matches:te})=>{try{W(te?"dark":"light")}catch(de){console.error(de)}})}},[h]),Y.useEffect(()=>{k.length<=1&&F(!1)},[k]),Y.useEffect(()=>{let I=ne=>{var te,de;s.every(he=>ne[he]||ne.code===he)&&(F(!0),(te=X.current)==null||te.focus()),ne.code==="Escape"&&(document.activeElement===X.current||(de=X.current)!=null&&de.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[s]),Y.useEffect(()=>{if(X.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,J.current=!1)}},[X.current]),Y.createElement("section",{ref:t,"aria-label":`${E} ${G}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((I,ne)=>{var te;let[de,he]=I.split("-");return k.length?Y.createElement("ol",{key:I,dir:y==="auto"?XE():y,tabIndex:-1,ref:X,className:c,"data-sonner-toaster":!0,"data-theme":R,"data-y-position":de,"data-lifted":q&&k.length>1&&!o,"data-x-position":he,style:{"--front-toast-height":`${((te=$[0])==null?void 0:te.height)||0}px`,"--width":`${V9}px`,"--gap":`${S}px`,...g,...Q9(d,f)},onBlur:V=>{J.current&&!V.currentTarget.contains(V.relatedTarget)&&(J.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||J.current||(J.current=!0,z.current=V.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{H||F(!1)},onDragEnd:()=>F(!1),onPointerDown:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},k.filter(V=>!V.position&&ne===0||V.position===I).map((V,ue)=>{var Q,Z;return Y.createElement(X9,{key:V.id,icons:N,index:ue,toast:V,defaultRichColors:p,duration:(Q=b?.duration)!=null?Q:x,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(Z=b?.closeButton)!=null?Z:i,interacting:H,position:I,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:D,toasts:k.filter(fe=>fe.position==V.position),heights:$.filter(fe=>fe.position==V.position),setHeights:B,expandByDefault:o,gap:S,loadingIcon:C,expanded:q,pauseWhenPageIsHidden:A,swipeDirections:e.swipeDirections})})):null}))});const Z9=({...e})=>{const{theme:t="system"}=C9();return a.jsx(J9,{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 eW=tv[" useId ".trim().toString()]||(()=>{}),tW=0;function nr(e){const[t,n]=m.useState(eW());return rr(()=>{n(r=>r??String(tW++))},[e]),e||(t?`radix-${t}`:"")}const nW=["top","right","bottom","left"],ni=Math.min,ia=Math.max,Dh=Math.round,sh=Math.floor,js=e=>({x:e,y:e}),rW={left:"right",right:"left",bottom:"top",top:"bottom"},aW={start:"end",end:"start"};function rS(e,t,n){return ia(e,ni(t,n))}function lo(e,t){return typeof e=="function"?e(t):e}function co(e){return e.split("-")[0]}function cu(e){return e.split("-")[1]}function hN(e){return e==="x"?"y":"x"}function mN(e){return e==="y"?"height":"width"}const sW=new Set(["top","bottom"]);function ys(e){return sW.has(co(e))?"y":"x"}function vN(e){return hN(ys(e))}function oW(e,t,n){n===void 0&&(n=!1);const r=cu(e),s=vN(e),o=mN(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Lh(i)),[i,Lh(i)]}function iW(e){const t=Lh(e);return[aS(e),t,aS(t)]}function aS(e){return e.replace(/start|end/g,t=>aW[t])}const QE=["left","right"],JE=["right","left"],lW=["top","bottom"],cW=["bottom","top"];function uW(e,t,n){switch(e){case"top":case"bottom":return n?t?JE:QE:t?QE:JE;case"left":case"right":return t?lW:cW;default:return[]}}function dW(e,t,n,r){const s=cu(e);let o=uW(co(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(aS)))),o}function Lh(e){return e.replace(/left|right|bottom|top/g,t=>rW[t])}function fW(e){return{top:0,right:0,bottom:0,left:0,...e}}function mD(e){return typeof e!="number"?fW(e):{top:e,right:e,bottom:e,left:e}}function Fh(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 ZE(e,t,n){let{reference:r,floating:s}=e;const o=ys(t),i=vN(t),c=mN(i),d=co(t),f=o==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,x=r[c]/2-s[c]/2;let g;switch(d){case"top":g={x:h,y:r.y-s.height};break;case"bottom":g={x:h,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-s.width,y:p};break;default:g={x:r.x,y:r.y}}switch(cu(t)){case"start":g[i]-=x*(n&&f?-1:1);break;case"end":g[i]+=x*(n&&f?-1:1);break}return g}async function pW(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:x=!1,padding:g=0}=lo(t,e),j=mD(g),y=c[x?p==="floating"?"reference":"floating":p],S=Fh(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),C=p==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),E=await(o.isElement==null?void 0:o.isElement(N))?await(o.getScale==null?void 0:o.getScale(N))||{x:1,y:1}:{x:1,y:1},A=Fh(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:N,strategy:d}):C);return{top:(S.top-A.top+j.top)/E.y,bottom:(A.bottom-S.bottom+j.bottom)/E.y,left:(S.left-A.left+j.left)/E.x,right:(A.right-S.right+j.right)/E.x}}const hW=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,c=o.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(t));let f=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:p}=ZE(f,r,d),x=r,g={},j=0;for(let y=0;y<c.length;y++){var b;const{name:S,fn:C}=c[y],{x:N,y:E,data:A,reset:k}=await C({x:h,y:p,initialPlacement:r,placement:x,strategy:s,middlewareData:g,rects:f,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:pW},elements:{reference:e,floating:t}});h=N??h,p=E??p,g={...g,[S]:{...g[S],...A}},k&&j<=50&&(j++,typeof k=="object"&&(k.placement&&(x=k.placement),k.rects&&(f=k.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):k.rects),{x:h,y:p}=ZE(f,x,d)),y=-1)}return{x:h,y:p,placement:x,strategy:s,middlewareData:g}},mW=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:i,elements:c,middlewareData:d}=t,{element:f,padding:h=0}=lo(e,t)||{};if(f==null)return{};const p=mD(h),x={x:n,y:r},g=vN(s),j=mN(g),b=await i.getDimensions(f),y=g==="y",S=y?"top":"left",C=y?"bottom":"right",N=y?"clientHeight":"clientWidth",E=o.reference[j]+o.reference[g]-x[g]-o.floating[j],A=x[g]-o.reference[g],k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let O=k?k[N]:0;(!O||!await(i.isElement==null?void 0:i.isElement(k)))&&(O=c.floating[N]||o.floating[j]);const T=E/2-A/2,$=O/2-b[j]/2-1,B=ni(p[S],$),q=ni(p[C],$),F=B,H=O-b[j]-q,U=O/2-b[j]/2+T,R=rS(F,U,H),W=!d.arrow&&cu(s)!=null&&U!==R&&o.reference[j]/2-(U<F?B:q)-b[j]/2<0,X=W?U<F?U-F:U-H:0;return{[g]:x[g]+X,data:{[g]:R,centerOffset:U-R-X,...W&&{alignmentOffset:X}},reset:W}}}),vW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:x,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:b=!0,...y}=lo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=co(s),C=ys(c),N=co(c)===c,E=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=x||(N||!b?[Lh(c)]:iW(c)),k=j!=="none";!x&&k&&A.push(...dW(c,b,j,E));const O=[c,...A],T=await d.detectOverflow(t,y),$=[];let B=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&$.push(T[S]),p){const U=oW(s,i,E);$.push(T[U[0]],T[U[1]])}if(B=[...B,{placement:s,overflows:$}],!$.every(U=>U<=0)){var q,F;const U=(((q=o.flip)==null?void 0:q.index)||0)+1,R=O[U];if(R&&(!(p==="alignment"?C!==ys(R):!1)||B.every(G=>ys(G.placement)===C?G.overflows[0]>0:!0)))return{data:{index:U,overflows:B},reset:{placement:R}};let W=(F=B.filter(X=>X.overflows[0]<=0).sort((X,G)=>X.overflows[1]-G.overflows[1])[0])==null?void 0:F.placement;if(!W)switch(g){case"bestFit":{var H;const X=(H=B.filter(G=>{if(k){const z=ys(G.placement);return z===C||z==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(z=>z>0).reduce((z,J)=>z+J,0)]).sort((G,z)=>G[1]-z[1])[0])==null?void 0:H[0];X&&(W=X);break}case"initialPlacement":W=c;break}if(s!==W)return{reset:{placement:W}}}return{}}}};function ek(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tk(e){return nW.some(t=>e[t]>=0)}const gW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...o}=lo(e,t);switch(s){case"referenceHidden":{const i=await r.detectOverflow(t,{...o,elementContext:"reference"}),c=ek(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:tk(c)}}}case"escaped":{const i=await r.detectOverflow(t,{...o,altBoundary:!0}),c=ek(i,n.floating);return{data:{escapedOffsets:c,escaped:tk(c)}}}default:return{}}}}},vD=new Set(["left","top"]);async function xW(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=co(n),c=cu(n),d=ys(n)==="y",f=vD.has(i)?-1:1,h=o&&d?-1:1,p=lo(t,e);let{mainAxis:x,crossAxis:g,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"&&(g=c==="end"?j*-1:j),d?{x:g*h,y:x*f}:{x:x*f,y:g*h}}const yW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:c}=t,d=await xW(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:o+d.y,data:{...d,placement:i}}}}},bW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:d={fn:S=>{let{x:C,y:N}=S;return{x:C,y:N}}},...f}=lo(e,t),h={x:n,y:r},p=await o.detectOverflow(t,f),x=ys(co(s)),g=hN(x);let j=h[g],b=h[x];if(i){const S=g==="y"?"top":"left",C=g==="y"?"bottom":"right",N=j+p[S],E=j-p[C];j=rS(N,j,E)}if(c){const S=x==="y"?"top":"left",C=x==="y"?"bottom":"right",N=b+p[S],E=b-p[C];b=rS(N,b,E)}const y=d.fn({...t,[g]:j,[x]:b});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[g]:i,[x]:c}}}}}},wW=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:i}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=lo(e,t),h={x:n,y:r},p=ys(s),x=hN(p);let g=h[x],j=h[p];const b=lo(c,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const N=x==="y"?"height":"width",E=o.reference[x]-o.floating[N]+y.mainAxis,A=o.reference[x]+o.reference[N]-y.mainAxis;g<E?g=E:g>A&&(g=A)}if(f){var S,C;const N=x==="y"?"width":"height",E=vD.has(co(s)),A=o.reference[p]-o.floating[N]+(E&&((S=i.offset)==null?void 0:S[p])||0)+(E?0:y.crossAxis),k=o.reference[p]+o.reference[N]+(E?0:((C=i.offset)==null?void 0:C[p])||0)-(E?y.crossAxis:0);j<A?j=A:j>k&&(j=k)}return{[x]:g,[p]:j}}}},jW=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:i,elements:c}=t,{apply:d=()=>{},...f}=lo(e,t),h=await i.detectOverflow(t,f),p=co(s),x=cu(s),g=ys(s)==="y",{width:j,height:b}=o.floating;let y,S;p==="top"||p==="bottom"?(y=p,S=x===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,y=x==="end"?"top":"bottom");const C=b-h.top-h.bottom,N=j-h.left-h.right,E=ni(b-h[y],C),A=ni(j-h[S],N),k=!t.middlewareData.shift;let O=E,T=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=C),k&&!x){const B=ia(h.left,0),q=ia(h.right,0),F=ia(h.top,0),H=ia(h.bottom,0);g?T=j-2*(B!==0||q!==0?B+q:ia(h.left,h.right)):O=b-2*(F!==0||H!==0?F+H:ia(h.top,h.bottom))}await d({...t,availableWidth:T,availableHeight:O});const $=await i.getDimensions(c.floating);return j!==$.width||b!==$.height?{reset:{rects:!0}}:{}}}};function ov(){return typeof window<"u"}function uu(e){return gD(e)?(e.nodeName||"").toLowerCase():"#document"}function da(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ts(e){var t;return(t=(gD(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gD(e){return ov()?e instanceof Node||e instanceof da(e).Node:!1}function es(e){return ov()?e instanceof Element||e instanceof da(e).Element:!1}function Es(e){return ov()?e instanceof HTMLElement||e instanceof da(e).HTMLElement:!1}function nk(e){return!ov()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof da(e).ShadowRoot}const SW=new Set(["inline","contents"]);function Af(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ts(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!SW.has(s)}const NW=new Set(["table","td","th"]);function CW(e){return NW.has(uu(e))}const _W=[":popover-open",":modal"];function iv(e){return _W.some(t=>{try{return e.matches(t)}catch{return!1}})}const AW=["transform","translate","scale","rotate","perspective"],EW=["transform","translate","scale","rotate","perspective","filter"],kW=["paint","layout","strict","content"];function gN(e){const t=xN(),n=es(e)?ts(e):e;return AW.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)||EW.some(r=>(n.willChange||"").includes(r))||kW.some(r=>(n.contain||"").includes(r))}function PW(e){let t=ri(e);for(;Es(t)&&!kc(t);){if(gN(t))return t;if(iv(t))return null;t=ri(t)}return null}function xN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const OW=new Set(["html","body","#document"]);function kc(e){return OW.has(uu(e))}function ts(e){return da(e).getComputedStyle(e)}function lv(e){return es(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ri(e){if(uu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nk(e)&&e.host||Ts(e);return nk(t)?t.host:t}function xD(e){const t=ri(e);return kc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Es(t)&&Af(t)?t:xD(t)}function Rd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=xD(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=da(s);if(o){const c=sS(i);return t.concat(i,i.visualViewport||[],Af(s)?s:[],c&&n?Rd(c):[])}return t.concat(s,Rd(s,[],n))}function sS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yD(e){const t=ts(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Es(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,c=Dh(n)!==o||Dh(r)!==i;return c&&(n=o,r=i),{width:n,height:r,$:c}}function yN(e){return es(e)?e:e.contextElement}function bc(e){const t=yN(e);if(!Es(t))return js(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=yD(t);let i=(o?Dh(n.width):n.width)/r,c=(o?Dh(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const TW=js(0);function bD(e){const t=da(e);return!xN()||!t.visualViewport?TW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function RW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==da(e)?!1:t}function tl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=yN(e);let i=js(1);t&&(r?es(r)&&(i=bc(r)):i=bc(e));const c=RW(o,n,r)?bD(o):js(0);let d=(s.left+c.x)/i.x,f=(s.top+c.y)/i.y,h=s.width/i.x,p=s.height/i.y;if(o){const x=da(o),g=r&&es(r)?da(r):r;let j=x,b=sS(j);for(;b&&r&&g!==j;){const y=bc(b),S=b.getBoundingClientRect(),C=ts(b),N=S.left+(b.clientLeft+parseFloat(C.paddingLeft))*y.x,E=S.top+(b.clientTop+parseFloat(C.paddingTop))*y.y;d*=y.x,f*=y.y,h*=y.x,p*=y.y,d+=N,f+=E,j=da(b),b=sS(j)}}return Fh({width:h,height:p,x:d,y:f})}function cv(e,t){const n=lv(e).scrollLeft;return t?t.left+n:tl(Ts(e)).left+n}function wD(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-cv(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function IW(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=Ts(r),c=t?iv(t.floating):!1;if(r===i||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=js(1);const h=js(0),p=Es(r);if((p||!p&&!o)&&((uu(r)!=="body"||Af(i))&&(d=lv(r)),Es(r))){const g=tl(r);f=bc(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const x=i&&!p&&!o?wD(i,d):js(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+x.x,y:n.y*f.y-d.scrollTop*f.y+h.y+x.y}}function MW(e){return Array.from(e.getClientRects())}function $W(e){const t=Ts(e),n=lv(e),r=e.ownerDocument.body,s=ia(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ia(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+cv(e);const c=-n.scrollTop;return ts(r).direction==="rtl"&&(i+=ia(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:c}}const rk=25;function DW(e,t){const n=da(e),r=Ts(e),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,c=0,d=0;if(s){o=s.width,i=s.height;const h=xN();(!h||h&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}const f=cv(r);if(f<=0){const h=r.ownerDocument,p=h.body,x=getComputedStyle(p),g=h.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-g);j<=rk&&(o-=j)}else f<=rk&&(o+=f);return{width:o,height:i,x:c,y:d}}const LW=new Set(["absolute","fixed"]);function FW(e,t){const n=tl(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Es(e)?bc(e):js(1),i=e.clientWidth*o.x,c=e.clientHeight*o.y,d=s*o.x,f=r*o.y;return{width:i,height:c,x:d,y:f}}function ak(e,t,n){let r;if(t==="viewport")r=DW(e,n);else if(t==="document")r=$W(Ts(e));else if(es(t))r=FW(t,n);else{const s=bD(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Fh(r)}function jD(e,t){const n=ri(e);return n===t||!es(n)||kc(n)?!1:ts(n).position==="fixed"||jD(n,t)}function zW(e,t){const n=t.get(e);if(n)return n;let r=Rd(e,[],!1).filter(c=>es(c)&&uu(c)!=="body"),s=null;const o=ts(e).position==="fixed";let i=o?ri(e):e;for(;es(i)&&!kc(i);){const c=ts(i),d=gN(i);!d&&c.position==="fixed"&&(s=null),(o?!d&&!s:!d&&c.position==="static"&&!!s&&LW.has(s.position)||Af(i)&&!d&&jD(e,i))?r=r.filter(h=>h!==i):s=c,i=ri(i)}return t.set(e,r),r}function BW(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?iv(t)?[]:zW(t,this._c):[].concat(n),r],c=i[0],d=i.reduce((f,h)=>{const p=ak(t,h,s);return f.top=ia(p.top,f.top),f.right=ni(p.right,f.right),f.bottom=ni(p.bottom,f.bottom),f.left=ia(p.left,f.left),f},ak(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function qW(e){const{width:t,height:n}=yD(e);return{width:t,height:n}}function UW(e,t,n){const r=Es(t),s=Ts(t),o=n==="fixed",i=tl(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=js(0);function f(){d.x=cv(s)}if(r||!r&&!o)if((uu(t)!=="body"||Af(s))&&(c=lv(t)),r){const g=tl(t,!0,o,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else s&&f();o&&!r&&s&&f();const h=s&&!r&&!o?wD(s,c):js(0),p=i.left+c.scrollLeft-d.x-h.x,x=i.top+c.scrollTop-d.y-h.y;return{x:p,y:x,width:i.width,height:i.height}}function wy(e){return ts(e).position==="static"}function sk(e,t){if(!Es(e)||ts(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ts(e)===n&&(n=n.ownerDocument.body),n}function SD(e,t){const n=da(e);if(iv(e))return n;if(!Es(e)){let s=ri(e);for(;s&&!kc(s);){if(es(s)&&!wy(s))return s;s=ri(s)}return n}let r=sk(e,t);for(;r&&CW(r)&&wy(r);)r=sk(r,t);return r&&kc(r)&&wy(r)&&!gN(r)?n:r||PW(e)||n}const WW=async function(e){const t=this.getOffsetParent||SD,n=this.getDimensions,r=await n(e.floating);return{reference:UW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function VW(e){return ts(e).direction==="rtl"}const HW={convertOffsetParentRelativeRectToViewportRelativeRect:IW,getDocumentElement:Ts,getClippingRect:BW,getOffsetParent:SD,getElementRects:WW,getClientRects:MW,getDimensions:qW,getScale:bc,isElement:es,isRTL:VW};function ND(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function KW(e,t){let n=null,r;const s=Ts(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:h,top:p,width:x,height:g}=f;if(c||t(),!x||!g)return;const j=sh(p),b=sh(s.clientWidth-(h+x)),y=sh(s.clientHeight-(p+g)),S=sh(h),N={rootMargin:-j+"px "+-b+"px "+-y+"px "+-S+"px",threshold:ia(0,ni(1,d))||1};let E=!0;function A(k){const O=k[0].intersectionRatio;if(O!==d){if(!E)return i();O?i(!1,O):r=setTimeout(()=>{i(!1,1e-7)},1e3)}O===1&&!ND(f,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(A,{...N,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,N)}n.observe(e)}return i(!0),o}function GW(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=yN(e),h=s||o?[...f?Rd(f):[],...Rd(t)]:[];h.forEach(S=>{s&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const p=f&&c?KW(f,n):null;let x=-1,g=null;i&&(g=new ResizeObserver(S=>{let[C]=S;C&&C.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var N;(N=g)==null||N.observe(t)})),n()}),f&&!d&&g.observe(f),g.observe(t));let j,b=d?tl(e):null;d&&y();function y(){const S=tl(e);b&&!ND(b,S)&&n(),b=S,j=requestAnimationFrame(y)}return n(),()=>{var S;h.forEach(C=>{s&&C.removeEventListener("scroll",n),o&&C.removeEventListener("resize",n)}),p?.(),(S=g)==null||S.disconnect(),g=null,d&&cancelAnimationFrame(j)}}const YW=yW,XW=bW,QW=vW,JW=jW,ZW=gW,ok=mW,eV=wW,tV=(e,t,n)=>{const r=new Map,s={platform:HW,...n},o={...s.platform,_c:r};return hW(e,t,{...s,platform:o})};var nV=typeof document<"u",rV=function(){},Oh=nV?m.useLayoutEffect:rV;function zh(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(!zh(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 o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!zh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function CD(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ik(e,t){const n=CD(e);return Math.round(t*n)/n}function jy(e){const t=m.useRef(e);return Oh(()=>{t.current=e}),t}function aV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[h,p]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,g]=m.useState(r);zh(x,r)||g(r);const[j,b]=m.useState(null),[y,S]=m.useState(null),C=m.useCallback(G=>{G!==k.current&&(k.current=G,b(G))},[]),N=m.useCallback(G=>{G!==O.current&&(O.current=G,S(G))},[]),E=o||j,A=i||y,k=m.useRef(null),O=m.useRef(null),T=m.useRef(h),$=d!=null,B=jy(d),q=jy(s),F=jy(f),H=m.useCallback(()=>{if(!k.current||!O.current)return;const G={placement:t,strategy:n,middleware:x};q.current&&(G.platform=q.current),tV(k.current,O.current,G).then(z=>{const J={...z,isPositioned:F.current!==!1};U.current&&!zh(T.current,J)&&(T.current=J,iu.flushSync(()=>{p(J)}))})},[x,t,n,q,F]);Oh(()=>{f===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,p(G=>({...G,isPositioned:!1})))},[f]);const U=m.useRef(!1);Oh(()=>(U.current=!0,()=>{U.current=!1}),[]),Oh(()=>{if(E&&(k.current=E),A&&(O.current=A),E&&A){if(B.current)return B.current(E,A,H);H()}},[E,A,H,B,$]);const R=m.useMemo(()=>({reference:k,floating:O,setReference:C,setFloating:N}),[C,N]),W=m.useMemo(()=>({reference:E,floating:A}),[E,A]),X=m.useMemo(()=>{const G={position:n,left:0,top:0};if(!W.floating)return G;const z=ik(W.floating,h.x),J=ik(W.floating,h.y);return c?{...G,transform:"translate("+z+"px, "+J+"px)",...CD(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:J}},[n,c,W.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:H,refs:R,elements:W,floatingStyles:X}),[h,H,R,W,X])}const sV=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?ok({element:r.current,padding:s}).fn(n):{}:r?ok({element:r,padding:s}).fn(n):{}}}},oV=(e,t)=>({...YW(e),options:[e,t]}),iV=(e,t)=>({...XW(e),options:[e,t]}),lV=(e,t)=>({...eV(e),options:[e,t]}),cV=(e,t)=>({...QW(e),options:[e,t]}),uV=(e,t)=>({...JW(e),options:[e,t]}),dV=(e,t)=>({...ZW(e),options:[e,t]}),fV=(e,t)=>({...sV(e),options:[e,t]});var pV="Arrow",_D=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return a.jsx(Ye.svg,{...o,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"})})});_D.displayName=pV;var hV=_D;function uv(e){const[t,n]=m.useState(void 0);return rr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;i=f.inlineSize,c=f.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var bN="Popper",[AD,ui]=hr(bN),[mV,ED]=AD(bN),kD=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return a.jsx(mV,{scope:t,anchor:r,onAnchorChange:s,children:n})};kD.displayName=bN;var PD="PopperAnchor",OD=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=ED(PD,n),i=m.useRef(null),c=wt(t,i),d=m.useRef(null);return m.useEffect(()=>{const f=d.current;d.current=r?.current||i.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:a.jsx(Ye.div,{...s,ref:c})});OD.displayName=PD;var wN="PopperContent",[vV,gV]=AD(wN),TD=m.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:j,...b}=e,y=ED(wN,n),[S,C]=m.useState(null),N=wt(t,V=>C(V)),[E,A]=m.useState(null),k=uv(E),O=k?.width??0,T=k?.height??0,$=r+(o!=="center"?"-"+o:""),B=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},q=Array.isArray(f)?f:[f],F=q.length>0,H={padding:B,boundary:q.filter(yV),altBoundary:F},{refs:U,floatingStyles:R,placement:W,isPositioned:X,middlewareData:G}=aV({strategy:"fixed",placement:$,whileElementsMounted:(...V)=>GW(...V,{animationFrame:g==="always"}),elements:{reference:y.anchor},middleware:[oV({mainAxis:s+T,alignmentAxis:i}),d&&iV({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?lV():void 0,...H}),d&&cV({...H}),uV({...H,apply:({elements:V,rects:ue,availableWidth:Q,availableHeight:Z})=>{const{width:fe,height:ae}=ue.reference,Re=V.floating.style;Re.setProperty("--radix-popper-available-width",`${Q}px`),Re.setProperty("--radix-popper-available-height",`${Z}px`),Re.setProperty("--radix-popper-anchor-width",`${fe}px`),Re.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),E&&fV({element:E,padding:c}),bV({arrowWidth:O,arrowHeight:T}),x&&dV({strategy:"referenceHidden",...H})]}),[z,J]=MD(W),D=Wn(j);rr(()=>{X&&D?.()},[X,D]);const I=G.arrow?.x,ne=G.arrow?.y,te=G.arrow?.centerOffset!==0,[de,he]=m.useState();return rr(()=>{S&&he(window.getComputedStyle(S).zIndex)},[S]),a.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:X?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[G.transformOrigin?.x,G.transformOrigin?.y].join(" "),...G.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(vV,{scope:n,placedSide:z,onArrowChange:A,arrowX:I,arrowY:ne,shouldHideArrow:te,children:a.jsx(Ye.div,{"data-side":z,"data-align":J,...b,ref:N,style:{...b.style,animation:X?void 0:"none"}})})})});TD.displayName=wN;var RD="PopperArrow",xV={top:"bottom",right:"left",bottom:"top",left:"right"},ID=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=gV(RD,r),i=xV[o.placedSide];return a.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:a.jsx(hV,{...s,ref:n,style:{...s.style,display:"block"}})})});ID.displayName=RD;function yV(e){return e!==null}var bV=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,i=s.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,d=i?0:e.arrowHeight,[f,h]=MD(n),p={start:"0%",center:"50%",end:"100%"}[h],x=(s.arrow?.x??0)+c/2,g=(s.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=i?p:`${x}px`,b=`${-d}px`):f==="top"?(j=i?p:`${x}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=i?p:`${g}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=i?p:`${g}px`),{data:{x:j,y:b}}}});function MD(e){const[t,n="center"]=e.split("-");return[t,n]}var dv=kD,Ef=OD,fv=TD,pv=ID,wV=Symbol("radix.slottable");function jV(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=wV,t}var[hv]=hr("Tooltip",[ui]),mv=ui(),$D="TooltipProvider",SV=700,oS="tooltip.open",[NV,jN]=hv($D),DD=e=>{const{__scopeTooltip:t,delayDuration:n=SV,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,i=m.useRef(!0),c=m.useRef(!1),d=m.useRef(0);return m.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),a.jsx(NV,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(d.current),i.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:m.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:o})};DD.displayName=$D;var Id="Tooltip",[CV,kf]=hv(Id),LD=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:o,disableHoverableContent:i,delayDuration:c}=e,d=jN(Id,e.__scopeTooltip),f=mv(t),[h,p]=m.useState(null),x=nr(),g=m.useRef(0),j=i??d.disableHoverableContent,b=c??d.delayDuration,y=m.useRef(!1),[S,C]=ha({prop:r,defaultProp:s??!1,onChange:O=>{O?(d.onOpen(),document.dispatchEvent(new CustomEvent(oS))):d.onClose(),o?.(O)},caller:Id}),N=m.useMemo(()=>S?y.current?"delayed-open":"instant-open":"closed",[S]),E=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,C(!0)},[C]),A=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),k=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,C(!0),g.current=0},b)},[b,C]);return m.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),a.jsx(dv,{...f,children:a.jsx(CV,{scope:t,contentId:x,open:S,stateAttribute:N,trigger:h,onTriggerChange:p,onTriggerEnter:m.useCallback(()=>{d.isOpenDelayedRef.current?k():E()},[d.isOpenDelayedRef,k,E]),onTriggerLeave:m.useCallback(()=>{j?A():(window.clearTimeout(g.current),g.current=0)},[A,j]),onOpen:E,onClose:A,disableHoverableContent:j,children:n})})};LD.displayName=Id;var iS="TooltipTrigger",FD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=kf(iS,n),o=jN(iS,n),i=mv(n),c=m.useRef(null),d=wt(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(Ef,{asChild:!0,...i,children:a.jsx(Ye.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:Te(e.onPointerMove,x=>{x.pointerType!=="touch"&&!h.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Te(e.onFocus,()=>{f.current||s.onOpen()}),onBlur:Te(e.onBlur,s.onClose),onClick:Te(e.onClick,s.onClose)})})});FD.displayName=iS;var SN="TooltipPortal",[_V,AV]=hv(SN,{forceMount:void 0}),zD=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,o=kf(SN,t);return a.jsx(_V,{scope:t,forceMount:n,children:a.jsx(Gn,{present:n||o.open,children:a.jsx(yl,{asChild:!0,container:s,children:r})})})};zD.displayName=SN;var Pc="TooltipContent",BD=m.forwardRef((e,t)=>{const n=AV(Pc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,i=kf(Pc,e.__scopeTooltip);return a.jsx(Gn,{present:r||i.open,children:i.disableHoverableContent?a.jsx(qD,{side:s,...o,ref:t}):a.jsx(EV,{side:s,...o,ref:t})})}),EV=m.forwardRef((e,t)=>{const n=kf(Pc,e.__scopeTooltip),r=jN(Pc,e.__scopeTooltip),s=m.useRef(null),o=wt(t,s),[i,c]=m.useState(null),{trigger:d,onClose:f}=n,h=s.current,{onPointerInTransitChange:p}=r,x=m.useCallback(()=>{c(null),p(!1)},[p]),g=m.useCallback((j,b)=>{const y=j.currentTarget,S={x:j.clientX,y:j.clientY},C=RV(S,y.getBoundingClientRect()),N=IV(S,C),E=MV(b.getBoundingClientRect()),A=DV([...N,...E]);c(A),p(!0)},[p]);return m.useEffect(()=>()=>x(),[x]),m.useEffect(()=>{if(d&&h){const j=y=>g(y,h),b=y=>g(y,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",b)}}},[d,h,g,x]),m.useEffect(()=>{if(i){const j=b=>{const y=b.target,S={x:b.clientX,y:b.clientY},C=d?.contains(y)||h?.contains(y),N=!$V(S,i);C?x():N&&(x(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,i,f,x]),a.jsx(qD,{...e,ref:o})}),[kV,PV]=hv(Id,{isInside:!1}),OV=jV("TooltipContent"),qD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...c}=e,d=kf(Pc,n),f=mv(n),{onClose:h}=d;return m.useEffect(()=>(document.addEventListener(oS,h),()=>document.removeEventListener(oS,h)),[h]),m.useEffect(()=>{if(d.trigger){const p=x=>{x.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),a.jsx(xl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:a.jsxs(fv,{"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(OV,{children:r}),a.jsx(kV,{scope:n,isInside:!0,children:a.jsx(n7,{id:d.contentId,role:"tooltip",children:s||r})})]})})});BD.displayName=Pc;var UD="TooltipArrow",TV=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=mv(n);return PV(UD,n).isInside?null:a.jsx(pv,{...s,...r,ref:t})});TV.displayName=UD;function RV(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function IV(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 MV(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 $V(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const c=t[o],d=t[i],f=c.x,h=c.y,p=d.x,x=d.y;h>r!=x>r&&n<(p-f)*(r-h)/(x-h)+f&&(s=!s)}return s}function DV(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),LV(t)}function LV(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 o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.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 o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.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 FV=DD,zV=LD,BV=FD,qV=zD,WD=BD;const ai=FV,si=zV,oi=BV,uo=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(qV,{children:a.jsx(WD,{ref:r,sideOffset:t,className:je("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})}));uo.displayName=WD.displayName;var vv=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(){}},UV={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},WV=class{#e=UV;#n=!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)}},lS=new WV;function VV(e){setTimeout(e,0)}var gv=typeof window>"u"||"Deno"in globalThis;function Ka(){}function HV(e,t){return typeof e=="function"?e(t):e}function KV(e){return typeof e=="number"&&e>=0&&e!==1/0}function GV(e,t){return Math.max(e+(t||0)-Date.now(),0)}function cS(e,t){return typeof e=="function"?e(t):e}function YV(e,t){return typeof e=="function"?e(t):e}function lk(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:c}=e;if(i){if(r){if(t.queryHash!==NN(i,t.options))return!1}else if(!$d(t.queryKey,i))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||o&&!o(t))}function ck(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Md(t.options.mutationKey)!==Md(o))return!1}else if(!$d(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function NN(e,t){return(t?.queryKeyHashFn||Md)(e)}function Md(e){return JSON.stringify(e,(t,n)=>uS(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function $d(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>$d(e[n],t[n])):!1}var XV=Object.prototype.hasOwnProperty;function VD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=uk(e)&&uk(t);if(!r&&!(uS(e)&&uS(t)))return t;const o=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),c=i.length,d=r?new Array(c):{};let f=0;for(let h=0;h<c;h++){const p=r?h:i[h],x=e[p],g=t[p];if(x===g){d[p]=x,(r?h<o:XV.call(e,p))&&f++;continue}if(x===null||g===null||typeof x!="object"||typeof g!="object"){d[p]=g;continue}const j=VD(x,g,n+1);d[p]=j,j===x&&f++}return o===c&&f===o?e:d}function uk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function uS(e){if(!dk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!dk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function dk(e){return Object.prototype.toString.call(e)==="[object Object]"}function QV(e){return new Promise(t=>{lS.setTimeout(t,e)})}function JV(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?VD(e,t):t}function ZV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function eH(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var CN=Symbol();function HD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===CN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function tH(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 nH=class extends vv{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!gv&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=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"}},KD=new nH;function rH(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});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 aH=VV;function sH(){let e=[],t=0,n=c=>{c()},r=c=>{c()},s=aH;const o=c=>{t?e.push(c):s(()=>{n(c)})},i=()=>{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||i()}return d},batchCalls:c=>(...d)=>{o(()=>{c(...d)})},schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{s=c}}}var Cr=sH(),oH=class extends vv{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!gv&&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.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Bh=new oH;function iH(e){return Math.min(1e3*2**e,3e4)}function GD(e){return(e??"online")==="online"?Bh.isOnline():!0}var dS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function YD(e){let t=!1,n=0,r;const s=rH(),o=()=>s.status!=="pending",i=b=>{if(!o()){const y=new dS(b);x(y),e.onCancel?.(y)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>KD.isFocused()&&(e.networkMode==="always"||Bh.isOnline())&&e.canRun(),h=()=>GD(e.networkMode)&&e.canRun(),p=b=>{o()||(r?.(),s.resolve(b))},x=b=>{o()||(r?.(),s.reject(b))},g=()=>new Promise(b=>{r=y=>{(o()||f())&&b(y)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),j=()=>{if(o())return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(S){b=Promise.reject(S)}Promise.resolve(b).then(p).catch(S=>{if(o())return;const C=e.retry??(gv?0:3),N=e.retryDelay??iH,E=typeof N=="function"?N(n,S):N,A=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,S);if(t||!A){x(S);return}n++,e.onFail?.(n,S),QV(E).then(()=>f()?void 0:g()).then(()=>{t?x(S):j()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r?.(),s),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?j():g().then(j),s)}}var XD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),KV(this.gcTime)&&(this.#e=lS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(gv?1/0:300*1e3))}clearGcTimeout(){this.#e&&(lS.clearTimeout(this.#e),this.#e=void 0)}},lH=class extends XD{#e;#n;#t;#a;#r;#o;#i;constructor(e){super(),this.#i=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#t=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=pk(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=pk(this.options);t.data!==void 0&&(this.setState(fk(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=JV(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Ka).catch(Ka):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>YV(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>cS(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:!GV(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.#t.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.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#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 c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},s=()=>{const c=HD(this.options,t),f=(()=>{const h={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(h),h})();return this.#i=!1,this.options.persister?this.options.persister(c,f,this):c(f)},i=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:s};return r(c),c})();this.options.behavior?.onFetch(i,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#s({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=YD({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:c=>{c instanceof dS&&c.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#t.config.onSuccess?.(c,this),this.#t.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof dS){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#t.config.onError?.(c,this),this.#t.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(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,...cH(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...fk(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),Cr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function cH(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:GD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fk(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pk(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"}}function hk(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let h=!1;const p=j=>{tH(j,()=>t.signal,()=>h=!0)},x=HD(t.options,t.fetchOptions),g=async(j,b,y)=>{if(h)return Promise.reject();if(b==null&&j.pages.length)return Promise.resolve(j);const C=(()=>{const k={client:t.client,queryKey:t.queryKey,pageParam:b,direction:y?"backward":"forward",meta:t.options.meta};return p(k),k})(),N=await x(C),{maxPages:E}=t.options,A=y?eH:ZV;return{pages:A(j.pages,N,E),pageParams:A(j.pageParams,b,E)}};if(s&&o.length){const j=s==="backward",b=j?uH:mk,y={pages:o,pageParams:i},S=b(r,y);c=await g(y,S,j)}else{const j=e??o.length;do{const b=d===0?i[0]??r.initialPageParam:mk(r,c);if(d>0&&b==null)break;c=await g(c,b),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 mk(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 uH(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var dH=class extends XD{#e;#n;#t;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#n=[],this.state=e.state||fH(),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.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=YD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,i)=>{this.#r({type:"failed",failureCount:o,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",s=!this.#a.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:s}),this.#t.config.onMutate&&await this.#t.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:s})}const o=await this.#a.start();return await this.#t.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#t.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{await this.#t.config.onError?.(o,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#t.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:o}),o}finally{this.#t.runNext(this)}}#r(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),Cr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function fH(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pH=class extends vv{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(e,t,n){const r=new dH({client:e,mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=oh(e);if(typeof t=="string"){const n=this.#n.get(t);n?n.push(e):this.#n.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=oh(e);if(typeof t=="string"){const n=this.#n.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#n.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=oh(e);if(typeof t=="string"){const r=this.#n.get(t)?.find(s=>s.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=oh(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Cr.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>ck(t,n))}findAll(e={}){return this.getAll().filter(t=>ck(e,t))}notify(e){Cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Cr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ka))))}};function oh(e){return e.options.scope?.id}var hH=class extends vv{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??NN(r,t);let o=this.get(s);return o||(o=new lH({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}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(){Cr.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=>lk(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>lk(e,n)):t}notify(e){Cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Cr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Cr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},mH=class{#e;#n;#t;#a;#r;#o;#i;#s;constructor(e={}){this.#e=e.queryCache||new hH,this.#n=e.mutationCache||new pH,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#i=KD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Bh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.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(cS(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}),o=this.#e.get(r.queryHash)?.state.data,i=HV(t,o);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Cr.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;Cr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Cr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Cr.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ka).catch(Ka)}invalidateQueries(e,t={}){return Cr.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=Cr.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Ka)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Ka)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(cS(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ka).catch(Ka)}fetchInfiniteQuery(e){return e.behavior=hk(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ka).catch(Ka)}ensureInfiniteQueryData(e){return e.behavior=hk(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Bh.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(e){this.#t=e}setQueryDefaults(e,t){this.#a.set(Md(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{$d(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Md(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{$d(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#t.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=NN(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===CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#t.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},vH=m.createContext(void 0),gH=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(vH.Provider,{value:e,children:t}));function Dd(){return Dd=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},Dd.apply(this,arguments)}var Xo;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Xo||(Xo={}));const vk="popstate";function xH(e){e===void 0&&(e={});function t(r,s){let{pathname:o,search:i,hash:c}=r.location;return fS("",{pathname:o,search:i,hash:c},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:qh(s)}return bH(t,n,null,e)}function $n(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _N(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function yH(){return Math.random().toString(36).substr(2,8)}function gk(e,t){return{usr:e.state,key:e.key,idx:t}}function fS(e,t,n,r){return n===void 0&&(n=null),Dd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?du(t):t,{state:n,key:t&&t.key||r||yH()})}function qh(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 du(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 bH(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,c=Xo.Pop,d=null,f=h();f==null&&(f=0,i.replaceState(Dd({},i.state,{idx:f}),""));function h(){return(i.state||{idx:null}).idx}function p(){c=Xo.Pop;let y=h(),S=y==null?null:y-f;f=y,d&&d({action:c,location:b.location,delta:S})}function x(y,S){c=Xo.Push;let C=fS(b.location,y,S);f=h()+1;let N=gk(C,f),E=b.createHref(C);try{i.pushState(N,"",E)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(E)}o&&d&&d({action:c,location:b.location,delta:1})}function g(y,S){c=Xo.Replace;let C=fS(b.location,y,S);f=h();let N=gk(C,f),E=b.createHref(C);i.replaceState(N,"",E),o&&d&&d({action:c,location:b.location,delta:0})}function j(y){let S=s.location.origin!=="null"?s.location.origin:s.location.href,C=typeof y=="string"?y:qh(y);return C=C.replace(/ $/,"%20"),$n(S,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,S)}let b={get action(){return c},get location(){return e(s,i)},listen(y){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(vk,p),d=y,()=>{s.removeEventListener(vk,p),d=null}},createHref(y){return t(s,y)},createURL:j,encodeLocation(y){let S=j(y);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:x,replace:g,go(y){return i.go(y)}};return b}var xk;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xk||(xk={}));function wH(e,t,n){return n===void 0&&(n="/"),jH(e,t,n)}function jH(e,t,n,r){let s=typeof t=="string"?du(t):t,o=Oc(s.pathname||"/",n);if(o==null)return null;let i=QD(e);SH(i);let c=null;for(let d=0;c==null&&d<i.length;++d){let f=IH(o);c=TH(i[d],f)}return c}function QD(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(o,i,c)=>{let d={relativePath:c===void 0?o.path||"":c,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};d.relativePath.startsWith("/")&&($n(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=Zo([r,d.relativePath]),h=n.concat(d);o.children&&o.children.length>0&&($n(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),QD(o.children,t,h,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:PH(f,o.index),routesMeta:h})};return e.forEach((o,i)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))s(o,i);else for(let d of JD(o.path))s(o,i,d)}),t}function JD(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let i=JD(r.join("/")),c=[];return c.push(...i.map(d=>d===""?o:[o,d].join("/"))),s&&c.push(...i),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function SH(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:OH(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const NH=/^:[\w-]+$/,CH=3,_H=2,AH=1,EH=10,kH=-2,yk=e=>e==="*";function PH(e,t){let n=e.split("/"),r=n.length;return n.some(yk)&&(r+=kH),t&&(r+=_H),n.filter(s=>!yk(s)).reduce((s,o)=>s+(NH.test(o)?CH:o===""?AH:EH),r)}function OH(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 TH(e,t,n){let{routesMeta:r}=e,s={},o="/",i=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",p=cn({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),x=d.route;if(!p)return null;Object.assign(s,p.params),i.push({params:s,pathname:Zo([o,p.pathname]),pathnameBase:FH(Zo([o,p.pathnameBase])),route:x}),p.pathnameBase!=="/"&&(o=Zo([o,p.pathnameBase]))}return i}function cn(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=RH(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),c=s.slice(1);return{params:r.reduce((f,h,p)=>{let{paramName:x,isOptional:g}=h;if(x==="*"){let b=c[p]||"";i=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}const j=c[p];return g&&!j?f[x]=void 0:f[x]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:i,pattern:e}}function RH(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),_N(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,(i,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 IH(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _N(!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 Oc(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 MH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$H=e=>MH.test(e);function DH(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?du(e):e,o;if(n)if($H(n))o=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),_N(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+n))}n.startsWith("/")?o=bk(n.substring(1),"/"):o=bk(n,t)}else o=t;return{pathname:o,search:zH(r),hash:BH(s)}}function bk(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 Sy(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 LH(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function AN(e,t){let n=LH(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function EN(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=du(e):(s=Dd({},e),$n(!s.pathname||!s.pathname.includes("?"),Sy("?","pathname","search",s)),$n(!s.pathname||!s.pathname.includes("#"),Sy("#","pathname","hash",s)),$n(!s.search||!s.search.includes("#"),Sy("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,c;if(i==null)c=n;else{let p=t.length-1;if(!r&&i.startsWith("..")){let x=i.split("/");for(;x[0]==="..";)x.shift(),p-=1;s.pathname=x.join("/")}c=p>=0?t[p]:"/"}let d=DH(s,c),f=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Zo=e=>e.join("/").replace(/\/\/+/g,"/"),FH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),zH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,BH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function qH(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ZD=["post","put","patch","delete"];new Set(ZD);const UH=["get",...ZD];new Set(UH);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)}const xv=m.createContext(null),e5=m.createContext(null),vo=m.createContext(null),yv=m.createContext(null),Rs=m.createContext({outlet:null,matches:[],isDataRoute:!1}),t5=m.createContext(null);function WH(e,t){let{relative:n}=t===void 0?{}:t;fu()||$n(!1);let{basename:r,navigator:s}=m.useContext(vo),{hash:o,pathname:i,search:c}=bv(e,{relative:n}),d=i;return r!=="/"&&(d=i==="/"?r:Zo([r,i])),s.createHref({pathname:d,search:c,hash:o})}function fu(){return m.useContext(yv)!=null}function Is(){return fu()||$n(!1),m.useContext(yv).location}function n5(e){m.useContext(vo).static||m.useLayoutEffect(e)}function Ia(){let{isDataRoute:e}=m.useContext(Rs);return e?sK():VH()}function VH(){fu()||$n(!1);let e=m.useContext(xv),{basename:t,future:n,navigator:r}=m.useContext(vo),{matches:s}=m.useContext(Rs),{pathname:o}=Is(),i=JSON.stringify(AN(s,n.v7_relativeSplatPath)),c=m.useRef(!1);return n5(()=>{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=EN(f,JSON.parse(i),o,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Zo([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,i,o,e])}const HH=m.createContext(null);function KH(e){let t=m.useContext(Rs).outlet;return t&&m.createElement(HH.Provider,{value:e},t)}function wl(){let{matches:e}=m.useContext(Rs),t=e[e.length-1];return t?t.params:{}}function bv(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(vo),{matches:s}=m.useContext(Rs),{pathname:o}=Is(),i=JSON.stringify(AN(s,r.v7_relativeSplatPath));return m.useMemo(()=>EN(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function GH(e,t){return YH(e,t)}function YH(e,t,n,r){fu()||$n(!1);let{navigator:s}=m.useContext(vo),{matches:o}=m.useContext(Rs),i=o[o.length-1],c=i?i.params:{};i&&i.pathname;let d=i?i.pathnameBase:"/";i&&i.route;let f=Is(),h;if(t){var p;let y=typeof t=="string"?du(t):t;d==="/"||(p=y.pathname)!=null&&p.startsWith(d)||$n(!1),h=y}else h=f;let x=h.pathname||"/",g=x;if(d!=="/"){let y=d.replace(/^\//,"").split("/");g="/"+x.replace(/^\//,"").split("/").slice(y.length).join("/")}let j=wH(e,{pathname:g}),b=eK(j&&j.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Zo([d,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?d:Zo([d,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,n,r);return t&&b?m.createElement(yv.Provider,{value:{location:Ld({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Xo.Pop}},b):b}function XH(){let e=aK(),t=qH(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 QH=m.createElement(XH,null);class JH 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(Rs.Provider,{value:this.props.routeContext},m.createElement(t5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ZH(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(xv);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Rs.Provider,{value:t},r)}function eK(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,c=(s=n)==null?void 0:s.errors;if(c!=null){let h=i.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);h>=0||$n(!1),i=i.slice(0,Math.min(i.length,h+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<i.length;h++){let p=i[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:x,errors:g}=n,j=p.route.loader&&x[p.route.id]===void 0&&(!g||g[p.route.id]===void 0);if(p.route.lazy||j){d=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}return i.reduceRight((h,p,x)=>{let g,j=!1,b=null,y=null;n&&(g=c&&p.route.id?c[p.route.id]:void 0,b=p.route.errorElement||QH,d&&(f<0&&x===0?(oK("route-fallback"),j=!0,y=null):f===x&&(j=!0,y=p.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,x+1)),C=()=>{let N;return g?N=b:j?N=y:p.route.Component?N=m.createElement(p.route.Component,null):p.route.element?N=p.route.element:N=h,m.createElement(ZH,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:N})};return n&&(p.route.ErrorBoundary||p.route.errorElement||x===0)?m.createElement(JH,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):C()},null)}var r5=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(r5||{}),a5=(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})(a5||{});function tK(e){let t=m.useContext(xv);return t||$n(!1),t}function nK(e){let t=m.useContext(e5);return t||$n(!1),t}function rK(e){let t=m.useContext(Rs);return t||$n(!1),t}function s5(e){let t=rK(),n=t.matches[t.matches.length-1];return n.route.id||$n(!1),n.route.id}function aK(){var e;let t=m.useContext(t5),n=nK(),r=s5();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function sK(){let{router:e}=tK(r5.UseNavigateStable),t=s5(a5.UseNavigateStable),n=m.useRef(!1);return n5(()=>{n.current=!0}),m.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Ld({fromRouteId:t},o)))},[e,t])}const wk={};function oK(e,t,n){wk[e]||(wk[e]=!0)}function iK(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function o5(e){let{to:t,replace:n,state:r,relative:s}=e;fu()||$n(!1);let{future:o,static:i}=m.useContext(vo),{matches:c}=m.useContext(Rs),{pathname:d}=Is(),f=Ia(),h=EN(t,AN(c,o.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 jk(e){return KH(e.context)}function fn(e){$n(!1)}function lK(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Xo.Pop,navigator:o,static:i=!1,future:c}=e;fu()&&$n(!1);let d=t.replace(/^\/*/,"/"),f=m.useMemo(()=>({basename:d,navigator:o,static:i,future:Ld({v7_relativeSplatPath:!1},c)}),[d,c,o,i]);typeof r=="string"&&(r=du(r));let{pathname:h="/",search:p="",hash:x="",state:g=null,key:j="default"}=r,b=m.useMemo(()=>{let y=Oc(h,d);return y==null?null:{location:{pathname:y,search:p,hash:x,state:g,key:j},navigationType:s}},[d,h,p,x,g,j,s]);return b==null?null:m.createElement(vo.Provider,{value:f},m.createElement(yv.Provider,{children:n,value:b}))}function cK(e){let{children:t,location:n}=e;return GH(pS(t),n)}new Promise(()=>{});function pS(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let o=[...t,s];if(r.type===m.Fragment){n.push.apply(n,pS(r.props.children,o));return}r.type!==fn&&$n(!1),!r.props.index||!r.props.children||$n(!1);let i={id:r.props.id||o.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&&(i.children=pS(r.props.children,o)),n.push(i)}),n}function Uh(){return Uh=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},Uh.apply(this,arguments)}function i5(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o<r.length;o++)s=r[o],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function uK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dK(e,t){return e.button===0&&(!t||t==="_self")&&!uK(e)}function hS(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 fK(e,t){let n=hS(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}const pK=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],hK=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],mK="6";try{window.__reactRouterVersion=mK}catch{}const vK=m.createContext({isTransitioning:!1}),gK="startTransition",Sk=tv[gK];function xK(e){let{basename:t,children:n,future:r,window:s}=e,o=m.useRef();o.current==null&&(o.current=xH({window:s,v5Compat:!0}));let i=o.current,[c,d]=m.useState({action:i.action,location:i.location}),{v7_startTransition:f}=r||{},h=m.useCallback(p=>{f&&Sk?Sk(()=>d(p)):d(p)},[d,f]);return m.useLayoutEffect(()=>i.listen(h),[i,h]),m.useEffect(()=>iK(r),[r]),m.createElement(lK,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:i,future:r})}const yK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_t=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:o,replace:i,state:c,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,x=i5(t,pK),{basename:g}=m.useContext(vo),j,b=!1;if(typeof f=="string"&&bK.test(f)&&(j=f,yK))try{let N=new URL(window.location.href),E=f.startsWith("//")?new URL(N.protocol+f):new URL(f),A=Oc(E.pathname,g);E.origin===N.origin&&A!=null?f=A+E.search+E.hash:b=!0}catch{}let y=WH(f,{relative:s}),S=SK(f,{replace:i,state:c,target:d,preventScrollReset:h,relative:s,viewTransition:p});function C(N){r&&r(N),N.defaultPrevented||S(N)}return m.createElement("a",Uh({},x,{href:j||y,onClick:b||o?r:C,ref:n,target:d}))}),wK=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:o="",end:i=!1,style:c,to:d,viewTransition:f,children:h}=t,p=i5(t,hK),x=bv(d,{relative:p.relative}),g=Is(),j=m.useContext(e5),{navigator:b,basename:y}=m.useContext(vo),S=j!=null&&NK(x)&&f===!0,C=b.encodeLocation?b.encodeLocation(x).pathname:x.pathname,N=g.pathname,E=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;s||(N=N.toLowerCase(),E=E?E.toLowerCase():null,C=C.toLowerCase()),E&&y&&(E=Oc(E,y)||E);const A=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let k=N===C||!i&&N.startsWith(C)&&N.charAt(A)==="/",O=E!=null&&(E===C||!i&&E.startsWith(C)&&E.charAt(C.length)==="/"),T={isActive:k,isPending:O,isTransitioning:S},$=k?r:void 0,B;typeof o=="function"?B=o(T):B=[o,k?"active":null,O?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let q=typeof c=="function"?c(T):c;return m.createElement(_t,Uh({},p,{"aria-current":$,className:B,ref:n,style:q,to:d,viewTransition:f}),typeof h=="function"?h(T):h)});var mS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(mS||(mS={}));var Nk;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Nk||(Nk={}));function jK(e){let t=m.useContext(xv);return t||$n(!1),t}function SK(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:i,viewTransition:c}=t===void 0?{}:t,d=Ia(),f=Is(),h=bv(e,{relative:i});return m.useCallback(p=>{if(dK(p,n)){p.preventDefault();let x=r!==void 0?r:qh(f)===qh(h);d(e,{replace:x,state:s,preventScrollReset:o,relative:i,viewTransition:c})}},[f,d,h,r,s,n,e,o,i,c])}function go(e){let t=m.useRef(hS(e)),n=m.useRef(!1),r=Is(),s=m.useMemo(()=>fK(r.search,n.current?null:t.current),[r.search]),o=Ia(),i=m.useCallback((c,d)=>{const f=hS(typeof c=="function"?c(s):c);n.current=!0,o("?"+f,d)},[o,s]);return[s,i]}function NK(e,t){t===void 0&&(t={});let n=m.useContext(vK);n==null&&$n(!1);let{basename:r}=jK(mS.useViewTransitionState),s=bv(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Oc(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Oc(n.nextLocation.pathname,r)||n.nextLocation.pathname;return cn(s.pathname,i)!=null||cn(s.pathname,o)!=null}var CK=Symbol.for("react.lazy"),Wh=tv[" use ".trim().toString()];function _K(e){return typeof e=="object"&&e!==null&&"then"in e}function l5(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===CK&&"_payload"in e&&_K(e._payload)}function wv(e){const t=AK(e),n=m.forwardRef((r,s)=>{let{children:o,...i}=r;l5(o)&&typeof Wh=="function"&&(o=Wh(o._payload));const c=m.Children.toArray(o),d=c.find(kK);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,{...i,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var di=wv("Slot");function AK(e){const t=m.forwardRef((n,r)=>{let{children:s,...o}=n;if(l5(s)&&typeof Wh=="function"&&(s=Wh(s._payload)),m.isValidElement(s)){const i=OK(s),c=PK(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Pr(r,i):i),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EK=Symbol("radix.slottable");function kK(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EK}function PK(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{const d=o(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function OK(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 Ny=768;function TK(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Ny-1}px)`),r=()=>{t(window.innerWidth<Ny)};return n.addEventListener("change",r),t(window.innerWidth<Ny),()=>n.removeEventListener("change",r)},[]),!!e}const kN=bl("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"}}),se=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const i=r?di:"button";return a.jsx(i,{className:je(kN({variant:t,size:n,className:e})),ref:o,...s})});se.displayName="Button";const vt=m.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:je("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}));vt.displayName="Input";var RK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],IK=RK.reduce((e,t)=>{const n=wv(`Primitive.${t}`),r=m.forwardRef((s,o)=>{const{asChild:i,...c}=s,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),MK="Separator",Ck="horizontal",$K=["horizontal","vertical"],c5=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=Ck,...s}=e,o=DK(r)?r:Ck,c=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return a.jsx(IK.div,{"data-orientation":o,...c,...s,ref:t})});c5.displayName=MK;function DK(e){return $K.includes(e)}var u5=c5;const d5=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(u5,{ref:s,decorative:n,orientation:t,className:je("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));d5.displayName=u5.displayName;var Cy="focusScope.autoFocusOnMount",_y="focusScope.autoFocusOnUnmount",_k={bubbles:!1,cancelable:!0},LK="FocusScope",Pf=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[c,d]=m.useState(null),f=Wn(s),h=Wn(o),p=m.useRef(null),x=wt(t,b=>d(b)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let b=function(N){if(g.paused||!c)return;const E=N.target;c.contains(E)?p.current=E:Go(p.current,{select:!0})},y=function(N){if(g.paused||!c)return;const E=N.relatedTarget;E!==null&&(c.contains(E)||Go(p.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const A of N)A.removedNodes.length>0&&Go(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",y);const C=new MutationObserver(S);return c&&C.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",y),C.disconnect()}}},[r,c,g.paused]),m.useEffect(()=>{if(c){Ek.add(g);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(Cy,_k);c.addEventListener(Cy,f),c.dispatchEvent(S),S.defaultPrevented||(FK(WK(f5(c)),{select:!0}),document.activeElement===b&&Go(c))}return()=>{c.removeEventListener(Cy,f),setTimeout(()=>{const S=new CustomEvent(_y,_k);c.addEventListener(_y,h),c.dispatchEvent(S),S.defaultPrevented||Go(b??document.body,{select:!0}),c.removeEventListener(_y,h),Ek.remove(g)},0)}}},[c,f,h,g]);const j=m.useCallback(b=>{if(!n&&!r||g.paused)return;const y=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(y&&S){const C=b.currentTarget,[N,E]=zK(C);N&&E?!b.shiftKey&&S===E?(b.preventDefault(),n&&Go(N,{select:!0})):b.shiftKey&&S===N&&(b.preventDefault(),n&&Go(E,{select:!0})):S===C&&b.preventDefault()}},[n,r,g.paused]);return a.jsx(Ye.div,{tabIndex:-1,...i,ref:x,onKeyDown:j})});Pf.displayName=LK;function FK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Go(r,{select:t}),document.activeElement!==n)return}function zK(e){const t=f5(e),n=Ak(t,e),r=Ak(t.reverse(),e);return[n,r]}function f5(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 Ak(e,t){for(const n of e)if(!BK(n,{upTo:t}))return n}function BK(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 qK(e){return e instanceof HTMLInputElement&&"select"in e}function Go(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&qK(e)&&t&&e.select()}}var Ek=UK();function UK(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=kk(e,t),e.unshift(t)},remove(t){e=kk(e,t),e[0]?.resume()}}}function kk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function WK(e){return e.filter(t=>t.tagName!=="A")}var Ay=0;function jv(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Pk()),document.body.insertAdjacentElement("beforeend",e[1]??Pk()),Ay++,()=>{Ay===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ay--}},[])}function Pk(){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 gs=function(){return gs=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},gs.apply(this,arguments)};function p5(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 VK(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Th="right-scroll-bar-position",Rh="width-before-scroll-bar",HK="with-scroll-bars-hidden",KK="--removed-body-scroll-bar-size";function Ey(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function GK(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 YK=typeof window<"u"?m.useLayoutEffect:m.useEffect,Ok=new WeakMap;function XK(e,t){var n=GK(null,function(r){return e.forEach(function(s){return Ey(s,r)})});return YK(function(){var r=Ok.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(c){o.has(c)||Ey(c,null)}),o.forEach(function(c){s.has(c)||Ey(c,i)})}Ok.set(n,e)},[e]),n}function QK(e){return e}function JK(e,t){t===void 0&&(t=QK);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(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(o),i=n}var d=function(){var h=i;i=[],h.forEach(o)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){i.push(h),f()},filter:function(h){return i=i.filter(h),n}}}};return s}function ZK(e){e===void 0&&(e={});var t=JK(null);return t.options=gs({async:!0,ssr:!1},e),t}var h5=function(e){var t=e.sideCar,n=p5(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,gs({},n))};h5.isSideCarExport=!0;function eG(e,t){return e.useMedium(t),h5}var m5=ZK(),ky=function(){},Sv=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:ky,onWheelCapture:ky,onTouchMoveCapture:ky}),s=r[0],o=r[1],i=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,x=e.sideCar,g=e.noRelative,j=e.noIsolation,b=e.inert,y=e.allowPinchZoom,S=e.as,C=S===void 0?"div":S,N=e.gapMode,E=p5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=x,k=XK([n,t]),O=gs(gs({},E),s);return m.createElement(m.Fragment,null,h&&m.createElement(A,{sideCar:m5,removeScrollBar:f,shards:p,noRelative:g,noIsolation:j,inert:b,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:N}),i?m.cloneElement(m.Children.only(c),gs(gs({},O),{ref:k})):m.createElement(C,gs({},O,{className:d,ref:k}),c))});Sv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Sv.classNames={fullWidth:Rh,zeroRight:Th};var tG=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tG();return t&&e.setAttribute("nonce",t),e}function rG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function aG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nG())&&(rG(t,n),aG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oG=function(){var e=sG();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},v5=function(){var e=oG(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},iG={left:0,top:0,right:0,gap:0},Py=function(e){return parseInt(e||"",10)||0},lG=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[Py(n),Py(r),Py(s)]},cG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return iG;var t=lG(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])}},uG=v5(),wc="data-scroll-locked",dG=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
10
|
-
.`.concat(HK,` {
|
|
11
|
-
overflow: hidden `).concat(r,`;
|
|
12
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
13
|
-
}
|
|
14
|
-
body[`).concat(wc,`] {
|
|
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(o,`px;
|
|
20
|
-
padding-right: `).concat(i,`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(Th,` {
|
|
28
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(Rh,` {
|
|
32
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(Th," .").concat(Th,` {
|
|
36
|
-
right: 0 `).concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(Rh," .").concat(Rh,` {
|
|
40
|
-
margin-right: 0 `).concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body[`).concat(wc,`] {
|
|
44
|
-
`).concat(KK,": ").concat(c,`px;
|
|
45
|
-
}
|
|
46
|
-
`)},Tk=function(){var e=parseInt(document.body.getAttribute(wc)||"0",10);return isFinite(e)?e:0},fG=function(){m.useEffect(function(){return document.body.setAttribute(wc,(Tk()+1).toString()),function(){var e=Tk()-1;e<=0?document.body.removeAttribute(wc):document.body.setAttribute(wc,e.toString())}},[])},pG=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;fG();var o=m.useMemo(function(){return cG(s)},[s]);return m.createElement(uG,{styles:dG(o,!t,s,n?"":"!important")})},vS=!1;if(typeof window<"u")try{var ih=Object.defineProperty({},"passive",{get:function(){return vS=!0,!0}});window.addEventListener("test",ih,ih),window.removeEventListener("test",ih,ih)}catch{vS=!1}var Zl=vS?{passive:!1}:!1,hG=function(e){return e.tagName==="TEXTAREA"},g5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hG(e)&&n[t]==="visible")},mG=function(e){return g5(e,"overflowY")},vG=function(e){return g5(e,"overflowX")},Rk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=x5(e,r);if(s){var o=y5(e,r),i=o[1],c=o[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gG=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},xG=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},x5=function(e,t){return e==="v"?mG(t):vG(t)},y5=function(e,t){return e==="v"?gG(t):xG(t)},yG=function(e,t){return e==="h"&&t==="rtl"?-1:1},bG=function(e,t,n,r,s){var o=yG(e,window.getComputedStyle(t).direction),i=o*r,c=n.target,d=t.contains(c),f=!1,h=i>0,p=0,x=0;do{if(!c)break;var g=y5(e,c),j=g[0],b=g[1],y=g[2],S=b-y-o*j;(j||S)&&x5(e,c)&&(p+=S,x+=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(x)<1)&&(f=!0),f},lh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ik=function(e){return[e.deltaX,e.deltaY]},Mk=function(e){return e&&"current"in e?e.current:e},wG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jG=function(e){return`
|
|
47
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
-
`)},SG=0,ec=[];function NG(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(SG++)[0],o=m.useState(v5)[0],i=m.useRef(e);m.useEffect(function(){i.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var b=VK([e.lockRef.current],(e.shards||[]).map(Mk),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=m.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!i.current.allowPinchZoom;var S=lh(b),C=n.current,N="deltaX"in b?b.deltaX:C[0]-S[0],E="deltaY"in b?b.deltaY:C[1]-S[1],A,k=b.target,O=Math.abs(N)>Math.abs(E)?"h":"v";if("touches"in b&&O==="h"&&k.type==="range")return!1;var T=window.getSelection(),$=T&&T.anchorNode,B=$?$===k||$.contains(k):!1;if(B)return!1;var q=Rk(O,k);if(!q)return!0;if(q?A=O:(A=O==="v"?"h":"v",q=Rk(O,k)),!q)return!1;if(!r.current&&"changedTouches"in b&&(N||E)&&(r.current=A),!A)return!0;var F=r.current||A;return bG(F,y,b,F==="h"?N:E)},[]),d=m.useCallback(function(b){var y=b;if(!(!ec.length||ec[ec.length-1]!==o)){var S="deltaY"in y?Ik(y):lh(y),C=t.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&wG(A.delta,S)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var N=(i.current.shards||[]).map(Mk).filter(Boolean).filter(function(A){return A.contains(y.target)}),E=N.length>0?c(y,N[0]):!i.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),f=m.useCallback(function(b,y,S,C){var N={name:b,delta:y,target:S,should:C,shadowParent:CG(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(E){return E!==N})},1)},[]),h=m.useCallback(function(b){n.current=lh(b),r.current=void 0},[]),p=m.useCallback(function(b){f(b.type,Ik(b),b.target,c(b,e.lockRef.current))},[]),x=m.useCallback(function(b){f(b.type,lh(b),b.target,c(b,e.lockRef.current))},[]);m.useEffect(function(){return ec.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:x}),document.addEventListener("wheel",d,Zl),document.addEventListener("touchmove",d,Zl),document.addEventListener("touchstart",h,Zl),function(){ec=ec.filter(function(b){return b!==o}),document.removeEventListener("wheel",d,Zl),document.removeEventListener("touchmove",d,Zl),document.removeEventListener("touchstart",h,Zl)}},[]);var g=e.removeScrollBar,j=e.inert;return m.createElement(m.Fragment,null,j?m.createElement(o,{styles:jG(s)}):null,g?m.createElement(pG,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function CG(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _G=eG(m5,NG);var Of=m.forwardRef(function(e,t){return m.createElement(Sv,gs({},e,{ref:t,sideCar:_G}))});Of.classNames=Sv.classNames;var AG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},tc=new WeakMap,ch=new WeakMap,uh={},Oy=0,b5=function(e){return e&&(e.host||b5(e.parentNode))},EG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=b5(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})},kG=function(e,t,n,r){var s=EG(t,Array.isArray(e)?e:[e]);uh[n]||(uh[n]=new WeakMap);var o=uh[n],i=[],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(x){if(c.has(x))h(x);else try{var g=x.getAttribute(r),j=g!==null&&g!=="false",b=(tc.get(x)||0)+1,y=(o.get(x)||0)+1;tc.set(x,b),o.set(x,y),i.push(x),b===1&&j&&ch.set(x,!0),y===1&&x.setAttribute(n,"true"),j||x.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",x,S)}})};return h(t),c.clear(),Oy++,function(){i.forEach(function(p){var x=tc.get(p)-1,g=o.get(p)-1;tc.set(p,x),o.set(p,g),x||(ch.has(p)||p.removeAttribute(r),ch.delete(p)),g||p.removeAttribute(n)}),Oy--,Oy||(tc=new WeakMap,tc=new WeakMap,ch=new WeakMap,uh={})}},Nv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=AG(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),kG(r,s,n,"aria-hidden")):function(){return null}};function PG(e){const t=OG(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(RG);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,{...i,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function OG(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=MG(s),c=IG(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Pr(r,i):i),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var TG=Symbol("radix.slottable");function RG(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TG}function IG(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{const d=o(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function MG(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 Cv="Dialog",[w5,j5]=hr(Cv),[$G,ns]=w5(Cv),S5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,c=m.useRef(null),d=m.useRef(null),[f,h]=ha({prop:r,defaultProp:s??!1,onChange:o,caller:Cv});return a.jsx($G,{scope:t,triggerRef:c,contentRef:d,contentId:nr(),titleId:nr(),descriptionId:nr(),open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),modal:i,children:n})};S5.displayName=Cv;var N5="DialogTrigger",C5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ns(N5,n),o=wt(t,s.triggerRef);return a.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":TN(s.open),...r,ref:o,onClick:Te(e.onClick,s.onOpenToggle)})});C5.displayName=N5;var PN="DialogPortal",[DG,_5]=w5(PN,{forceMount:void 0}),A5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=ns(PN,t);return a.jsx(DG,{scope:t,forceMount:n,children:m.Children.map(r,i=>a.jsx(Gn,{present:n||o.open,children:a.jsx(yl,{asChild:!0,container:s,children:i})}))})};A5.displayName=PN;var Vh="DialogOverlay",E5=m.forwardRef((e,t)=>{const n=_5(Vh,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ns(Vh,e.__scopeDialog);return o.modal?a.jsx(Gn,{present:r||o.open,children:a.jsx(FG,{...s,ref:t})}):null});E5.displayName=Vh;var LG=PG("DialogOverlay.RemoveScroll"),FG=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ns(Vh,n);return a.jsx(Of,{as:LG,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Ye.div,{"data-state":TN(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),nl="DialogContent",k5=m.forwardRef((e,t)=>{const n=_5(nl,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ns(nl,e.__scopeDialog);return a.jsx(Gn,{present:r||o.open,children:o.modal?a.jsx(zG,{...s,ref:t}):a.jsx(BG,{...s,ref:t})})});k5.displayName=nl;var zG=m.forwardRef((e,t)=>{const n=ns(nl,e.__scopeDialog),r=m.useRef(null),s=wt(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return Nv(o)},[]),a.jsx(P5,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&o.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,o=>o.preventDefault())})}),BG=m.forwardRef((e,t)=>{const n=ns(nl,e.__scopeDialog),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(P5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;n.triggerRef.current?.contains(i)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),P5=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,c=ns(nl,n),d=m.useRef(null),f=wt(t,d);return jv(),a.jsxs(a.Fragment,{children:[a.jsx(Pf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(xl,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":TN(c.open),...i,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(UG,{titleId:c.titleId}),a.jsx(VG,{contentRef:d,descriptionId:c.descriptionId})]})]})}),ON="DialogTitle",O5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ns(ON,n);return a.jsx(Ye.h2,{id:s.titleId,...r,ref:t})});O5.displayName=ON;var T5="DialogDescription",R5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ns(T5,n);return a.jsx(Ye.p,{id:s.descriptionId,...r,ref:t})});R5.displayName=T5;var I5="DialogClose",M5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ns(I5,n);return a.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});M5.displayName=I5;function TN(e){return e?"open":"closed"}var $5="DialogTitleWarning",[qG,D5]=CU($5,{contentName:nl,titleName:ON,docsSlug:"dialog"}),UG=({titleId:e})=>{const t=D5($5),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},WG="DialogDescriptionWarning",VG=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${D5(WG).contentName}}.`;return m.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},_v=S5,HG=C5,Av=A5,pu=E5,hu=k5,Tf=O5,Rf=R5,Ev=M5;const L5=_v,KG=Av,F5=m.forwardRef(({className:e,...t},n)=>a.jsx(pu,{className:je("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}));F5.displayName=pu.displayName;const GG=bl("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"}}),RN=m.forwardRef(({side:e="right",className:t,children:n,...r},s)=>a.jsxs(KG,{children:[a.jsx(F5,{}),a.jsxs(hu,{ref:s,className:je(GG({side:e}),t),...r,children:[n,a.jsxs(Ev,{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(As,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));RN.displayName=hu.displayName;const z5=({className:e,...t})=>a.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...t});z5.displayName="SheetHeader";const B5=m.forwardRef(({className:e,...t},n)=>a.jsx(Tf,{ref:n,className:je("text-lg font-semibold text-foreground",e),...t}));B5.displayName=Tf.displayName;const YG=m.forwardRef(({className:e,...t},n)=>a.jsx(Rf,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));YG.displayName=Rf.displayName;function $k({className:e,...t}){return a.jsx("div",{className:je("animate-pulse rounded-md bg-muted",e),...t})}const XG="sidebar:state",QG=3600*24*7,JG="16rem",ZG="18rem",eY="3rem",tY="b",q5=m.createContext(null);function If(){const e=m.useContext(q5);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const U5=m.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:o,...i},c)=>{const d=TK(),[f,h]=m.useState(!1),[p,x]=m.useState(e),g=t??p,j=m.useCallback(C=>{const N=typeof C=="function"?C(g):C;n?n(N):x(N),document.cookie=`${XG}=${N}; path=/; max-age=${QG}`},[n,g]),b=m.useCallback(()=>d?h(C=>!C):j(C=>!C),[d,j,h]);m.useEffect(()=>{const C=N=>{N.key===tY&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),b())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[b]);const y=g?"expanded":"collapsed",S=m.useMemo(()=>({state:y,open:g,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:b}),[y,g,j,d,f,h,b]);return a.jsx(q5.Provider,{value:S,children:a.jsx(ai,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":JG,"--sidebar-width-icon":eY,...s},className:je("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...i,children:o})})})});U5.displayName="SidebarProvider";const W5=m.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...o},i)=>{const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=If();return n==="none"?a.jsx("div",{className:je("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:i,...o,children:s}):c?a.jsx(L5,{open:f,onOpenChange:h,...o,children:a.jsx(RN,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":ZG},side:e,children:a.jsx("div",{className:"flex h-full w-full flex-col",children:s})})}):a.jsxs("div",{ref:i,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:je("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:je("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),...o,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})})]})});W5.displayName="Sidebar";const V5=m.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:s}=If();return a.jsxs(se,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:je("h-7 w-7",e),onClick:o=>{t?.(o),s()},...n,children:[a.jsx(M7,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});V5.displayName="SidebarTrigger";const nY=m.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=If();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:je("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})});nY.displayName="SidebarRail";const rY=m.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:je("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}));rY.displayName="SidebarInset";const aY=m.forwardRef(({className:e,...t},n)=>a.jsx(vt,{ref:n,"data-sidebar":"input",className:je("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));aY.displayName="SidebarInput";const H5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:je("flex flex-col gap-2 p-2",e),...t}));H5.displayName="SidebarHeader";const K5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:je("flex flex-col gap-2 p-2",e),...t}));K5.displayName="SidebarFooter";const gS=m.forwardRef(({className:e,...t},n)=>a.jsx(d5,{ref:n,"data-sidebar":"separator",className:je("mx-2 w-auto bg-sidebar-border",e),...t}));gS.displayName="SidebarSeparator";const G5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:je("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));G5.displayName="SidebarContent";const Y5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:je("relative flex w-full min-w-0 flex-col p-2",e),...t}));Y5.displayName="SidebarGroup";const X5=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?di:"div";return a.jsx(s,{ref:r,"data-sidebar":"group-label",className:je("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})});X5.displayName="SidebarGroupLabel";const sY=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?di:"button";return a.jsx(s,{ref:r,"data-sidebar":"group-action",className:je("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})});sY.displayName="SidebarGroupAction";const Q5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:je("w-full text-sm",e),...t}));Q5.displayName="SidebarGroupContent";const J5=m.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:je("flex w-full min-w-0 flex-col gap-1",e),...t}));J5.displayName="SidebarMenu";const Z5=m.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:je("group/menu-item relative",e),...t}));Z5.displayName="SidebarMenuItem";const oY=bl("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"}}),e3=m.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:o,...i},c)=>{const d=e?di:"button",{isMobile:f,state:h}=If(),p=a.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:je(oY({variant:n,size:r}),o),...i});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(si,{children:[a.jsx(oi,{asChild:!0,children:p}),a.jsx(uo,{side:"right",align:"center",hidden:h!=="collapsed"||f,...s})]})):p});e3.displayName="SidebarMenuButton";const iY=m.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const o=t?di:"button";return a.jsx(o,{ref:s,"data-sidebar":"menu-action",className:je("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})});iY.displayName="SidebarMenuAction";const lY=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:je("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}));lY.displayName="SidebarMenuBadge";const cY=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:je("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&a.jsx($k,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),a.jsx($k,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});cY.displayName="SidebarMenuSkeleton";const uY=m.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:je("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}));uY.displayName="SidebarMenuSub";const dY=m.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));dY.displayName="SidebarMenuSubItem";const fY=m.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},o)=>{const i=e?di:"a";return a.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:je("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})});fY.displayName="SidebarMenuSubButton";const t3=m.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...s},o)=>a.jsx(wK,{ref:o,to:r,className:({isActive:i,isPending:c})=>je(e,i&&t,c&&n),...s}));t3.displayName="NavLink";function pY({width:e=24,height:t=24,from:n="#53afba",to:r="#76fffb",...s}){const o=`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:o,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(#${o})`,fillRule:"evenodd"})]})}const hY=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:eD}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:Z$},{title:"Analyze MCP",url:"/tool-analysis",icon:tD},{title:"OAuth Debugger",url:"/oauth-debugger",icon:L7}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:J$},{title:"MCP servers",url:"/libraries/servers",icon:Q$},{title:"Agents",url:"/libraries/agents",icon:kr}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:to},{title:"Evaluation Results",url:"/results",icon:_c},{title:"Compare Evaluations",url:"/compare",icon:cN},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:nD},{title:"Custom Reports",url:"/markdown-reports",icon:dc}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:fN},{title:"MCPLab MCP server",url:"/settings/mcp",icon:Jj}]}];function mY(e={version:null}){const t=e.version??null,{state:n}=If(),r=n==="collapsed",s=Is(),o=m.useMemo(()=>hY,[]);return a.jsxs(W5,{collapsible:"icon",children:[a.jsx(H5,{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(pY,{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(G5,{children:o.map((i,c)=>a.jsxs("div",{children:[c>0&&!r&&a.jsx(gS,{className:"my-1.5"}),a.jsxs(Y5,{className:r?"px-2":"px-3 py-2",children:[!r&&a.jsx(X5,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:i.title}),a.jsx(Q5,{children:a.jsx(J5,{children:i.items.map(d=>a.jsx(Z5,{children:a.jsx(e3,{asChild:!0,isActive:d.url==="/"?s.pathname==="/":d.url==="/settings"?s.pathname==="/settings":s.pathname.startsWith(d.url),tooltip:d.title,children:a.jsxs(t3,{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))})})]})]},i.title))}),a.jsxs(K5,{className:r?"px-2 py-2":"px-3 py-3",children:[a.jsx(gS,{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(k7,{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 n3=m.forwardRef(({...e},t)=>a.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));n3.displayName="Breadcrumb";const r3=m.forwardRef(({className:e,...t},n)=>a.jsx("ol",{ref:n,className:je("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));r3.displayName="BreadcrumbList";const a3=m.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,className:je("inline-flex items-center gap-1.5",e),...t}));a3.displayName="BreadcrumbItem";const s3=m.forwardRef(({asChild:e,className:t,...n},r)=>{const s=e?di:"a";return a.jsx(s,{ref:r,className:je("transition-colors hover:text-foreground",t),...n})});s3.displayName="BreadcrumbLink";const o3=m.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:je("font-normal text-foreground",e),...t}));o3.displayName="BreadcrumbPage";const i3=({children:e,className:t,...n})=>a.jsx("li",{role:"presentation","aria-hidden":"true",className:je("[&>svg]:size-3.5",t),...n,children:e??a.jsx(lN,{})});i3.displayName="BreadcrumbSeparator";function xs(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function oc(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 Qs(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 vY(e){const t=xs();for(const n of e)oc(t,n);return Qs(t)}function gY(e,t){return`${e}-${t+1}`}function xY(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 l3(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 Dk(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 ic(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,o=[],i=[];for(const p of n){if("ref"in p){const y=String(p.ref||"").trim();if(!y)continue;s.set(y,y),i.push({kind:"referenced",ref:y});continue}const x=String(p.id||p.name||"").trim();if(!x)continue;const g=x;s.set(x,g);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",b={id:g,name:String(p.name||x),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};o.push(b),i.push({kind:"inline",server:b})}const c=[],d=[];for(const p of r){if("ref"in p){const y=String(p.ref||"").trim();if(!y)continue;d.push({kind:"referenced",ref:y});continue}const x=String(p.id||p.name||"").trim();if(!x)continue;const g=x,j=p.provider==="azure_openai"?"azure":p.provider,b={id:g,name:String(p.name||x),provider:j,model:p.model,temperature:p.temperature??0,maxTokens:p.max_tokens??2048,maxTurns:p.max_turns,systemPrompt:p.system};c.push(b),d.push({kind:"inline",agent:b})}const f=[],h=[];return e.config.scenarios.forEach((p,x)=>{if("ref"in p){const b=String(p.ref||"").trim();if(!b)return;const y=p.mcp_servers,S=Array.isArray(y)?y.flatMap(C=>{if("ref"in C&&C.ref)return[{kind:"referenced",ref:String(C.ref)}];const N=Dk(C);return N?[{kind:"inline",server:N.server}]:[]}):void 0;h.push({kind:"referenced",ref:b,...S?{mcpServers:S}:{}});return}const g=[];for(const b of p.eval?.tool_constraints?.required_tools??[])g.push({type:"required_tool",value:b});for(const b of p.eval?.tool_constraints?.forbidden_tools??[])g.push({type:"forbidden_tool",value:b});for(const b of p.eval?.response_assertions??[])g.push(xY(b));const j={id:p.id||gY("scn",x),name:p.name||p.id||`Scenario ${x+1}`,serverIds:(()=>{if((p.servers??[]).length>0)return p.servers.map(y=>s.get(y)??y).filter(Boolean);const b=p.mcp_servers;return Array.isArray(b)?b.flatMap(y=>{if("ref"in y&&y.ref)return[String(y.ref)];const S=Dk(y);if(S){const C=S.id;return s.has(C)||(s.set(C,C),o.push(S.server),i.push({kind:"inline",server:o[o.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:g,extractRules:(p.extract??[]).map(b=>({name:b.name,pattern:b.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:o,serverEntries:i,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 yY(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=ic(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function Lk(e){const t=new Map,n=g=>{const j=g.id,b=g.authValue?.trim()??"",y=g.apiKeyHeaderName?.trim()??"",S=g.authType==="bearer"?(()=>{if(!b)throw new Error(`Server '${j}' is missing bearer token value`);return{type:"bearer",token:b}})():g.authType==="api-key"&&!g.oauthTokenUrl?{type:"api_key",...y?{header_name:y}:{},value:(()=>{if(!b)throw new Error(`Server '${j}' is missing API key value`);return b})()}:g.authType==="api-key"?{type:"oauth_client_credentials",token_url:g.oauthTokenUrl||"",client_id_env:g.oauthClientIdEnv||"",client_secret_env:g.oauthClientSecretEnv||"",...g.oauthScope?{scope:g.oauthScope}:{},...g.oauthAudience?{audience:g.oauthAudience}:{}}:g.authType==="oauth2"?{type:"oauth_authorization_code",...g.oauthMode==="dcr"?{mode:"dcr"}:{},...g.oauthMode!=="dcr"&&g.oauthClientId?{client_id:g.oauthClientId}:{},...g.oauthClientSecret?{client_secret:g.oauthClientSecret}:{},...g.oauthRedirectUrl?{redirect_url:g.oauthRedirectUrl}:{},...g.oauthScope?{scope:g.oauthScope}:{},...g.oauthAuthorizationUrl?{authorization_url:g.oauthAuthorizationUrl}:{},...g.oauthTokenEndpoint?{token_url:g.oauthTokenEndpoint}:{}}:void 0;return{id:j,...g.name&&g.name!==j?{name:g.name}:{},transport:"http",url:g.url||"http://localhost:3000/mcp",...S!==void 0?{auth:S}:{}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(g=>({kind:"inline",server:g}))],s=new Set,o=new Map,i=r.flatMap(g=>{if(g.kind==="referenced"){const b=String(g.ref||"").trim();return!b||s.has(b)?[]:(s.add(b),t.set(b,b),[{ref:b}])}const j=n(g.server);return t.set(g.server.id,j.id),o.set(j.id,j),[j]}),c=g=>{const j=g.id;return{id:j,...g.name&&g.name!==j?{name:g.name}:{},provider:g.provider==="azure"?"azure_openai":g.provider==="anthropic"?"anthropic":"openai",model:g.model,temperature:g.temperature,max_tokens:g.maxTokens,max_turns:g.maxTurns,system:g.systemPrompt}},d=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(g=>({kind:"inline",agent:g}))],f=new Set,h=d.flatMap(g=>{if(g.kind==="referenced"){const j=String(g.ref||"").trim();return!j||f.has(j)?[]:(f.add(j),[{ref:j}])}return[c(g.agent)]}),p=g=>{const j=g.evalRules.filter(S=>S.type==="required_tool").map(S=>S.value).filter(S=>typeof S=="string"&&S.length>0),b=g.evalRules.filter(S=>S.type==="forbidden_tool").map(S=>S.value).filter(S=>typeof S=="string"&&S.length>0),y=g.evalRules.map(S=>l3(S)).filter(S=>!!S);return{id:g.id,name:g.name||void 0,mcp_servers:g.serverIds.length>0?g.serverIds.map(S=>{const C=t.get(S)??S;return o.get(C)??{ref:C}}):void 0,prompt:g.prompt,...g.snapshotEval?{snapshot_eval:{enabled:g.snapshotEval.enabled,baseline_snapshot_id:g.snapshotEval.baselineSnapshotId,baseline_source_run_id:g.snapshotEval.baselineSourceRunId,last_updated_at:g.snapshotEval.lastUpdatedAt}}:{},eval:{tool_constraints:{required_tools:j,forbidden_tools:b},response_assertions:y},extract:g.extractRules.map(S=>({name:S.name,from:"final_text",regex:S.pattern}))}},x=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(g=>g.kind==="referenced"?{ref:g.ref,...Array.isArray(g.mcpServers)?{mcp_servers:g.mcpServers.map(j=>j.kind==="referenced"?{ref:j.ref}:n(j.server))}:{}}:p(g.scenario)):[...e.scenarios.map(g=>p(g))];return{name:e.configName?.trim()||void 0,servers:i,agents:h,scenarios:x,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 bY(e){const t=Object.fromEntries((e.servers??[]).map(r=>[r.id,(()=>{const s=r.authValue?.trim()??"",o=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",...o?{header_name:o}:{},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=>({id:r.id,name:r.name||void 0,mcp_servers:r.serverIds.length>0?r.serverIds.map(s=>({ref:s})):void 0,prompt:r.prompt,snapshot_eval:r.snapshotEval?{enabled:r.snapshotEval.enabled,baseline_snapshot_id:r.snapshotEval.baselineSnapshotId,baseline_source_run_id:r.snapshotEval.baselineSourceRunId,last_updated_at:r.snapshotEval.lastUpdatedAt}:void 0,eval:{tool_constraints:{required_tools:r.evalRules.filter(s=>s.type==="required_tool").map(s=>s.value).filter(s=>typeof s=="string"&&s.length>0),forbidden_tools:r.evalRules.filter(s=>s.type==="forbidden_tool").map(s=>s.value).filter(s=>typeof s=="string"&&s.length>0)},response_assertions:r.evalRules.map(s=>l3(s)).filter(s=>!!s)},extract:r.extractRules.map(s=>({name:s.name,from:"final_text",regex:s.pattern}))}))}}function wY(e,t){if(e)return`${e}::${t??""}`}function dh(e){return e.type==="text"}function c3(e,t){if(!t)return e.tool_calls.map((s,o)=>({name:s,arguments:{},duration:e.tool_durations_ms[o]??0,timestamp:new Date().toISOString()}));const n=[],r=new Map;for(const s of t.messages)for(const o of s.content)o.type==="tool_use"?n.push({id:o.id,name:o.name,input:o.input??{},ts:s.ts}):o.type==="tool_result"&&r.set(o.tool_use_id,{durationMs:o.duration_ms,tsEnd:o.ts_end});return n.map((s,o)=>{const i=r.get(s.id);return{name:s.name,arguments:s.input,duration:i?.durationMs??e.tool_durations_ms[o]??0,timestamp:i?.tsEnd??s.ts??new Date().toISOString()}})}function u3(e,t){const n=[];if(!e)return n;let r;const s=e.messages??[];for(let o=0;o<s.length;o+=1){const i=s[o];if(i.role==="user"){const c=i.content.filter(dh);for(const d of c)n.push({id:`user_prompt-${n.length}`,kind:"user_prompt",text:d.text,timestamp:i.ts});continue}if(i.role==="assistant"){const c=i.content.filter(h=>h.type==="tool_use");for(const h of i.content)h.type==="text"&&(n.push({id:`assistant_thought-${n.length}`,kind:"assistant_thought",text:h.text,timestamp:i.ts}),r=n.length-1);const d=s[o+1],f=d?.role==="tool";if(c.length>0&&f){const h=new Map,p=[];for(const x of d.content)x.type==="tool_result"&&(x.tool_use_id?h.set(x.tool_use_id,x):p.push(x));for(const x of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:Fk(x.input??{}),toolName:x.name,timestamp:i.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});const g=h.get(x.id);if(!g)continue;const j=g.content.filter(dh).map(b=>b.text).join(`
|
|
54
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:j,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}),h.delete(x.id)}for(const x of[...h.values(),...p]){const g=x.content.filter(dh).map(j=>j.text).join(`
|
|
55
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:g,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})}o+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:Fk(h.input??{}),toolName:h.name,timestamp:i.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(i.role==="tool")for(const c of i.content){if(c.type!=="tool_result")continue;const d=c.content.filter(dh).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??i.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 Fk(e){try{return JSON.stringify(e)}catch{return String(e)}}function zk(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 Ty(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,o)=>n+(o<r?1:0))}function d3(e){const t=xs(),n=xs(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(const o of e.messages??[]){if(o.role!=="assistant")continue;zk(t,o.usage);const i=o.content.filter(p=>p.type==="tool_use");if(i.length===0)continue;if(i.every(p=>!!p.estimated_tokens)){for(const p of i){const x=p.estimated_tokens;n.input+=x.input,n.hasInput=!0,n.output+=x.output,n.hasOutput=!0,n.total+=x.total,n.hasTotal=!0;const g=r.get(p.name)??xs();g.input+=x.input,g.hasInput=!0,g.output+=x.output,g.hasOutput=!0,g.total+=x.total,g.hasTotal=!0,r.set(p.name,g)}continue}zk(n,o.usage);const d=Ty(o.usage?.input_tokens,i.length),f=Ty(o.usage?.output_tokens,i.length),h=Ty(o.usage?.total_tokens,i.length);for(let p=0;p<i.length;p+=1){const x=i[p].name,g=r.get(x)??xs(),j=d[p],b=f[p],y=h[p];typeof j=="number"&&(g.input+=j,g.hasInput=!0),typeof b=="number"&&(g.output+=b,g.hasOutput=!0),typeof y=="number"&&(g.total+=y,g.hasTotal=!0),r.set(x,g)}}const s={};for(const[o,i]of Array.from(r.entries()).sort((c,d)=>c[0].localeCompare(d[0]))){const c=Qs(i);c&&(s[o]=c)}return{assistant:Qs(t),tool:Qs(n),perTool:s}}function Bk(e,t=[]){const n=new Map;for(const i of t){const c=wY(i.scenario_id,i.agent);if(!c)continue;const d=n.get(c)??[];d.push(i),n.set(c,d)}const r=e.scenarios.map(i=>{const c=n.get(`${i.scenario_id}::${i.agent}`)??[],d=new Map;for(const y of c)d.set(y.run_index,y);const f=i.runs.map((y,S)=>{const C=d.get(y.run_index)??c[S],N=d3(C);return{runIndex:y.run_index,passed:y.pass,toolCalls:c3(y,C),assistantTokenUsage:N.assistant,toolTokenUsage:N.tool,toolTokenUsageByTool:N.perTool,finalAnswer:y.final_text,conversation:u3(C),duration:y.tool_durations_ms.reduce((E,A)=>E+A,0),extractedValues:Object.fromEntries(Object.entries(y.extracted).map(([E,A])=>[E,String(A??"")])),failureReasons:y.failures}}),h=xs(),p=xs(),x=new Map;for(const y of f){oc(h,y.assistantTokenUsage),oc(p,y.toolTokenUsage);for(const[S,C]of Object.entries(y.toolTokenUsageByTool??{})){const N=x.get(S)??xs();oc(N,C),x.set(S,N)}}const g={};for(const[y,S]of Array.from(x.entries()).sort((C,N)=>C[0].localeCompare(N[0]))){const C=Qs(S);C&&(g[y]=C)}const j=f.length===0?0:Math.round(f.reduce((y,S)=>y+S.duration,0)/f.length),b=f.length===0?0:f.reduce((y,S)=>y+S.toolCalls.length,0)/f.length;return{scenarioId:i.scenario_id,scenarioName:i.scenario_name||i.scenario_id,agentId:i.agent,agentName:i.agent,provider:i.provider,model:i.model,runs:f,passRate:i.pass_rate,avgToolCalls:b,avgDuration:j,assistantTokenUsage:Qs(h),toolTokenUsage:Qs(p),toolTokenUsageByTool:g}}),s=xs(),o=xs();for(const i of r)oc(s,i.assistantTokenUsage),oc(o,i.toolTokenUsage);return{id:e.metadata.run_id,configId:"",configHash:e.metadata.config_hash,timestamp:e.metadata.timestamp,runNote:e.metadata.run_note,mcpServerVersions:e.metadata.mcp_server_versions??{},scenarios:r,assistantTokenUsage:Qs(s),toolTokenUsage:Qs(o),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 jY(e,t){const n=d3(t??void 0);return{runIndex:e.run_index,passed:e.pass,toolCalls:c3(e,t??void 0),assistantTokenUsage:n.assistant,toolTokenUsage:n.tool,toolTokenUsageByTool:n.perTool,finalAnswer:e.final_text,conversation:u3(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 SY(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const Ki=SY();class IN extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function lt(e,t){const n=await fetch(`${Ki}${e}`,{...t,headers:{"content-type":"application/json",...t?.headers||{}}});if(!n.ok){const r=await n.text();throw new IN(n.status,`Request failed (${n.status}): ${r}`)}return await n.json()}async function NY(e,t){const n=await fetch(`${Ki}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new IN(n.status,`Request failed (${n.status}): ${r}`)}return n.text()}function qk(e,t){const n=new EventSource(`${Ki}${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 o=!1;const i=()=>{o||(o=!0,n.close())},c=d=>{if(!o&&!(typeof d.data!="string"||!d.data))try{const f=JSON.parse(d.data);f.type==="session_finished"&&i(),t(f)}catch{}};for(const d of s)n.addEventListener(d,c);return n.onerror=()=>{if(!o){if(n.readyState===2){i();return}fetch(`${Ki}${r}`,{method:"GET",cache:"no-store",headers:{accept:"application/json"}}).then(d=>{(d.status===404||d.status===410)&&i()}).catch(()=>{})}},()=>i()}const Je={health:()=>lt("/api/health"),getSettings:()=>lt("/api/settings"),updateSettings:e=>lt("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>lt("/api/evals"),createConfig:(e,t)=>lt("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>lt(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>lt(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>lt("/api/runs"),listMarkdownReports:()=>lt("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>lt(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>lt(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>lt(`/api/runs/${e}`),deleteRun:e=>lt(`/api/runs/${e}`,{method:"DELETE"}),updateRunNote:(e,t)=>lt(`/api/runs/${encodeURIComponent(e)}/note`,{method:"PATCH",body:JSON.stringify({runNote:t??""})}).then(()=>{}),getRunTrace:e=>lt(`/api/runs/${e}/trace`),listSnapshots:()=>lt("/api/snapshots"),createSnapshotFromRun:(e,t)=>lt("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>lt(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>lt(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),applyResultAssistantReport:e=>lt(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>lt("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getResultAssistantSession:e=>lt(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>lt(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>lt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>lt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>lt(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),subscribeResultAssistantSessionEvents:(e,t)=>qk(`/api/result-assistant/sessions/${e}/events`,t),generateSnapshotEvalBaseline:(e,t,n)=>lt("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>lt(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>lt("/api/libraries"),saveLibraries:e=>lt("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>lt("/api/runs",{method:"POST",body:JSON.stringify(e)}),runScenarioPreview:e=>lt("/api/runs/preview",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>lt(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>lt("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>lt(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>lt(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>lt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>lt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>lt(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>lt(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),subscribeScenarioAssistantSessionEvents:(e,t)=>qk(`/api/scenario-assistant/sessions/${e}/events`,t),discoverToolsForAnalysis:e=>lt("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>lt("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>lt(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>lt(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${Ki}/api/tool-analysis/jobs/${e}/events`);let r=!1;const s=()=>{r||(r=!0,n.close())},o=i=>{if(!r&&!(typeof i.data!="string"||!i.data))try{const c=JSON.parse(i.data);t(c),(c.type==="completed"||c.type==="error")&&s()}catch{}};return n.addEventListener("started",o),n.addEventListener("log",o),n.addEventListener("completed",o),n.addEventListener("error",o),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),s())},()=>s()},listToolAnalysisResults:()=>lt("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>lt(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>lt(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>lt("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>lt(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>lt(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${Ki}/api/oauth-debugger/sessions/${e}/events`);let r=!1;const s=()=>{r||(r=!0,n.close())},o=i=>{if(!r&&!(typeof i.data!="string"||!i.data))try{const c=JSON.parse(i.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(i=>n.addEventListener(i,o)),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),s())},()=>s()},submitOAuthDebuggerManualCallback:(e,t)=>lt(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>lt(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?lt(`/api/oauth-debugger/sessions/${e}/export?format=json`):NY(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),createOAuthRuntimeSession:e=>lt("/api/oauth-runtime/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthRuntimeSession:e=>lt(`/api/oauth-runtime/sessions/${e}`),getOAuthRuntimeSessionToken:e=>lt(`/api/oauth-runtime/sessions/${e}/token`),submitOAuthRuntimeCallback:(e,t)=>lt(`/api/oauth-runtime/sessions/${e}/callback`,{method:"POST",body:JSON.stringify(t)}),cancelOAuthRuntimeSession:e=>lt(`/api/oauth-runtime/sessions/${e}/cancel`,{method:"POST",body:JSON.stringify({})}),ensureOAuthServers:e=>lt("/api/oauth-runtime/servers/ensure",{method:"POST",body:JSON.stringify(e)}),stopRun:e=>lt(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>lt("/api/runs/queue"),removeQueuedRun:e=>lt(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),resumeQueue:()=>lt("/api/runs/queue/resume",{method:"POST"}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${Ki}/api/runs/jobs/${e}/events`);let r=!1;const s=()=>{r||(r=!0,n.close())},o=i=>{if(!r&&!(typeof i.data!="string"||!i.data))try{const c=JSON.parse(i.data);t(c),(c.type==="completed"||c.type==="error")&&s()}catch{}};return n.addEventListener("queued",o),n.addEventListener("started",o),n.addEventListener("log",o),n.addEventListener("completed",o),n.addEventListener("error",o),n.addEventListener("oauth_required",o),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),s())},()=>{s()}}};function CY(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 _Y(e){return e||`config-${Date.now()}`}const AY={async health(){return Je.health()},async listConfigs(){return(await Je.listConfigs()).map(ic)},async createConfig(e){const t=await Je.createConfig(CY(e),Lk(e));return ic(t)},async updateConfig(e){const t=await Je.updateConfig(e.id,Lk(e),_Y(e.name));return ic(t)},async deleteConfig(e){await Je.deleteConfig(e)},async listResults(){const t=(await Je.listRuns()).map(async n=>{const[{results:r},s]=await Promise.all([Je.getRun(n.runId),Je.getRunTrace(n.runId)]);return Bk(r,s.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([Je.getRun(e),Je.getRunTrace(e)]);return Bk(t,n.records)}catch{return}},async deleteResult(e){await Je.deleteRun(e)},async updateRunNote(e,t){await Je.updateRunNote(e,t)},async listMarkdownReports(){return Je.listMarkdownReports()},async getMarkdownReport(e){return Je.getMarkdownReport(e)},async deleteMarkdownReport(e){await Je.deleteMarkdownReport(e)},async startRun(e){return Je.startRun(e)},async runScenarioPreview(e){const t=await Je.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:jY(n,t.scenario.traceRecord)}},async stopRun(e){await Je.stopRun(e)},async getRunQueue(){return Je.getRunQueue()},async removeQueuedRun(e){await Je.removeQueuedRun(e)},async resumeQueue(){return Je.resumeQueue()},subscribeRunJob(e,t){return Je.subscribeRunJob(e,t)},async listSnapshots(){return Je.listSnapshots()},async createSnapshotFromRun(e,t){return Je.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await Je.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return Je.compareSnapshot(e,t)},async applyResultAssistantReport(e){return Je.applyResultAssistantReport(e)},async createResultAssistantSession(e){return Je.createResultAssistantSession(e)},async getResultAssistantSession(e){return Je.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return Je.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return Je.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return Je.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await Je.closeResultAssistantSession(e)},subscribeResultAssistantSessionEvents(e,t){return Je.subscribeResultAssistantSessionEvents(e,t)},async generateSnapshotEvalBaseline(e,t,n){const r=await Je.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:ic(r.config)}},async updateSnapshotPolicy(e,t){const n=await Je.updateSnapshotPolicy(e,t);return ic(n)},async getLibraries(){const e=await Je.getLibraries();return yY(e)},async saveLibraries(e){await Je.saveLibraries(bY(e))},async listProviderModels(e){return Je.listProviderModels(e)},async getWorkspaceSettings(){return Je.getSettings()},async updateWorkspaceSettings(e){return Je.updateSettings(e)},async createScenarioAssistantSession(e){return Je.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return Je.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return Je.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return Je.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return Je.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return Je.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await Je.closeScenarioAssistantSession(e)},subscribeScenarioAssistantSessionEvents(e,t){return Je.subscribeScenarioAssistantSessionEvents(e,t)},async discoverToolsForAnalysis(e){return Je.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return Je.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return Je.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return Je.getToolAnalysisResult(e)},async stopToolAnalysis(e){return Je.stopToolAnalysis(e)},async listToolAnalysisResults(){return Je.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return Je.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await Je.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return Je.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return Je.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return Je.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return Je.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return Je.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return Je.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return Je.exportOAuthDebuggerSession(e,t)},async createOAuthRuntimeSession(e){return Je.createOAuthRuntimeSession(e)},async getOAuthRuntimeSession(e){return Je.getOAuthRuntimeSession(e)},async getOAuthRuntimeSessionToken(e){return Je.getOAuthRuntimeSessionToken(e)},async submitOAuthRuntimeCallback(e,t){return Je.submitOAuthRuntimeCallback(e,t)},async cancelOAuthRuntimeSession(e){return Je.cancelOAuthRuntimeSession(e)},async ensureOAuthServers(e){return Je.ensureOAuthServers(e)}},f3=m.createContext(null);function EY({children:e}){const t="workspace",[n,r]=m.useState("checking"),[s,o]=m.useState(null);m.useEffect(()=>{r("checking"),Je.health().then(c=>{r("connected"),o(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),o(null)})},[t]);const i=m.useMemo(()=>AY,[]);return a.jsx(f3.Provider,{value:{mode:t,connection:n,version:s,source:i},children:e})}function Dn(){const e=m.useContext(f3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const kY=(e,t)=>{if(e==="/")return[{label:"Dashboard"}];const n=[{label:"Dashboard",to:"/"}];if(cn("/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(cn("/mcp-evaluations/:id",e))return n.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),n;if(cn("/mcp-evaluations",e))return n.push({label:"MCP Evaluations"}),n;if(cn("/settings/mcp",e))return n.push({label:"Settings",to:"/settings"},{label:"MCP Connection"}),n;if(cn("/settings",e))return n.push({label:"Settings"}),n;if(cn("/tool-analysis",e))return n.push({label:"Analyze MCP Tools"}),n;if(cn("/tool-analysis-results/:id",e)){const r=cn("/tool-analysis-results/:id",e);return n.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:r?.params.id??"Report"}),n}if(cn("/tool-analysis-results",e))return n.push({label:"Tool Analysis Results"}),n;if(cn("/markdown-reports/view",e))return n.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),n;if(cn("/markdown-reports",e))return n.push({label:"Markdown Reports"}),n;if(cn("/oauth-debugger",e))return n.push({label:"OAuth Debugger"}),n;if(cn("/results/:id",e))return n.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),n;if(cn("/results",e))return n.push({label:"Evaluation Results"}),n;if(cn("/run",e))return n.push({label:"Run Evaluation"}),n;if(cn("/libraries/servers/:serverId",e)){const r=cn("/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(cn("/libraries/servers",e))return n.push({label:"Libraries",to:"/libraries/servers"},{label:"MCP servers"}),n;if(cn("/libraries/agents/:agentName",e)){const r=cn("/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(cn("/libraries/agents",e))return n.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),n;if(cn("/libraries/test-cases/:testCaseId",e)){const r=cn("/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(cn("/libraries/test-cases",e))return n.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),n;if(cn("/compare/results",e))return n.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),n;if(cn("/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 PY(){const e=Is(),t=new URLSearchParams(e.search).get("embed")==="1",n=kY(e.pathname,e.search),{connection:r,version:s}=Dn();return t?a.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:a.jsx(jk,{})}):a.jsx(U5,{children:a.jsxs("div",{className:"flex min-h-screen w-full",children:[a.jsx(mY,{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(V5,{}),a.jsx(n3,{children:a.jsx(r3,{children:n.map((o,i)=>{const c=i===n.length-1;return a.jsxs(m.Fragment,{children:[a.jsx(a3,{children:o.to&&!c?a.jsx(s3,{asChild:!0,children:a.jsx(_t,{to:o.to,children:o.label})}):a.jsx(o3,{children:o.label})}),!c&&a.jsx(i3,{})]},`${o.label}-${i}`)})})}),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(jk,{})})]})]})})}const p3=m.createContext(null);function OY({children:e}){const{source:t}=Dn(),[n,r]=m.useState([]),[s,o]=m.useState(!0),i=m.useCallback(async()=>{o(!0);try{const x=await t.listConfigs();r(x)}finally{o(!1)}},[t]);m.useEffect(()=>{i()},[i]);const c=m.useCallback(x=>n.find(g=>g.id===x),[n]),d=m.useCallback(async x=>{const g=await t.createConfig(x);return r(j=>[...j,g]),g},[t]),f=m.useCallback(async(x,g)=>{const j=await t.updateConfig({...g,id:x});return r(b=>b.map(y=>y.id===x?j:y)),j},[t]),h=m.useCallback(async x=>{await t.deleteConfig(x),r(g=>g.filter(j=>j.id!==x))},[t]),p=m.useCallback(async x=>{const g=n.find(y=>y.id===x);if(!g)throw new Error("Config not found");const j={...structuredClone(g),id:`cfg-${Date.now()}`,name:`${g.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},b=await t.createConfig(j);return r(y=>[...y,b]),b},[n,t]);return a.jsx(p3.Provider,{value:{configs:n,loading:s,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:i},children:e})}function Mf(){const e=m.useContext(p3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const h3=m.createContext(null);function TY({children:e}){const{source:t}=Dn(),[n,r]=m.useState({servers:[],agents:[],scenarios:[]}),[s,o]=m.useState(!0),i=m.useCallback(async()=>{o(!0);try{const f=await t.getLibraries();r(f)}finally{o(!1)}},[t]);m.useEffect(()=>{i()},[t]),m.useEffect(()=>{const f=()=>{i()};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:i}),[n,s,i,c]);return a.jsx(h3.Provider,{value:d,children:e})}function rs(){const e=m.useContext(h3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const Ve=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:je("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ve.displayName="Card";const kt=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:je("flex flex-col space-y-1.5 p-6",e),...t}));kt.displayName="CardHeader";const Pt=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:je("text-2xl font-semibold leading-none tracking-tight",e),...t}));Pt.displayName="CardTitle";const Br=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:je("text-sm text-muted-foreground",e),...t}));Br.displayName="CardDescription";const He=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:je("p-6 pt-0",e),...t}));He.displayName="CardContent";const RY=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:je("flex items-center p-6 pt-0",e),...t}));RY.displayName="CardFooter";const qr=m.forwardRef(({className:e,containerClassName:t,...n},r)=>a.jsx("div",{className:je("relative w-full overflow-auto",t),children:a.jsx("table",{ref:r,className:je("w-full caption-bottom text-sm",e),...n})}));qr.displayName="Table";const Ur=m.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:je("[&_tr]:border-b",e),...t}));Ur.displayName="TableHeader";const Wr=m.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:je("[&_tr:last-child]:border-0",e),...t}));Wr.displayName="TableBody";const IY=m.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:je("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));IY.displayName="TableFooter";const Gt=m.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:je("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Gt.displayName="TableRow";const at=m.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:je("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));at.displayName="TableHead";const Ue=m.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:je("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ue.displayName="TableCell";const MY=m.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:je("mt-4 text-sm text-muted-foreground",e),...t}));MY.displayName="TableCaption";function vs({title:e,value:t,subtitle:n,icon:r,trend:s}){return a.jsx(Ve,{children:a.jsx(He,{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 $Y=bl("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"}}),We=m.forwardRef(({className:e,variant:t,asChild:n,...r},s)=>{const o=n?di:"div";return a.jsx(o,{ref:s,className:je($Y({variant:t}),e),...r})});We.displayName="Badge";function Js({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return a.jsxs(We,{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 Ry,Uk;function Gr(){if(Uk)return Ry;Uk=1;var e=Array.isArray;return Ry=e,Ry}var Iy,Wk;function m3(){if(Wk)return Iy;Wk=1;var e=typeof eh=="object"&&eh&&eh.Object===Object&&eh;return Iy=e,Iy}var My,Vk;function Ms(){if(Vk)return My;Vk=1;var e=m3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return My=n,My}var $y,Hk;function $f(){if(Hk)return $y;Hk=1;var e=Ms(),t=e.Symbol;return $y=t,$y}var Dy,Kk;function DY(){if(Kk)return Dy;Kk=1;var e=$f(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function o(i){var c=n.call(i,s),d=i[s];try{i[s]=void 0;var f=!0}catch{}var h=r.call(i);return f&&(c?i[s]=d:delete i[s]),h}return Dy=o,Dy}var Ly,Gk;function LY(){if(Gk)return Ly;Gk=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Ly=n,Ly}var Fy,Yk;function xo(){if(Yk)return Fy;Yk=1;var e=$f(),t=DY(),n=LY(),r="[object Null]",s="[object Undefined]",o=e?e.toStringTag:void 0;function i(c){return c==null?c===void 0?s:r:o&&o in Object(c)?t(c):n(c)}return Fy=i,Fy}var zy,Xk;function yo(){if(Xk)return zy;Xk=1;function e(t){return t!=null&&typeof t=="object"}return zy=e,zy}var By,Qk;function mu(){if(Qk)return By;Qk=1;var e=xo(),t=yo(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return By=r,By}var qy,Jk;function MN(){if(Jk)return qy;Jk=1;var e=Gr(),t=mu(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(o,i){if(e(o))return!1;var c=typeof o;return c=="number"||c=="symbol"||c=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||i!=null&&o in Object(i)}return qy=s,qy}var Uy,Zk;function fi(){if(Zk)return Uy;Zk=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Uy=e,Uy}var Wy,eP;function $N(){if(eP)return Wy;eP=1;var e=xo(),t=fi(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",o="[object Proxy]";function i(c){if(!t(c))return!1;var d=e(c);return d==r||d==s||d==n||d==o}return Wy=i,Wy}var Vy,tP;function FY(){if(tP)return Vy;tP=1;var e=Ms(),t=e["__core-js_shared__"];return Vy=t,Vy}var Hy,nP;function zY(){if(nP)return Hy;nP=1;var e=FY(),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 Hy=n,Hy}var Ky,rP;function v3(){if(rP)return Ky;rP=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 Ky=n,Ky}var Gy,aP;function BY(){if(aP)return Gy;aP=1;var e=$N(),t=zY(),n=fi(),r=v3(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,i=Function.prototype,c=Object.prototype,d=i.toString,f=c.hasOwnProperty,h=RegExp("^"+d.call(f).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(x){if(!n(x)||t(x))return!1;var g=e(x)?h:o;return g.test(r(x))}return Gy=p,Gy}var Yy,sP;function qY(){if(sP)return Yy;sP=1;function e(t,n){return t?.[n]}return Yy=e,Yy}var Xy,oP;function jl(){if(oP)return Xy;oP=1;var e=BY(),t=qY();function n(r,s){var o=t(r,s);return e(o)?o:void 0}return Xy=n,Xy}var Qy,iP;function kv(){if(iP)return Qy;iP=1;var e=jl(),t=e(Object,"create");return Qy=t,Qy}var Jy,lP;function UY(){if(lP)return Jy;lP=1;var e=kv();function t(){this.__data__=e?e(null):{},this.size=0}return Jy=t,Jy}var Zy,cP;function WY(){if(cP)return Zy;cP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Zy=e,Zy}var eb,uP;function VY(){if(uP)return eb;uP=1;var e=kv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(o){var i=this.__data__;if(e){var c=i[o];return c===t?void 0:c}return r.call(i,o)?i[o]:void 0}return eb=s,eb}var tb,dP;function HY(){if(dP)return tb;dP=1;var e=kv(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var o=this.__data__;return e?o[s]!==void 0:n.call(o,s)}return tb=r,tb}var nb,fP;function KY(){if(fP)return nb;fP=1;var e=kv(),t="__lodash_hash_undefined__";function n(r,s){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&s===void 0?t:s,this}return nb=n,nb}var rb,pP;function GY(){if(pP)return rb;pP=1;var e=UY(),t=WY(),n=VY(),r=HY(),s=KY();function o(i){var c=-1,d=i==null?0:i.length;for(this.clear();++c<d;){var f=i[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,rb=o,rb}var ab,hP;function YY(){if(hP)return ab;hP=1;function e(){this.__data__=[],this.size=0}return ab=e,ab}var sb,mP;function DN(){if(mP)return sb;mP=1;function e(t,n){return t===n||t!==t&&n!==n}return sb=e,sb}var ob,vP;function Pv(){if(vP)return ob;vP=1;var e=DN();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return ob=t,ob}var ib,gP;function XY(){if(gP)return ib;gP=1;var e=Pv(),t=Array.prototype,n=t.splice;function r(s){var o=this.__data__,i=e(o,s);if(i<0)return!1;var c=o.length-1;return i==c?o.pop():n.call(o,i,1),--this.size,!0}return ib=r,ib}var lb,xP;function QY(){if(xP)return lb;xP=1;var e=Pv();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return lb=t,lb}var cb,yP;function JY(){if(yP)return cb;yP=1;var e=Pv();function t(n){return e(this.__data__,n)>-1}return cb=t,cb}var ub,bP;function ZY(){if(bP)return ub;bP=1;var e=Pv();function t(n,r){var s=this.__data__,o=e(s,n);return o<0?(++this.size,s.push([n,r])):s[o][1]=r,this}return ub=t,ub}var db,wP;function Ov(){if(wP)return db;wP=1;var e=YY(),t=XY(),n=QY(),r=JY(),s=ZY();function o(i){var c=-1,d=i==null?0:i.length;for(this.clear();++c<d;){var f=i[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,db=o,db}var fb,jP;function LN(){if(jP)return fb;jP=1;var e=jl(),t=Ms(),n=e(t,"Map");return fb=n,fb}var pb,SP;function eX(){if(SP)return pb;SP=1;var e=GY(),t=Ov(),n=LN();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return pb=r,pb}var hb,NP;function tX(){if(NP)return hb;NP=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return hb=e,hb}var mb,CP;function Tv(){if(CP)return mb;CP=1;var e=tX();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return mb=t,mb}var vb,_P;function nX(){if(_P)return vb;_P=1;var e=Tv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return vb=t,vb}var gb,AP;function rX(){if(AP)return gb;AP=1;var e=Tv();function t(n){return e(this,n).get(n)}return gb=t,gb}var xb,EP;function aX(){if(EP)return xb;EP=1;var e=Tv();function t(n){return e(this,n).has(n)}return xb=t,xb}var yb,kP;function sX(){if(kP)return yb;kP=1;var e=Tv();function t(n,r){var s=e(this,n),o=s.size;return s.set(n,r),this.size+=s.size==o?0:1,this}return yb=t,yb}var bb,PP;function FN(){if(PP)return bb;PP=1;var e=eX(),t=nX(),n=rX(),r=aX(),s=sX();function o(i){var c=-1,d=i==null?0:i.length;for(this.clear();++c<d;){var f=i[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=s,bb=o,bb}var wb,OP;function g3(){if(OP)return wb;OP=1;var e=FN(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var o=function(){var i=arguments,c=s?s.apply(this,i):i[0],d=o.cache;if(d.has(c))return d.get(c);var f=r.apply(this,i);return o.cache=d.set(c,f)||d,f};return o.cache=new(n.Cache||e),o}return n.Cache=e,wb=n,wb}var jb,TP;function oX(){if(TP)return jb;TP=1;var e=g3(),t=500;function n(r){var s=e(r,function(i){return o.size===t&&o.clear(),i}),o=s.cache;return s}return jb=n,jb}var Sb,RP;function iX(){if(RP)return Sb;RP=1;var e=oX(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(t,function(i,c,d,f){o.push(d?f.replace(n,"$1"):c||i)}),o});return Sb=r,Sb}var Nb,IP;function zN(){if(IP)return Nb;IP=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,o=Array(s);++r<s;)o[r]=n(t[r],r,t);return o}return Nb=e,Nb}var Cb,MP;function lX(){if(MP)return Cb;MP=1;var e=$f(),t=zN(),n=Gr(),r=mu(),s=e?e.prototype:void 0,o=s?s.toString:void 0;function i(c){if(typeof c=="string")return c;if(n(c))return t(c,i)+"";if(r(c))return o?o.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return Cb=i,Cb}var _b,$P;function x3(){if($P)return _b;$P=1;var e=lX();function t(n){return n==null?"":e(n)}return _b=t,_b}var Ab,DP;function y3(){if(DP)return Ab;DP=1;var e=Gr(),t=MN(),n=iX(),r=x3();function s(o,i){return e(o)?o:t(o,i)?[o]:n(r(o))}return Ab=s,Ab}var Eb,LP;function Rv(){if(LP)return Eb;LP=1;var e=mu();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Eb=t,Eb}var kb,FP;function BN(){if(FP)return kb;FP=1;var e=y3(),t=Rv();function n(r,s){s=e(s,r);for(var o=0,i=s.length;r!=null&&o<i;)r=r[t(s[o++])];return o&&o==i?r:void 0}return kb=n,kb}var Pb,zP;function b3(){if(zP)return Pb;zP=1;var e=BN();function t(n,r,s){var o=n==null?void 0:e(n,r);return o===void 0?s:o}return Pb=t,Pb}var cX=b3();const fa=un(cX);var Ob,BP;function uX(){if(BP)return Ob;BP=1;function e(t){return t==null}return Ob=e,Ob}var dX=uX();const Mt=un(dX);var Tb,qP;function fX(){if(qP)return Tb;qP=1;var e=xo(),t=Gr(),n=yo(),r="[object String]";function s(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return Tb=s,Tb}var pX=fX();const rl=un(pX);var hX=$N();const It=un(hX);var mX=fi();const vu=un(mX);var Rb={exports:{}},an={};var UP;function vX(){if(UP)return an;UP=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"),o=Symbol.for("react.provider"),i=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"),x=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function b(y){if(typeof y=="object"&&y!==null){var S=y.$$typeof;switch(S){case e:switch(y=y.type,y){case n:case s:case r:case f:case h:return y;default:switch(y=y&&y.$$typeof,y){case c:case i:case d:case x:case p:case o:return y;default:return S}}case t:return S}}}return an.ContextConsumer=i,an.ContextProvider=o,an.Element=e,an.ForwardRef=d,an.Fragment=n,an.Lazy=x,an.Memo=p,an.Portal=t,an.Profiler=s,an.StrictMode=r,an.Suspense=f,an.SuspenseList=h,an.isAsyncMode=function(){return!1},an.isConcurrentMode=function(){return!1},an.isContextConsumer=function(y){return b(y)===i},an.isContextProvider=function(y){return b(y)===o},an.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},an.isForwardRef=function(y){return b(y)===d},an.isFragment=function(y){return b(y)===n},an.isLazy=function(y){return b(y)===x},an.isMemo=function(y){return b(y)===p},an.isPortal=function(y){return b(y)===t},an.isProfiler=function(y){return b(y)===s},an.isStrictMode=function(y){return b(y)===r},an.isSuspense=function(y){return b(y)===f},an.isSuspenseList=function(y){return b(y)===h},an.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===s||y===r||y===f||y===h||y===g||typeof y=="object"&&y!==null&&(y.$$typeof===x||y.$$typeof===p||y.$$typeof===o||y.$$typeof===i||y.$$typeof===d||y.$$typeof===j||y.getModuleId!==void 0)},an.typeOf=b,an}var WP;function gX(){return WP||(WP=1,Rb.exports=vX()),Rb.exports}var xX=gX(),Ib,VP;function w3(){if(VP)return Ib;VP=1;var e=xo(),t=yo(),n="[object Number]";function r(s){return typeof s=="number"||t(s)&&e(s)==n}return Ib=r,Ib}var Mb,HP;function yX(){if(HP)return Mb;HP=1;var e=w3();function t(n){return e(n)&&n!=+n}return Mb=t,Mb}var bX=yX();const Df=un(bX);var wX=w3();const jX=un(wX);var _r=function(t){return t===0?0:t>0?1:-1},Ui=function(t){return rl(t)&&t.indexOf("%")===t.length-1},Ge=function(t){return jX(t)&&!Df(t)},SX=function(t){return Mt(t)},tr=function(t){return Ge(t)||rl(t)},NX=0,gu=function(t){var n=++NX;return"".concat(t||"").concat(n)},Ar=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(!Ge(t)&&!rl(t))return r;var o;if(Ui(t)){var i=t.indexOf("%");o=n*parseFloat(t.slice(0,i))/100}else o=+t;return Df(o)&&(o=r),s&&o>n&&(o=n),o},lc=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},CX=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},la=function(t,n){return Ge(t)&&Ge(n)?function(r){return t+r*(n-t)}:function(){return n}};function Hh(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):fa(r,t))===n})}var _X=function(t,n){return Ge(t)&&Ge(n)?t-n:rl(t)&&rl(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function jc(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 xS(e){"@babel/helpers - typeof";return xS=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},xS(e)}var AX=["viewBox","children"],EX=["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"],KP=["points","pathLength"],$b={svg:AX,polygon:KP,polyline:KP},qN=["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"],Kh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(m.isValidElement(t)&&(r=t.props),!vu(r))return null;var s={};return Object.keys(r).forEach(function(o){qN.includes(o)&&(s[o]=n||function(i){return r[o](r,i)})}),s},kX=function(t,n,r){return function(s){return t(n,r,s),null}},al=function(t,n,r){if(!vu(t)||xS(t)!=="object")return null;var s=null;return Object.keys(t).forEach(function(o){var i=t[o];qN.includes(o)&&typeof i=="function"&&(s||(s={}),s[o]=kX(i,n,r))}),s},PX=["children"],OX=["children"];function GP(e,t){if(e==null)return{};var n=TX(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TX(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 yS(e){"@babel/helpers - typeof";return yS=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},yS(e)}var YP={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"},no=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},XP=null,Db=null,UN=function e(t){if(t===XP&&Array.isArray(Db))return Db;var n=[];return m.Children.forEach(t,function(r){Mt(r)||(xX.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Db=n,XP=t,n};function pa(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return no(s)}):r=[no(t)],UN(e).forEach(function(s){var o=fa(s,"type.displayName")||fa(s,"type.name");r.indexOf(o)!==-1&&n.push(s)}),n}function oa(e,t){var n=pa(e,t);return n&&n[0]}var QP=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!Ge(r)||r<=0||!Ge(s)||s<=0)},RX=["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"],IX=function(t){return t&&t.type&&rl(t.type)&&RX.indexOf(t.type)>=0},MX=function(t){return t&&yS(t)==="object"&&"clipDot"in t},$X=function(t,n,r,s){var o,i=(o=$b?.[s])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!It(t)&&(s&&i.includes(n)||EX.includes(n))||r&&qN.includes(n)},St=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(m.isValidElement(t)&&(s=t.props),!vu(s))return null;var o={};return Object.keys(s).forEach(function(i){var c;$X((c=s)===null||c===void 0?void 0:c[i],i,n,r)&&(o[i]=s[i])}),o},bS=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 JP(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var s=0;s<r;s++){var o=t[s],i=n[s];if(Array.isArray(o)||Array.isArray(i)){if(!e(o,i))return!1}else if(!JP(o,i))return!1}return!0},JP=function(t,n){if(Mt(t)&&Mt(n))return!0;if(!Mt(t)&&!Mt(n)){var r=t.props||{},s=r.children,o=GP(r,PX),i=n.props||{},c=i.children,d=GP(i,OX);return s&&c?jc(o,d)&&bS(s,c):!s&&!c?jc(o,d):!1}return!1},ZP=function(t,n){var r=[],s={};return UN(t).forEach(function(o,i){if(IX(o))r.push(o);else if(o){var c=no(o.type),d=n[c]||{},f=d.handler,h=d.once;if(f&&(!h||!s[c])){var p=f(o,c,i);r.push(p),s[c]=!0}}}),r},DX=function(t){var n=t&&t.type;return n&&YP[n]?YP[n]:null},LX=function(t,n){return UN(n).indexOf(t)},FX=["children","width","height","viewBox","className","style","title","desc"];function wS(){return wS=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},wS.apply(this,arguments)}function zX(e,t){if(e==null)return{};var n=BX(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BX(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 jS(e){var t=e.children,n=e.width,r=e.height,s=e.viewBox,o=e.className,i=e.style,c=e.title,d=e.desc,f=zX(e,FX),h=s||{width:n,height:r,x:0,y:0},p=Lt("recharts-surface",o);return Y.createElement("svg",wS({},St(f,!0,"svg"),{className:p,width:n,height:r,style:i,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 qX=["children","className"];function SS(){return SS=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},SS.apply(this,arguments)}function UX(e,t){if(e==null)return{};var n=WX(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WX(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 en=Y.forwardRef(function(e,t){var n=e.children,r=e.className,s=UX(e,qX),o=Lt("recharts-layer",r);return Y.createElement("g",SS({className:o},St(s,!0),{ref:t}),n)}),ro=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),o=2;o<r;o++)s[o-2]=arguments[o]},Lb,eO;function VX(){if(eO)return Lb;eO=1;function e(t,n,r){var s=-1,o=t.length;n<0&&(n=-n>o?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var i=Array(o);++s<o;)i[s]=t[s+n];return i}return Lb=e,Lb}var Fb,tO;function HX(){if(tO)return Fb;tO=1;var e=VX();function t(n,r,s){var o=n.length;return s=s===void 0?o:s,!r&&s>=o?n:e(n,r,s)}return Fb=t,Fb}var zb,nO;function j3(){if(nO)return zb;nO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,o="\\ufe0e\\ufe0f",i="\\u200d",c=RegExp("["+i+e+s+o+"]");function d(f){return c.test(f)}return zb=d,zb}var Bb,rO;function KX(){if(rO)return Bb;rO=1;function e(t){return t.split("")}return Bb=e,Bb}var qb,aO;function GX(){if(aO)return qb;aO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,o="\\ufe0e\\ufe0f",i="["+e+"]",c="["+s+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+d+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",j=f+"?",b="["+o+"]?",y="(?:"+g+"(?:"+[h,p,x].join("|")+")"+b+j+")*",S=b+j+y,C="(?:"+[h+c+"?",c,p,x,i].join("|")+")",N=RegExp(d+"(?="+d+")|"+C+S,"g");function E(A){return A.match(N)||[]}return qb=E,qb}var Ub,sO;function YX(){if(sO)return Ub;sO=1;var e=KX(),t=j3(),n=GX();function r(s){return t(s)?n(s):e(s)}return Ub=r,Ub}var Wb,oO;function XX(){if(oO)return Wb;oO=1;var e=HX(),t=j3(),n=YX(),r=x3();function s(o){return function(i){i=r(i);var c=t(i)?n(i):void 0,d=c?c[0]:i.charAt(0),f=c?e(c,1).join(""):i.slice(1);return d[o]()+f}}return Wb=s,Wb}var Vb,iO;function QX(){if(iO)return Vb;iO=1;var e=XX(),t=e("toUpperCase");return Vb=t,Vb}var JX=QX();const Iv=un(JX);function bn(e){return function(){return e}}const S3=Math.cos,Gh=Math.sin,as=Math.sqrt,Yh=Math.PI,Mv=2*Yh,NS=Math.PI,CS=2*NS,zi=1e-6,ZX=CS-zi;function N3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function eQ(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return N3;const n=10**t;return function(r){this._+=r[0];for(let s=1,o=r.length;s<o;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}class tQ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?N3:eQ(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,o,i){this._append`C${+t},${+n},${+r},${+s},${this._x1=+o},${this._y1=+i}`}arcTo(t,n,r,s,o){if(t=+t,n=+n,r=+r,s=+s,o=+o,o<0)throw new Error(`negative radius: ${o}`);let i=this._x1,c=this._y1,d=r-t,f=s-n,h=i-t,p=c-n,x=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(x>zi)if(!(Math.abs(p*d-f*h)>zi)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-i,j=s-c,b=d*d+f*f,y=g*g+j*j,S=Math.sqrt(b),C=Math.sqrt(x),N=o*Math.tan((NS-Math.acos((b+x-y)/(2*S*C)))/2),E=N/C,A=N/S;Math.abs(E-1)>zi&&this._append`L${t+E*h},${n+E*p}`,this._append`A${o},${o},0,0,${+(p*g>h*j)},${this._x1=t+A*d},${this._y1=n+A*f}`}}arc(t,n,r,s,o,i){if(t=+t,n=+n,r=+r,i=!!i,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^i,x=i?s-o:o-s;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>zi||Math.abs(this._y1-h)>zi)&&this._append`L${f},${h}`,r&&(x<0&&(x=x%CS+CS),x>ZX?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:x>zi&&this._append`A${r},${r},0,${+(x>=NS)},${p},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}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 WN(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 tQ(t)}function VN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function C3(e){this._context=e}C3.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 $v(e){return new C3(e)}function _3(e){return e[0]}function A3(e){return e[1]}function E3(e,t){var n=bn(!0),r=null,s=$v,o=null,i=WN(c);e=typeof e=="function"?e:e===void 0?_3:bn(e),t=typeof t=="function"?t:t===void 0?A3:bn(t);function c(d){var f,h=(d=VN(d)).length,p,x=!1,g;for(r==null&&(o=s(g=i())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===x&&((x=!x)?o.lineStart():o.lineEnd()),x&&o.point(+e(p,f,d),+t(p,f,d));if(g)return o=null,g+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:bn(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:bn(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:bn(!!d),c):n},c.curve=function(d){return arguments.length?(s=d,r!=null&&(o=s(r)),c):s},c.context=function(d){return arguments.length?(d==null?r=o=null:o=s(r=d),c):r},c}function fh(e,t,n){var r=null,s=bn(!0),o=null,i=$v,c=null,d=WN(f);e=typeof e=="function"?e:e===void 0?_3:bn(+e),t=typeof t=="function"?t:bn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?A3:bn(+n);function f(p){var x,g,j,b=(p=VN(p)).length,y,S=!1,C,N=new Array(b),E=new Array(b);for(o==null&&(c=i(C=d())),x=0;x<=b;++x){if(!(x<b&&s(y=p[x],x,p))===S)if(S=!S)g=x,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=x-1;j>=g;--j)c.point(N[j],E[j]);c.lineEnd(),c.areaEnd()}S&&(N[x]=+e(y,x,p),E[x]=+t(y,x,p),c.point(r?+r(y,x,p):N[x],n?+n(y,x,p):E[x]))}if(C)return c=null,C+""||null}function h(){return E3().defined(s).curve(i).context(o)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:bn(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:bn(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:bn(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:bn(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:bn(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:bn(+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:bn(!!p),f):s},f.curve=function(p){return arguments.length?(i=p,o!=null&&(c=i(o)),f):i},f.context=function(p){return arguments.length?(p==null?o=c=null:c=i(o=p),f):o},f}class k3{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 nQ(e){return new k3(e,!0)}function rQ(e){return new k3(e,!1)}const HN={draw(e,t){const n=as(t/Yh);e.moveTo(n,0),e.arc(0,0,n,0,Mv)}},aQ={draw(e,t){const n=as(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()}},P3=as(1/3),sQ=P3*2,oQ={draw(e,t){const n=as(t/sQ),r=n*P3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},iQ={draw(e,t){const n=as(t),r=-n/2;e.rect(r,r,n,n)}},lQ=.8908130915292852,O3=Gh(Yh/10)/Gh(7*Yh/10),cQ=Gh(Mv/10)*O3,uQ=-S3(Mv/10)*O3,dQ={draw(e,t){const n=as(t*lQ),r=cQ*n,s=uQ*n;e.moveTo(0,-n),e.lineTo(r,s);for(let o=1;o<5;++o){const i=Mv*o/5,c=S3(i),d=Gh(i);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*s,d*r+c*s)}e.closePath()}},Hb=as(3),fQ={draw(e,t){const n=-as(t/(Hb*3));e.moveTo(0,n*2),e.lineTo(-Hb*n,-n),e.lineTo(Hb*n,-n),e.closePath()}},Sa=-.5,Na=as(3)/2,_S=1/as(12),pQ=(_S/2+1)*3,hQ={draw(e,t){const n=as(t/pQ),r=n/2,s=n*_S,o=r,i=n*_S+n,c=-o,d=i;e.moveTo(r,s),e.lineTo(o,i),e.lineTo(c,d),e.lineTo(Sa*r-Na*s,Na*r+Sa*s),e.lineTo(Sa*o-Na*i,Na*o+Sa*i),e.lineTo(Sa*c-Na*d,Na*c+Sa*d),e.lineTo(Sa*r+Na*s,Sa*s-Na*r),e.lineTo(Sa*o+Na*i,Sa*i-Na*o),e.lineTo(Sa*c+Na*d,Sa*d-Na*c),e.closePath()}};function mQ(e,t){let n=null,r=WN(s);e=typeof e=="function"?e:bn(e||HN),t=typeof t=="function"?t:bn(t===void 0?64:+t);function s(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return s.type=function(o){return arguments.length?(e=typeof o=="function"?o:bn(o),s):e},s.size=function(o){return arguments.length?(t=typeof o=="function"?o:bn(+o),s):t},s.context=function(o){return arguments.length?(n=o??null,s):n},s}function Xh(){}function Qh(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 T3(e){this._context=e}T3.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:Qh(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:Qh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function vQ(e){return new T3(e)}function R3(e){this._context=e}R3.prototype={areaStart:Xh,areaEnd:Xh,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:Qh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gQ(e){return new R3(e)}function I3(e){this._context=e}I3.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:Qh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xQ(e){return new I3(e)}function M3(e){this._context=e}M3.prototype={areaStart:Xh,areaEnd:Xh,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 yQ(e){return new M3(e)}function lO(e){return e<0?-1:1}function cO(e,t,n){var r=e._x1-e._x0,s=t-e._x1,o=(e._y1-e._y0)/(r||s<0&&-0),i=(n-e._y1)/(s||r<0&&-0),c=(o*s+i*r)/(r+s);return(lO(o)+lO(i))*Math.min(Math.abs(o),Math.abs(i),.5*Math.abs(c))||0}function uO(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Kb(e,t,n){var r=e._x0,s=e._y0,o=e._x1,i=e._y1,c=(o-r)/3;e._context.bezierCurveTo(r+c,s+c*t,o-c,i-c*n,o,i)}function Jh(e){this._context=e}Jh.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:Kb(this,this._t0,uO(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,Kb(this,uO(this,n=cO(this,e,t)),n);break;default:Kb(this,this._t0,n=cO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function $3(e){this._context=new D3(e)}($3.prototype=Object.create(Jh.prototype)).point=function(e,t){Jh.prototype.point.call(this,t,e)};function D3(e){this._context=e}D3.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,o){this._context.bezierCurveTo(t,e,r,n,o,s)}};function bQ(e){return new Jh(e)}function wQ(e){return new $3(e)}function L3(e){this._context=e}L3.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=dO(e),s=dO(t),o=0,i=1;i<n;++o,++i)this._context.bezierCurveTo(r[0][o],s[0][o],r[1][o],s[1][o],e[i],t[i]);(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 dO(e){var t,n=e.length-1,r,s=new Array(n),o=new Array(n),i=new Array(n);for(s[0]=0,o[0]=2,i[0]=e[0]+2*e[1],t=1;t<n-1;++t)s[t]=1,o[t]=4,i[t]=4*e[t]+2*e[t+1];for(s[n-1]=2,o[n-1]=7,i[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=s[t]/o[t-1],o[t]-=r,i[t]-=r*i[t-1];for(s[n-1]=i[n-1]/o[n-1],t=n-2;t>=0;--t)s[t]=(i[t]-s[t+1])/o[t];for(o[n-1]=(e[n]+s[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-s[t+1];return[s,o]}function jQ(e){return new L3(e)}function Dv(e,t){this._context=e,this._t=t}Dv.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 SQ(e){return new Dv(e,.5)}function NQ(e){return new Dv(e,0)}function CQ(e){return new Dv(e,1)}function Tc(e,t){if((i=e.length)>1)for(var n=1,r,s,o=e[t[0]],i,c=o.length;n<i;++n)for(s=o,o=e[t[n]],r=0;r<c;++r)o[r][1]+=o[r][0]=isNaN(s[r][1])?s[r][0]:s[r][1]}function AS(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function _Q(e,t){return e[t]}function AQ(e){const t=[];return t.key=e,t}function EQ(){var e=bn([]),t=AS,n=Tc,r=_Q;function s(o){var i=Array.from(e.apply(this,arguments),AQ),c,d=i.length,f=-1,h;for(const p of o)for(c=0,++f;c<d;++c)(i[c][f]=[0,+r(p,i[c].key,f,o)]).data=p;for(c=0,h=VN(t(i));c<d;++c)i[h[c]].index=c;return n(i,h),i}return s.keys=function(o){return arguments.length?(e=typeof o=="function"?o:bn(Array.from(o)),s):e},s.value=function(o){return arguments.length?(r=typeof o=="function"?o:bn(+o),s):r},s.order=function(o){return arguments.length?(t=o==null?AS:typeof o=="function"?o:bn(Array.from(o)),s):t},s.offset=function(o){return arguments.length?(n=o??Tc,s):n},s}function kQ(e,t){if((r=e.length)>0){for(var n,r,s=0,o=e[0].length,i;s<o;++s){for(i=n=0;n<r;++n)i+=e[n][s][1]||0;if(i)for(n=0;n<r;++n)e[n][s][1]/=i}Tc(e,t)}}function PQ(e,t){if((s=e.length)>0){for(var n=0,r=e[t[0]],s,o=r.length;n<o;++n){for(var i=0,c=0;i<s;++i)c+=e[i][n][1]||0;r[n][1]+=r[n][0]=-c/2}Tc(e,t)}}function OQ(e,t){if(!(!((i=e.length)>0)||!((o=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,o,i;r<o;++r){for(var c=0,d=0,f=0;c<i;++c){for(var h=e[t[c]],p=h[r][1]||0,x=h[r-1][1]||0,g=(p-x)/2,j=0;j<c;++j){var b=e[t[j]],y=b[r][1]||0,S=b[r-1][1]||0;g+=y-S}d+=p,f+=g*p}s[r-1][1]+=s[r-1][0]=n,d&&(n-=f/d)}s[r-1][1]+=s[r-1][0]=n,Tc(e,t)}}function Fd(e){"@babel/helpers - typeof";return Fd=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},Fd(e)}var TQ=["type","size","sizeType"];function ES(){return ES=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},ES.apply(this,arguments)}function fO(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 pO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fO(Object(n),!0).forEach(function(r){RQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RQ(e,t,n){return t=IQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IQ(e){var t=MQ(e,"string");return Fd(t)=="symbol"?t:t+""}function MQ(e,t){if(Fd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $Q(e,t){if(e==null)return{};var n=DQ(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DQ(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 F3={symbolCircle:HN,symbolCross:aQ,symbolDiamond:oQ,symbolSquare:iQ,symbolStar:dQ,symbolTriangle:fQ,symbolWye:hQ},LQ=Math.PI/180,FQ=function(t){var n="symbol".concat(Iv(t));return F3[n]||HN},zQ=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*LQ;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}},BQ=function(t,n){F3["symbol".concat(Iv(t))]=n},KN=function(t){var n=t.type,r=n===void 0?"circle":n,s=t.size,o=s===void 0?64:s,i=t.sizeType,c=i===void 0?"area":i,d=$Q(t,TQ),f=pO(pO({},d),{},{type:r,size:o,sizeType:c}),h=function(){var y=FQ(r),S=mQ().type(y).size(zQ(o,c,r));return S()},p=f.className,x=f.cx,g=f.cy,j=St(f,!0);return x===+x&&g===+g&&o===+o?Y.createElement("path",ES({},j,{className:Lt("recharts-symbols",p),transform:"translate(".concat(x,", ").concat(g,")"),d:h()})):null};KN.registerSymbol=BQ;function Rc(e){"@babel/helpers - typeof";return Rc=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},Rc(e)}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 hO(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 qQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hO(Object(n),!0).forEach(function(r){zd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WQ(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,B3(r.key),r)}}function VQ(e,t,n){return t&&WQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function HQ(e,t,n){return t=Zh(t),KQ(e,z3()?Reflect.construct(t,n||[],Zh(e).constructor):t.apply(e,n))}function KQ(e,t){if(t&&(Rc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GQ(e)}function GQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(z3=function(){return!!e})()}function Zh(e){return Zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zh(e)}function YQ(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&&PS(e,t)}function PS(e,t){return PS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},PS(e,t)}function zd(e,t,n){return t=B3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B3(e){var t=XQ(e,"string");return Rc(t)=="symbol"?t:t+""}function XQ(e,t){if(Rc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ca=32,GN=(function(e){function t(){return UQ(this,t),HQ(this,t,arguments)}return YQ(t,e),VQ(t,[{key:"renderIcon",value:function(r){var s=this.props.inactiveColor,o=Ca/2,i=Ca/6,c=Ca/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:o,x2:Ca,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return Y.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(o,"h").concat(c,`
|
|
57
|
-
A`).concat(i,",").concat(i,",0,1,1,").concat(2*c,",").concat(o,`
|
|
58
|
-
H`).concat(Ca,"M").concat(2*c,",").concat(o,`
|
|
59
|
-
A`).concat(i,",").concat(i,",0,1,1,").concat(c,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return Y.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(Ca/8,"h").concat(Ca,"v").concat(Ca*3/4,"h").concat(-Ca,"z"),className:"recharts-legend-icon"});if(Y.isValidElement(r.legendIcon)){var f=qQ({},r);return delete f.legendIcon,Y.cloneElement(r.legendIcon,f)}return Y.createElement(KN,{fill:d,cx:o,cy:o,size:Ca,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,s=this.props,o=s.payload,i=s.iconSize,c=s.layout,d=s.formatter,f=s.inactiveColor,h={x:0,y:0,width:Ca,height:Ca},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},x={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(g,j){var b=g.formatter||d,y=Lt(zd(zd({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",g.inactive));if(g.type==="none")return null;var S=It(g.value)?null:g.value;ro(!It(g.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=g.inactive?f:g.color;return Y.createElement("li",kS({className:y,style:p,key:"legend-item-".concat(j)},al(r.props,g,j)),Y.createElement(jS,{width:i,height:i,viewBox:h,style:x},r.renderIcon(g)),Y.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},b?b(S,g,j):S))})}},{key:"render",value:function(){var r=this.props,s=r.payload,o=r.layout,i=r.align;if(!s||!s.length)return null;var c={padding:0,margin:0,textAlign:o==="horizontal"?i:"left"};return Y.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(m.PureComponent);zd(GN,"displayName","Legend");zd(GN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Gb,mO;function QQ(){if(mO)return Gb;mO=1;var e=Ov();function t(){this.__data__=new e,this.size=0}return Gb=t,Gb}var Yb,vO;function JQ(){if(vO)return Yb;vO=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Yb=e,Yb}var Xb,gO;function ZQ(){if(gO)return Xb;gO=1;function e(t){return this.__data__.get(t)}return Xb=e,Xb}var Qb,xO;function eJ(){if(xO)return Qb;xO=1;function e(t){return this.__data__.has(t)}return Qb=e,Qb}var Jb,yO;function tJ(){if(yO)return Jb;yO=1;var e=Ov(),t=LN(),n=FN(),r=200;function s(o,i){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!t||d.length<r-1)return d.push([o,i]),this.size=++c.size,this;c=this.__data__=new n(d)}return c.set(o,i),this.size=c.size,this}return Jb=s,Jb}var Zb,bO;function q3(){if(bO)return Zb;bO=1;var e=Ov(),t=QQ(),n=JQ(),r=ZQ(),s=eJ(),o=tJ();function i(c){var d=this.__data__=new e(c);this.size=d.size}return i.prototype.clear=t,i.prototype.delete=n,i.prototype.get=r,i.prototype.has=s,i.prototype.set=o,Zb=i,Zb}var e0,wO;function nJ(){if(wO)return e0;wO=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return e0=t,e0}var t0,jO;function rJ(){if(jO)return t0;jO=1;function e(t){return this.__data__.has(t)}return t0=e,t0}var n0,SO;function U3(){if(SO)return n0;SO=1;var e=FN(),t=nJ(),n=rJ();function r(s){var o=-1,i=s==null?0:s.length;for(this.__data__=new e;++o<i;)this.add(s[o])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,n0=r,n0}var r0,NO;function W3(){if(NO)return r0;NO=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 r0=e,r0}var a0,CO;function V3(){if(CO)return a0;CO=1;function e(t,n){return t.has(n)}return a0=e,a0}var s0,_O;function H3(){if(_O)return s0;_O=1;var e=U3(),t=W3(),n=V3(),r=1,s=2;function o(i,c,d,f,h,p){var x=d&r,g=i.length,j=c.length;if(g!=j&&!(x&&j>g))return!1;var b=p.get(i),y=p.get(c);if(b&&y)return b==c&&y==i;var S=-1,C=!0,N=d&s?new e:void 0;for(p.set(i,c),p.set(c,i);++S<g;){var E=i[S],A=c[S];if(f)var k=x?f(A,E,S,c,i,p):f(E,A,S,i,c,p);if(k!==void 0){if(k)continue;C=!1;break}if(N){if(!t(c,function(O,T){if(!n(N,T)&&(E===O||h(E,O,d,f,p)))return N.push(T)})){C=!1;break}}else if(!(E===A||h(E,A,d,f,p))){C=!1;break}}return p.delete(i),p.delete(c),C}return s0=o,s0}var o0,AO;function aJ(){if(AO)return o0;AO=1;var e=Ms(),t=e.Uint8Array;return o0=t,o0}var i0,EO;function sJ(){if(EO)return i0;EO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,o){r[++n]=[o,s]}),r}return i0=e,i0}var l0,kO;function YN(){if(kO)return l0;kO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return l0=e,l0}var c0,PO;function oJ(){if(PO)return c0;PO=1;var e=$f(),t=aJ(),n=DN(),r=H3(),s=sJ(),o=YN(),i=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",x="[object Number]",g="[object RegExp]",j="[object Set]",b="[object String]",y="[object Symbol]",S="[object ArrayBuffer]",C="[object DataView]",N=e?e.prototype:void 0,E=N?N.valueOf:void 0;function A(k,O,T,$,B,q,F){switch(T){case C:if(k.byteLength!=O.byteLength||k.byteOffset!=O.byteOffset)return!1;k=k.buffer,O=O.buffer;case S:return!(k.byteLength!=O.byteLength||!q(new t(k),new t(O)));case d:case f:case x:return n(+k,+O);case h:return k.name==O.name&&k.message==O.message;case g:case b:return k==O+"";case p:var H=s;case j:var U=$&i;if(H||(H=o),k.size!=O.size&&!U)return!1;var R=F.get(k);if(R)return R==O;$|=c,F.set(k,O);var W=r(H(k),H(O),$,B,q,F);return F.delete(k),W;case y:if(E)return E.call(k)==E.call(O)}return!1}return c0=A,c0}var u0,OO;function K3(){if(OO)return u0;OO=1;function e(t,n){for(var r=-1,s=n.length,o=t.length;++r<s;)t[o+r]=n[r];return t}return u0=e,u0}var d0,TO;function iJ(){if(TO)return d0;TO=1;var e=K3(),t=Gr();function n(r,s,o){var i=s(r);return t(r)?i:e(i,o(r))}return d0=n,d0}var f0,RO;function lJ(){if(RO)return f0;RO=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,o=0,i=[];++r<s;){var c=t[r];n(c,r,t)&&(i[o++]=c)}return i}return f0=e,f0}var p0,IO;function cJ(){if(IO)return p0;IO=1;function e(){return[]}return p0=e,p0}var h0,MO;function uJ(){if(MO)return h0;MO=1;var e=lJ(),t=cJ(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,o=s?function(i){return i==null?[]:(i=Object(i),e(s(i),function(c){return r.call(i,c)}))}:t;return h0=o,h0}var m0,$O;function dJ(){if($O)return m0;$O=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return m0=e,m0}var v0,DO;function fJ(){if(DO)return v0;DO=1;var e=xo(),t=yo(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return v0=r,v0}var g0,LO;function XN(){if(LO)return g0;LO=1;var e=fJ(),t=yo(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(i){return t(i)&&r.call(i,"callee")&&!s.call(i,"callee")};return g0=o,g0}var bd={exports:{}},x0,FO;function pJ(){if(FO)return x0;FO=1;function e(){return!1}return x0=e,x0}bd.exports;var zO;function G3(){return zO||(zO=1,(function(e,t){var n=Ms(),r=pJ(),s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===s,c=i?n.Buffer:void 0,d=c?c.isBuffer:void 0,f=d||r;e.exports=f})(bd,bd.exports)),bd.exports}var y0,BO;function QN(){if(BO)return y0;BO=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var o=typeof r;return s=s??e,!!s&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return y0=n,y0}var b0,qO;function JN(){if(qO)return b0;qO=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return b0=t,b0}var w0,UO;function hJ(){if(UO)return w0;UO=1;var e=xo(),t=JN(),n=yo(),r="[object Arguments]",s="[object Array]",o="[object Boolean]",i="[object Date]",c="[object Error]",d="[object Function]",f="[object Map]",h="[object Number]",p="[object Object]",x="[object RegExp]",g="[object Set]",j="[object String]",b="[object WeakMap]",y="[object ArrayBuffer]",S="[object DataView]",C="[object Float32Array]",N="[object Float64Array]",E="[object Int8Array]",A="[object Int16Array]",k="[object Int32Array]",O="[object Uint8Array]",T="[object Uint8ClampedArray]",$="[object Uint16Array]",B="[object Uint32Array]",q={};q[C]=q[N]=q[E]=q[A]=q[k]=q[O]=q[T]=q[$]=q[B]=!0,q[r]=q[s]=q[y]=q[o]=q[S]=q[i]=q[c]=q[d]=q[f]=q[h]=q[p]=q[x]=q[g]=q[j]=q[b]=!1;function F(H){return n(H)&&t(H.length)&&!!q[e(H)]}return w0=F,w0}var j0,WO;function Y3(){if(WO)return j0;WO=1;function e(t){return function(n){return t(n)}}return j0=e,j0}var wd={exports:{}};wd.exports;var VO;function mJ(){return VO||(VO=1,(function(e,t){var n=m3(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===r,i=o&&n.process,c=(function(){try{var d=s&&s.require&&s.require("util").types;return d||i&&i.binding&&i.binding("util")}catch{}})();e.exports=c})(wd,wd.exports)),wd.exports}var S0,HO;function X3(){if(HO)return S0;HO=1;var e=hJ(),t=Y3(),n=mJ(),r=n&&n.isTypedArray,s=r?t(r):e;return S0=s,S0}var N0,KO;function vJ(){if(KO)return N0;KO=1;var e=dJ(),t=XN(),n=Gr(),r=G3(),s=QN(),o=X3(),i=Object.prototype,c=i.hasOwnProperty;function d(f,h){var p=n(f),x=!p&&t(f),g=!p&&!x&&r(f),j=!p&&!x&&!g&&o(f),b=p||x||g||j,y=b?e(f.length,String):[],S=y.length;for(var C in f)(h||c.call(f,C))&&!(b&&(C=="length"||g&&(C=="offset"||C=="parent")||j&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||s(C,S)))&&y.push(C);return y}return N0=d,N0}var C0,GO;function gJ(){if(GO)return C0;GO=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return C0=t,C0}var _0,YO;function Q3(){if(YO)return _0;YO=1;function e(t,n){return function(r){return t(n(r))}}return _0=e,_0}var A0,XO;function xJ(){if(XO)return A0;XO=1;var e=Q3(),t=e(Object.keys,Object);return A0=t,A0}var E0,QO;function yJ(){if(QO)return E0;QO=1;var e=gJ(),t=xJ(),n=Object.prototype,r=n.hasOwnProperty;function s(o){if(!e(o))return t(o);var i=[];for(var c in Object(o))r.call(o,c)&&c!="constructor"&&i.push(c);return i}return E0=s,E0}var k0,JO;function Lf(){if(JO)return k0;JO=1;var e=$N(),t=JN();function n(r){return r!=null&&t(r.length)&&!e(r)}return k0=n,k0}var P0,ZO;function Lv(){if(ZO)return P0;ZO=1;var e=vJ(),t=yJ(),n=Lf();function r(s){return n(s)?e(s):t(s)}return P0=r,P0}var O0,eT;function bJ(){if(eT)return O0;eT=1;var e=iJ(),t=uJ(),n=Lv();function r(s){return e(s,n,t)}return O0=r,O0}var T0,tT;function wJ(){if(tT)return T0;tT=1;var e=bJ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(o,i,c,d,f,h){var p=c&t,x=e(o),g=x.length,j=e(i),b=j.length;if(g!=b&&!p)return!1;for(var y=g;y--;){var S=x[y];if(!(p?S in i:r.call(i,S)))return!1}var C=h.get(o),N=h.get(i);if(C&&N)return C==i&&N==o;var E=!0;h.set(o,i),h.set(i,o);for(var A=p;++y<g;){S=x[y];var k=o[S],O=i[S];if(d)var T=p?d(O,k,S,i,o,h):d(k,O,S,o,i,h);if(!(T===void 0?k===O||f(k,O,c,d,h):T)){E=!1;break}A||(A=S=="constructor")}if(E&&!A){var $=o.constructor,B=i.constructor;$!=B&&"constructor"in o&&"constructor"in i&&!(typeof $=="function"&&$ instanceof $&&typeof B=="function"&&B instanceof B)&&(E=!1)}return h.delete(o),h.delete(i),E}return T0=s,T0}var R0,nT;function jJ(){if(nT)return R0;nT=1;var e=jl(),t=Ms(),n=e(t,"DataView");return R0=n,R0}var I0,rT;function SJ(){if(rT)return I0;rT=1;var e=jl(),t=Ms(),n=e(t,"Promise");return I0=n,I0}var M0,aT;function J3(){if(aT)return M0;aT=1;var e=jl(),t=Ms(),n=e(t,"Set");return M0=n,M0}var $0,sT;function NJ(){if(sT)return $0;sT=1;var e=jl(),t=Ms(),n=e(t,"WeakMap");return $0=n,$0}var D0,oT;function CJ(){if(oT)return D0;oT=1;var e=jJ(),t=LN(),n=SJ(),r=J3(),s=NJ(),o=xo(),i=v3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",x="[object DataView]",g=i(e),j=i(t),b=i(n),y=i(r),S=i(s),C=o;return(e&&C(new e(new ArrayBuffer(1)))!=x||t&&C(new t)!=c||n&&C(n.resolve())!=f||r&&C(new r)!=h||s&&C(new s)!=p)&&(C=function(N){var E=o(N),A=E==d?N.constructor:void 0,k=A?i(A):"";if(k)switch(k){case g:return x;case j:return c;case b:return f;case y:return h;case S:return p}return E}),D0=C,D0}var L0,iT;function _J(){if(iT)return L0;iT=1;var e=q3(),t=H3(),n=oJ(),r=wJ(),s=CJ(),o=Gr(),i=G3(),c=X3(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",x=Object.prototype,g=x.hasOwnProperty;function j(b,y,S,C,N,E){var A=o(b),k=o(y),O=A?h:s(b),T=k?h:s(y);O=O==f?p:O,T=T==f?p:T;var $=O==p,B=T==p,q=O==T;if(q&&i(b)){if(!i(y))return!1;A=!0,$=!1}if(q&&!$)return E||(E=new e),A||c(b)?t(b,y,S,C,N,E):n(b,y,O,S,C,N,E);if(!(S&d)){var F=$&&g.call(b,"__wrapped__"),H=B&&g.call(y,"__wrapped__");if(F||H){var U=F?b.value():b,R=H?y.value():y;return E||(E=new e),N(U,R,S,C,E)}}return q?(E||(E=new e),r(b,y,S,C,N,E)):!1}return L0=j,L0}var F0,lT;function ZN(){if(lT)return F0;lT=1;var e=_J(),t=yo();function n(r,s,o,i,c){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,o,i,n,c)}return F0=n,F0}var z0,cT;function AJ(){if(cT)return z0;cT=1;var e=q3(),t=ZN(),n=1,r=2;function s(o,i,c,d){var f=c.length,h=f,p=!d;if(o==null)return!h;for(o=Object(o);f--;){var x=c[f];if(p&&x[2]?x[1]!==o[x[0]]:!(x[0]in o))return!1}for(;++f<h;){x=c[f];var g=x[0],j=o[g],b=x[1];if(p&&x[2]){if(j===void 0&&!(g in o))return!1}else{var y=new e;if(d)var S=d(j,b,g,o,i,y);if(!(S===void 0?t(b,j,n|r,d,y):S))return!1}}return!0}return z0=s,z0}var B0,uT;function Z3(){if(uT)return B0;uT=1;var e=fi();function t(n){return n===n&&!e(n)}return B0=t,B0}var q0,dT;function EJ(){if(dT)return q0;dT=1;var e=Z3(),t=Lv();function n(r){for(var s=t(r),o=s.length;o--;){var i=s[o],c=r[i];s[o]=[i,c,e(c)]}return s}return q0=n,q0}var U0,fT;function eL(){if(fT)return U0;fT=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return U0=e,U0}var W0,pT;function kJ(){if(pT)return W0;pT=1;var e=AJ(),t=EJ(),n=eL();function r(s){var o=t(s);return o.length==1&&o[0][2]?n(o[0][0],o[0][1]):function(i){return i===s||e(i,s,o)}}return W0=r,W0}var V0,hT;function PJ(){if(hT)return V0;hT=1;function e(t,n){return t!=null&&n in Object(t)}return V0=e,V0}var H0,mT;function OJ(){if(mT)return H0;mT=1;var e=y3(),t=XN(),n=Gr(),r=QN(),s=JN(),o=Rv();function i(c,d,f){d=e(d,c);for(var h=-1,p=d.length,x=!1;++h<p;){var g=o(d[h]);if(!(x=c!=null&&f(c,g)))break;c=c[g]}return x||++h!=p?x:(p=c==null?0:c.length,!!p&&s(p)&&r(g,p)&&(n(c)||t(c)))}return H0=i,H0}var K0,vT;function TJ(){if(vT)return K0;vT=1;var e=PJ(),t=OJ();function n(r,s){return r!=null&&t(r,s,e)}return K0=n,K0}var G0,gT;function RJ(){if(gT)return G0;gT=1;var e=ZN(),t=b3(),n=TJ(),r=MN(),s=Z3(),o=eL(),i=Rv(),c=1,d=2;function f(h,p){return r(h)&&s(p)?o(i(h),p):function(x){var g=t(x,h);return g===void 0&&g===p?n(x,h):e(p,g,c|d)}}return G0=f,G0}var Y0,xT;function xu(){if(xT)return Y0;xT=1;function e(t){return t}return Y0=e,Y0}var X0,yT;function IJ(){if(yT)return X0;yT=1;function e(t){return function(n){return n?.[t]}}return X0=e,X0}var Q0,bT;function MJ(){if(bT)return Q0;bT=1;var e=BN();function t(n){return function(r){return e(r,n)}}return Q0=t,Q0}var J0,wT;function $J(){if(wT)return J0;wT=1;var e=IJ(),t=MJ(),n=MN(),r=Rv();function s(o){return n(o)?e(r(o)):t(o)}return J0=s,J0}var Z0,jT;function $s(){if(jT)return Z0;jT=1;var e=kJ(),t=RJ(),n=xu(),r=Gr(),s=$J();function o(i){return typeof i=="function"?i:i==null?n:typeof i=="object"?r(i)?t(i[0],i[1]):e(i):s(i)}return Z0=o,Z0}var ew,ST;function tL(){if(ST)return ew;ST=1;function e(t,n,r,s){for(var o=t.length,i=r+(s?1:-1);s?i--:++i<o;)if(n(t[i],i,t))return i;return-1}return ew=e,ew}var tw,NT;function DJ(){if(NT)return tw;NT=1;function e(t){return t!==t}return tw=e,tw}var nw,CT;function LJ(){if(CT)return nw;CT=1;function e(t,n,r){for(var s=r-1,o=t.length;++s<o;)if(t[s]===n)return s;return-1}return nw=e,nw}var rw,_T;function FJ(){if(_T)return rw;_T=1;var e=tL(),t=DJ(),n=LJ();function r(s,o,i){return o===o?n(s,o,i):e(s,t,i)}return rw=r,rw}var aw,AT;function zJ(){if(AT)return aw;AT=1;var e=FJ();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return aw=t,aw}var sw,ET;function BJ(){if(ET)return sw;ET=1;function e(t,n,r){for(var s=-1,o=t==null?0:t.length;++s<o;)if(r(n,t[s]))return!0;return!1}return sw=e,sw}var ow,kT;function qJ(){if(kT)return ow;kT=1;function e(){}return ow=e,ow}var iw,PT;function UJ(){if(PT)return iw;PT=1;var e=J3(),t=qJ(),n=YN(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return iw=s,iw}var lw,OT;function WJ(){if(OT)return lw;OT=1;var e=U3(),t=zJ(),n=BJ(),r=V3(),s=UJ(),o=YN(),i=200;function c(d,f,h){var p=-1,x=t,g=d.length,j=!0,b=[],y=b;if(h)j=!1,x=n;else if(g>=i){var S=f?null:s(d);if(S)return o(S);j=!1,x=r,y=new e}else y=f?[]:b;e:for(;++p<g;){var C=d[p],N=f?f(C):C;if(C=h||C!==0?C:0,j&&N===N){for(var E=y.length;E--;)if(y[E]===N)continue e;f&&y.push(N),b.push(C)}else x(y,N,h)||(y!==b&&y.push(N),b.push(C))}return b}return lw=c,lw}var cw,TT;function VJ(){if(TT)return cw;TT=1;var e=$s(),t=WJ();function n(r,s){return r&&r.length?t(r,e(s,2)):[]}return cw=n,cw}var HJ=VJ();const RT=un(HJ);function nL(e,t,n){return t===!0?RT(e,n):It(t)?RT(e,t):e}function Ic(e){"@babel/helpers - typeof";return Ic=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},Ic(e)}var KJ=["ref"];function IT(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 Ys(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IT(Object(n),!0).forEach(function(r){Fv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MT(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,aL(r.key),r)}}function YJ(e,t,n){return t&&MT(e.prototype,t),n&&MT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function XJ(e,t,n){return t=em(t),QJ(e,rL()?Reflect.construct(t,n||[],em(e).constructor):t.apply(e,n))}function QJ(e,t){if(t&&(Ic(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JJ(e)}function JJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rL=function(){return!!e})()}function em(e){return em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},em(e)}function ZJ(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&&OS(e,t)}function OS(e,t){return OS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},OS(e,t)}function Fv(e,t,n){return t=aL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aL(e){var t=eZ(e,"string");return Ic(t)=="symbol"?t:t+""}function eZ(e,t){if(Ic(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ic(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function tZ(e,t){if(e==null)return{};var n=nZ(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nZ(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 rZ(e){return e.value}function aZ(e,t){if(Y.isValidElement(e))return Y.cloneElement(e,t);if(typeof e=="function")return Y.createElement(e,t);t.ref;var n=tZ(t,KJ);return Y.createElement(GN,n)}var $T=1,Gi=(function(e){function t(){var n;GJ(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=XJ(this,t,[].concat(s)),Fv(n,"lastBoundingBox",{width:-1,height:-1}),n}return ZJ(t,e),YJ(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)>$T||Math.abs(s.height-this.lastBoundingBox.height)>$T)&&(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?Ys({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var s=this.props,o=s.layout,i=s.align,c=s.verticalAlign,d=s.margin,f=s.chartWidth,h=s.chartHeight,p,x;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(i==="center"&&o==="vertical"){var g=this.getBBoxSnapshot();p={left:((f||0)-g.width)/2}}else p=i==="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();x={top:((h||0)-j.height)/2}}else x=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Ys(Ys({},p),x)}},{key:"render",value:function(){var r=this,s=this.props,o=s.content,i=s.width,c=s.height,d=s.wrapperStyle,f=s.payloadUniqBy,h=s.payload,p=Ys(Ys({position:"absolute",width:i||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return Y.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){r.wrapperNode=g}},aZ(o,Ys(Ys({},this.props),{},{payload:nL(h,f,rZ)})))}}],[{key:"getWithHeight",value:function(r,s){var o=Ys(Ys({},this.defaultProps),r.props),i=o.layout;return i==="vertical"&&Ge(r.props.height)?{height:r.props.height}:i==="horizontal"?{width:r.props.width||s}:null}}])})(m.PureComponent);Fv(Gi,"displayName","Legend");Fv(Gi,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var uw,DT;function sZ(){if(DT)return uw;DT=1;var e=$f(),t=XN(),n=Gr(),r=e?e.isConcatSpreadable:void 0;function s(o){return n(o)||t(o)||!!(r&&o&&o[r])}return uw=s,uw}var dw,LT;function sL(){if(LT)return dw;LT=1;var e=K3(),t=sZ();function n(r,s,o,i,c){var d=-1,f=r.length;for(o||(o=t),c||(c=[]);++d<f;){var h=r[d];s>0&&o(h)?s>1?n(h,s-1,o,i,c):e(c,h):i||(c[c.length]=h)}return c}return dw=n,dw}var fw,FT;function oZ(){if(FT)return fw;FT=1;function e(t){return function(n,r,s){for(var o=-1,i=Object(n),c=s(n),d=c.length;d--;){var f=c[t?d:++o];if(r(i[f],f,i)===!1)break}return n}}return fw=e,fw}var pw,zT;function iZ(){if(zT)return pw;zT=1;var e=oZ(),t=e();return pw=t,pw}var hw,BT;function oL(){if(BT)return hw;BT=1;var e=iZ(),t=Lv();function n(r,s){return r&&e(r,s,t)}return hw=n,hw}var mw,qT;function lZ(){if(qT)return mw;qT=1;var e=Lf();function t(n,r){return function(s,o){if(s==null)return s;if(!e(s))return n(s,o);for(var i=s.length,c=r?i:-1,d=Object(s);(r?c--:++c<i)&&o(d[c],c,d)!==!1;);return s}}return mw=t,mw}var vw,UT;function eC(){if(UT)return vw;UT=1;var e=oL(),t=lZ(),n=t(e);return vw=n,vw}var gw,WT;function iL(){if(WT)return gw;WT=1;var e=eC(),t=Lf();function n(r,s){var o=-1,i=t(r)?Array(r.length):[];return e(r,function(c,d,f){i[++o]=s(c,d,f)}),i}return gw=n,gw}var xw,VT;function cZ(){if(VT)return xw;VT=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return xw=e,xw}var yw,HT;function uZ(){if(HT)return yw;HT=1;var e=mu();function t(n,r){if(n!==r){var s=n!==void 0,o=n===null,i=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||o&&d&&h||!s&&h||!i)return 1;if(!o&&!c&&!p&&n<r||p&&s&&i&&!o&&!c||f&&s&&i||!d&&i||!h)return-1}return 0}return yw=t,yw}var bw,KT;function dZ(){if(KT)return bw;KT=1;var e=uZ();function t(n,r,s){for(var o=-1,i=n.criteria,c=r.criteria,d=i.length,f=s.length;++o<d;){var h=e(i[o],c[o]);if(h){if(o>=f)return h;var p=s[o];return h*(p=="desc"?-1:1)}}return n.index-r.index}return bw=t,bw}var ww,GT;function fZ(){if(GT)return ww;GT=1;var e=zN(),t=BN(),n=$s(),r=iL(),s=cZ(),o=Y3(),i=dZ(),c=xu(),d=Gr();function f(h,p,x){p.length?p=e(p,function(b){return d(b)?function(y){return t(y,b.length===1?b[0]:b)}:b}):p=[c];var g=-1;p=e(p,o(n));var j=r(h,function(b,y,S){var C=e(p,function(N){return N(b)});return{criteria:C,index:++g,value:b}});return s(j,function(b,y){return i(b,y,x)})}return ww=f,ww}var jw,YT;function pZ(){if(YT)return jw;YT=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 jw=e,jw}var Sw,XT;function hZ(){if(XT)return Sw;XT=1;var e=pZ(),t=Math.max;function n(r,s,o){return s=t(s===void 0?r.length-1:s,0),function(){for(var i=arguments,c=-1,d=t(i.length-s,0),f=Array(d);++c<d;)f[c]=i[s+c];c=-1;for(var h=Array(s+1);++c<s;)h[c]=i[c];return h[s]=o(f),e(r,this,h)}}return Sw=n,Sw}var Nw,QT;function mZ(){if(QT)return Nw;QT=1;function e(t){return function(){return t}}return Nw=e,Nw}var Cw,JT;function lL(){if(JT)return Cw;JT=1;var e=jl(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Cw=t,Cw}var _w,ZT;function vZ(){if(ZT)return _w;ZT=1;var e=mZ(),t=lL(),n=xu(),r=t?function(s,o){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:n;return _w=r,_w}var Aw,eR;function gZ(){if(eR)return Aw;eR=1;var e=800,t=16,n=Date.now;function r(s){var o=0,i=0;return function(){var c=n(),d=t-(c-i);if(i=c,d>0){if(++o>=e)return arguments[0]}else o=0;return s.apply(void 0,arguments)}}return Aw=r,Aw}var Ew,tR;function xZ(){if(tR)return Ew;tR=1;var e=vZ(),t=gZ(),n=t(e);return Ew=n,Ew}var kw,nR;function yZ(){if(nR)return kw;nR=1;var e=xu(),t=hZ(),n=xZ();function r(s,o){return n(t(s,o,e),s+"")}return kw=r,kw}var Pw,rR;function zv(){if(rR)return Pw;rR=1;var e=DN(),t=Lf(),n=QN(),r=fi();function s(o,i,c){if(!r(c))return!1;var d=typeof i;return(d=="number"?t(c)&&n(i,c.length):d=="string"&&i in c)?e(c[i],o):!1}return Pw=s,Pw}var Ow,aR;function bZ(){if(aR)return Ow;aR=1;var e=sL(),t=fZ(),n=yZ(),r=zv(),s=n(function(o,i){if(o==null)return[];var c=i.length;return c>1&&r(o,i[0],i[1])?i=[]:c>2&&r(i[0],i[1],i[2])&&(i=[i[0]]),t(o,e(i,1),[])});return Ow=s,Ow}var wZ=bZ();const tC=un(wZ);function Bd(e){"@babel/helpers - typeof";return Bd=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},Bd(e)}function TS(){return TS=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},TS.apply(this,arguments)}function jZ(e,t){return _Z(e)||CZ(e,t)||NZ(e,t)||SZ()}function SZ(){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 NZ(e,t){if(e){if(typeof e=="string")return sR(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 sR(e,t)}}function sR(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 CZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function _Z(e){if(Array.isArray(e))return e}function oR(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 Tw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oR(Object(n),!0).forEach(function(r){AZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AZ(e,t,n){return t=EZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EZ(e){var t=kZ(e,"string");return Bd(t)=="symbol"?t:t+""}function kZ(e,t){if(Bd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PZ(e){return Array.isArray(e)&&tr(e[0])&&tr(e[1])?e.join(" ~ "):e}var OZ=function(t){var n=t.separator,r=n===void 0?" : ":n,s=t.contentStyle,o=s===void 0?{}:s,i=t.itemStyle,c=i===void 0?{}:i,d=t.labelStyle,f=d===void 0?{}:d,h=t.payload,p=t.formatter,x=t.itemSorter,g=t.wrapperClassName,j=t.labelClassName,b=t.label,y=t.labelFormatter,S=t.accessibilityLayer,C=S===void 0?!1:S,N=function(){if(h&&h.length){var F={padding:0,margin:0},H=(x?tC(h,x):h).map(function(U,R){if(U.type==="none")return null;var W=Tw({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},c),X=U.formatter||p||PZ,G=U.value,z=U.name,J=G,D=z;if(X&&J!=null&&D!=null){var I=X(G,z,U,R,h);if(Array.isArray(I)){var ne=jZ(I,2);J=ne[0],D=ne[1]}else J=I}return Y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:W},tr(D)?Y.createElement("span",{className:"recharts-tooltip-item-name"},D):null,tr(D)?Y.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,Y.createElement("span",{className:"recharts-tooltip-item-value"},J),Y.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return Y.createElement("ul",{className:"recharts-tooltip-item-list",style:F},H)}return null},E=Tw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),A=Tw({margin:0},f),k=!Mt(b),O=k?b:"",T=Lt("recharts-default-tooltip",g),$=Lt("recharts-tooltip-label",j);k&&y&&h!==void 0&&h!==null&&(O=y(b,h));var B=C?{role:"status","aria-live":"assertive"}:{};return Y.createElement("div",TS({className:T,style:E},B),Y.createElement("p",{className:$,style:A},Y.isValidElement(O)?O:"".concat(O)),N())};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 ph(e,t,n){return t=TZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TZ(e){var t=RZ(e,"string");return qd(t)=="symbol"?t:t+""}function RZ(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)}var cd="recharts-tooltip-wrapper",IZ={visibility:"hidden"};function MZ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Lt(cd,ph(ph(ph(ph({},"".concat(cd,"-right"),Ge(n)&&t&&Ge(t.x)&&n>=t.x),"".concat(cd,"-left"),Ge(n)&&t&&Ge(t.x)&&n<t.x),"".concat(cd,"-bottom"),Ge(r)&&t&&Ge(t.y)&&r>=t.y),"".concat(cd,"-top"),Ge(r)&&t&&Ge(t.y)&&r<t.y))}function iR(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,s=e.offsetTopLeft,o=e.position,i=e.reverseDirection,c=e.tooltipDimension,d=e.viewBox,f=e.viewBoxDimension;if(o&&Ge(o[r]))return o[r];var h=n[r]-c-s,p=n[r]+s;if(t[r])return i[r]?h:p;if(i[r]){var x=h,g=d[r];return x<g?Math.max(p,d[r]):Math.max(h,d[r])}var j=p+c,b=d[r]+f;return j>b?Math.max(h,d[r]):Math.max(p,d[r])}function $Z(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 DZ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,s=e.position,o=e.reverseDirection,i=e.tooltipBox,c=e.useTranslate3d,d=e.viewBox,f,h,p;return i.height>0&&i.width>0&&n?(h=iR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:o,tooltipDimension:i.width,viewBox:d,viewBoxDimension:d.width}),p=iR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:o,tooltipDimension:i.height,viewBox:d,viewBoxDimension:d.height}),f=$Z({translateX:h,translateY:p,useTranslate3d:c})):f=IZ,{cssProperties:f,cssClasses:MZ({translateX:h,translateY:p,coordinate:n})}}function Mc(e){"@babel/helpers - typeof";return Mc=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},Mc(e)}function lR(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 cR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lR(Object(n),!0).forEach(function(r){IS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FZ(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,uL(r.key),r)}}function zZ(e,t,n){return t&&FZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function BZ(e,t,n){return t=tm(t),qZ(e,cL()?Reflect.construct(t,n||[],tm(e).constructor):t.apply(e,n))}function qZ(e,t){if(t&&(Mc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UZ(e)}function UZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cL=function(){return!!e})()}function tm(e){return tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},tm(e)}function WZ(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&&RS(e,t)}function RS(e,t){return RS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},RS(e,t)}function IS(e,t,n){return t=uL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uL(e){var t=VZ(e,"string");return Mc(t)=="symbol"?t:t+""}function VZ(e,t){if(Mc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var uR=1,HZ=(function(e){function t(){var n;LZ(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=BZ(this,t,[].concat(s)),IS(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),IS(n,"handleKeyDown",function(i){if(i.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 WZ(t,e),zZ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>uR||Math.abs(r.height-this.state.lastBoundingBox.height)>uR)&&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,o=s.active,i=s.allowEscapeViewBox,c=s.animationDuration,d=s.animationEasing,f=s.children,h=s.coordinate,p=s.hasPayload,x=s.isAnimationActive,g=s.offset,j=s.position,b=s.reverseDirection,y=s.useTranslate3d,S=s.viewBox,C=s.wrapperStyle,N=DZ({allowEscapeViewBox:i,coordinate:h,offsetTopLeft:g,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:S}),E=N.cssClasses,A=N.cssProperties,k=cR(cR({transition:x&&o?"transform ".concat(c,"ms ").concat(d):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&p?"visible":"hidden",position:"absolute",top:0,left:0},C);return Y.createElement("div",{tabIndex:-1,className:E,style:k,ref:function(T){r.wrapperNode=T}},f)}}])})(m.PureComponent),KZ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Sl={isSsr:KZ()};function $c(e){"@babel/helpers - typeof";return $c=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},$c(e)}function dR(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 fR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dR(Object(n),!0).forEach(function(r){nC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YZ(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,fL(r.key),r)}}function XZ(e,t,n){return t&&YZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function QZ(e,t,n){return t=nm(t),JZ(e,dL()?Reflect.construct(t,n||[],nm(e).constructor):t.apply(e,n))}function JZ(e,t){if(t&&($c(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZZ(e)}function ZZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dL=function(){return!!e})()}function nm(e){return nm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},nm(e)}function eee(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&&MS(e,t)}function MS(e,t){return MS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},MS(e,t)}function nC(e,t,n){return t=fL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fL(e){var t=tee(e,"string");return $c(t)=="symbol"?t:t+""}function tee(e,t){if($c(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function nee(e){return e.dataKey}function ree(e,t){return Y.isValidElement(e)?Y.cloneElement(e,t):typeof e=="function"?Y.createElement(e,t):Y.createElement(OZ,t)}var Fr=(function(e){function t(){return GZ(this,t),QZ(this,t,arguments)}return eee(t,e),XZ(t,[{key:"render",value:function(){var r=this,s=this.props,o=s.active,i=s.allowEscapeViewBox,c=s.animationDuration,d=s.animationEasing,f=s.content,h=s.coordinate,p=s.filterNull,x=s.isAnimationActive,g=s.offset,j=s.payload,b=s.payloadUniqBy,y=s.position,S=s.reverseDirection,C=s.useTranslate3d,N=s.viewBox,E=s.wrapperStyle,A=j??[];p&&A.length&&(A=nL(j.filter(function(O){return O.value!=null&&(O.hide!==!0||r.props.includeHidden)}),b,nee));var k=A.length>0;return Y.createElement(HZ,{allowEscapeViewBox:i,animationDuration:c,animationEasing:d,isAnimationActive:x,active:o,coordinate:h,hasPayload:k,offset:g,position:y,reverseDirection:S,useTranslate3d:C,viewBox:N,wrapperStyle:E},ree(f,fR(fR({},this.props),{},{payload:A})))}}])})(m.PureComponent);nC(Fr,"displayName","Tooltip");nC(Fr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Sl.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 Rw,pR;function aee(){if(pR)return Rw;pR=1;var e=Ms(),t=function(){return e.Date.now()};return Rw=t,Rw}var Iw,hR;function see(){if(hR)return Iw;hR=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Iw=t,Iw}var Mw,mR;function oee(){if(mR)return Mw;mR=1;var e=see(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Mw=n,Mw}var $w,vR;function pL(){if(vR)return $w;vR=1;var e=oee(),t=fi(),n=mu(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^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=o.test(f);return p||i.test(f)?c(f.slice(2),p?2:8):s.test(f)?r:+f}return $w=d,$w}var Dw,gR;function iee(){if(gR)return Dw;gR=1;var e=fi(),t=aee(),n=pL(),r="Expected a function",s=Math.max,o=Math.min;function i(c,d,f){var h,p,x,g,j,b,y=0,S=!1,C=!1,N=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(S=!!f.leading,C="maxWait"in f,x=C?s(n(f.maxWait)||0,d):x,N="trailing"in f?!!f.trailing:N);function E(H){var U=h,R=p;return h=p=void 0,y=H,g=c.apply(R,U),g}function A(H){return y=H,j=setTimeout(T,d),S?E(H):g}function k(H){var U=H-b,R=H-y,W=d-U;return C?o(W,x-R):W}function O(H){var U=H-b,R=H-y;return b===void 0||U>=d||U<0||C&&R>=x}function T(){var H=t();if(O(H))return $(H);j=setTimeout(T,k(H))}function $(H){return j=void 0,N&&h?E(H):(h=p=void 0,g)}function B(){j!==void 0&&clearTimeout(j),y=0,h=b=p=j=void 0}function q(){return j===void 0?g:$(t())}function F(){var H=t(),U=O(H);if(h=arguments,p=this,b=H,U){if(j===void 0)return A(b);if(C)return clearTimeout(j),j=setTimeout(T,d),E(b)}return j===void 0&&(j=setTimeout(T,d)),g}return F.cancel=B,F.flush=q,F}return Dw=i,Dw}var Lw,xR;function lee(){if(xR)return Lw;xR=1;var e=iee(),t=fi(),n="Expected a function";function r(s,o,i){var c=!0,d=!0;if(typeof s!="function")throw new TypeError(n);return t(i)&&(c="leading"in i?!!i.leading:c,d="trailing"in i?!!i.trailing:d),e(s,o,{leading:c,maxWait:o,trailing:d})}return Lw=r,Lw}var cee=lee();const hL=un(cee);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 yR(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 hh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yR(Object(n),!0).forEach(function(r){uee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uee(e,t,n){return t=dee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dee(e){var t=fee(e,"string");return Ud(t)=="symbol"?t:t+""}function fee(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)}function pee(e,t){return gee(e)||vee(e,t)||mee(e,t)||hee()}function hee(){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 mee(e,t){if(e){if(typeof e=="string")return bR(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 bR(e,t)}}function bR(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 vee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function gee(e){if(Array.isArray(e))return e}var rm=m.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,s=r===void 0?{width:-1,height:-1}:r,o=e.width,i=o===void 0?"100%":o,c=e.height,d=c===void 0?"100%":c,f=e.minWidth,h=f===void 0?0:f,p=e.minHeight,x=e.maxHeight,g=e.children,j=e.debounce,b=j===void 0?0:j,y=e.id,S=e.className,C=e.onResize,N=e.style,E=N===void 0?{}:N,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 O=m.useState({containerWidth:s.width,containerHeight:s.height}),T=pee(O,2),$=T[0],B=T[1],q=m.useCallback(function(H,U){B(function(R){var W=Math.round(H),X=Math.round(U);return R.containerWidth===W&&R.containerHeight===X?R:{containerWidth:W,containerHeight:X}})},[]);m.useEffect(function(){var H=function(z){var J,D=z[0].contentRect,I=D.width,ne=D.height;q(I,ne),(J=k.current)===null||J===void 0||J.call(k,I,ne)};b>0&&(H=hL(H,b,{trailing:!0,leading:!1}));var U=new ResizeObserver(H),R=A.current.getBoundingClientRect(),W=R.width,X=R.height;return q(W,X),U.observe(A.current),function(){U.disconnect()}},[q,b]);var F=m.useMemo(function(){var H=$.containerWidth,U=$.containerHeight;if(H<0||U<0)return null;ro(Ui(i)||Ui(d),`The width(%s) and height(%s) are both fixed numbers,
|
|
62
|
-
maybe you don't need to use a ResponsiveContainer.`,i,d),ro(!n||n>0,"The aspect(%s) must be greater than zero.",n);var R=Ui(i)?H:i,W=Ui(d)?U:d;n&&n>0&&(R?W=R/n:W&&(R=W*n),x&&W>x&&(W=x)),ro(R>0||W>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.`,R,W,i,d,h,p,n);var X=!Array.isArray(g)&&no(g.type).endsWith("Chart");return Y.Children.map(g,function(G){return Y.isValidElement(G)?m.cloneElement(G,hh({width:R,height:W},X?{style:hh({height:"100%",width:"100%",maxHeight:W,maxWidth:R},G.props.style)}:{})):G})},[n,g,d,x,p,h,$,i]);return Y.createElement("div",{id:y?"".concat(y):void 0,className:Lt("recharts-responsive-container",S),style:hh(hh({},E),{},{width:i,height:d,minWidth:h,minHeight:p,maxHeight:x}),ref:A},F)}),Bv=function(t){return null};Bv.displayName="Cell";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 wR(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 $S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wR(Object(n),!0).forEach(function(r){xee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xee(e,t,n){return t=yee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yee(e){var t=bee(e,"string");return Wd(t)=="symbol"?t:t+""}function bee(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)}var nc={widthCache:{},cacheCount:0},wee=2e3,jee={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},jR="recharts_measurement_span";function See(e){var t=$S({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var _d=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Sl.isSsr)return{width:0,height:0};var r=See(n),s=JSON.stringify({text:t,copyStyle:r});if(nc.widthCache[s])return nc.widthCache[s];try{var o=document.getElementById(jR);o||(o=document.createElement("span"),o.setAttribute("id",jR),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var i=$S($S({},jee),r);Object.assign(o.style,i),o.textContent="".concat(t);var c=o.getBoundingClientRect(),d={width:c.width,height:c.height};return nc.widthCache[s]=d,++nc.cacheCount>wee&&(nc.cacheCount=0,nc.widthCache={}),d}catch{return{width:0,height:0}}},Nee=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};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 am(e,t){return Eee(e)||Aee(e,t)||_ee(e,t)||Cee()}function Cee(){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 _ee(e,t){if(e){if(typeof e=="string")return SR(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 SR(e,t)}}function SR(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 Aee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function Eee(e){if(Array.isArray(e))return e}function kee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NR(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,Oee(r.key),r)}}function Pee(e,t,n){return t&&NR(e.prototype,t),n&&NR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oee(e){var t=Tee(e,"string");return Vd(t)=="symbol"?t:t+""}function Tee(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 String(e)}var CR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,_R=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Ree=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Iee=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,mL={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Mee=Object.keys(mL),fc="NaN";function $ee(e,t){return e*mL[t]}var mh=(function(){function e(t,n){kee(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!Ree.test(n)&&(this.num=NaN,this.unit=""),Mee.includes(n)&&(this.num=$ee(t,n),this.unit="px")}return Pee(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=Iee.exec(n))!==null&&r!==void 0?r:[],o=am(s,3),i=o[1],c=o[2];return new e(parseFloat(i),c??"")}}])})();function vL(e){if(e.includes(fc))return fc;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=CR.exec(t))!==null&&n!==void 0?n:[],s=am(r,4),o=s[1],i=s[2],c=s[3],d=mh.parse(o??""),f=mh.parse(c??""),h=i==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return fc;t=t.replace(CR,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,x=(p=_R.exec(t))!==null&&p!==void 0?p:[],g=am(x,4),j=g[1],b=g[2],y=g[3],S=mh.parse(j??""),C=mh.parse(y??""),N=b==="+"?S.add(C):S.subtract(C);if(N.isNaN())return fc;t=t.replace(_R,N.toString())}return t}var AR=/\(([^()]*)\)/;function Dee(e){for(var t=e;t.includes("(");){var n=AR.exec(t),r=am(n,2),s=r[1];t=t.replace(AR,vL(s))}return t}function Lee(e){var t=e.replace(/\s+/g,"");return t=Dee(t),t=vL(t),t}function Fee(e){try{return Lee(e)}catch{return fc}}function Fw(e){var t=Fee(e.slice(5,-1));return t===fc?"":t}var zee=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Bee=["dx","dy","angle","className","breakAll"];function DS(){return DS=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},DS.apply(this,arguments)}function ER(e,t){if(e==null)return{};var n=qee(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qee(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 kR(e,t){return Hee(e)||Vee(e,t)||Wee(e,t)||Uee()}function Uee(){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 Wee(e,t){if(e){if(typeof e=="string")return PR(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 PR(e,t)}}function PR(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 Vee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function Hee(e){if(Array.isArray(e))return e}var gL=/[ \f\n\r\t\v\u2028\u2029]+/,xL=function(t){var n=t.children,r=t.breakAll,s=t.style;try{var o=[];Mt(n)||(r?o=n.toString().split(""):o=n.toString().split(gL));var i=o.map(function(d){return{word:d,width:_d(d,s).width}}),c=r?0:_d(" ",s).width;return{wordsWithComputedWidth:i,spaceWidth:c}}catch{return null}},Kee=function(t,n,r,s,o){var i=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=Ge(i),p=c,x=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return R.reduce(function(W,X){var G=X.word,z=X.width,J=W[W.length-1];if(J&&(s==null||o||J.width+z+r<Number(s)))J.words.push(G),J.width+=z+r;else{var D={words:[G],width:z};W.push(D)}return W},[])},g=x(n),j=function(R){return R.reduce(function(W,X){return W.width>X.width?W:X})};if(!h)return g;for(var b="…",y=function(R){var W=p.slice(0,R),X=xL({breakAll:f,style:d,children:W+b}).wordsWithComputedWidth,G=x(X),z=G.length>i||j(G).width>Number(s);return[z,G]},S=0,C=p.length-1,N=0,E;S<=C&&N<=p.length-1;){var A=Math.floor((S+C)/2),k=A-1,O=y(k),T=kR(O,2),$=T[0],B=T[1],q=y(A),F=kR(q,1),H=F[0];if(!$&&!H&&(S=A+1),$&&H&&(C=A-1),!$&&H){E=B;break}N++}return E||g},OR=function(t){var n=Mt(t)?[]:t.toString().split(gL);return[{words:n}]},Gee=function(t){var n=t.width,r=t.scaleToFit,s=t.children,o=t.style,i=t.breakAll,c=t.maxLines;if((n||r)&&!Sl.isSsr){var d,f,h=xL({breakAll:i,children:s,style:o});if(h){var p=h.wordsWithComputedWidth,x=h.spaceWidth;d=p,f=x}else return OR(s);return Kee({breakAll:i,children:s,maxLines:c,style:o},d,f,n,r)}return OR(s)},TR="#808080",sl=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,o=s===void 0?0:s,i=t.lineHeight,c=i===void 0?"1em":i,d=t.capHeight,f=d===void 0?"0.71em":d,h=t.scaleToFit,p=h===void 0?!1:h,x=t.textAnchor,g=x===void 0?"start":x,j=t.verticalAnchor,b=j===void 0?"end":j,y=t.fill,S=y===void 0?TR:y,C=ER(t,zee),N=m.useMemo(function(){return Gee({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,O=C.className,T=C.breakAll,$=ER(C,Bee);if(!tr(r)||!tr(o))return null;var B=r+(Ge(E)?E:0),q=o+(Ge(A)?A:0),F;switch(b){case"start":F=Fw("calc(".concat(f,")"));break;case"middle":F=Fw("calc(".concat((N.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:F=Fw("calc(".concat(N.length-1," * -").concat(c,")"));break}var H=[];if(p){var U=N[0].width,R=C.width;H.push("scale(".concat((Ge(R)?R/U:1)/U,")"))}return k&&H.push("rotate(".concat(k,", ").concat(B,", ").concat(q,")")),H.length&&($.transform=H.join(" ")),Y.createElement("text",DS({},St($,!0),{x:B,y:q,className:Lt("recharts-text",O),textAnchor:g,fill:S.includes("url")?TR:S}),N.map(function(W,X){var G=W.words.join(T?"":" ");return Y.createElement("tspan",{x:B,dy:X===0?F:c,key:"".concat(G,"-").concat(X)},G)}))};function ei(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Yee(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function rC(e){let t,n,r;e.length!==2?(t=ei,n=(c,d)=>ei(e(c),d),r=(c,d)=>e(c)-d):(t=e===ei||e===Yee?e:Xee,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 o(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){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:i,right:o}}function Xee(){return 0}function yL(e){return e===null?NaN:+e}function*Qee(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Jee=rC(ei),Ff=Jee.right;rC(yL).center;class RR extends Map{constructor(t,n=tte){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(IR(this,t))}has(t){return super.has(IR(this,t))}set(t,n){return super.set(Zee(this,t),n)}delete(t){return super.delete(ete(this,t))}}function IR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Zee({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function ete({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function tte(e){return e!==null&&typeof e=="object"?e.valueOf():e}function nte(e=ei){if(e===ei)return bL;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 bL(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const rte=Math.sqrt(50),ate=Math.sqrt(10),ste=Math.sqrt(2);function sm(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),o=r/Math.pow(10,s),i=o>=rte?10:o>=ate?5:o>=ste?2:1;let c,d,f;return s<0?(f=Math.pow(10,-s)/i,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)*i,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?sm(e,t,n*2):[c,d,f]}function LS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[s,o,i]=r?sm(t,e,n):sm(e,t,n);if(!(o>=s))return[];const c=o-s+1,d=new Array(c);if(r)if(i<0)for(let f=0;f<c;++f)d[f]=(o-f)/-i;else for(let f=0;f<c;++f)d[f]=(o-f)*i;else if(i<0)for(let f=0;f<c;++f)d[f]=(s+f)/-i;else for(let f=0;f<c;++f)d[f]=(s+f)*i;return d}function FS(e,t,n){return t=+t,e=+e,n=+n,sm(e,t,n)[2]}function zS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,s=r?FS(t,e,n):FS(e,t,n);return(r?-1:1)*(s<0?1/-s:s)}function MR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function $R(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function wL(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?bL:nte(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),x=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),g=Math.max(n,Math.floor(t-f*p/d+x)),j=Math.min(r,Math.floor(t+(d-f)*p/d+x));wL(e,t,g,j,s)}const o=e[t];let i=n,c=r;for(ud(e,n,t),s(e[r],o)>0&&ud(e,n,r);i<c;){for(ud(e,i,c),++i,--c;s(e[i],o)<0;)++i;for(;s(e[c],o)>0;)--c}s(e[n],o)===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 ote(e,t,n){if(e=Float64Array.from(Qee(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return $R(e);if(t>=1)return MR(e);var r,s=(r-1)*t,o=Math.floor(s),i=MR(wL(e,o).subarray(0,o+1)),c=$R(e.subarray(o+1));return i+(c-i)*(s-o)}}function ite(e,t,n=yL){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,o=Math.floor(s),i=+n(e[o],o,e),c=+n(e[o+1],o+1,e);return i+(c-i)*(s-o)}}function lte(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,o=new Array(s);++r<s;)o[r]=e+r*n;return o}function Ma(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function bo(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 BS=Symbol("implicit");function aC(){var e=new RR,t=[],n=[],r=BS;function s(o){let i=e.get(o);if(i===void 0){if(r!==BS)return r;e.set(o,i=t.push(o)-1)}return n[i%n.length]}return s.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new RR;for(const i of o)e.has(i)||e.set(i,t.push(i)-1);return s},s.range=function(o){return arguments.length?(n=Array.from(o),s):n.slice()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.copy=function(){return aC(t,n).unknown(r)},Ma.apply(s,arguments),s}function Hd(){var e=aC().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,o,i,c=!1,d=0,f=0,h=.5;delete e.unknown;function p(){var x=t().length,g=s<r,j=g?s:r,b=g?r:s;o=(b-j)/Math.max(1,x-d+f*2),c&&(o=Math.floor(o)),j+=(b-j-o*(x-d))*h,i=o*(1-d),c&&(j=Math.round(j),i=Math.round(i));var y=lte(x).map(function(S){return j+o*S});return n(g?y.reverse():y)}return e.domain=function(x){return arguments.length?(t(x),p()):t()},e.range=function(x){return arguments.length?([r,s]=x,r=+r,s=+s,p()):[r,s]},e.rangeRound=function(x){return[r,s]=x,r=+r,s=+s,c=!0,p()},e.bandwidth=function(){return i},e.step=function(){return o},e.round=function(x){return arguments.length?(c=!!x,p()):c},e.padding=function(x){return arguments.length?(d=Math.min(1,f=+x),p()):d},e.paddingInner=function(x){return arguments.length?(d=Math.min(1,x),p()):d},e.paddingOuter=function(x){return arguments.length?(f=+x,p()):f},e.align=function(x){return arguments.length?(h=Math.max(0,Math.min(1,x)),p()):h},e.copy=function(){return Hd(t(),[r,s]).round(c).paddingInner(d).paddingOuter(f).align(h)},Ma.apply(p(),arguments)}function jL(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return jL(t())},e}function Ad(){return jL(Hd.apply(null,arguments).paddingInner(1))}function sC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function SL(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function zf(){}var Kd=.7,om=1/Kd,Sc="\\s*([+-]?\\d+)\\s*",Gd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ss="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cte=/^#([0-9a-f]{3,8})$/,ute=new RegExp(`^rgb\\(${Sc},${Sc},${Sc}\\)$`),dte=new RegExp(`^rgb\\(${Ss},${Ss},${Ss}\\)$`),fte=new RegExp(`^rgba\\(${Sc},${Sc},${Sc},${Gd}\\)$`),pte=new RegExp(`^rgba\\(${Ss},${Ss},${Ss},${Gd}\\)$`),hte=new RegExp(`^hsl\\(${Gd},${Ss},${Ss}\\)$`),mte=new RegExp(`^hsla\\(${Gd},${Ss},${Ss},${Gd}\\)$`),DR={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};sC(zf,Yd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:LR,formatHex:LR,formatHex8:vte,formatHsl:gte,formatRgb:FR,toString:FR});function LR(){return this.rgb().formatHex()}function vte(){return this.rgb().formatHex8()}function gte(){return NL(this).formatHsl()}function FR(){return this.rgb().formatRgb()}function Yd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=cte.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?zR(t):n===3?new Vr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vh(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=ute.exec(e))?new Vr(t[1],t[2],t[3],1):(t=dte.exec(e))?new Vr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=fte.exec(e))?vh(t[1],t[2],t[3],t[4]):(t=pte.exec(e))?vh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hte.exec(e))?UR(t[1],t[2]/100,t[3]/100,1):(t=mte.exec(e))?UR(t[1],t[2]/100,t[3]/100,t[4]):DR.hasOwnProperty(e)?zR(DR[e]):e==="transparent"?new Vr(NaN,NaN,NaN,0):null}function zR(e){return new Vr(e>>16&255,e>>8&255,e&255,1)}function vh(e,t,n,r){return r<=0&&(e=t=n=NaN),new Vr(e,t,n,r)}function xte(e){return e instanceof zf||(e=Yd(e)),e?(e=e.rgb(),new Vr(e.r,e.g,e.b,e.opacity)):new Vr}function qS(e,t,n,r){return arguments.length===1?xte(e):new Vr(e,t,n,r??1)}function Vr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}sC(Vr,qS,SL(zf,{brighter(e){return e=e==null?om:Math.pow(om,e),new Vr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Kd:Math.pow(Kd,e),new Vr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vr(Yi(this.r),Yi(this.g),Yi(this.b),im(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:BR,formatHex:BR,formatHex8:yte,formatRgb:qR,toString:qR}));function BR(){return`#${Wi(this.r)}${Wi(this.g)}${Wi(this.b)}`}function yte(){return`#${Wi(this.r)}${Wi(this.g)}${Wi(this.b)}${Wi((isNaN(this.opacity)?1:this.opacity)*255)}`}function qR(){const e=im(this.opacity);return`${e===1?"rgb(":"rgba("}${Yi(this.r)}, ${Yi(this.g)}, ${Yi(this.b)}${e===1?")":`, ${e})`}`}function im(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Yi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wi(e){return e=Yi(e),(e<16?"0":"")+e.toString(16)}function UR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Za(e,t,n,r)}function NL(e){if(e instanceof Za)return new Za(e.h,e.s,e.l,e.opacity);if(e instanceof zf||(e=Yd(e)),!e)return new Za;if(e instanceof Za)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),i=NaN,c=o-s,d=(o+s)/2;return c?(t===o?i=(n-r)/c+(n<r)*6:n===o?i=(r-t)/c+2:i=(t-n)/c+4,c/=d<.5?o+s:2-o-s,i*=60):c=d>0&&d<1?0:i,new Za(i,c,d,e.opacity)}function bte(e,t,n,r){return arguments.length===1?NL(e):new Za(e,t,n,r??1)}function Za(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}sC(Za,bte,SL(zf,{brighter(e){return e=e==null?om:Math.pow(om,e),new Za(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Kd:Math.pow(Kd,e),new Za(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 Vr(zw(e>=240?e-240:e+120,s,r),zw(e,s,r),zw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Za(WR(this.h),gh(this.s),gh(this.l),im(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=im(this.opacity);return`${e===1?"hsl(":"hsla("}${WR(this.h)}, ${gh(this.s)*100}%, ${gh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function WR(e){return e=(e||0)%360,e<0?e+360:e}function gh(e){return Math.max(0,Math.min(1,e||0))}function zw(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 oC=e=>()=>e;function wte(e,t){return function(n){return e+n*t}}function jte(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 Ste(e){return(e=+e)==1?CL:function(t,n){return n-t?jte(t,n,e):oC(isNaN(t)?n:t)}}function CL(e,t){var n=t-e;return n?wte(e,n):oC(isNaN(e)?t:e)}const VR=(function e(t){var n=Ste(t);function r(s,o){var i=n((s=qS(s)).r,(o=qS(o)).r),c=n(s.g,o.g),d=n(s.b,o.b),f=CL(s.opacity,o.opacity);return function(h){return s.r=i(h),s.g=c(h),s.b=d(h),s.opacity=f(h),s+""}}return r.gamma=e,r})(1);function Nte(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function Cte(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _te(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),i;for(i=0;i<r;++i)s[i]=yu(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(c){for(i=0;i<r;++i)o[i]=s[i](c);return o}}function Ate(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function lm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ete(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]=yu(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var US=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Bw=new RegExp(US.source,"g");function kte(e){return function(){return e}}function Pte(e){return function(t){return e(t)+""}}function Ote(e,t){var n=US.lastIndex=Bw.lastIndex=0,r,s,o,i=-1,c=[],d=[];for(e=e+"",t=t+"";(r=US.exec(e))&&(s=Bw.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),c[i]?c[i]+=o:c[++i]=o),(r=r[0])===(s=s[0])?c[i]?c[i]+=s:c[++i]=s:(c[++i]=null,d.push({i,x:lm(r,s)})),n=Bw.lastIndex;return n<t.length&&(o=t.slice(n),c[i]?c[i]+=o:c[++i]=o),c.length<2?d[0]?Pte(d[0].x):kte(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 yu(e,t){var n=typeof t,r;return t==null||n==="boolean"?oC(t):(n==="number"?lm:n==="string"?(r=Yd(t))?(t=r,VR):Ote:t instanceof Yd?VR:t instanceof Date?Ate:Cte(t)?Nte:Array.isArray(t)?_te:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Ete:lm)(e,t)}function iC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Tte(e,t){t===void 0&&(t=e,e=yu);for(var n=0,r=t.length-1,s=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(s,s=t[++n]);return function(i){var c=Math.max(0,Math.min(r-1,Math.floor(i*=r)));return o[c](i-c)}}function Rte(e){return function(){return e}}function cm(e){return+e}var HR=[0,1];function Er(e){return e}function WS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Rte(isNaN(t)?NaN:.5)}function Ite(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Mte(e,t,n){var r=e[0],s=e[1],o=t[0],i=t[1];return s<r?(r=WS(s,r),o=n(i,o)):(r=WS(r,s),o=n(o,i)),function(c){return o(r(c))}}function $te(e,t,n){var r=Math.min(e.length,t.length)-1,s=new Array(r),o=new Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)s[i]=WS(e[i],e[i+1]),o[i]=n(t[i],t[i+1]);return function(c){var d=Ff(e,c,1,r)-1;return o[d](s[d](c))}}function Bf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function qv(){var e=HR,t=HR,n=yu,r,s,o,i=Er,c,d,f;function h(){var x=Math.min(e.length,t.length);return i!==Er&&(i=Ite(e[0],e[x-1])),c=x>2?$te:Mte,d=f=null,p}function p(x){return x==null||isNaN(x=+x)?o:(d||(d=c(e.map(r),t,n)))(r(i(x)))}return p.invert=function(x){return i(s((f||(f=c(t,e.map(r),lm)))(x)))},p.domain=function(x){return arguments.length?(e=Array.from(x,cm),h()):e.slice()},p.range=function(x){return arguments.length?(t=Array.from(x),h()):t.slice()},p.rangeRound=function(x){return t=Array.from(x),n=iC,h()},p.clamp=function(x){return arguments.length?(i=x?!0:Er,h()):i!==Er},p.interpolate=function(x){return arguments.length?(n=x,h()):n},p.unknown=function(x){return arguments.length?(o=x,p):o},function(x,g){return r=x,s=g,h()}}function lC(){return qv()(Er,Er)}function Dte(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function um(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 Dc(e){return e=um(Math.abs(e)),e?e[1]:NaN}function Lte(e,t){return function(n,r){for(var s=n.length,o=[],i=0,c=e[0],d=0;s>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),o.push(n.substring(s-=c,s+c)),!((d+=c+1)>r));)c=e[i=(i+1)%e.length];return o.reverse().join(t)}}function Fte(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var zte=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xd(e){if(!(t=zte.exec(e)))throw new Error("invalid format: "+e);var t;return new cC({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]})}Xd.prototype=cC.prototype;function cC(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+""}cC.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 Bte(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 dm;function qte(e,t){var n=um(e,t);if(!n)return dm=void 0,e.toPrecision(t);var r=n[0],s=n[1],o=s-(dm=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,i=r.length;return o===i?r:o>i?r+new Array(o-i+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+um(e,Math.max(0,t+o-1))[0]}function KR(e,t){var n=um(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 GR={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Dte,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)=>KR(e*100,t),r:KR,s:qte,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function YR(e){return e}var XR=Array.prototype.map,QR=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ute(e){var t=e.grouping===void 0||e.thousands===void 0?YR:Lte(XR.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+"",o=e.numerals===void 0?YR:Fte(XR.call(e.numerals,String)),i=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p,x){p=Xd(p);var g=p.fill,j=p.align,b=p.sign,y=p.symbol,S=p.zero,C=p.width,N=p.comma,E=p.precision,A=p.trim,k=p.type;k==="n"?(N=!0,k="g"):GR[k]||(E===void 0&&(E=12),A=!0,k="g"),(S||g==="0"&&j==="=")&&(S=!0,g="0",j="=");var O=(x&&x.prefix!==void 0?x.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():""),T=(y==="$"?r:/[%p]/.test(k)?i:"")+(x&&x.suffix!==void 0?x.suffix:""),$=GR[k],B=/[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 q(F){var H=O,U=T,R,W,X;if(k==="c")U=$(F)+U,F="";else{F=+F;var G=F<0||1/F<0;if(F=isNaN(F)?d:$(Math.abs(F),E),A&&(F=Bte(F)),G&&+F==0&&b!=="+"&&(G=!1),H=(G?b==="("?b:c:b==="-"||b==="("?"":b)+H,U=(k==="s"&&!isNaN(F)&&dm!==void 0?QR[8+dm/3]:"")+U+(G&&b==="("?")":""),B){for(R=-1,W=F.length;++R<W;)if(X=F.charCodeAt(R),48>X||X>57){U=(X===46?s+F.slice(R+1):F.slice(R))+U,F=F.slice(0,R);break}}}N&&!S&&(F=t(F,1/0));var z=H.length+F.length+U.length,J=z<C?new Array(C-z+1).join(g):"";switch(N&&S&&(F=t(J+F,J.length?C-U.length:1/0),J=""),j){case"<":F=H+F+U+J;break;case"=":F=H+J+F+U;break;case"^":F=J.slice(0,z=J.length>>1)+H+F+U+J.slice(z);break;default:F=J+H+F+U;break}return o(F)}return q.toString=function(){return p+""},q}function h(p,x){var g=Math.max(-8,Math.min(8,Math.floor(Dc(x)/3)))*3,j=Math.pow(10,-g),b=f((p=Xd(p),p.type="f",p),{suffix:QR[8+g/3]});return function(y){return b(j*y)}}return{format:f,formatPrefix:h}}var xh,uC,_L;Wte({thousands:",",grouping:[3],currency:["$",""]});function Wte(e){return xh=Ute(e),uC=xh.format,_L=xh.formatPrefix,xh}function Vte(e){return Math.max(0,-Dc(Math.abs(e)))}function Hte(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Dc(t)/3)))*3-Dc(Math.abs(e)))}function Kte(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Dc(t)-Dc(e))+1}function AL(e,t,n,r){var s=zS(e,t,n),o;switch(r=Xd(r??",f"),r.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Hte(s,i))&&(r.precision=o),_L(r,i)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Kte(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Vte(s))&&(r.precision=o-(r.type==="%")*2);break}}return uC(r)}function pi(e){var t=e.domain;return e.ticks=function(n){var r=t();return LS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return AL(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,o=r.length-1,i=r[s],c=r[o],d,f,h=10;for(c<i&&(f=i,i=c,c=f,f=s,s=o,o=f);h-- >0;){if(f=FS(i,c,n),f===d)return r[s]=i,r[o]=c,t(r);if(f>0)i=Math.floor(i/f)*f,c=Math.ceil(c/f)*f;else if(f<0)i=Math.ceil(i*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function fm(){var e=lC();return e.copy=function(){return Bf(e,fm())},Ma.apply(e,arguments),pi(e)}function EL(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,cm),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return EL(e).unknown(t)},e=arguments.length?Array.from(e,cm):[0,1],pi(n)}function kL(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],o=e[r],i;return o<s&&(i=n,n=r,r=i,i=s,s=o,o=i),e[n]=t.floor(s),e[r]=t.ceil(o),e}function JR(e){return Math.log(e)}function ZR(e){return Math.exp(e)}function Gte(e){return-Math.log(-e)}function Yte(e){return-Math.exp(-e)}function Xte(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Qte(e){return e===10?Xte:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Jte(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 e2(e){return(t,n)=>-e(-t,n)}function dC(e){const t=e(JR,ZR),n=t.domain;let r=10,s,o;function i(){return s=Jte(r),o=Qte(r),n()[0]<0?(s=e2(s),o=e2(o),e(Gte,Yte)):e(JR,ZR),t}return t.base=function(c){return arguments.length?(r=+c,i()):r},t.domain=function(c){return arguments.length?(n(c),i()):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 x=s(f),g=s(h),j,b;const y=c==null?10:+c;let S=[];if(!(r%1)&&g-x<y){if(x=Math.floor(x),g=Math.ceil(g),f>0){for(;x<=g;++x)for(j=1;j<r;++j)if(b=x<0?j/o(-x):j*o(x),!(b<f)){if(b>h)break;S.push(b)}}else for(;x<=g;++x)for(j=r-1;j>=1;--j)if(b=x>0?j/o(-x):j*o(x),!(b<f)){if(b>h)break;S.push(b)}S.length*2<y&&(S=LS(f,h,y))}else S=LS(x,g,Math.min(g-x,y)).map(o);return p?S.reverse():S},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Xd(d)).precision==null&&(d.trim=!0),d=uC(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return h=>{let p=h/o(Math.round(s(h)));return p*r<r-.5&&(p*=r),p<=f?d(h):""}},t.nice=()=>n(kL(n(),{floor:c=>o(Math.floor(s(c))),ceil:c=>o(Math.ceil(s(c)))})),t}function PL(){const e=dC(qv()).domain([1,10]);return e.copy=()=>Bf(e,PL()).base(e.base()),Ma.apply(e,arguments),e}function t2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function n2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function fC(e){var t=1,n=e(t2(t),n2(t));return n.constant=function(r){return arguments.length?e(t2(t=+r),n2(t)):t},pi(n)}function OL(){var e=fC(qv());return e.copy=function(){return Bf(e,OL()).constant(e.constant())},Ma.apply(e,arguments)}function r2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Zte(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function ene(e){return e<0?-e*e:e*e}function pC(e){var t=e(Er,Er),n=1;function r(){return n===1?e(Er,Er):n===.5?e(Zte,ene):e(r2(n),r2(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},pi(t)}function hC(){var e=pC(qv());return e.copy=function(){return Bf(e,hC()).exponent(e.exponent())},Ma.apply(e,arguments),e}function tne(){return hC.apply(null,arguments).exponent(.5)}function a2(e){return Math.sign(e)*e*e}function nne(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function TL(){var e=lC(),t=[0,1],n=!1,r;function s(o){var i=nne(e(o));return isNaN(i)?r:n?Math.round(i):i}return s.invert=function(o){return e.invert(a2(o))},s.domain=function(o){return arguments.length?(e.domain(o),s):e.domain()},s.range=function(o){return arguments.length?(e.range((t=Array.from(o,cm)).map(a2)),s):t.slice()},s.rangeRound=function(o){return s.range(o).round(!0)},s.round=function(o){return arguments.length?(n=!!o,s):n},s.clamp=function(o){return arguments.length?(e.clamp(o),s):e.clamp()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.copy=function(){return TL(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ma.apply(s,arguments),pi(s)}function RL(){var e=[],t=[],n=[],r;function s(){var i=0,c=Math.max(1,t.length);for(n=new Array(c-1);++i<c;)n[i-1]=ite(e,i/c);return o}function o(i){return i==null||isNaN(i=+i)?r:t[Ff(n,i)]}return o.invertExtent=function(i){var c=t.indexOf(i);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},o.domain=function(i){if(!arguments.length)return e.slice();e=[];for(let c of i)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(ei),s()},o.range=function(i){return arguments.length?(t=Array.from(i),s()):t.slice()},o.unknown=function(i){return arguments.length?(r=i,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return RL().domain(e).range(t).unknown(r)},Ma.apply(o,arguments)}function IL(){var e=0,t=1,n=1,r=[.5],s=[0,1],o;function i(d){return d!=null&&d<=d?s[Ff(r,d,0,n)]:o}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return i}return i.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},i.range=function(d){return arguments.length?(n=(s=Array.from(d)).length-1,c()):s.slice()},i.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]]},i.unknown=function(d){return arguments.length&&(o=d),i},i.thresholds=function(){return r.slice()},i.copy=function(){return IL().domain([e,t]).range(s).unknown(o)},Ma.apply(pi(i),arguments)}function ML(){var e=[.5],t=[0,1],n,r=1;function s(o){return o!=null&&o<=o?t[Ff(e,o,0,r)]:n}return s.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(o){var i=t.indexOf(o);return[e[i-1],e[i]]},s.unknown=function(o){return arguments.length?(n=o,s):n},s.copy=function(){return ML().domain(e).range(t).unknown(n)},Ma.apply(s,arguments)}const qw=new Date,Uw=new Date;function ar(e,t,n,r){function s(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return s.floor=o=>(e(o=new Date(+o)),o),s.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),s.round=o=>{const i=s(o),c=s.ceil(o);return o-i<c-o?i:c},s.offset=(o,i)=>(t(o=new Date(+o),i==null?1:Math.floor(i)),o),s.range=(o,i,c)=>{const d=[];if(o=s.ceil(o),c=c==null?1:Math.floor(c),!(o<i)||!(c>0))return d;let f;do d.push(f=new Date(+o)),t(o,c),e(o);while(f<o&&o<i);return d},s.filter=o=>ar(i=>{if(i>=i)for(;e(i),!o(i);)i.setTime(i-1)},(i,c)=>{if(i>=i)if(c<0)for(;++c<=0;)for(;t(i,-1),!o(i););else for(;--c>=0;)for(;t(i,1),!o(i););}),n&&(s.count=(o,i)=>(qw.setTime(+o),Uw.setTime(+i),e(qw),e(Uw),Math.floor(n(qw,Uw))),s.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?s.filter(r?i=>r(i)%o===0:i=>s.count(0,i)%o===0):s)),s}const pm=ar(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);pm.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ar(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):pm);pm.range;const Zs=1e3,ka=Zs*60,eo=ka*60,fo=eo*24,mC=fo*7,s2=fo*30,Ww=fo*365,Vi=ar(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Zs)},(e,t)=>(t-e)/Zs,e=>e.getUTCSeconds());Vi.range;const vC=ar(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zs)},(e,t)=>{e.setTime(+e+t*ka)},(e,t)=>(t-e)/ka,e=>e.getMinutes());vC.range;const gC=ar(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ka)},(e,t)=>(t-e)/ka,e=>e.getUTCMinutes());gC.range;const xC=ar(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zs-e.getMinutes()*ka)},(e,t)=>{e.setTime(+e+t*eo)},(e,t)=>(t-e)/eo,e=>e.getHours());xC.range;const yC=ar(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*eo)},(e,t)=>(t-e)/eo,e=>e.getUTCHours());yC.range;const qf=ar(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ka)/fo,e=>e.getDate()-1);qf.range;const Uv=ar(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fo,e=>e.getUTCDate()-1);Uv.range;const $L=ar(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fo,e=>Math.floor(e/fo));$L.range;function Nl(e){return ar(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())*ka)/mC)}const Wv=Nl(0),hm=Nl(1),rne=Nl(2),ane=Nl(3),Lc=Nl(4),sne=Nl(5),one=Nl(6);Wv.range;hm.range;rne.range;ane.range;Lc.range;sne.range;one.range;function Cl(e){return ar(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)/mC)}const Vv=Cl(0),mm=Cl(1),ine=Cl(2),lne=Cl(3),Fc=Cl(4),cne=Cl(5),une=Cl(6);Vv.range;mm.range;ine.range;lne.range;Fc.range;cne.range;une.range;const bC=ar(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());bC.range;const wC=ar(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());wC.range;const po=ar(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());po.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ar(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)});po.range;const ho=ar(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());ho.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ar(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)});ho.range;function DL(e,t,n,r,s,o){const i=[[Vi,1,Zs],[Vi,5,5*Zs],[Vi,15,15*Zs],[Vi,30,30*Zs],[o,1,ka],[o,5,5*ka],[o,15,15*ka],[o,30,30*ka],[s,1,eo],[s,3,3*eo],[s,6,6*eo],[s,12,12*eo],[r,1,fo],[r,2,2*fo],[n,1,mC],[t,1,s2],[t,3,3*s2],[e,1,Ww]];function c(f,h,p){const x=h<f;x&&([f,h]=[h,f]);const g=p&&typeof p.range=="function"?p:d(f,h,p),j=g?g.range(f,+h+1):[];return x?j.reverse():j}function d(f,h,p){const x=Math.abs(h-f)/p,g=rC(([,,y])=>y).right(i,x);if(g===i.length)return e.every(zS(f/Ww,h/Ww,p));if(g===0)return pm.every(Math.max(zS(f,h,p),1));const[j,b]=i[x/i[g-1][2]<i[g][2]/x?g-1:g];return j.every(b)}return[c,d]}const[dne,fne]=DL(ho,wC,Vv,$L,yC,gC),[pne,hne]=DL(po,bC,Wv,qf,xC,vC);function Vw(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 Hw(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 mne(e){var t=e.dateTime,n=e.date,r=e.time,s=e.periods,o=e.days,i=e.shortDays,c=e.months,d=e.shortMonths,f=fd(s),h=pd(s),p=fd(o),x=pd(o),g=fd(i),j=pd(i),b=fd(c),y=pd(c),S=fd(d),C=pd(d),N={a:X,A:G,b:z,B:J,c:null,d:d2,e:d2,f:Lne,g:Gne,G:Xne,H:Mne,I:$ne,j:Dne,L:LL,m:Fne,M:zne,p:D,q:I,Q:h2,s:m2,S:Bne,u:qne,U:Une,V:Wne,w:Vne,W:Hne,x:null,X:null,y:Kne,Y:Yne,Z:Qne,"%":p2},E={a:ne,A:te,b:de,B:he,c:null,d:f2,e:f2,f:tre,g:dre,G:pre,H:Jne,I:Zne,j:ere,L:zL,m:nre,M:rre,p:V,q:ue,Q:h2,s:m2,S:are,u:sre,U:ore,V:ire,w:lre,W:cre,x:null,X:null,y:ure,Y:fre,Z:hre,"%":p2},A={a:B,A:q,b:F,B:H,c:U,d:c2,e:c2,f:One,g:l2,G:i2,H:u2,I:u2,j:Ane,L:Pne,m:_ne,M:Ene,p:$,q:Cne,Q:Rne,s:Ine,S:kne,u:bne,U:wne,V:jne,w:yne,W:Sne,x:R,X:W,y:l2,Y:i2,Z:Nne,"%":Tne};N.x=k(n,N),N.X=k(r,N),N.c=k(t,N),E.x=k(n,E),E.X=k(r,E),E.c=k(t,E);function k(Q,Z){return function(fe){var ae=[],Re=-1,_e=0,Me=Q.length,L,oe,pe;for(fe instanceof Date||(fe=new Date(+fe));++Re<Me;)Q.charCodeAt(Re)===37&&(ae.push(Q.slice(_e,Re)),(oe=o2[L=Q.charAt(++Re)])!=null?L=Q.charAt(++Re):oe=L==="e"?" ":"0",(pe=Z[L])&&(L=pe(fe,oe)),ae.push(L),_e=Re+1);return ae.push(Q.slice(_e,Re)),ae.join("")}}function O(Q,Z){return function(fe){var ae=dd(1900,void 0,1),Re=T(ae,Q,fe+="",0),_e,Me;if(Re!=fe.length)return null;if("Q"in ae)return new Date(ae.Q);if("s"in ae)return new Date(ae.s*1e3+("L"in ae?ae.L:0));if(Z&&!("Z"in ae)&&(ae.Z=0),"p"in ae&&(ae.H=ae.H%12+ae.p*12),ae.m===void 0&&(ae.m="q"in ae?ae.q:0),"V"in ae){if(ae.V<1||ae.V>53)return null;"w"in ae||(ae.w=1),"Z"in ae?(_e=Hw(dd(ae.y,0,1)),Me=_e.getUTCDay(),_e=Me>4||Me===0?mm.ceil(_e):mm(_e),_e=Uv.offset(_e,(ae.V-1)*7),ae.y=_e.getUTCFullYear(),ae.m=_e.getUTCMonth(),ae.d=_e.getUTCDate()+(ae.w+6)%7):(_e=Vw(dd(ae.y,0,1)),Me=_e.getDay(),_e=Me>4||Me===0?hm.ceil(_e):hm(_e),_e=qf.offset(_e,(ae.V-1)*7),ae.y=_e.getFullYear(),ae.m=_e.getMonth(),ae.d=_e.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),Me="Z"in ae?Hw(dd(ae.y,0,1)).getUTCDay():Vw(dd(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(Me+5)%7:ae.w+ae.U*7-(Me+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,Hw(ae)):Vw(ae)}}function T(Q,Z,fe,ae){for(var Re=0,_e=Z.length,Me=fe.length,L,oe;Re<_e;){if(ae>=Me)return-1;if(L=Z.charCodeAt(Re++),L===37){if(L=Z.charAt(Re++),oe=A[L in o2?Z.charAt(Re++):L],!oe||(ae=oe(Q,fe,ae))<0)return-1}else if(L!=fe.charCodeAt(ae++))return-1}return ae}function $(Q,Z,fe){var ae=f.exec(Z.slice(fe));return ae?(Q.p=h.get(ae[0].toLowerCase()),fe+ae[0].length):-1}function B(Q,Z,fe){var ae=g.exec(Z.slice(fe));return ae?(Q.w=j.get(ae[0].toLowerCase()),fe+ae[0].length):-1}function q(Q,Z,fe){var ae=p.exec(Z.slice(fe));return ae?(Q.w=x.get(ae[0].toLowerCase()),fe+ae[0].length):-1}function F(Q,Z,fe){var ae=S.exec(Z.slice(fe));return ae?(Q.m=C.get(ae[0].toLowerCase()),fe+ae[0].length):-1}function H(Q,Z,fe){var ae=b.exec(Z.slice(fe));return ae?(Q.m=y.get(ae[0].toLowerCase()),fe+ae[0].length):-1}function U(Q,Z,fe){return T(Q,t,Z,fe)}function R(Q,Z,fe){return T(Q,n,Z,fe)}function W(Q,Z,fe){return T(Q,r,Z,fe)}function X(Q){return i[Q.getDay()]}function G(Q){return o[Q.getDay()]}function z(Q){return d[Q.getMonth()]}function J(Q){return c[Q.getMonth()]}function D(Q){return s[+(Q.getHours()>=12)]}function I(Q){return 1+~~(Q.getMonth()/3)}function ne(Q){return i[Q.getUTCDay()]}function te(Q){return o[Q.getUTCDay()]}function de(Q){return d[Q.getUTCMonth()]}function he(Q){return c[Q.getUTCMonth()]}function V(Q){return s[+(Q.getUTCHours()>=12)]}function ue(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var Z=k(Q+="",N);return Z.toString=function(){return Q},Z},parse:function(Q){var Z=O(Q+="",!1);return Z.toString=function(){return Q},Z},utcFormat:function(Q){var Z=k(Q+="",E);return Z.toString=function(){return Q},Z},utcParse:function(Q){var Z=O(Q+="",!0);return Z.toString=function(){return Q},Z}}}var o2={"-":"",_:" ",0:"0"},ur=/^\s*\d+/,vne=/^%/,gne=/[\\^$*+?|[\]().{}]/g;function tn(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",o=s.length;return r+(o<n?new Array(n-o+1).join(t)+s:s)}function xne(e){return e.replace(gne,"\\$&")}function fd(e){return new RegExp("^(?:"+e.map(xne).join("|")+")","i")}function pd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function yne(e,t,n){var r=ur.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function bne(e,t,n){var r=ur.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function wne(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function jne(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Sne(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function i2(e,t,n){var r=ur.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function l2(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nne(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 Cne(e,t,n){var r=ur.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function _ne(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function c2(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ane(e,t,n){var r=ur.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function u2(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ene(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function kne(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Pne(e,t,n){var r=ur.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function One(e,t,n){var r=ur.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Tne(e,t,n){var r=vne.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Rne(e,t,n){var r=ur.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ine(e,t,n){var r=ur.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function d2(e,t){return tn(e.getDate(),t,2)}function Mne(e,t){return tn(e.getHours(),t,2)}function $ne(e,t){return tn(e.getHours()%12||12,t,2)}function Dne(e,t){return tn(1+qf.count(po(e),e),t,3)}function LL(e,t){return tn(e.getMilliseconds(),t,3)}function Lne(e,t){return LL(e,t)+"000"}function Fne(e,t){return tn(e.getMonth()+1,t,2)}function zne(e,t){return tn(e.getMinutes(),t,2)}function Bne(e,t){return tn(e.getSeconds(),t,2)}function qne(e){var t=e.getDay();return t===0?7:t}function Une(e,t){return tn(Wv.count(po(e)-1,e),t,2)}function FL(e){var t=e.getDay();return t>=4||t===0?Lc(e):Lc.ceil(e)}function Wne(e,t){return e=FL(e),tn(Lc.count(po(e),e)+(po(e).getDay()===4),t,2)}function Vne(e){return e.getDay()}function Hne(e,t){return tn(hm.count(po(e)-1,e),t,2)}function Kne(e,t){return tn(e.getFullYear()%100,t,2)}function Gne(e,t){return e=FL(e),tn(e.getFullYear()%100,t,2)}function Yne(e,t){return tn(e.getFullYear()%1e4,t,4)}function Xne(e,t){var n=e.getDay();return e=n>=4||n===0?Lc(e):Lc.ceil(e),tn(e.getFullYear()%1e4,t,4)}function Qne(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+tn(t/60|0,"0",2)+tn(t%60,"0",2)}function f2(e,t){return tn(e.getUTCDate(),t,2)}function Jne(e,t){return tn(e.getUTCHours(),t,2)}function Zne(e,t){return tn(e.getUTCHours()%12||12,t,2)}function ere(e,t){return tn(1+Uv.count(ho(e),e),t,3)}function zL(e,t){return tn(e.getUTCMilliseconds(),t,3)}function tre(e,t){return zL(e,t)+"000"}function nre(e,t){return tn(e.getUTCMonth()+1,t,2)}function rre(e,t){return tn(e.getUTCMinutes(),t,2)}function are(e,t){return tn(e.getUTCSeconds(),t,2)}function sre(e){var t=e.getUTCDay();return t===0?7:t}function ore(e,t){return tn(Vv.count(ho(e)-1,e),t,2)}function BL(e){var t=e.getUTCDay();return t>=4||t===0?Fc(e):Fc.ceil(e)}function ire(e,t){return e=BL(e),tn(Fc.count(ho(e),e)+(ho(e).getUTCDay()===4),t,2)}function lre(e){return e.getUTCDay()}function cre(e,t){return tn(mm.count(ho(e)-1,e),t,2)}function ure(e,t){return tn(e.getUTCFullYear()%100,t,2)}function dre(e,t){return e=BL(e),tn(e.getUTCFullYear()%100,t,2)}function fre(e,t){return tn(e.getUTCFullYear()%1e4,t,4)}function pre(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Fc(e):Fc.ceil(e),tn(e.getUTCFullYear()%1e4,t,4)}function hre(){return"+0000"}function p2(){return"%"}function h2(e){return+e}function m2(e){return Math.floor(+e/1e3)}var rc,qL,UL;mre({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 mre(e){return rc=mne(e),qL=rc.format,rc.parse,UL=rc.utcFormat,rc.utcParse,rc}function vre(e){return new Date(e)}function gre(e){return e instanceof Date?+e:+new Date(+e)}function jC(e,t,n,r,s,o,i,c,d,f){var h=lC(),p=h.invert,x=h.domain,g=f(".%L"),j=f(":%S"),b=f("%I:%M"),y=f("%I %p"),S=f("%a %d"),C=f("%b %d"),N=f("%B"),E=f("%Y");function A(k){return(d(k)<k?g:c(k)<k?j:i(k)<k?b:o(k)<k?y:r(k)<k?s(k)<k?S:C:n(k)<k?N:E)(k)}return h.invert=function(k){return new Date(p(k))},h.domain=function(k){return arguments.length?x(Array.from(k,gre)):x().map(vre)},h.ticks=function(k){var O=x();return e(O[0],O[O.length-1],k??10)},h.tickFormat=function(k,O){return O==null?A:f(O)},h.nice=function(k){var O=x();return(!k||typeof k.range!="function")&&(k=t(O[0],O[O.length-1],k??10)),k?x(kL(O,k)):h},h.copy=function(){return Bf(h,jC(e,t,n,r,s,o,i,c,d,f))},h}function xre(){return Ma.apply(jC(pne,hne,po,bC,Wv,qf,xC,vC,Vi,qL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function yre(){return Ma.apply(jC(dne,fne,ho,wC,Vv,Uv,yC,gC,Vi,UL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Hv(){var e=0,t=1,n,r,s,o,i=Er,c=!1,d;function f(p){return p==null||isNaN(p=+p)?d:i(s===0?.5:(p=(o(p)-n)*s,c?Math.max(0,Math.min(1,p)):p))}f.domain=function(p){return arguments.length?([e,t]=p,n=o(e=+e),r=o(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?(i=p,f):i};function h(p){return function(x){var g,j;return arguments.length?([g,j]=x,i=p(g,j),f):[i(0),i(1)]}}return f.range=h(yu),f.rangeRound=h(iC),f.unknown=function(p){return arguments.length?(d=p,f):d},function(p){return o=p,n=p(e),r=p(t),s=n===r?0:1/(r-n),f}}function hi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function WL(){var e=pi(Hv()(Er));return e.copy=function(){return hi(e,WL())},bo.apply(e,arguments)}function VL(){var e=dC(Hv()).domain([1,10]);return e.copy=function(){return hi(e,VL()).base(e.base())},bo.apply(e,arguments)}function HL(){var e=fC(Hv());return e.copy=function(){return hi(e,HL()).constant(e.constant())},bo.apply(e,arguments)}function SC(){var e=pC(Hv());return e.copy=function(){return hi(e,SC()).exponent(e.exponent())},bo.apply(e,arguments)}function bre(){return SC.apply(null,arguments).exponent(.5)}function KL(){var e=[],t=Er;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ff(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(ei),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,o)=>ote(e,o/r))},n.copy=function(){return KL(t).domain(e)},bo.apply(n,arguments)}function Kv(){var e=0,t=.5,n=1,r=1,s,o,i,c,d,f=Er,h,p=!1,x;function g(b){return isNaN(b=+b)?x:(b=.5+((b=+h(b))-o)*(r*b<r*o?c:d),f(p?Math.max(0,Math.min(1,b)):b))}g.domain=function(b){return arguments.length?([e,t,n]=b,s=h(e=+e),o=h(t=+t),i=h(n=+n),c=s===o?0:.5/(o-s),d=o===i?0:.5/(i-o),r=o<s?-1:1,g):[e,t,n]},g.clamp=function(b){return arguments.length?(p=!!b,g):p},g.interpolator=function(b){return arguments.length?(f=b,g):f};function j(b){return function(y){var S,C,N;return arguments.length?([S,C,N]=y,f=Tte(b,[S,C,N]),g):[f(0),f(.5),f(1)]}}return g.range=j(yu),g.rangeRound=j(iC),g.unknown=function(b){return arguments.length?(x=b,g):x},function(b){return h=b,s=b(e),o=b(t),i=b(n),c=s===o?0:.5/(o-s),d=o===i?0:.5/(i-o),r=o<s?-1:1,g}}function GL(){var e=pi(Kv()(Er));return e.copy=function(){return hi(e,GL())},bo.apply(e,arguments)}function YL(){var e=dC(Kv()).domain([.1,1,10]);return e.copy=function(){return hi(e,YL()).base(e.base())},bo.apply(e,arguments)}function XL(){var e=fC(Kv());return e.copy=function(){return hi(e,XL()).constant(e.constant())},bo.apply(e,arguments)}function NC(){var e=pC(Kv());return e.copy=function(){return hi(e,NC()).exponent(e.exponent())},bo.apply(e,arguments)}function wre(){return NC.apply(null,arguments).exponent(.5)}const v2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Hd,scaleDiverging:GL,scaleDivergingLog:YL,scaleDivergingPow:NC,scaleDivergingSqrt:wre,scaleDivergingSymlog:XL,scaleIdentity:EL,scaleImplicit:BS,scaleLinear:fm,scaleLog:PL,scaleOrdinal:aC,scalePoint:Ad,scalePow:hC,scaleQuantile:RL,scaleQuantize:IL,scaleRadial:TL,scaleSequential:WL,scaleSequentialLog:VL,scaleSequentialPow:SC,scaleSequentialQuantile:KL,scaleSequentialSqrt:bre,scaleSequentialSymlog:HL,scaleSqrt:tne,scaleSymlog:OL,scaleThreshold:ML,scaleTime:xre,scaleUtc:yre,tickFormat:AL},Symbol.toStringTag,{value:"Module"}));var Kw,g2;function Gv(){if(g2)return Kw;g2=1;var e=mu();function t(n,r,s){for(var o=-1,i=n.length;++o<i;){var c=n[o],d=r(c);if(d!=null&&(f===void 0?d===d&&!e(d):s(d,f)))var f=d,h=c}return h}return Kw=t,Kw}var Gw,x2;function QL(){if(x2)return Gw;x2=1;function e(t,n){return t>n}return Gw=e,Gw}var Yw,y2;function jre(){if(y2)return Yw;y2=1;var e=Gv(),t=QL(),n=xu();function r(s){return s&&s.length?e(s,n,t):void 0}return Yw=r,Yw}var Sre=jre();const Yv=un(Sre);var Xw,b2;function JL(){if(b2)return Xw;b2=1;function e(t,n){return t<n}return Xw=e,Xw}var Qw,w2;function Nre(){if(w2)return Qw;w2=1;var e=Gv(),t=JL(),n=xu();function r(s){return s&&s.length?e(s,n,t):void 0}return Qw=r,Qw}var Cre=Nre();const Xv=un(Cre);var Jw,j2;function _re(){if(j2)return Jw;j2=1;var e=zN(),t=$s(),n=iL(),r=Gr();function s(o,i){var c=r(o)?e:n;return c(o,t(i,3))}return Jw=s,Jw}var Zw,S2;function Are(){if(S2)return Zw;S2=1;var e=sL(),t=_re();function n(r,s){return e(t(r,s),1)}return Zw=n,Zw}var Ere=Are();const kre=un(Ere);var ej,N2;function Pre(){if(N2)return ej;N2=1;var e=ZN();function t(n,r){return e(n,r)}return ej=t,ej}var Ore=Pre();const Uf=un(Ore);var bu=1e9,Tre={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},_C,On=!0,Ra="[DecimalError] ",Xi=Ra+"Invalid argument: ",CC=Ra+"Exponent out of range: ",wu=Math.floor,Bi=Math.pow,Rre=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ca,lr=1e7,En=7,ZL=9007199254740991,vm=wu(ZL/En),rt={};rt.absoluteValue=rt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};rt.comparedTo=rt.cmp=function(e){var t,n,r,s,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,s=e.d.length,t=0,n=r<s?r:s;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===s?0:r>s^o.s<0?1:-1};rt.decimalPlaces=rt.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*En;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};rt.dividedBy=rt.div=function(e){return ao(this,new this.constructor(e))};rt.dividedToIntegerBy=rt.idiv=function(e){var t=this,n=t.constructor;return vn(ao(t,new n(e),0,1),n.precision)};rt.equals=rt.eq=function(e){return!this.cmp(e)};rt.exponent=function(){return Kn(this)};rt.greaterThan=rt.gt=function(e){return this.cmp(e)>0};rt.greaterThanOrEqualTo=rt.gte=function(e){return this.cmp(e)>=0};rt.isInteger=rt.isint=function(){return this.e>this.d.length-2};rt.isNegative=rt.isneg=function(){return this.s<0};rt.isPositive=rt.ispos=function(){return this.s>0};rt.isZero=function(){return this.s===0};rt.lessThan=rt.lt=function(e){return this.cmp(e)<0};rt.lessThanOrEqualTo=rt.lte=function(e){return this.cmp(e)<1};rt.logarithm=rt.log=function(e){var t,n=this,r=n.constructor,s=r.precision,o=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ca))throw Error(Ra+"NaN");if(n.s<1)throw Error(Ra+(n.s?"NaN":"-Infinity"));return n.eq(ca)?new r(0):(On=!1,t=ao(Qd(n,o),Qd(e,o),o),On=!0,vn(t,s))};rt.minus=rt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?n4(t,e):e4(t,(e.s=-e.s,e))};rt.modulo=rt.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(Ra+"NaN");return n.s?(On=!1,t=ao(n,e,0,1).times(e),On=!0,n.minus(t)):vn(new r(n),s)};rt.naturalExponential=rt.exp=function(){return t4(this)};rt.naturalLogarithm=rt.ln=function(){return Qd(this)};rt.negated=rt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};rt.plus=rt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?e4(t,e):n4(t,(e.s=-e.s,e))};rt.precision=rt.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Xi+e);if(t=Kn(s)+1,r=s.d.length-1,n=r*En+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};rt.squareRoot=rt.sqrt=function(){var e,t,n,r,s,o,i,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(Ra+"NaN")}for(e=Kn(c),On=!1,s=Math.sqrt(+c),s==0||s==1/0?(t=bs(c.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=wu((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=i=n+3;;)if(o=r,r=o.plus(ao(c,o,i+2)).times(.5),bs(o.d).slice(0,i)===(t=bs(r.d)).slice(0,i)){if(t=t.slice(i-3,i+1),s==i&&t=="4999"){if(vn(o,n+1,0),o.times(o).eq(c)){r=o;break}}else if(t!="9999")break;i+=4}return On=!0,vn(r,n)};rt.times=rt.mul=function(e){var t,n,r,s,o,i,c,d,f,h=this,p=h.constructor,x=h.d,g=(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=x.length,f=g.length,d<f&&(o=x,x=g,g=o,i=d,d=f,f=i),o=[],i=d+f,r=i;r--;)o.push(0);for(r=f;--r>=0;){for(t=0,s=d+r;s>r;)c=o[s]+g[r]*x[s-r-1]+t,o[s--]=c%lr|0,t=c/lr|0;o[s]=(o[s]+t)%lr|0}for(;!o[--i];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,On?vn(e,p.precision):e};rt.toDecimalPlaces=rt.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ks(e,0,bu),t===void 0?t=r.rounding:ks(t,0,8),vn(n,e+Kn(n)+1,t))};rt.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=ol(r,!0):(ks(e,0,bu),t===void 0?t=s.rounding:ks(t,0,8),r=vn(new s(r),e+1,t),n=ol(r,!0,e+1)),n};rt.toFixed=function(e,t){var n,r,s=this,o=s.constructor;return e===void 0?ol(s):(ks(e,0,bu),t===void 0?t=o.rounding:ks(t,0,8),r=vn(new o(s),e+Kn(s)+1,t),n=ol(r.abs(),!1,e+Kn(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};rt.toInteger=rt.toint=function(){var e=this,t=e.constructor;return vn(new t(e),Kn(e)+1,t.rounding)};rt.toNumber=function(){return+this};rt.toPower=rt.pow=function(e){var t,n,r,s,o,i,c=this,d=c.constructor,f=12,h=+(e=new d(e));if(!e.s)return new d(ca);if(c=new d(c),!c.s){if(e.s<1)throw Error(Ra+"Infinity");return c}if(c.eq(ca))return c;if(r=d.precision,e.eq(ca))return vn(c,r);if(t=e.e,n=e.d.length-1,i=t>=n,o=c.s,i){if((n=h<0?-h:h)<=ZL){for(s=new d(ca),t=Math.ceil(r/En+4),On=!1;n%2&&(s=s.times(c),_2(s.d,t)),n=wu(n/2),n!==0;)c=c.times(c),_2(c.d,t);return On=!0,e.s<0?new d(ca).div(s):vn(s,r)}}else if(o<0)throw Error(Ra+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,On=!1,s=e.times(Qd(c,r+f)),On=!0,s=t4(s),s.s=o,s};rt.toPrecision=function(e,t){var n,r,s=this,o=s.constructor;return e===void 0?(n=Kn(s),r=ol(s,n<=o.toExpNeg||n>=o.toExpPos)):(ks(e,1,bu),t===void 0?t=o.rounding:ks(t,0,8),s=vn(new o(s),e,t),n=Kn(s),r=ol(s,e<=n||n<=o.toExpNeg,e)),r};rt.toSignificantDigits=rt.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ks(e,1,bu),t===void 0?t=r.rounding:ks(t,0,8)),vn(new r(n),e,t)};rt.toString=rt.valueOf=rt.val=rt.toJSON=rt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Kn(e),n=e.constructor;return ol(e,t<=n.toExpNeg||t>=n.toExpPos)};function e4(e,t){var n,r,s,o,i,c,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),On?vn(t,p):t;if(d=e.d,f=t.d,i=e.e,s=t.e,d=d.slice(),o=i-s,o){for(o<0?(r=d,o=-o,c=f.length):(r=f,s=i,c=d.length),i=Math.ceil(p/En),c=i>c?i+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=d.length,o=f.length,c-o<0&&(o=c,r=f,f=d,d=r),n=0;o;)n=(d[--o]=d[o]+f[o]+n)/lr|0,d[o]%=lr;for(n&&(d.unshift(n),++s),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=s,On?vn(t,p):t}function ks(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Xi+e)}function bs(e){var t,n,r,s=e.length-1,o="",i=e[0];if(s>0){for(o+=i,t=1;t<s;t++)r=e[t]+"",n=En-r.length,n&&(o+=Yo(n)),o+=r;i=e[t],r=i+"",n=En-r.length,n&&(o+=Yo(n))}else if(i===0)return"0";for(;i%10===0;)i/=10;return o+i}var ao=(function(){function e(r,s){var o,i=0,c=r.length;for(r=r.slice();c--;)o=r[c]*s+i,r[c]=o%lr|0,i=o/lr|0;return i&&r.unshift(i),r}function t(r,s,o,i){var c,d;if(o!=i)d=o>i?1:-1;else for(c=d=0;c<o;c++)if(r[c]!=s[c]){d=r[c]>s[c]?1:-1;break}return d}function n(r,s,o){for(var i=0;o--;)r[o]-=i,i=r[o]<s[o]?1:0,r[o]=i*lr+r[o]-s[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,s,o,i){var c,d,f,h,p,x,g,j,b,y,S,C,N,E,A,k,O,T,$=r.constructor,B=r.s==s.s?1:-1,q=r.d,F=s.d;if(!r.s)return new $(r);if(!s.s)throw Error(Ra+"Division by zero");for(d=r.e-s.e,O=F.length,A=q.length,g=new $(B),j=g.d=[],f=0;F[f]==(q[f]||0);)++f;if(F[f]>(q[f]||0)&&--d,o==null?C=o=$.precision:i?C=o+(Kn(r)-Kn(s))+1:C=o,C<0)return new $(0);if(C=C/En+2|0,f=0,O==1)for(h=0,F=F[0],C++;(f<A||h)&&C--;f++)N=h*lr+(q[f]||0),j[f]=N/F|0,h=N%F|0;else{for(h=lr/(F[0]+1)|0,h>1&&(F=e(F,h),q=e(q,h),O=F.length,A=q.length),E=O,b=q.slice(0,O),y=b.length;y<O;)b[y++]=0;T=F.slice(),T.unshift(0),k=F[0],F[1]>=lr/2&&++k;do h=0,c=t(F,b,O,y),c<0?(S=b[0],O!=y&&(S=S*lr+(b[1]||0)),h=S/k|0,h>1?(h>=lr&&(h=lr-1),p=e(F,h),x=p.length,y=b.length,c=t(p,b,x,y),c==1&&(h--,n(p,O<x?T:F,x))):(h==0&&(c=h=1),p=F.slice()),x=p.length,x<y&&p.unshift(0),n(b,p,y),c==-1&&(y=b.length,c=t(F,b,O,y),c<1&&(h++,n(b,O<y?T:F,y))),y=b.length):c===0&&(h++,b=[0]),j[f++]=h,c&&b[0]?b[y++]=q[E]||0:(b=[q[E]],y=1);while((E++<A||b[0]!==void 0)&&C--)}return j[0]||j.shift(),g.e=d,vn(g,i?o+Kn(g)+1:o)}})();function t4(e,t){var n,r,s,o,i,c,d=0,f=0,h=e.constructor,p=h.precision;if(Kn(e)>16)throw Error(CC+Kn(e));if(!e.s)return new h(ca);for(On=!1,c=p,i=new h(.03125);e.abs().gte(.1);)e=e.times(i),f+=5;for(r=Math.log(Bi(2,f))/Math.LN10*2+5|0,c+=r,n=s=o=new h(ca),h.precision=c;;){if(s=vn(s.times(e),c),n=n.times(++d),i=o.plus(ao(s,n,c)),bs(i.d).slice(0,c)===bs(o.d).slice(0,c)){for(;f--;)o=vn(o.times(o),c);return h.precision=p,t==null?(On=!0,vn(o,p)):o}o=i}}function Kn(e){for(var t=e.e*En,n=e.d[0];n>=10;n/=10)t++;return t}function tj(e,t,n){if(t>e.LN10.sd())throw On=!0,n&&(e.precision=n),Error(Ra+"LN10 precision limit exceeded");return vn(new e(e.LN10),t)}function Yo(e){for(var t="";e--;)t+="0";return t}function Qd(e,t){var n,r,s,o,i,c,d,f,h,p=1,x=10,g=e,j=g.d,b=g.constructor,y=b.precision;if(g.s<1)throw Error(Ra+(g.s?"NaN":"-Infinity"));if(g.eq(ca))return new b(0);if(t==null?(On=!1,f=y):f=t,g.eq(10))return t==null&&(On=!0),tj(b,f);if(f+=x,b.precision=f,n=bs(j),r=n.charAt(0),o=Kn(g),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=bs(g.d),r=n.charAt(0),p++;o=Kn(g),r>1?(g=new b("0."+n),o++):g=new b(r+"."+n.slice(1))}else return d=tj(b,f+2,y).times(o+""),g=Qd(new b(r+"."+n.slice(1)),f-x).plus(d),b.precision=y,t==null?(On=!0,vn(g,y)):g;for(c=i=g=ao(g.minus(ca),g.plus(ca),f),h=vn(g.times(g),f),s=3;;){if(i=vn(i.times(h),f),d=c.plus(ao(i,new b(s),f)),bs(d.d).slice(0,f)===bs(c.d).slice(0,f))return c=c.times(2),o!==0&&(c=c.plus(tj(b,f+2,y).times(o+""))),c=ao(c,new b(p),f),b.precision=y,t==null?(On=!0,vn(c,y)):c;c=d,s+=2}}function C2(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=wu(n/En),e.d=[],r=(n+1)%En,n<0&&(r+=En),r<s){for(r&&e.d.push(+t.slice(0,r)),s-=En;r<s;)e.d.push(+t.slice(r,r+=En));t=t.slice(r),r=En-t.length}else r-=s;for(;r--;)t+="0";if(e.d.push(+t),On&&(e.e>vm||e.e<-vm))throw Error(CC+n)}else e.s=0,e.e=0,e.d=[0];return e}function vn(e,t,n){var r,s,o,i,c,d,f,h,p=e.d;for(i=1,o=p[0];o>=10;o/=10)i++;if(r=t-i,r<0)r+=En,s=t,f=p[h=0];else{if(h=Math.ceil((r+1)/En),o=p.length,h>=o)return e;for(f=o=p[h],i=1;o>=10;o/=10)i++;r%=En,s=r-En+i}if(n!==void 0&&(o=Bi(10,i-s-1),c=f/o%10|0,d=t<0||p[h+1]!==void 0||f%o,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/Bi(10,i-s):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(o=Kn(e),p.length=1,t=t-o-1,p[0]=Bi(10,(En-t%En)%En),e.e=wu(-t/En)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=h,o=1,h--):(p.length=h+1,o=Bi(10,En-r),p[h]=s>0?(f/Bi(10,i-s)%Bi(10,s)|0)*o:0),d)for(;;)if(h==0){(p[0]+=o)==lr&&(p[0]=1,++e.e);break}else{if(p[h]+=o,p[h]!=lr)break;p[h--]=0,o=1}for(r=p.length;p[--r]===0;)p.pop();if(On&&(e.e>vm||e.e<-vm))throw Error(CC+Kn(e));return e}function n4(e,t){var n,r,s,o,i,c,d,f,h,p,x=e.constructor,g=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),On?vn(t,g):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),i=f-r,i){for(h=i<0,h?(n=d,i=-i,c=p.length):(n=p,r=f,c=d.length),s=Math.max(Math.ceil(g/En),c)+2,i>s&&(i=s,n.length=1),n.reverse(),s=i;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}i=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>i;){if(d[--s]<p[s]){for(o=s;o&&d[--o]===0;)d[o]=lr-1;--d[o],d[s]+=lr}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,On?vn(t,g):t):new x(0)}function ol(e,t,n){var r,s=Kn(e),o=bs(e.d),i=o.length;return t?(n&&(r=n-i)>0?o=o.charAt(0)+"."+o.slice(1)+Yo(r):i>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(s<0?"e":"e+")+s):s<0?(o="0."+Yo(-s-1)+o,n&&(r=n-i)>0&&(o+=Yo(r))):s>=i?(o+=Yo(s+1-i),n&&(r=n-s-1)>0&&(o=o+"."+Yo(r))):((r=s+1)<i&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-i)>0&&(s+1===i&&(o+="."),o+=Yo(r))),e.s<0?"-"+o:o}function _2(e,t){if(e.length>t)return e.length=t,!0}function r4(e){var t,n,r;function s(o){var i=this;if(!(i instanceof s))return new s(o);if(i.constructor=s,o instanceof s){i.s=o.s,i.e=o.e,i.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Xi+o);if(o>0)i.s=1;else if(o<0)o=-o,i.s=-1;else{i.s=0,i.e=0,i.d=[0];return}if(o===~~o&&o<1e7){i.e=0,i.d=[o];return}return C2(i,o.toString())}else if(typeof o!="string")throw Error(Xi+o);if(o.charCodeAt(0)===45?(o=o.slice(1),i.s=-1):i.s=1,Rre.test(o))C2(i,o);else throw Error(Xi+o)}if(s.prototype=rt,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=r4,s.config=s.set=Ire,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 Ire(e){if(!e||typeof e!="object")throw Error(Ra+"Object expected");var t,n,r,s=["precision",1,bu,"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(wu(r)===r&&r>=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(Xi+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Xi+n+": "+r);return this}var _C=r4(Tre);ca=new _C(1);const pn=_C;function Mre(e){return Fre(e)||Lre(e)||Dre(e)||$re()}function $re(){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 Dre(e,t){if(e){if(typeof e=="string")return VS(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 VS(e,t)}}function Lre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Fre(e){if(Array.isArray(e))return VS(e)}function VS(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 zre=function(t){return t},a4={},s4=function(t){return t===a4},A2=function(t){return function n(){return arguments.length===0||arguments.length===1&&s4(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Bre=function e(t,n){return t===1?n:A2(function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];var i=s.filter(function(c){return c!==a4}).length;return i>=t?n.apply(void 0,s):e(t-i,A2(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 s4(p)?d.shift():p});return n.apply(void 0,Mre(h).concat(d))}))})},Qv=function(t){return Bre(t.length,t)},HS=function(t,n){for(var r=[],s=t;s<n;++s)r[s-t]=s;return r},qre=Qv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Ure=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return zre;var s=n.reverse(),o=s[0],i=s.slice(1);return function(){return i.reduce(function(c,d){return d(c)},o.apply(void 0,arguments))}},KS=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},o4=function(t){var n=null,r=null;return function(){for(var s=arguments.length,o=new Array(s),i=0;i<s;i++)o[i]=arguments[i];return n&&o.every(function(c,d){return c===n[d]})||(n=o,r=t.apply(void 0,o)),r}};function Wre(e){var t;return e===0?t=1:t=Math.floor(new pn(e).abs().log(10).toNumber())+1,t}function Vre(e,t,n){for(var r=new pn(e),s=0,o=[];r.lt(t)&&s<1e5;)o.push(r.toNumber()),r=r.add(n),s++;return o}var Hre=Qv(function(e,t,n){var r=+e,s=+t;return r+n*(s-r)}),Kre=Qv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Gre=Qv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Jv={rangeStep:Vre,getDigitCount:Wre,interpolateNumber:Hre,uninterpolateNumber:Kre,uninterpolateTruncation:Gre};function GS(e){return Qre(e)||Xre(e)||i4(e)||Yre()}function Yre(){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 Xre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Qre(e){if(Array.isArray(e))return YS(e)}function Jd(e,t){return eae(e)||Zre(e,t)||i4(e,t)||Jre()}function Jre(){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 i4(e,t){if(e){if(typeof e=="string")return YS(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 YS(e,t)}}function YS(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 Zre(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!1,o=void 0;try{for(var i=e[Symbol.iterator](),c;!(r=(c=i.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(d){s=!0,o=d}finally{try{!r&&i.return!=null&&i.return()}finally{if(s)throw o}}return n}}function eae(e){if(Array.isArray(e))return e}function l4(e){var t=Jd(e,2),n=t[0],r=t[1],s=n,o=r;return n>r&&(s=r,o=n),[s,o]}function c4(e,t,n){if(e.lte(0))return new pn(0);var r=Jv.getDigitCount(e.toNumber()),s=new pn(10).pow(r),o=e.div(s),i=r!==1?.05:.1,c=new pn(Math.ceil(o.div(i).toNumber())).add(n).mul(i),d=c.mul(s);return t?d:new pn(Math.ceil(d))}function tae(e,t,n){var r=1,s=new pn(e);if(!s.isint()&&n){var o=Math.abs(e);o<1?(r=new pn(10).pow(Jv.getDigitCount(e)-1),s=new pn(Math.floor(s.div(r).toNumber())).mul(r)):o>1&&(s=new pn(Math.floor(e)))}else e===0?s=new pn(Math.floor((t-1)/2)):n||(s=new pn(Math.floor(e)));var i=Math.floor((t-1)/2),c=Ure(qre(function(d){return s.add(new pn(d-i).mul(r)).toNumber()}),HS);return c(0,t)}function u4(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 pn(0),tickMin:new pn(0),tickMax:new pn(0)};var o=c4(new pn(t).sub(e).div(n-1),r,s),i;e<=0&&t>=0?i=new pn(0):(i=new pn(e).add(t).div(2),i=i.sub(new pn(i).mod(o)));var c=Math.ceil(i.sub(e).div(o).toNumber()),d=Math.ceil(new pn(t).sub(i).div(o).toNumber()),f=c+d+1;return f>n?u4(e,t,n,r,s+1):(f<n&&(d=t>0?d+(n-f):d,c=t>0?c:c+(n-f)),{step:o,tickMin:i.sub(new pn(c).mul(o)),tickMax:i.add(new pn(d).mul(o))})}function nae(e){var t=Jd(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=Math.max(s,2),c=l4([n,r]),d=Jd(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(GS(HS(0,s-1).map(function(){return 1/0}))):[].concat(GS(HS(0,s-1).map(function(){return-1/0})),[h]);return n>r?KS(p):p}if(f===h)return tae(f,s,o);var x=u4(f,h,i,o),g=x.step,j=x.tickMin,b=x.tickMax,y=Jv.rangeStep(j,b.add(new pn(.1).mul(g)),g);return n>r?KS(y):y}function rae(e,t){var n=Jd(e,2),r=n[0],s=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=l4([r,s]),c=Jd(i,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=c4(new pn(f).sub(d).div(h-1),o,0),x=[].concat(GS(Jv.rangeStep(new pn(d),new pn(f).sub(new pn(.99).mul(p)),p)),[f]);return r>s?KS(x):x}var aae=o4(nae),sae=o4(rae),oae="Invariant failed";function il(e,t){throw new Error(oae)}var iae=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];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 gm(){return gm=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},gm.apply(this,arguments)}function lae(e,t){return fae(e)||dae(e,t)||uae(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 uae(e,t){if(e){if(typeof e=="string")return E2(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 E2(e,t)}}function E2(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 dae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function fae(e){if(Array.isArray(e))return e}function pae(e,t){if(e==null)return{};var n=hae(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hae(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 mae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vae(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,p4(r.key),r)}}function gae(e,t,n){return t&&vae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xae(e,t,n){return t=xm(t),yae(e,d4()?Reflect.construct(t,n||[],xm(e).constructor):t.apply(e,n))}function yae(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 bae(e)}function bae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(d4=function(){return!!e})()}function xm(e){return xm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xm(e)}function wae(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&&XS(e,t)}function XS(e,t){return XS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},XS(e,t)}function f4(e,t,n){return t=p4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p4(e){var t=jae(e,"string");return zc(t)=="symbol"?t:t+""}function jae(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 Wf=(function(e){function t(){return mae(this,t),xae(this,t,arguments)}return wae(t,e),gae(t,[{key:"render",value:function(){var r=this.props,s=r.offset,o=r.layout,i=r.width,c=r.dataKey,d=r.data,f=r.dataPointFormatter,h=r.xAxis,p=r.yAxis,x=pae(r,iae),g=St(x,!1);this.props.direction==="x"&&h.type!=="number"&&il();var j=d.map(function(b){var y=f(b,c),S=y.x,C=y.y,N=y.value,E=y.errorVal;if(!E)return null;var A=[],k,O;if(Array.isArray(E)){var T=lae(E,2);k=T[0],O=T[1]}else k=O=E;if(o==="vertical"){var $=h.scale,B=C+s,q=B+i,F=B-i,H=$(N-k),U=$(N+O);A.push({x1:U,y1:q,x2:U,y2:F}),A.push({x1:H,y1:B,x2:U,y2:B}),A.push({x1:H,y1:q,x2:H,y2:F})}else if(o==="horizontal"){var R=p.scale,W=S+s,X=W-i,G=W+i,z=R(N-k),J=R(N+O);A.push({x1:X,y1:J,x2:G,y2:J}),A.push({x1:W,y1:z,x2:W,y2:J}),A.push({x1:X,y1:z,x2:G,y2:z})}return Y.createElement(en,gm({className:"recharts-errorBar",key:"bar-".concat(A.map(function(D){return"".concat(D.x1,"-").concat(D.x2,"-").concat(D.y1,"-").concat(D.y2)}))},g),A.map(function(D){return Y.createElement("line",gm({},D,{key:"line-".concat(D.x1,"-").concat(D.x2,"-").concat(D.y1,"-").concat(D.y2)}))}))});return Y.createElement(en,{className:"recharts-errorBars"},j)}}])})(Y.Component);f4(Wf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});f4(Wf,"displayName","ErrorBar");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)}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 Ii(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){Sae(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 Sae(e,t,n){return t=Nae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nae(e){var t=Cae(e,"string");return Zd(t)=="symbol"?t:t+""}function Cae(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)}var h4=function(t){var n=t.children,r=t.formattedGraphicalItems,s=t.legendWidth,o=t.legendContent,i=oa(n,Gi);if(!i)return null;var c=Gi.defaultProps,d=c!==void 0?Ii(Ii({},c),i.props):{},f;return i.props&&i.props.payload?f=i.props&&i.props.payload:o==="children"?f=(r||[]).reduce(function(h,p){var x=p.item,g=p.props,j=g.sectors||g.data||[];return h.concat(j.map(function(b){return{type:i.props.iconType||x.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):f=(r||[]).map(function(h){var p=h.item,x=p.type.defaultProps,g=x!==void 0?Ii(Ii({},x),p.props):{},j=g.dataKey,b=g.name,y=g.legendType,S=g.hide;return{inactive:S,dataKey:j,type:d.iconType||y||"square",color:AC(p),value:b||j,payload:g}}),Ii(Ii(Ii({},d),Gi.getWithHeight(i,s)),{},{payload:f,item:i})};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 P2(e){return kae(e)||Eae(e)||Aae(e)||_ae()}function _ae(){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 Aae(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"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kae(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}function O2(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?O2(Object(n),!0).forEach(function(r){Nc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nc(e,t,n){return t=Pae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pae(e){var t=Oae(e,"string");return ef(t)=="symbol"?t:t+""}function Oae(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)}function er(e,t,n){return Mt(e)||Mt(t)?n:tr(t)?fa(e,t,n):It(t)?t(e):n}function Ed(e,t,n,r){var s=kre(e,function(c){return er(c,t)});if(n==="number"){var o=s.filter(function(c){return Ge(c)||parseFloat(c)});return o.length?[Xv(o),Yv(o)]:[1/0,-1/0]}var i=r?s.filter(function(c){return!Mt(c)}):s;return i.map(function(c){return tr(c)||c instanceof Date?c:""})}var Tae=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=-1,c=(n=r?.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var d=o.range,f=0;f<c;f++){var h=f>0?s[f-1].coordinate:s[c-1].coordinate,p=s[f].coordinate,x=f>=c-1?s[0].coordinate:s[f+1].coordinate,g=void 0;if(_r(p-h)!==_r(x-p)){var j=[];if(_r(x-p)===_r(d[1]-d[0])){g=x;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+h)/2),j[1]=Math.max(b,(b+h)/2)}else{g=h;var y=x+d[1]-d[0];j[0]=Math.min(p,(y+p)/2),j[1]=Math.max(p,(y+p)/2)}var S=[Math.min(p,(g+p)/2),Math.max(p,(g+p)/2)];if(t>S[0]&&t<=S[1]||t>=j[0]&&t<=j[1]){i=s[f].index;break}}else{var C=Math.min(h,x),N=Math.max(h,x);if(t>(C+p)/2&&t<=(N+p)/2){i=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){i=r[E].index;break}return i},AC=function(t){var n,r=t,s=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Bn(Bn({},t.type.defaultProps),t.props):t.props,i=o.stroke,c=o.fill,d;switch(s){case"Line":d=i;break;case"Area":case"Radar":d=i&&i!=="none"?i:c;break;default:d=c;break}return d},Rae=function(t){var n=t.barSize,r=t.totalSize,s=t.stackGroups,o=s===void 0?{}:s;if(!o)return{};for(var i={},c=Object.keys(o),d=0,f=c.length;d<f;d++)for(var h=o[c[d]].stackGroups,p=Object.keys(h),x=0,g=p.length;x<g;x++){var j=h[p[x]],b=j.items,y=j.cateAxisId,S=b.filter(function(O){return no(O.type).indexOf("Bar")>=0});if(S&&S.length){var C=S[0].type.defaultProps,N=C!==void 0?Bn(Bn({},C),S[0].props):S[0].props,E=N.barSize,A=N[y];i[A]||(i[A]=[]);var k=Mt(E)?n:E;i[A].push({item:S[0],stackList:S.slice(1),barSize:Mt(k)?void 0:Ar(k,r,0)})}}return i},Iae=function(t){var n=t.barGap,r=t.barCategoryGap,s=t.bandSize,o=t.sizeList,i=o===void 0?[]:o,c=t.maxBarSize,d=i.length;if(d<1)return null;var f=Ar(n,s,0,!0),h,p=[];if(i[0].barSize===+i[0].barSize){var x=!1,g=s/d,j=i.reduce(function(E,A){return E+A.barSize||0},0);j+=(d-1)*f,j>=s&&(j-=(d-1)*f,f=0),j>=s&&g>0&&(x=!0,g*=.9,j=d*g);var b=(s-j)/2>>0,y={offset:b-f,size:0};h=i.reduce(function(E,A){var k={item:A.item,position:{offset:y.offset+y.size+f,size:x?g:A.barSize}},O=[].concat(P2(E),[k]);return y=O[O.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(T){O.push({item:T,position:y})}),O},p)}else{var S=Ar(r,s,0,!0);s-2*S-(d-1)*f<=0&&(f=0);var C=(s-2*S-(d-1)*f)/d;C>1&&(C>>=0);var N=c===+c?Math.min(C,c):C;h=i.reduce(function(E,A,k){var O=[].concat(P2(E),[{item:A.item,position:{offset:S+(C+f)*k+(C-N)/2,size:N}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(T){O.push({item:T,position:O[O.length-1].position})}),O},p)}return h},Mae=function(t,n,r,s){var o=r.children,i=r.width,c=r.margin,d=i-(c.left||0)-(c.right||0),f=h4({children:o,legendWidth:d});if(f){var h=s||{},p=h.width,x=h.height,g=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&g!=="center"&&Ge(t[g]))return Bn(Bn({},t),{},Nc({},g,t[g]+(p||0)));if((b==="horizontal"||b==="vertical"&&g==="center")&&j!=="middle"&&Ge(t[j]))return Bn(Bn({},t),{},Nc({},j,t[j]+(x||0)))}return t},$ae=function(t,n,r){return Mt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},m4=function(t,n,r,s,o){var i=n.props.children,c=pa(i,Wf).filter(function(f){return $ae(s,o,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=er(h,r);if(Mt(p))return f;var x=Array.isArray(p)?[Xv(p),Yv(p)]:[p,p],g=d.reduce(function(j,b){var y=er(h,b,0),S=x[0]-Math.abs(Array.isArray(y)?y[0]:y),C=x[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(S,j[0]),Math.max(C,j[1])]},[1/0,-1/0]);return[Math.min(g[0],f[0]),Math.max(g[1],f[1])]},[1/0,-1/0])}return null},Dae=function(t,n,r,s,o){var i=n.map(function(c){return m4(t,c,r,o,s)}).filter(function(c){return!Mt(c)});return i&&i.length?i.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]):null},v4=function(t,n,r,s,o){var i=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&m4(t,d,f,s)||Ed(t,f,r,o)});if(r==="number")return i.reduce(function(d,f){return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);var c={};return i.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},[])},g4=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Hi=function(t,n,r){if(!t)return null;var s=t.scale,o=t.duplicateDomain,i=t.type,c=t.range,d=t.realScaleType==="scaleBand"?s.bandwidth()/2:2,f=(n||r)&&i==="category"&&s.bandwidth?s.bandwidth()/d:0;if(f=t.axisType==="angleAxis"&&c?.length>=2?_r(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var x=o?o.indexOf(p):p;return{coordinate:s(x)+f,value:p,offset:f}});return h.filter(function(p){return!Df(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,x){return{coordinate:s(p)+f,value:p,index:x,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,x){return{coordinate:s(p)+f,value:o?o[p]:p,index:x,offset:f}})},nj=new WeakMap,yh=function(t,n){if(typeof n!="function")return t;nj.has(t)||nj.set(t,new WeakMap);var r=nj.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},x4=function(t,n,r){var s=t.scale,o=t.type,i=t.layout,c=t.axisType;if(s==="auto")return i==="radial"&&c==="radiusAxis"?{scale:Hd(),realScaleType:"band"}:i==="radial"&&c==="angleAxis"?{scale:fm(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Ad(),realScaleType:"point"}:o==="category"?{scale:Hd(),realScaleType:"band"}:{scale:fm(),realScaleType:"linear"};if(rl(s)){var d="scale".concat(Iv(s));return{scale:(v2[d]||Ad)(),realScaleType:v2[d]?d:"point"}}return It(s)?{scale:s}:{scale:Ad(),realScaleType:"point"}},T2=1e-4,y4=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,s=t.range(),o=Math.min(s[0],s[1])-T2,i=Math.max(s[0],s[1])+T2,c=t(n[0]),d=t(n[r-1]);(c<o||c>i||d<o||d>i)&&t.domain([n[0],n[r-1]])}},Lae=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},Fae=function(t,n){if(!n||n.length!==2||!Ge(n[0])||!Ge(n[1]))return t;var r=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]),o=[t[0],t[1]];return(!Ge(t[0])||t[0]<r)&&(o[0]=r),(!Ge(t[1])||t[1]>s)&&(o[1]=s),o[0]>s&&(o[0]=s),o[1]<r&&(o[1]=r),o},zae=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var o=0,i=0,c=0;c<n;++c){var d=Df(t[c][r][1])?t[c][r][0]:t[c][r][1];d>=0?(t[c][r][0]=o,t[c][r][1]=o+d,o=t[c][r][1]):(t[c][r][0]=i,t[c][r][1]=i+d,i=t[c][r][1])}},Bae=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var o=0,i=0;i<n;++i){var c=Df(t[i][r][1])?t[i][r][0]:t[i][r][1];c>=0?(t[i][r][0]=o,t[i][r][1]=o+c,o=t[i][r][1]):(t[i][r][0]=0,t[i][r][1]=0)}},qae={sign:zae,expand:kQ,none:Tc,silhouette:PQ,wiggle:OQ,positive:Bae},Uae=function(t,n,r){var s=n.map(function(c){return c.props.dataKey}),o=qae[r],i=EQ().keys(s).value(function(c,d){return+er(c,d,0)}).order(AS).offset(o);return i(t)},Wae=function(t,n,r,s,o,i){if(!t)return null;var c=i?n.reverse():n,d={},f=c.reduce(function(p,x){var g,j=(g=x.type)!==null&&g!==void 0&&g.defaultProps?Bn(Bn({},x.type.defaultProps),x.props):x.props,b=j.stackId,y=j.hide;if(y)return p;var S=j[r],C=p[S]||{hasStack:!1,stackGroups:{}};if(tr(b)){var N=C.stackGroups[b]||{numericAxisId:r,cateAxisId:s,items:[]};N.items.push(x),C.hasStack=!0,C.stackGroups[b]=N}else C.stackGroups[gu("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[x]};return Bn(Bn({},p),{},Nc({},S,C))},d),h={};return Object.keys(f).reduce(function(p,x){var g=f[x];if(g.hasStack){var j={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(b,y){var S=g.stackGroups[y];return Bn(Bn({},b),{},Nc({},y,{numericAxisId:r,cateAxisId:s,items:S.items,stackedData:Uae(t,S.items,o)}))},j)}return Bn(Bn({},p),{},Nc({},x,g))},h)},b4=function(t,n){var r=n.realScaleType,s=n.type,o=n.tickCount,i=n.originalDomain,c=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(o&&s==="number"&&i&&(i[0]==="auto"||i[1]==="auto")){var f=t.domain();if(!f.length)return null;var h=aae(f,o,c);return t.domain([Xv(h),Yv(h)]),{niceTicks:h}}if(o&&s==="number"){var p=t.domain(),x=sae(p,o,c);return{niceTicks:x}}return null};function R2(e){var t=e.axis,n=e.ticks,r=e.bandSize,s=e.entry,o=e.index,i=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Mt(s[t.dataKey])){var c=Hh(n,"value",s[t.dataKey]);if(c)return c.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var d=er(s,Mt(i)?t.dataKey:i);return Mt(d)?null:t.scale(d)}var I2=function(t){var n=t.axis,r=t.ticks,s=t.offset,o=t.bandSize,i=t.entry,c=t.index;if(n.type==="category")return r[c]?r[c].coordinate+s:null;var d=er(i,n.dataKey,n.domain[c]);return Mt(d)?null:n.scale(d)-o/2+s},Vae=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var s=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return s<=0&&o>=0?0:o<0?o:s}return r[0]},Hae=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Bn(Bn({},t.type.defaultProps),t.props):t.props,o=s.stackId;if(tr(o)){var i=n[o];if(i){var c=i.items.indexOf(t);return c>=0?i.stackedData[c]:null}}return null},Kae=function(t){return t.reduce(function(n,r){return[Xv(r.concat([n[0]]).filter(Ge)),Yv(r.concat([n[1]]).filter(Ge))]},[1/0,-1/0])},w4=function(t,n,r){return Object.keys(t).reduce(function(s,o){var i=t[o],c=i.stackedData,d=c.reduce(function(f,h){var p=Kae(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})},M2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,$2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,JS=function(t,n,r){if(It(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(Ge(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(M2.test(t[0])){var o=+M2.exec(t[0])[1];s[0]=n[0]-o}else It(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(Ge(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if($2.test(t[1])){var i=+$2.exec(t[1])[1];s[1]=n[1]+i}else It(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},ym=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 o=tC(n,function(p){return p.coordinate}),i=1/0,c=1,d=o.length;c<d;c++){var f=o[c],h=o[c-1];i=Math.min((f.coordinate||0)-(h.coordinate||0),i)}return i===1/0?0:i}return r?void 0:0},D2=function(t,n,r){return!t||!t.length||Uf(t,fa(r,"type.defaultProps.domain"))?n:t},j4=function(t,n){var r=t.type.defaultProps?Bn(Bn({},t.type.defaultProps),t.props):t.props,s=r.dataKey,o=r.name,i=r.unit,c=r.formatter,d=r.tooltipType,f=r.chartType,h=r.hide;return Bn(Bn({},St(t,!1)),{},{dataKey:s,unit:i,formatter:c,name:o||s,color:AC(t),value:er(n,s),type:d,payload:n,chartType:f,hide:h})};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 L2(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 Xs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L2(Object(n),!0).forEach(function(r){S4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function S4(e,t,n){return t=Gae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gae(e){var t=Yae(e,"string");return tf(t)=="symbol"?t:t+""}function Yae(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 Xae(e,t){return ese(e)||Zae(e,t)||Jae(e,t)||Qae()}function Qae(){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 Jae(e,t){if(e){if(typeof e=="string")return F2(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 F2(e,t)}}function F2(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 Zae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function ese(e){if(Array.isArray(e))return e}var bm=Math.PI/180,tse=function(t){return t*180/Math.PI},Sn=function(t,n,r,s){return{x:t+Math.cos(-bm*s)*r,y:n+Math.sin(-bm*s)*r}},N4=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},nse=function(t,n,r,s,o){var i=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=Ar(t.cx,i,i/2),p=Ar(t.cy,c,c/2),x=N4(i,c,r),g=Ar(t.innerRadius,x,0),j=Ar(t.outerRadius,x,x*.8),b=Object.keys(n);return b.reduce(function(y,S){var C=n[S],N=C.domain,E=C.reversed,A;if(Mt(C.range))s==="angleAxis"?A=[d,f]:s==="radiusAxis"&&(A=[g,j]),E&&(A=[A[1],A[0]]);else{A=C.range;var k=A,O=Xae(k,2);d=O[0],f=O[1]}var T=x4(C,o),$=T.realScaleType,B=T.scale;B.domain(N).range(A),y4(B);var q=b4(B,Xs(Xs({},C),{},{realScaleType:$})),F=Xs(Xs(Xs({},C),q),{},{range:A,radius:j,realScaleType:$,scale:B,cx:h,cy:p,innerRadius:g,outerRadius:j,startAngle:d,endAngle:f});return Xs(Xs({},y),{},S4({},S,F))},{})},rse=function(t,n){var r=t.x,s=t.y,o=n.x,i=n.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(s-i,2))},ase=function(t,n){var r=t.x,s=t.y,o=n.cx,i=n.cy,c=rse({x:r,y:s},{x:o,y:i});if(c<=0)return{radius:c};var d=(r-o)/c,f=Math.acos(d);return s>i&&(f=2*Math.PI-f),{radius:c,angle:tse(f),angleInRadian:f}},sse=function(t){var n=t.startAngle,r=t.endAngle,s=Math.floor(n/360),o=Math.floor(r/360),i=Math.min(s,o);return{startAngle:n-i*360,endAngle:r-i*360}},ose=function(t,n){var r=n.startAngle,s=n.endAngle,o=Math.floor(r/360),i=Math.floor(s/360),c=Math.min(o,i);return t+c*360},z2=function(t,n){var r=t.x,s=t.y,o=ase({x:r,y:s},n),i=o.radius,c=o.angle,d=n.innerRadius,f=n.outerRadius;if(i<d||i>f)return!1;if(i===0)return!0;var h=sse(n),p=h.startAngle,x=h.endAngle,g=c,j;if(p<=x){for(;g>x;)g-=360;for(;g<p;)g+=360;j=g>=p&&g<=x}else{for(;g>p;)g-=360;for(;g<x;)g+=360;j=g>=x&&g<=p}return j?Xs(Xs({},n),{},{radius:i,angle:ose(g,n)}):null},C4=function(t){return!m.isValidElement(t)&&!It(t)&&typeof t!="boolean"?t.className:""};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)}var ise=["offset"];function lse(e){return fse(e)||dse(e)||use(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 use(e,t){if(e){if(typeof e=="string")return ZS(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 ZS(e,t)}}function dse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fse(e){if(Array.isArray(e))return ZS(e)}function ZS(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 pse(e,t){if(e==null)return{};var n=hse(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hse(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 B2(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?B2(Object(n),!0).forEach(function(r){mse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mse(e,t,n){return t=vse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vse(e){var t=gse(e,"string");return nf(t)=="symbol"?t:t+""}function gse(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 rf(){return rf=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},rf.apply(this,arguments)}var xse=function(t){var n=t.value,r=t.formatter,s=Mt(t.children)?n:t.children;return It(r)?r(s):s},yse=function(t,n){var r=_r(n-t),s=Math.min(Math.abs(n-t),360);return r*s},bse=function(t,n,r){var s=t.position,o=t.viewBox,i=t.offset,c=t.className,d=o,f=d.cx,h=d.cy,p=d.innerRadius,x=d.outerRadius,g=d.startAngle,j=d.endAngle,b=d.clockWise,y=(p+x)/2,S=yse(g,j),C=S>=0?1:-1,N,E;s==="insideStart"?(N=g+C*i,E=b):s==="insideEnd"?(N=j-C*i,E=!b):s==="end"&&(N=j+C*i,E=b),E=S<=0?E:!E;var A=Sn(f,h,y,N),k=Sn(f,h,y,N+(E?1:-1)*359),O="M".concat(A.x,",").concat(A.y,`
|
|
75
|
-
A`).concat(y,",").concat(y,",0,1,").concat(E?0:1,`,
|
|
76
|
-
`).concat(k.x,",").concat(k.y),T=Mt(t.id)?gu("recharts-radial-line-"):t.id;return Y.createElement("text",rf({},r,{dominantBaseline:"central",className:Lt("recharts-radial-bar-label",c)}),Y.createElement("defs",null,Y.createElement("path",{id:T,d:O})),Y.createElement("textPath",{xlinkHref:"#".concat(T)},n))},wse=function(t){var n=t.viewBox,r=t.offset,s=t.position,o=n,i=o.cx,c=o.cy,d=o.innerRadius,f=o.outerRadius,h=o.startAngle,p=o.endAngle,x=(h+p)/2;if(s==="outside"){var g=Sn(i,c,f+r,x),j=g.x,b=g.y;return{x:j,y:b,textAnchor:j>=i?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:i,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:i,y:c,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:i,y:c,textAnchor:"middle",verticalAnchor:"end"};var y=(d+f)/2,S=Sn(i,c,y,x),C=S.x,N=S.y;return{x:C,y:N,textAnchor:"middle",verticalAnchor:"middle"}},jse=function(t){var n=t.viewBox,r=t.parentViewBox,s=t.offset,o=t.position,i=n,c=i.x,d=i.y,f=i.width,h=i.height,p=h>=0?1:-1,x=p*s,g=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,y=b*s,S=b>0?"end":"start",C=b>0?"start":"end";if(o==="top"){var N={x:c+f/2,y:d-p*s,textAnchor:"middle",verticalAnchor:g};return Zn(Zn({},N),r?{height:Math.max(d-r.y,0),width:f}:{})}if(o==="bottom"){var E={x:c+f/2,y:d+h+x,textAnchor:"middle",verticalAnchor:j};return Zn(Zn({},E),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(o==="left"){var A={x:c-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return Zn(Zn({},A),r?{width:Math.max(A.x-r.x,0),height:h}:{})}if(o==="right"){var k={x:c+f+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"};return Zn(Zn({},k),r?{width:Math.max(r.x+r.width-k.x,0),height:h}:{})}var O=r?{width:f,height:h}:{};return o==="insideLeft"?Zn({x:c+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"},O):o==="insideRight"?Zn({x:c+f-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},O):o==="insideTop"?Zn({x:c+f/2,y:d+x,textAnchor:"middle",verticalAnchor:j},O):o==="insideBottom"?Zn({x:c+f/2,y:d+h-x,textAnchor:"middle",verticalAnchor:g},O):o==="insideTopLeft"?Zn({x:c+y,y:d+x,textAnchor:C,verticalAnchor:j},O):o==="insideTopRight"?Zn({x:c+f-y,y:d+x,textAnchor:S,verticalAnchor:j},O):o==="insideBottomLeft"?Zn({x:c+y,y:d+h-x,textAnchor:C,verticalAnchor:g},O):o==="insideBottomRight"?Zn({x:c+f-y,y:d+h-x,textAnchor:S,verticalAnchor:g},O):vu(o)&&(Ge(o.x)||Ui(o.x))&&(Ge(o.y)||Ui(o.y))?Zn({x:c+Ar(o.x,f),y:d+Ar(o.y,h),textAnchor:"end",verticalAnchor:"end"},O):Zn({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},O)},Sse=function(t){return"cx"in t&&Ge(t.cx)};function cr(e){var t=e.offset,n=t===void 0?5:t,r=pse(e,ise),s=Zn({offset:n},r),o=s.viewBox,i=s.position,c=s.value,d=s.children,f=s.content,h=s.className,p=h===void 0?"":h,x=s.textBreakAll;if(!o||Mt(c)&&Mt(d)&&!m.isValidElement(f)&&!It(f))return null;if(m.isValidElement(f))return m.cloneElement(f,s);var g;if(It(f)){if(g=m.createElement(f,s),m.isValidElement(g))return g}else g=xse(s);var j=Sse(o),b=St(s,!0);if(j&&(i==="insideStart"||i==="insideEnd"||i==="end"))return bse(s,g,b);var y=j?wse(s):jse(s);return Y.createElement(sl,rf({className:Lt("recharts-label",p)},b,y,{breakAll:x}),g)}cr.displayName="Label";var _4=function(t){var n=t.cx,r=t.cy,s=t.angle,o=t.startAngle,i=t.endAngle,c=t.r,d=t.radius,f=t.innerRadius,h=t.outerRadius,p=t.x,x=t.y,g=t.top,j=t.left,b=t.width,y=t.height,S=t.clockWise,C=t.labelViewBox;if(C)return C;if(Ge(b)&&Ge(y)){if(Ge(p)&&Ge(x))return{x:p,y:x,width:b,height:y};if(Ge(g)&&Ge(j))return{x:g,y:j,width:b,height:y}}return Ge(p)&&Ge(x)?{x:p,y:x,width:0,height:0}:Ge(n)&&Ge(r)?{cx:n,cy:r,startAngle:o||s||0,endAngle:i||s||0,innerRadius:f||0,outerRadius:h||d||c||0,clockWise:S}:t.viewBox?t.viewBox:{}},Nse=function(t,n){return t?t===!0?Y.createElement(cr,{key:"label-implicit",viewBox:n}):tr(t)?Y.createElement(cr,{key:"label-implicit",viewBox:n,value:t}):m.isValidElement(t)?t.type===cr?m.cloneElement(t,{key:"label-implicit",viewBox:n}):Y.createElement(cr,{key:"label-implicit",content:t,viewBox:n}):It(t)?Y.createElement(cr,{key:"label-implicit",content:t,viewBox:n}):vu(t)?Y.createElement(cr,rf({viewBox:n},t,{key:"label-implicit"})):null:null},Cse=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,o=_4(t),i=pa(s,cr).map(function(d,f){return m.cloneElement(d,{viewBox:n||o,key:"label-".concat(f)})});if(!r)return i;var c=Nse(t.label,n||o);return[c].concat(lse(i))};cr.parseViewBox=_4;cr.renderCallByParent=Cse;var rj,q2;function _se(){if(q2)return rj;q2=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return rj=e,rj}var Ase=_se();const Ese=un(Ase);function af(e){"@babel/helpers - typeof";return af=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},af(e)}var kse=["valueAccessor"],Pse=["data","dataKey","clockWise","id","textBreakAll"];function Ose(e){return Mse(e)||Ise(e)||Rse(e)||Tse()}function Tse(){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 Rse(e,t){if(e){if(typeof e=="string")return e1(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 e1(e,t)}}function Ise(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Mse(e){if(Array.isArray(e))return e1(e)}function e1(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 wm(){return wm=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},wm.apply(this,arguments)}function U2(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 W2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U2(Object(n),!0).forEach(function(r){$se(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $se(e,t,n){return t=Dse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dse(e){var t=Lse(e,"string");return af(t)=="symbol"?t:t+""}function Lse(e,t){if(af(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(af(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function V2(e,t){if(e==null)return{};var n=Fse(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fse(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 zse=function(t){return Array.isArray(t.value)?Ese(t.value):t.value};function so(e){var t=e.valueAccessor,n=t===void 0?zse:t,r=V2(e,kse),s=r.data,o=r.dataKey,i=r.clockWise,c=r.id,d=r.textBreakAll,f=V2(r,Pse);return!s||!s.length?null:Y.createElement(en,{className:"recharts-label-list"},s.map(function(h,p){var x=Mt(o)?n(h,p):er(h&&h.payload,o),g=Mt(c)?{}:{id:"".concat(c,"-").concat(p)};return Y.createElement(cr,wm({},St(h,!0),f,g,{parentViewBox:h.parentViewBox,value:x,textBreakAll:d,viewBox:cr.parseViewBox(Mt(i)?h:W2(W2({},h),{},{clockWise:i})),key:"label-".concat(p),index:p}))}))}so.displayName="LabelList";function Bse(e,t){return e?e===!0?Y.createElement(so,{key:"labelList-implicit",data:t}):Y.isValidElement(e)||It(e)?Y.createElement(so,{key:"labelList-implicit",data:t,content:e}):vu(e)?Y.createElement(so,wm({data:t},e,{key:"labelList-implicit"})):null:null}function qse(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=pa(r,so).map(function(i,c){return m.cloneElement(i,{data:t,key:"labelList-".concat(c)})});if(!n)return s;var o=Bse(e.label,t);return[o].concat(Ose(s))}so.renderCallByParent=qse;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)}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 H2(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 K2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H2(Object(n),!0).forEach(function(r){Use(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Use(e,t,n){return t=Wse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wse(e){var t=Vse(e,"string");return sf(t)=="symbol"?t:t+""}function Vse(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)}var Hse=function(t,n){var r=_r(n-t),s=Math.min(Math.abs(n-t),359.999);return r*s},bh=function(t){var n=t.cx,r=t.cy,s=t.radius,o=t.angle,i=t.sign,c=t.isExternal,d=t.cornerRadius,f=t.cornerIsExternal,h=d*(c?1:-1)+s,p=Math.asin(d/h)/bm,x=f?o:o+i*p,g=Sn(n,r,h,x),j=Sn(n,r,s,x),b=f?o-i*p:o,y=Sn(n,r,h*Math.cos(p*bm),b);return{center:g,circleTangency:j,lineTangency:y,theta:p}},A4=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,o=t.outerRadius,i=t.startAngle,c=t.endAngle,d=Hse(i,c),f=i+d,h=Sn(n,r,o,i),p=Sn(n,r,o,f),x="M ".concat(h.x,",").concat(h.y,`
|
|
78
|
-
A `).concat(o,",").concat(o,`,0,
|
|
79
|
-
`).concat(+(Math.abs(d)>180),",").concat(+(i>f),`,
|
|
80
|
-
`).concat(p.x,",").concat(p.y,`
|
|
81
|
-
`);if(s>0){var g=Sn(n,r,s,i),j=Sn(n,r,s,f);x+="L ".concat(j.x,",").concat(j.y,`
|
|
82
|
-
A `).concat(s,",").concat(s,`,0,
|
|
83
|
-
`).concat(+(Math.abs(d)>180),",").concat(+(i<=f),`,
|
|
84
|
-
`).concat(g.x,",").concat(g.y," Z")}else x+="L ".concat(n,",").concat(r," Z");return x},Kse=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,o=t.outerRadius,i=t.cornerRadius,c=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,h=t.endAngle,p=_r(h-f),x=bh({cx:n,cy:r,radius:o,angle:f,sign:p,cornerRadius:i,cornerIsExternal:d}),g=x.circleTangency,j=x.lineTangency,b=x.theta,y=bh({cx:n,cy:r,radius:o,angle:h,sign:-p,cornerRadius:i,cornerIsExternal:d}),S=y.circleTangency,C=y.lineTangency,N=y.theta,E=d?Math.abs(f-h):Math.abs(f-h)-b-N;if(E<0)return c?"M ".concat(j.x,",").concat(j.y,`
|
|
85
|
-
a`).concat(i,",").concat(i,",0,0,1,").concat(i*2,`,0
|
|
86
|
-
a`).concat(i,",").concat(i,",0,0,1,").concat(-i*2,`,0
|
|
87
|
-
`):A4({cx:n,cy:r,innerRadius:s,outerRadius:o,startAngle:f,endAngle:h});var A="M ".concat(j.x,",").concat(j.y,`
|
|
88
|
-
A`).concat(i,",").concat(i,",0,0,").concat(+(p<0),",").concat(g.x,",").concat(g.y,`
|
|
89
|
-
A`).concat(o,",").concat(o,",0,").concat(+(E>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
|
|
90
|
-
A`).concat(i,",").concat(i,",0,0,").concat(+(p<0),",").concat(C.x,",").concat(C.y,`
|
|
91
|
-
`);if(s>0){var k=bh({cx:n,cy:r,radius:s,angle:f,sign:p,isExternal:!0,cornerRadius:i,cornerIsExternal:d}),O=k.circleTangency,T=k.lineTangency,$=k.theta,B=bh({cx:n,cy:r,radius:s,angle:h,sign:-p,isExternal:!0,cornerRadius:i,cornerIsExternal:d}),q=B.circleTangency,F=B.lineTangency,H=B.theta,U=d?Math.abs(f-h):Math.abs(f-h)-$-H;if(U<0&&i===0)return"".concat(A,"L").concat(n,",").concat(r,"Z");A+="L".concat(F.x,",").concat(F.y,`
|
|
92
|
-
A`).concat(i,",").concat(i,",0,0,").concat(+(p<0),",").concat(q.x,",").concat(q.y,`
|
|
93
|
-
A`).concat(s,",").concat(s,",0,").concat(+(U>180),",").concat(+(p>0),",").concat(O.x,",").concat(O.y,`
|
|
94
|
-
A`).concat(i,",").concat(i,",0,0,").concat(+(p<0),",").concat(T.x,",").concat(T.y,"Z")}else A+="L".concat(n,",").concat(r,"Z");return A},Gse={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},E4=function(t){var n=K2(K2({},Gse),t),r=n.cx,s=n.cy,o=n.innerRadius,i=n.outerRadius,c=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,h=n.startAngle,p=n.endAngle,x=n.className;if(i<o||h===p)return null;var g=Lt("recharts-sector",x),j=i-o,b=Ar(c,j,0,!0),y;return b>0&&Math.abs(h-p)<360?y=Kse({cx:r,cy:s,innerRadius:o,outerRadius:i,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):y=A4({cx:r,cy:s,innerRadius:o,outerRadius:i,startAngle:h,endAngle:p}),Y.createElement("path",t1({},St(n,!0),{className:g,d:y,role:"img"}))};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 n1(){return n1=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},n1.apply(this,arguments)}function G2(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 Y2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?G2(Object(n),!0).forEach(function(r){Yse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yse(e,t,n){return t=Xse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xse(e){var t=Qse(e,"string");return of(t)=="symbol"?t:t+""}function Qse(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 X2={curveBasisClosed:gQ,curveBasisOpen:xQ,curveBasis:vQ,curveBumpX:nQ,curveBumpY:rQ,curveLinearClosed:yQ,curveLinear:$v,curveMonotoneX:bQ,curveMonotoneY:wQ,curveNatural:jQ,curveStep:SQ,curveStepAfter:CQ,curveStepBefore:NQ},wh=function(t){return t.x===+t.x&&t.y===+t.y},hd=function(t){return t.x},md=function(t){return t.y},Jse=function(t,n){if(It(t))return t;var r="curve".concat(Iv(t));return(r==="curveMonotone"||r==="curveBump")&&n?X2["".concat(r).concat(n==="vertical"?"Y":"X")]:X2[r]||$v},Zse=function(t){var n=t.type,r=n===void 0?"linear":n,s=t.points,o=s===void 0?[]:s,i=t.baseLine,c=t.layout,d=t.connectNulls,f=d===void 0?!1:d,h=Jse(r,c),p=f?o.filter(function(b){return wh(b)}):o,x;if(Array.isArray(i)){var g=f?i.filter(function(b){return wh(b)}):i,j=p.map(function(b,y){return Y2(Y2({},b),{},{base:g[y]})});return c==="vertical"?x=fh().y(md).x1(hd).x0(function(b){return b.base.x}):x=fh().x(hd).y1(md).y0(function(b){return b.base.y}),x.defined(wh).curve(h),x(j)}return c==="vertical"&&Ge(i)?x=fh().y(md).x1(hd).x0(i):Ge(i)?x=fh().x(hd).y1(md).y0(i):x=E3().x(hd).y(md),x.defined(wh).curve(h),x(p)},jm=function(t){var n=t.className,r=t.points,s=t.path,o=t.pathRef;if((!r||!r.length)&&!s)return null;var i=r&&r.length?Zse(t):s;return m.createElement("path",n1({},St(t,!1),Kh(t),{className:Lt("recharts-curve",n),d:i,ref:o}))},aj={exports:{}},sj,Q2;function eoe(){if(Q2)return sj;Q2=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return sj=e,sj}var oj,J2;function toe(){if(J2)return oj;J2=1;var e=eoe();function t(){}function n(){}return n.resetWarningCache=t,oj=function(){function r(i,c,d,f,h,p){if(p!==e){var x=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 x.name="Invariant Violation",x}}r.isRequired=r;function s(){return r}var o={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 o.PropTypes=o,o},oj}var Z2;function noe(){return Z2||(Z2=1,aj.exports=toe()()),aj.exports}var roe=noe();const sn=un(roe),{getOwnPropertyNames:aoe,getOwnPropertySymbols:soe}=Object,{hasOwnProperty:ooe}=Object.prototype;function ij(e,t){return function(r,s,o){return e(r,s,o)&&t(r,s,o)}}function jh(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);const{cache:o}=s,i=o.get(n),c=o.get(r);if(i&&c)return i===r&&c===n;o.set(n,r),o.set(r,n);const d=e(n,r,s);return o.delete(n),o.delete(r),d}}function ioe(e){return e?.[Symbol.toStringTag]}function eI(e){return aoe(e).concat(soe(e))}const loe=Object.hasOwn||((e,t)=>ooe.call(e,t));function _l(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const coe="__v",uoe="__o",doe="_owner",{getOwnPropertyDescriptor:tI,keys:nI}=Object;function foe(e,t){return e.byteLength===t.byteLength&&Sm(new Uint8Array(e),new Uint8Array(t))}function poe(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 hoe(e,t){return e.byteLength===t.byteLength&&Sm(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function moe(e,t){return _l(e.getTime(),t.getTime())}function voe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function goe(e,t){return e===t}function rI(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=new Array(r),o=e.entries();let i,c,d=0;for(;(i=o.next())&&!i.done;){const f=t.entries();let h=!1,p=0;for(;(c=f.next())&&!c.done;){if(s[p]){p++;continue}const x=i.value,g=c.value;if(n.equals(x[0],g[0],d,p,e,t,n)&&n.equals(x[1],g[1],x[0],g[0],e,t,n)){h=s[p]=!0;break}p++}if(!h)return!1;d++}return!0}const xoe=_l;function yoe(e,t,n){const r=nI(e);let s=r.length;if(nI(t).length!==s)return!1;for(;s-- >0;)if(!k4(e,t,n,r[s]))return!1;return!0}function vd(e,t,n){const r=eI(e);let s=r.length;if(eI(t).length!==s)return!1;let o,i,c;for(;s-- >0;)if(o=r[s],!k4(e,t,n,o)||(i=tI(e,o),c=tI(t,o),(i||c)&&(!i||!c||i.configurable!==c.configurable||i.enumerable!==c.enumerable||i.writable!==c.writable)))return!1;return!0}function boe(e,t){return _l(e.valueOf(),t.valueOf())}function woe(e,t){return e.source===t.source&&e.flags===t.flags}function aI(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=new Array(r),o=e.values();let i,c;for(;(i=o.next())&&!i.done;){const d=t.values();let f=!1,h=0;for(;(c=d.next())&&!c.done;){if(!s[h]&&n.equals(i.value,c.value,i.value,c.value,e,t,n)){f=s[h]=!0;break}h++}if(!f)return!1}return!0}function Sm(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 joe(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 k4(e,t,n,r){return(r===doe||r===uoe||r===coe)&&(e.$$typeof||t.$$typeof)?!0:loe(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Soe="[object ArrayBuffer]",Noe="[object Arguments]",Coe="[object Boolean]",_oe="[object DataView]",Aoe="[object Date]",Eoe="[object Error]",koe="[object Map]",Poe="[object Number]",Ooe="[object Object]",Toe="[object RegExp]",Roe="[object Set]",Ioe="[object String]",Moe={"[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},$oe="[object URL]",Doe=Object.prototype.toString;function Loe({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:f,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:x,areUrlsEqual:g,unknownTagComparators:j}){return function(y,S,C){if(y===S)return!0;if(y==null||S==null)return!1;const N=typeof y;if(N!==typeof S)return!1;if(N!=="object")return N==="number"?c(y,S,C):N==="function"?o(y,S,C):!1;const E=y.constructor;if(E!==S.constructor)return!1;if(E===Object)return d(y,S,C);if(Array.isArray(y))return t(y,S,C);if(E===Date)return r(y,S,C);if(E===RegExp)return h(y,S,C);if(E===Map)return i(y,S,C);if(E===Set)return p(y,S,C);const A=Doe.call(y);if(A===Aoe)return r(y,S,C);if(A===Toe)return h(y,S,C);if(A===koe)return i(y,S,C);if(A===Roe)return p(y,S,C);if(A===Ooe)return typeof y.then!="function"&&typeof S.then!="function"&&d(y,S,C);if(A===$oe)return g(y,S,C);if(A===Eoe)return s(y,S,C);if(A===Noe)return d(y,S,C);if(Moe[A])return x(y,S,C);if(A===Soe)return e(y,S,C);if(A===_oe)return n(y,S,C);if(A===Coe||A===Poe||A===Ioe)return f(y,S,C);if(j){let k=j[A];if(!k){const O=ioe(y);O&&(k=j[O])}if(k)return k(y,S,C)}return!1}}function Foe({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:foe,areArraysEqual:n?vd:poe,areDataViewsEqual:hoe,areDatesEqual:moe,areErrorsEqual:voe,areFunctionsEqual:goe,areMapsEqual:n?ij(rI,vd):rI,areNumbersEqual:xoe,areObjectsEqual:n?vd:yoe,arePrimitiveWrappersEqual:boe,areRegExpsEqual:woe,areSetsEqual:n?ij(aI,vd):aI,areTypedArraysEqual:n?ij(Sm,vd):Sm,areUrlsEqual:joe,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const s=jh(r.areArraysEqual),o=jh(r.areMapsEqual),i=jh(r.areObjectsEqual),c=jh(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:c})}return r}function zoe(e){return function(t,n,r,s,o,i,c){return e(t,n,c)}}function Boe({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 o={cache:void 0,equals:r,meta:void 0,strict:s};return function(c,d){return t(c,d,o)}}const qoe=mi();mi({strict:!0});mi({circular:!0});mi({circular:!0,strict:!0});mi({createInternalComparator:()=>_l});mi({strict:!0,createInternalComparator:()=>_l});mi({circular:!0,createInternalComparator:()=>_l});mi({circular:!0,createInternalComparator:()=>_l,strict:!0});function mi(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:s=!1}=e,o=Foe(e),i=Loe(o),c=n?n(i):zoe(i);return Boe({circular:t,comparator:i,createState:r,equals:c,strict:s})}function Uoe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function sI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function s(o){n<0&&(n=o),o-n>t?(e(o),n=-1):Uoe(s)};requestAnimationFrame(r)}function r1(e){"@babel/helpers - typeof";return r1=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},r1(e)}function Woe(e){return Goe(e)||Koe(e)||Hoe(e)||Voe()}function Voe(){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 Hoe(e,t){if(e){if(typeof e=="string")return oI(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 oI(e,t)}}function oI(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 Koe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Goe(e){if(Array.isArray(e))return e}function Yoe(){var e={},t=function(){return null},n=!1,r=function s(o){if(!n){if(Array.isArray(o)){if(!o.length)return;var i=o,c=Woe(i),d=c[0],f=c.slice(1);if(typeof d=="number"){sI(s.bind(null,f),d);return}s(d),sI(s.bind(null,f));return}r1(o)==="object"&&(e=o,t(e)),typeof o=="function"&&o()}};return{stop:function(){n=!0},start:function(o){n=!1,r(o)},subscribe:function(o){return t=o,function(){t=function(){return null}}}}}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 iI(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 lI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iI(Object(n),!0).forEach(function(r){P4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P4(e,t,n){return t=Xoe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xoe(e){var t=Qoe(e,"string");return lf(t)==="symbol"?t:String(t)}function Qoe(e,t){if(lf(e)!=="object"||e===null)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 Joe=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,s){return r.filter(function(o){return s.includes(o)})})},Zoe=function(t){return t},eie=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},kd=function(t,n){return Object.keys(n).reduce(function(r,s){return lI(lI({},r),{},P4({},s,t(s,n[s])))},{})},cI=function(t,n,r){return t.map(function(s){return"".concat(eie(s)," ").concat(n,"ms ").concat(r)}).join(",")};function tie(e,t){return aie(e)||rie(e,t)||O4(e,t)||nie()}function nie(){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 rie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function aie(e){if(Array.isArray(e))return e}function sie(e){return lie(e)||iie(e)||O4(e)||oie()}function oie(){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 O4(e,t){if(e){if(typeof e=="string")return a1(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 a1(e,t)}}function iie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lie(e){if(Array.isArray(e))return a1(e)}function a1(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 Nm=1e-4,T4=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},R4=function(t,n){return t.map(function(r,s){return r*Math.pow(n,s)}).reduce(function(r,s){return r+s})},uI=function(t,n){return function(r){var s=T4(t,n);return R4(s,r)}},cie=function(t,n){return function(r){var s=T4(t,n),o=[].concat(sie(s.map(function(i,c){return i*c}).slice(1)),[0]);return R4(o,r)}},dI=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0],o=n[1],i=n[2],c=n[3];if(n.length===1)switch(n[0]){case"linear":s=0,o=0,i=1,c=1;break;case"ease":s=.25,o=.1,i=.25,c=1;break;case"ease-in":s=.42,o=0,i=1,c=1;break;case"ease-out":s=.42,o=0,i=.58,c=1;break;case"ease-in-out":s=0,o=0,i=.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(y){return parseFloat(y)}),h=tie(f,4);s=h[0],o=h[1],i=h[2],c=h[3]}}}var p=uI(s,i),x=uI(o,c),g=cie(s,i),j=function(S){return S>1?1:S<0?0:S},b=function(S){for(var C=S>1?1:S,N=C,E=0;E<8;++E){var A=p(N)-C,k=g(N);if(Math.abs(A-C)<Nm||k<Nm)return x(N);N=j(N-A/k)}return x(N)};return b.isStepper=!1,b},uie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,s=t.damping,o=s===void 0?8:s,i=t.dt,c=i===void 0?17:i,d=function(h,p,x){var g=-(h-p)*r,j=x*o,b=x+(g-j)*c/1e3,y=x*c/1e3+h;return Math.abs(y-p)<Nm&&Math.abs(b)<Nm?[p,0]:[y,b]};return d.isStepper=!0,d.dt=c,d},die=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 dI(s);case"spring":return uie();default:if(s.split("(")[0]==="cubic-bezier")return dI(s)}return typeof s=="function"?s: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 fI(e){return hie(e)||pie(e)||I4(e)||fie()}function fie(){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 pie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hie(e){if(Array.isArray(e))return o1(e)}function pI(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?pI(Object(n),!0).forEach(function(r){s1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s1(e,t,n){return t=mie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mie(e){var t=vie(e,"string");return cf(t)==="symbol"?t:String(t)}function vie(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)}function gie(e,t){return bie(e)||yie(e,t)||I4(e,t)||xie()}function xie(){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 I4(e,t){if(e){if(typeof e=="string")return o1(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 o1(e,t)}}function o1(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 yie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function bie(e){if(Array.isArray(e))return e}var Cm=function(t,n,r){return t+(n-t)*r},i1=function(t){var n=t.from,r=t.to;return n!==r},wie=function e(t,n,r){var s=kd(function(o,i){if(i1(i)){var c=t(i.from,i.to,i.velocity),d=gie(c,2),f=d[0],h=d[1];return pr(pr({},i),{},{from:f,velocity:h})}return i},n);return r<1?kd(function(o,i){return i1(i)?pr(pr({},i),{},{velocity:Cm(i.velocity,s[o].velocity,r),from:Cm(i.from,s[o].from,r)}):i},n):e(t,s,r-1)};const jie=(function(e,t,n,r,s){var o=Joe(e,t),i=o.reduce(function(y,S){return pr(pr({},y),{},s1({},S,[e[S],t[S]]))},{}),c=o.reduce(function(y,S){return pr(pr({},y),{},s1({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},x=function(){return kd(function(S,C){return C.from},c)},g=function(){return!Object.values(c).filter(i1).length},j=function(S){f||(f=S);var C=S-f,N=C/n.dt;c=wie(n,c,N),s(pr(pr(pr({},e),t),x())),f=S,g()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var C=(S-h)/r,N=kd(function(A,k){return Cm.apply(void 0,fI(k).concat([n(C)]))},i);if(s(pr(pr(pr({},e),t),N)),C<1)d=requestAnimationFrame(p);else{var E=kd(function(A,k){return Cm.apply(void 0,fI(k).concat([n(1)]))},i);s(pr(pr(pr({},e),t),E))}};return p=n.isStepper?j:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function Bc(e){"@babel/helpers - typeof";return Bc=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},Bc(e)}var Sie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Nie(e,t){if(e==null)return{};var n=Cie(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cie(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o<r.length;o++)s=r[o],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function lj(e){return kie(e)||Eie(e)||Aie(e)||_ie()}function _ie(){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 Aie(e,t){if(e){if(typeof e=="string")return l1(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 l1(e,t)}}function Eie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kie(e){if(Array.isArray(e))return l1(e)}function l1(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 hI(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 Va(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hI(Object(n),!0).forEach(function(r){jd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jd(e,t,n){return t=M4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oie(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,M4(r.key),r)}}function Tie(e,t,n){return t&&Oie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function M4(e){var t=Rie(e,"string");return Bc(t)==="symbol"?t:String(t)}function Rie(e,t){if(Bc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Iie(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&&c1(e,t)}function c1(e,t){return c1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},c1(e,t)}function Mie(e){var t=$ie();return function(){var r=_m(e),s;if(t){var o=_m(this).constructor;s=Reflect.construct(r,arguments,o)}else s=r.apply(this,arguments);return u1(this,s)}}function u1(e,t){if(t&&(Bc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d1(e)}function d1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $ie(){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 _m(e){return _m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_m(e)}var Ps=(function(e){Iie(n,e);var t=Mie(n);function n(r,s){var o;Pie(this,n),o=t.call(this,r,s);var i=o.props,c=i.isActive,d=i.attributeName,f=i.from,h=i.to,p=i.steps,x=i.children,g=i.duration;if(o.handleStyleChange=o.handleStyleChange.bind(d1(o)),o.changeStyle=o.changeStyle.bind(d1(o)),!c||g<=0)return o.state={style:{}},typeof x=="function"&&(o.state={style:h}),u1(o);if(p&&p.length)o.state={style:p[0].style};else if(f){if(typeof x=="function")return o.state={style:f},u1(o);o.state={style:d?jd({},d,f):f}}else o.state={style:{}};return o}return Tie(n,[{key:"componentDidMount",value:function(){var s=this.props,o=s.isActive,i=s.canBegin;this.mounted=!0,!(!o||!i)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var o=this.props,i=o.isActive,c=o.canBegin,d=o.attributeName,f=o.shouldReAnimate,h=o.to,p=o.from,x=this.state.style;if(c){if(!i){var g={style:d?jd({},d,h):h};this.state&&x&&(d&&x[d]!==h||!d&&x!==h)&&this.setState(g);return}if(!(qoe(s.to,h)&&s.canBegin&&s.isActive)){var j=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||f?p:s.to;if(this.state&&x){var y={style:d?jd({},d,b):b};(d&&x[d]!==b||!d&&x!==b)&&this.setState(y)}this.runAnimation(Va(Va({},this.props),{},{from:b,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 o=this,i=s.from,c=s.to,d=s.duration,f=s.easing,h=s.begin,p=s.onAnimationEnd,x=s.onAnimationStart,g=jie(i,c,die(f),d,this.changeStyle),j=function(){o.stopJSAnimation=g()};this.manager.start([x,h,j,d,p])}},{key:"runStepAnimation",value:function(s){var o=this,i=s.steps,c=s.begin,d=s.onAnimationStart,f=i[0],h=f.style,p=f.duration,x=p===void 0?0:p,g=function(b,y,S){if(S===0)return b;var C=y.duration,N=y.easing,E=N===void 0?"ease":N,A=y.style,k=y.properties,O=y.onAnimationEnd,T=S>0?i[S-1]:y,$=k||Object.keys(A);if(typeof E=="function"||E==="spring")return[].concat(lj(b),[o.runJSAnimation.bind(o,{from:T.style,to:A,duration:C,easing:E}),C]);var B=cI($,C,E),q=Va(Va(Va({},T.style),A),{},{transition:B});return[].concat(lj(b),[q,C,O]).filter(Zoe)};return this.manager.start([d].concat(lj(i.reduce(g,[h,Math.max(x,c)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=Yoe());var o=s.begin,i=s.duration,c=s.attributeName,d=s.to,f=s.easing,h=s.onAnimationStart,p=s.onAnimationEnd,x=s.steps,g=s.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof g=="function"||f==="spring"){this.runJSAnimation(s);return}if(x.length>1){this.runStepAnimation(s);return}var b=c?jd({},c,d):d,y=cI(Object.keys(b),i,f);j.start([h,o,Va(Va({},b),{},{transition:y}),i,p])}},{key:"render",value:function(){var s=this.props,o=s.children;s.begin;var i=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=Nie(s,Sie),f=m.Children.count(o),h=this.state.style;if(typeof o=="function")return o(h);if(!c||f===0||i<=0)return o;var p=function(g){var j=g.props,b=j.style,y=b===void 0?{}:b,S=j.className,C=m.cloneElement(g,Va(Va({},d),{},{style:Va(Va({},y),h),className:S}));return C};return f===1?p(m.Children.only(o)):Y.createElement("div",null,m.Children.map(o,function(x){return p(x)}))}}]),n})(m.PureComponent);Ps.displayName="Animate";Ps.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Ps.propTypes={from:sn.oneOfType([sn.object,sn.string]),to:sn.oneOfType([sn.object,sn.string]),attributeName:sn.string,duration:sn.number,begin:sn.number,easing:sn.oneOfType([sn.string,sn.func]),steps:sn.arrayOf(sn.shape({duration:sn.number.isRequired,style:sn.object.isRequired,easing:sn.oneOfType([sn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),sn.func]),properties:sn.arrayOf("string"),onAnimationEnd:sn.func})),children:sn.oneOfType([sn.node,sn.func]),isActive:sn.bool,canBegin:sn.bool,onAnimationEnd:sn.func,shouldReAnimate:sn.bool,onAnimationStart:sn.func,onAnimationReStart:sn.func};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 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 Die(e,t){return Bie(e)||zie(e,t)||Fie(e,t)||Lie()}function Lie(){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 Fie(e,t){if(e){if(typeof e=="string")return mI(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 mI(e,t)}}function mI(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 zie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function Bie(e){if(Array.isArray(e))return e}function vI(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 gI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vI(Object(n),!0).forEach(function(r){qie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qie(e,t,n){return t=Uie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uie(e){var t=Wie(e,"string");return uf(t)=="symbol"?t:t+""}function Wie(e,t){if(uf(e)!="object"||!e)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)}var xI=function(t,n,r,s,o){var i=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(i>0&&o instanceof Array){for(var p=[0,0,0,0],x=0,g=4;x<g;x++)p[x]=o[x]>i?i:o[x];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(i>0&&o===+o&&o>0){var j=Math.min(i,o);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},Vie=function(t,n){if(!t||!n)return!1;var r=t.x,s=t.y,o=n.x,i=n.y,c=n.width,d=n.height;if(Math.abs(c)>0&&Math.abs(d)>0){var f=Math.min(o,o+c),h=Math.max(o,o+c),p=Math.min(i,i+d),x=Math.max(i,i+d);return r>=f&&r<=h&&s>=p&&s<=x}return!1},Hie={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},EC=function(t){var n=gI(gI({},Hie),t),r=m.useRef(),s=m.useState(-1),o=Die(s,2),i=o[0],c=o[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,x=n.radius,g=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isAnimationActive,C=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var N=Lt("recharts-rectangle",g);return C?Y.createElement(Ps,{canBegin:i>0,from:{width:h,height:p,x:d,y:f},to:{width:h,height:p,x:d,y:f},duration:b,animationEasing:j,isActive:C},function(E){var A=E.width,k=E.height,O=E.x,T=E.y;return Y.createElement(Ps,{canBegin:i>0,from:"0px ".concat(i===-1?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,isActive:S,easing:j},Y.createElement("path",Am({},St(n,!0),{className:N,d:xI(O,T,A,k,x),ref:r})))}):Y.createElement("path",Am({},St(n,!0),{className:N,d:xI(d,f,h,p,x)}))},Kie=["points","className","baseLinePoints","connectNulls"];function pc(){return pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pc.apply(this,arguments)}function Gie(e,t){if(e==null)return{};var n=Yie(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yie(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 yI(e){return Zie(e)||Jie(e)||Qie(e)||Xie()}function Xie(){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 Qie(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 Jie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zie(e){if(Array.isArray(e))return f1(e)}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}var bI=function(t){return t&&t.x===+t.x&&t.y===+t.y},ele=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){bI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),bI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Pd=function(t,n){var r=ele(t);n&&(r=[r.reduce(function(o,i){return[].concat(yI(o),yI(i))},[])]);var s=r.map(function(o){return o.reduce(function(i,c,d){return"".concat(i).concat(d===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(s,"Z"):s},tle=function(t,n,r){var s=Pd(t,r);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(Pd(n.reverse(),r).slice(1))},nle=function(t){var n=t.points,r=t.className,s=t.baseLinePoints,o=t.connectNulls,i=Gie(t,Kie);if(!n||!n.length)return null;var c=Lt("recharts-polygon",r);if(s&&s.length){var d=i.stroke&&i.stroke!=="none",f=tle(n,s,o);return Y.createElement("g",{className:c},Y.createElement("path",pc({},St(i,!0),{fill:f.slice(-1)==="Z"?i.fill:"none",stroke:"none",d:f})),d?Y.createElement("path",pc({},St(i,!0),{fill:"none",d:Pd(n,o)})):null,d?Y.createElement("path",pc({},St(i,!0),{fill:"none",d:Pd(s,o)})):null)}var h=Pd(n,o);return Y.createElement("path",pc({},St(i,!0),{fill:h.slice(-1)==="Z"?i.fill:"none",className:c,d:h}))};function p1(){return p1=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},p1.apply(this,arguments)}var Zv=function(t){var n=t.cx,r=t.cy,s=t.r,o=t.className,i=Lt("recharts-dot",o);return n===+n&&r===+r&&s===+s?m.createElement("circle",p1({},St(t,!1),Kh(t),{className:i,cx:n,cy:r,r:s})):null};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)}var rle=["x","y","top","left","width","height","className"];function h1(){return h1=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},h1.apply(this,arguments)}function wI(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 ale(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wI(Object(n),!0).forEach(function(r){sle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sle(e,t,n){return t=ole(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ole(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)}function lle(e,t){if(e==null)return{};var n=cle(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[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 ule=function(t,n,r,s,o,i){return"M".concat(t,",").concat(o,"v").concat(s,"M").concat(i,",").concat(n,"h").concat(r)},dle=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,o=s===void 0?0:s,i=t.top,c=i===void 0?0:i,d=t.left,f=d===void 0?0:d,h=t.width,p=h===void 0?0:h,x=t.height,g=x===void 0?0:x,j=t.className,b=lle(t,rle),y=ale({x:r,y:o,top:c,left:f,width:p,height:g},b);return!Ge(r)||!Ge(o)||!Ge(p)||!Ge(g)||!Ge(c)||!Ge(f)?null:Y.createElement("path",h1({},St(y,!0),{className:Lt("recharts-cross",j),d:ule(r,o,p,g,c,f)}))},cj,jI;function fle(){if(jI)return cj;jI=1;var e=Gv(),t=QL(),n=$s();function r(s,o){return s&&s.length?e(s,n(o,2),t):void 0}return cj=r,cj}var ple=fle();const hle=un(ple);var uj,SI;function mle(){if(SI)return uj;SI=1;var e=Gv(),t=$s(),n=JL();function r(s,o){return s&&s.length?e(s,t(o,2),n):void 0}return uj=r,uj}var vle=mle();const gle=un(vle);var xle=["cx","cy","angle","ticks","axisLine"],yle=["ticks","tick","angle","tickFormatter","stroke"];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 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 NI(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 Mi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NI(Object(n),!0).forEach(function(r){eg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CI(e,t){if(e==null)return{};var n=ble(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ble(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 wle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _I(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,D4(r.key),r)}}function jle(e,t,n){return t&&_I(e.prototype,t),n&&_I(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sle(e,t,n){return t=Em(t),Nle(e,$4()?Reflect.construct(t,n||[],Em(e).constructor):t.apply(e,n))}function Nle(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 Cle(e)}function Cle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($4=function(){return!!e})()}function Em(e){return Em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Em(e)}function _le(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 eg(e,t,n){return t=D4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D4(e){var t=Ale(e,"string");return qc(t)=="symbol"?t:t+""}function Ale(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(t==="string"?String:Number)(e)}var tg=(function(e){function t(){return wle(this,t),Sle(this,t,arguments)}return _le(t,e),jle(t,[{key:"getTickValueCoord",value:function(r){var s=r.coordinate,o=this.props,i=o.angle,c=o.cx,d=o.cy;return Sn(c,d,s,i)}},{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,o=r.cy,i=r.angle,c=r.ticks,d=hle(c,function(h){return h.coordinate||0}),f=gle(c,function(h){return h.coordinate||0});return{cx:s,cy:o,startAngle:i,endAngle:i,innerRadius:f.coordinate||0,outerRadius:d.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,o=r.cy,i=r.angle,c=r.ticks,d=r.axisLine,f=CI(r,xle),h=c.reduce(function(j,b){return[Math.min(j[0],b.coordinate),Math.max(j[1],b.coordinate)]},[1/0,-1/0]),p=Sn(s,o,h[0],i),x=Sn(s,o,h[1],i),g=Mi(Mi(Mi({},St(f,!1)),{},{fill:"none"},St(d,!1)),{},{x1:p.x,y1:p.y,x2:x.x,y2:x.y});return Y.createElement("line",Od({className:"recharts-polar-radius-axis-line"},g))}},{key:"renderTicks",value:function(){var r=this,s=this.props,o=s.ticks,i=s.tick,c=s.angle,d=s.tickFormatter,f=s.stroke,h=CI(s,yle),p=this.getTickTextAnchor(),x=St(h,!1),g=St(i,!1),j=o.map(function(b,y){var S=r.getTickValueCoord(b),C=Mi(Mi(Mi(Mi({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},x),{},{stroke:"none",fill:f},g),{},{index:y},S),{},{payload:b});return Y.createElement(en,Od({className:Lt("recharts-polar-radius-axis-tick",C4(i)),key:"tick-".concat(b.coordinate)},al(r.props,b,y)),t.renderTickItem(i,C,d?d(b.value,y):b.value))});return Y.createElement(en,{className:"recharts-polar-radius-axis-ticks"},j)}},{key:"render",value:function(){var r=this.props,s=r.ticks,o=r.axisLine,i=r.tick;return!s||!s.length?null:Y.createElement(en,{className:Lt("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),i&&this.renderTicks(),cr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,s,o){var i;return Y.isValidElement(r)?i=Y.cloneElement(r,s):It(r)?i=r(s):i=Y.createElement(sl,Od({},s,{className:"recharts-polar-radius-axis-tick-value"}),o),i}}])})(m.PureComponent);eg(tg,"displayName","PolarRadiusAxis");eg(tg,"axisType","radiusAxis");eg(tg,"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 Uc(e){"@babel/helpers - typeof";return Uc=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},Uc(e)}function qi(){return qi=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},qi.apply(this,arguments)}function AI(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 $i(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){ng(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ele(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EI(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,F4(r.key),r)}}function kle(e,t,n){return t&&EI(e.prototype,t),n&&EI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ple(e,t,n){return t=km(t),Ole(e,L4()?Reflect.construct(t,n||[],km(e).constructor):t.apply(e,n))}function Ole(e,t){if(t&&(Uc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tle(e)}function Tle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(L4=function(){return!!e})()}function km(e){return km=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},km(e)}function Rle(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&&v1(e,t)}function v1(e,t){return v1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},v1(e,t)}function ng(e,t,n){return t=F4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F4(e){var t=Ile(e,"string");return Uc(t)=="symbol"?t:t+""}function Ile(e,t){if(Uc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Uc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mle=Math.PI/180,kI=1e-5,rg=(function(e){function t(){return Ele(this,t),Ple(this,t,arguments)}return Rle(t,e),kle(t,[{key:"getTickLineCoord",value:function(r){var s=this.props,o=s.cx,i=s.cy,c=s.radius,d=s.orientation,f=s.tickSize,h=f||8,p=Sn(o,i,c,r.coordinate),x=Sn(o,i,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:x.x,y2:x.y}}},{key:"getTickTextAnchor",value:function(r){var s=this.props.orientation,o=Math.cos(-r.coordinate*Mle),i;return o>kI?i=s==="outer"?"start":"end":o<-kI?i=s==="outer"?"end":"start":i="middle",i}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,o=r.cy,i=r.radius,c=r.axisLine,d=r.axisLineType,f=$i($i({},St(this.props,!1)),{},{fill:"none"},St(c,!1));if(d==="circle")return Y.createElement(Zv,qi({className:"recharts-polar-angle-axis-line"},f,{cx:s,cy:o,r:i}));var h=this.props.ticks,p=h.map(function(x){return Sn(s,o,i,x.coordinate)});return Y.createElement(nle,qi({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,s=this.props,o=s.ticks,i=s.tick,c=s.tickLine,d=s.tickFormatter,f=s.stroke,h=St(this.props,!1),p=St(i,!1),x=$i($i({},h),{},{fill:"none"},St(c,!1)),g=o.map(function(j,b){var y=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),C=$i($i($i({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:y.x2,y:y.y2});return Y.createElement(en,qi({className:Lt("recharts-polar-angle-axis-tick",C4(i)),key:"tick-".concat(j.coordinate)},al(r.props,j,b)),c&&Y.createElement("line",qi({className:"recharts-polar-angle-axis-tick-line"},x,y)),i&&t.renderTickItem(i,C,d?d(j.value,b):j.value))});return Y.createElement(en,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var r=this.props,s=r.ticks,o=r.radius,i=r.axisLine;return o<=0||!s||!s.length?null:Y.createElement(en,{className:Lt("recharts-polar-angle-axis",this.props.className)},i&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,s,o){var i;return Y.isValidElement(r)?i=Y.cloneElement(r,s):It(r)?i=r(s):i=Y.createElement(sl,qi({},s,{className:"recharts-polar-angle-axis-tick-value"}),o),i}}])})(m.PureComponent);ng(rg,"displayName","PolarAngleAxis");ng(rg,"axisType","angleAxis");ng(rg,"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 dj,PI;function $le(){if(PI)return dj;PI=1;var e=Q3(),t=e(Object.getPrototypeOf,Object);return dj=t,dj}var fj,OI;function Dle(){if(OI)return fj;OI=1;var e=xo(),t=$le(),n=yo(),r="[object Object]",s=Function.prototype,o=Object.prototype,i=s.toString,c=o.hasOwnProperty,d=i.call(Object);function f(h){if(!n(h)||e(h)!=r)return!1;var p=t(h);if(p===null)return!0;var x=c.call(p,"constructor")&&p.constructor;return typeof x=="function"&&x instanceof x&&i.call(x)==d}return fj=f,fj}var Lle=Dle();const Fle=un(Lle);var pj,TI;function zle(){if(TI)return pj;TI=1;var e=xo(),t=yo(),n="[object Boolean]";function r(s){return s===!0||s===!1||t(s)&&e(s)==n}return pj=r,pj}var Ble=zle();const qle=un(Ble);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)}function Pm(){return Pm=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},Pm.apply(this,arguments)}function Ule(e,t){return Kle(e)||Hle(e,t)||Vle(e,t)||Wle()}function Wle(){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 Vle(e,t){if(e){if(typeof e=="string")return RI(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 RI(e,t)}}function RI(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 Hle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function Kle(e){if(Array.isArray(e))return e}function II(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 MI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?II(Object(n),!0).forEach(function(r){Gle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):II(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gle(e,t,n){return t=Yle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yle(e){var t=Xle(e,"string");return ff(t)=="symbol"?t:t+""}function Xle(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)}var $I=function(t,n,r,s,o){var i=r-s,c;return c="M ".concat(t,",").concat(n),c+="L ".concat(t+r,",").concat(n),c+="L ".concat(t+r-i/2,",").concat(n+o),c+="L ".concat(t+r-i/2-s,",").concat(n+o),c+="L ".concat(t,",").concat(n," Z"),c},Qle={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Jle=function(t){var n=MI(MI({},Qle),t),r=m.useRef(),s=m.useState(-1),o=Ule(s,2),i=o[0],c=o[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var N=r.current.getTotalLength();N&&c(N)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,x=n.height,g=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||x!==+x||h===0&&p===0||x===0)return null;var C=Lt("recharts-trapezoid",g);return S?Y.createElement(Ps,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:x,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:x,x:d,y:f},duration:b,animationEasing:j,isActive:S},function(N){var E=N.upperWidth,A=N.lowerWidth,k=N.height,O=N.x,T=N.y;return Y.createElement(Ps,{canBegin:i>0,from:"0px ".concat(i===-1?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,easing:j},Y.createElement("path",Pm({},St(n,!0),{className:C,d:$I(O,T,E,A,k),ref:r})))}):Y.createElement("g",null,Y.createElement("path",Pm({},St(n,!0),{className:C,d:$I(d,f,h,p,x)})))},Zle=["option","shapeType","propTransformer","activeClassName","isActive"];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 ece(e,t){if(e==null)return{};var n=tce(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tce(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 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 Om(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){nce(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 nce(e,t,n){return t=rce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rce(e){var t=ace(e,"string");return pf(t)=="symbol"?t:t+""}function ace(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)}function sce(e,t){return Om(Om({},t),e)}function oce(e,t){return e==="symbols"}function LI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return Y.createElement(EC,n);case"trapezoid":return Y.createElement(Jle,n);case"sector":return Y.createElement(E4,n);case"symbols":if(oce(t))return Y.createElement(KN,n);break;default:return null}}function ice(e){return m.isValidElement(e)?e.props:e}function z4(e){var t=e.option,n=e.shapeType,r=e.propTransformer,s=r===void 0?sce:r,o=e.activeClassName,i=o===void 0?"recharts-active-shape":o,c=e.isActive,d=ece(e,Zle),f;if(m.isValidElement(t))f=m.cloneElement(t,Om(Om({},d),ice(t)));else if(It(t))f=t(d);else if(Fle(t)&&!qle(t)){var h=s(t,d);f=Y.createElement(LI,{shapeType:n,elementProps:h})}else{var p=d;f=Y.createElement(LI,{shapeType:n,elementProps:p})}return c?Y.createElement(en,{className:i},f):f}function ag(e,t){return t!=null&&"trapezoids"in e.props}function sg(e,t){return t!=null&&"sectors"in e.props}function hf(e,t){return t!=null&&"points"in e.props}function lce(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,o=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return s&&o}function cce(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function uce(e,t){var n=e.x===t.x,r=e.y===t.y,s=e.z===t.z;return n&&r&&s}function dce(e,t){var n;return ag(e,t)?n=lce:sg(e,t)?n=cce:hf(e,t)&&(n=uce),n}function fce(e,t){var n;return ag(e,t)?n="trapezoids":sg(e,t)?n="sectors":hf(e,t)&&(n="points"),n}function pce(e,t){if(ag(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(sg(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 hf(e,t)?t.payload:{}}function hce(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,s=fce(n,t),o=pce(n,t),i=r.filter(function(d,f){var h=Uf(o,d),p=n.props[s].filter(function(j){var b=dce(n,t);return b(j,t)}),x=n.props[s].indexOf(p[p.length-1]),g=f===x;return h&&g}),c=r.indexOf(i[i.length-1]);return c}var Ih;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 hc(){return hc=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},hc.apply(this,arguments)}function FI(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 yn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FI(Object(n),!0).forEach(function(r){Aa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zI(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,q4(r.key),r)}}function vce(e,t,n){return t&&zI(e.prototype,t),n&&zI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gce(e,t,n){return t=Tm(t),xce(e,B4()?Reflect.construct(t,n||[],Tm(e).constructor):t.apply(e,n))}function xce(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 yce(e)}function yce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(B4=function(){return!!e})()}function Tm(e){return Tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Tm(e)}function bce(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&&g1(e,t)}function g1(e,t){return g1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},g1(e,t)}function Aa(e,t,n){return t=q4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q4(e){var t=wce(e,"string");return Wc(t)=="symbol"?t:t+""}function wce(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 wo=(function(e){function t(n){var r;return mce(this,t),r=gce(this,t,[n]),Aa(r,"pieRef",null),Aa(r,"sectorRefs",[]),Aa(r,"id",gu("recharts-pie-")),Aa(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),It(s)&&s()}),Aa(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),It(s)&&s()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return bce(t,e),vce(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 o=this.props,i=o.label,c=o.labelLine,d=o.dataKey,f=o.valueKey,h=St(this.props,!1),p=St(i,!1),x=St(c,!1),g=i&&i.offsetRadius||20,j=r.map(function(b,y){var S=(b.startAngle+b.endAngle)/2,C=Sn(b.cx,b.cy,b.outerRadius+g,S),N=yn(yn(yn(yn({},h),b),{},{stroke:"none"},p),{},{index:y,textAnchor:t.getTextAnchor(C.x,b.cx)},C),E=yn(yn(yn(yn({},h),b),{},{fill:"none",stroke:b.fill},x),{},{index:y,points:[Sn(b.cx,b.cy,b.outerRadius,S),C]}),A=d;return Mt(d)&&Mt(f)?A="value":Mt(d)&&(A=f),Y.createElement(en,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(y)},c&&t.renderLabelLineItem(c,E,"line"),t.renderLabelItem(i,N,er(b,A)))});return Y.createElement(en,{className:"recharts-pie-labels"},j)}},{key:"renderSectorsStatically",value:function(r){var s=this,o=this.props,i=o.activeShape,c=o.blendStroke,d=o.inactiveShape;return r.map(function(f,h){if(f?.startAngle===0&&f?.endAngle===0&&r.length!==1)return null;var p=s.isActiveIndex(h),x=d&&s.hasActiveIndex()?d:null,g=p?i:x,j=yn(yn({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return Y.createElement(en,hc({ref:function(y){y&&!s.sectorRefs.includes(y)&&s.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},al(s.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),Y.createElement(z4,hc({option:g,isActive:p,shapeType:"sector"},j)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,s=this.props,o=s.sectors,i=s.isAnimationActive,c=s.animationBegin,d=s.animationDuration,f=s.animationEasing,h=s.animationId,p=this.state,x=p.prevSectors,g=p.prevIsAnimationActive;return Y.createElement(Ps,{begin:c,duration:d,isActive:i,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(g),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(j){var b=j.t,y=[],S=o&&o[0],C=S.startAngle;return o.forEach(function(N,E){var A=x&&x[E],k=E>0?fa(N,"paddingAngle",0):0;if(A){var O=la(A.endAngle-A.startAngle,N.endAngle-N.startAngle),T=yn(yn({},N),{},{startAngle:C+k,endAngle:C+O(b)+k});y.push(T),C=T.endAngle}else{var $=N.endAngle,B=N.startAngle,q=la(0,$-B),F=q(b),H=yn(yn({},N),{},{startAngle:C+k,endAngle:C+F+k});y.push(H),C=H.endAngle}}),Y.createElement(en,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var s=this;r.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var i=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[i].focus(),s.setState({sectorToFocus:i});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,o=r.isAnimationActive,i=this.state.prevSectors;return o&&s&&s.length&&(!i||!Uf(i,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,o=s.hide,i=s.sectors,c=s.className,d=s.label,f=s.cx,h=s.cy,p=s.innerRadius,x=s.outerRadius,g=s.isAnimationActive,j=this.state.isAnimationFinished;if(o||!i||!i.length||!Ge(f)||!Ge(h)||!Ge(p)||!Ge(x))return null;var b=Lt("recharts-pie",c);return Y.createElement(en,{tabIndex:this.props.rootTabIndex,className:b,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(i),cr.renderCallByParent(this.props,null,!1),(!g||j)&&so.renderCallByParent(this.props,i,!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,o){if(Y.isValidElement(r))return Y.cloneElement(r,s);if(It(r))return r(s);var i=Lt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return Y.createElement(jm,hc({},s,{key:o,type:"linear",className:i}))}},{key:"renderLabelItem",value:function(r,s,o){if(Y.isValidElement(r))return Y.cloneElement(r,s);var i=o;if(It(r)&&(i=r(s),Y.isValidElement(i)))return i;var c=Lt("recharts-pie-label-text",typeof r!="boolean"&&!It(r)?r.className:"");return Y.createElement(sl,hc({},s,{alignmentBaseline:"middle",className:c}),i)}}])})(m.PureComponent);Ih=wo;Aa(wo,"displayName","Pie");Aa(wo,"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:!Sl.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Aa(wo,"parseDeltaAngle",function(e,t){var n=_r(t-e),r=Math.min(Math.abs(t-e),360);return n*r});Aa(wo,"getRealPieData",function(e){var t=e.data,n=e.children,r=St(e,!1),s=pa(n,Bv);return t&&t.length?t.map(function(o,i){return yn(yn(yn({payload:o},r),o),s&&s[i]&&s[i].props)}):s&&s.length?s.map(function(o){return yn(yn({},r),o.props)}):[]});Aa(wo,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,s=t.width,o=t.height,i=N4(s,o),c=r+Ar(e.cx,s,s/2),d=n+Ar(e.cy,o,o/2),f=Ar(e.innerRadius,i,0),h=Ar(e.outerRadius,i,i*.8),p=e.maxRadius||Math.sqrt(s*s+o*o)/2;return{cx:c,cy:d,innerRadius:f,outerRadius:h,maxRadius:p}});Aa(wo,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?yn(yn({},t.type.defaultProps),t.props):t.props,s=Ih.getRealPieData(r);if(!s||!s.length)return null;var o=r.cornerRadius,i=r.startAngle,c=r.endAngle,d=r.paddingAngle,f=r.dataKey,h=r.nameKey,p=r.valueKey,x=r.tooltipType,g=Math.abs(r.minAngle),j=Ih.parseCoordinateOfPie(r,n),b=Ih.parseDeltaAngle(i,c),y=Math.abs(b),S=f;Mt(f)&&Mt(p)?(ro(!1,`Use "dataKey" to specify the value of pie,
|
|
114
|
-
the props "valueKey" will be deprecated in 1.1.0`),S="value"):Mt(f)&&(ro(!1,`Use "dataKey" to specify the value of pie,
|
|
115
|
-
the props "valueKey" will be deprecated in 1.1.0`),S=p);var C=s.filter(function(T){return er(T,S,0)!==0}).length,N=(y>=360?C:C-1)*d,E=y-C*g-N,A=s.reduce(function(T,$){var B=er($,S,0);return T+(Ge(B)?B:0)},0),k;if(A>0){var O;k=s.map(function(T,$){var B=er(T,S,0),q=er(T,h,$),F=(Ge(B)?B:0)/A,H;$?H=O.endAngle+_r(b)*d*(B!==0?1:0):H=i;var U=H+_r(b)*((B!==0?g:0)+F*E),R=(H+U)/2,W=(j.innerRadius+j.outerRadius)/2,X=[{name:q,value:B,payload:T,dataKey:S,type:x}],G=Sn(j.cx,j.cy,W,R);return O=yn(yn(yn({percent:F,cornerRadius:o,name:q,tooltipPayload:X,midAngle:R,middleRadius:W,tooltipPosition:G},T),j),{},{value:er(T,S),startAngle:H,endAngle:U,payload:T,paddingAngle:_r(b)*d}),O})}return yn(yn({},j),{},{sectors:k,data:s})});var hj,BI;function jce(){if(BI)return hj;BI=1;var e=Math.ceil,t=Math.max;function n(r,s,o,i){for(var c=-1,d=t(e((s-r)/(o||1)),0),f=Array(d);d--;)f[i?d:++c]=r,r+=o;return f}return hj=n,hj}var mj,qI;function U4(){if(qI)return mj;qI=1;var e=pL(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var o=s<0?-1:1;return o*n}return s===s?s:0}return mj=r,mj}var vj,UI;function Sce(){if(UI)return vj;UI=1;var e=jce(),t=zv(),n=U4();function r(s){return function(o,i,c){return c&&typeof c!="number"&&t(o,i,c)&&(i=c=void 0),o=n(o),i===void 0?(i=o,o=0):i=n(i),c=c===void 0?o<i?1:-1:n(c),e(o,i,c,s)}}return vj=r,vj}var gj,WI;function Nce(){if(WI)return gj;WI=1;var e=Sce(),t=e();return gj=t,gj}var Cce=Nce();const Rm=un(Cce);function mf(e){"@babel/helpers - typeof";return mf=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},mf(e)}function VI(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 HI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VI(Object(n),!0).forEach(function(r){W4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W4(e,t,n){return t=_ce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ce(e){var t=Ace(e,"string");return mf(t)=="symbol"?t:t+""}function Ace(e,t){if(mf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ece=["Webkit","Moz","O","ms"],kce=function(t,n){var r=t.replace(/(\w)/,function(o){return o.toUpperCase()}),s=Ece.reduce(function(o,i){return HI(HI({},o),{},W4({},i+r,n))},{});return s[t]=n,s};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)}function Im(){return Im=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},Im.apply(this,arguments)}function KI(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 xj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KI(Object(n),!0).forEach(function(r){sa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GI(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,H4(r.key),r)}}function Oce(e,t,n){return t&&GI(e.prototype,t),n&&GI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tce(e,t,n){return t=Mm(t),Rce(e,V4()?Reflect.construct(t,n||[],Mm(e).constructor):t.apply(e,n))}function Rce(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 Ice(e)}function Ice(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(V4=function(){return!!e})()}function Mm(e){return Mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mm(e)}function Mce(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&&x1(e,t)}function x1(e,t){return x1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},x1(e,t)}function sa(e,t,n){return t=H4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H4(e){var t=$ce(e,"string");return Vc(t)=="symbol"?t:t+""}function $ce(e,t){if(Vc(e)!="object"||!e)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 String(e)}var Dce=function(t){var n=t.data,r=t.startIndex,s=t.endIndex,o=t.x,i=t.width,c=t.travellerWidth;if(!n||!n.length)return{};var d=n.length,f=Ad().domain(Rm(0,d)).range([o,o+i-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}},YI=function(t){return t.changedTouches&&!!t.changedTouches.length},Hc=(function(e){function t(n){var r;return Pce(this,t),r=Tce(this,t,[n]),sa(r,"handleDrag",function(s){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(s):r.state.isSlideMoving&&r.handleSlideDrag(s)}),sa(r,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&r.handleDrag(s.changedTouches[0])}),sa(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=r.props,o=s.endIndex,i=s.onDragEnd,c=s.startIndex;i?.({endIndex:o,startIndex:c})}),r.detachDragEndListener()}),sa(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),sa(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),sa(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),sa(r,"handleSlideDragStart",function(s){var o=YI(s)?s.changedTouches[0]:s;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Mce(t,e),Oce(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=r.startX,o=r.endX,i=this.state.scaleValues,c=this.props,d=c.gap,f=c.data,h=f.length-1,p=Math.min(s,o),x=Math.max(s,o),g=t.getIndexInRange(i,p),j=t.getIndexInRange(i,x);return{startIndex:g-g%d,endIndex:j===h?h:j-j%d}}},{key:"getTextOfTick",value:function(r){var s=this.props,o=s.data,i=s.tickFormatter,c=s.dataKey,d=er(o[r],c,r);return It(i)?i(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,o=s.slideMoveStartX,i=s.startX,c=s.endX,d=this.props,f=d.x,h=d.width,p=d.travellerWidth,x=d.startIndex,g=d.endIndex,j=d.onChange,b=r.pageX-o;b>0?b=Math.min(b,f+h-p-c,f+h-p-i):b<0&&(b=Math.max(b,f-i,f-c));var y=this.getIndex({startX:i+b,endX:c+b});(y.startIndex!==x||y.endIndex!==g)&&j&&j(y),this.setState({startX:i+b,endX:c+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var o=YI(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var s=this.state,o=s.brushMoveStartX,i=s.movingTravellerId,c=s.endX,d=s.startX,f=this.state[i],h=this.props,p=h.x,x=h.width,g=h.travellerWidth,j=h.onChange,b=h.gap,y=h.data,S={startX:this.state.startX,endX:this.state.endX},C=r.pageX-o;C>0?C=Math.min(C,p+x-g-f):C<0&&(C=Math.max(C,p-f)),S[i]=f+C;var N=this.getIndex(S),E=N.startIndex,A=N.endIndex,k=function(){var T=y.length-1;return i==="startX"&&(c>d?E%b===0:A%b===0)||c<d&&A===T||i==="endX"&&(c>d?A%b===0:E%b===0)||c>d&&A===T};this.setState(sa(sa({},i,f+C),"brushMoveStartX",r.pageX),function(){j&&k()&&j(N)})}},{key:"handleTravellerMoveKeyboard",value:function(r,s){var o=this,i=this.state,c=i.scaleValues,d=i.startX,f=i.endX,h=this.state[s],p=c.indexOf(h);if(p!==-1){var x=p+r;if(!(x===-1||x>=c.length)){var g=c[x];s==="startX"&&g>=f||s==="endX"&&g<=d||this.setState(sa({},s,g),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,s=r.x,o=r.y,i=r.width,c=r.height,d=r.fill,f=r.stroke;return Y.createElement("rect",{stroke:f,fill:d,x:s,y:o,width:i,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,s=r.x,o=r.y,i=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:o,width:i,height:c,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,s){var o,i,c=this,d=this.props,f=d.y,h=d.travellerWidth,p=d.height,x=d.traveller,g=d.ariaLabel,j=d.data,b=d.startIndex,y=d.endIndex,S=Math.max(r,this.props.x),C=xj(xj({},St(this.props,!1)),{},{x:S,y:f,width:h,height:p}),N=g||"Min value: ".concat((o=j[b])===null||o===void 0?void 0:o.name,", Max value: ").concat((i=j[y])===null||i===void 0?void 0:i.name);return Y.createElement(en,{tabIndex:0,role:"slider","aria-label":N,"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(x,C))}},{key:"renderSlide",value:function(r,s){var o=this.props,i=o.y,c=o.height,d=o.stroke,f=o.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:i,width:p,height:c})}},{key:"renderText",value:function(){var r=this.props,s=r.startIndex,o=r.endIndex,i=r.y,c=r.height,d=r.travellerWidth,f=r.stroke,h=this.state,p=h.startX,x=h.endX,g=5,j={pointerEvents:"none",fill:f};return Y.createElement(en,{className:"recharts-brush-texts"},Y.createElement(sl,Im({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,x)-g,y:i+c/2},j),this.getTextOfTick(s)),Y.createElement(sl,Im({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,x)+d+g,y:i+c/2},j),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,s=r.data,o=r.className,i=r.children,c=r.x,d=r.y,f=r.width,h=r.height,p=r.alwaysShowText,x=this.state,g=x.startX,j=x.endX,b=x.isTextActive,y=x.isSlideMoving,S=x.isTravellerMoving,C=x.isTravellerFocused;if(!s||!s.length||!Ge(c)||!Ge(d)||!Ge(f)||!Ge(h)||f<=0||h<=0)return null;var N=Lt("recharts-brush",o),E=Y.Children.count(i)===1,A=kce("userSelect","none");return Y.createElement(en,{className:N,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(g,j),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(j,"endX"),(b||y||S||C||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var s=r.x,o=r.y,i=r.width,c=r.height,d=r.stroke,f=Math.floor(o+c/2)-1;return Y.createElement(Y.Fragment,null,Y.createElement("rect",{x:s,y:o,width:i,height:c,fill:d,stroke:"none"}),Y.createElement("line",{x1:s+1,y1:f,x2:s+i-1,y2:f,fill:"none",stroke:"#fff"}),Y.createElement("line",{x1:s+1,y1:f+2,x2:s+i-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,s){var o;return Y.isValidElement(r)?o=Y.cloneElement(r,s):It(r)?o=r(s):o=t.renderDefaultTraveller(s),o}},{key:"getDerivedStateFromProps",value:function(r,s){var o=r.data,i=r.width,c=r.x,d=r.travellerWidth,f=r.updateId,h=r.startIndex,p=r.endIndex;if(o!==s.prevData||f!==s.prevUpdateId)return xj({prevData:o,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:i},o&&o.length?Dce({data:o,width:i,x:c,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(s.scale&&(i!==s.prevWidth||c!==s.prevX||d!==s.prevTravellerWidth)){s.scale.range([c,c+i-d]);var x=s.scale.domain().map(function(g){return s.scale(g)});return{prevData:o,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:i,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:x}}return null}},{key:"getIndexInRange",value:function(r,s){for(var o=r.length,i=0,c=o-1;c-i>1;){var d=Math.floor((i+c)/2);r[d]>s?c=d:i=d}return s>=r[c]?c:i}}])})(m.PureComponent);sa(Hc,"displayName","Brush");sa(Hc,"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 yj,XI;function Lce(){if(XI)return yj;XI=1;var e=eC();function t(n,r){var s;return e(n,function(o,i,c){return s=r(o,i,c),!s}),!!s}return yj=t,yj}var bj,QI;function Fce(){if(QI)return bj;QI=1;var e=W3(),t=$s(),n=Lce(),r=Gr(),s=zv();function o(i,c,d){var f=r(i)?e:n;return d&&s(i,c,d)&&(c=void 0),f(i,t(c,3))}return bj=o,bj}var zce=Fce();const Bce=un(zce);var Ns=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},wj,JI;function qce(){if(JI)return wj;JI=1;var e=lL();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return wj=t,wj}var jj,ZI;function Uce(){if(ZI)return jj;ZI=1;var e=qce(),t=oL(),n=$s();function r(s,o){var i={};return o=n(o,3),t(s,function(c,d,f){e(i,d,o(c,d,f))}),i}return jj=r,jj}var Wce=Uce();const Vce=un(Wce);var Sj,eM;function Hce(){if(eM)return Sj;eM=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 Sj=e,Sj}var Nj,tM;function Kce(){if(tM)return Nj;tM=1;var e=eC();function t(n,r){var s=!0;return e(n,function(o,i,c){return s=!!r(o,i,c),s}),s}return Nj=t,Nj}var Cj,nM;function Gce(){if(nM)return Cj;nM=1;var e=Hce(),t=Kce(),n=$s(),r=Gr(),s=zv();function o(i,c,d){var f=r(i)?e:t;return d&&s(i,c,d)&&(c=void 0),f(i,n(c,3))}return Cj=o,Cj}var Yce=Gce();const Xce=un(Yce);var Qce=["x","y"];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 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)}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 gd(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){Jce(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 Jce(e,t,n){return t=Zce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zce(e){var t=eue(e,"string");return vf(t)=="symbol"?t:t+""}function eue(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)}function tue(e,t){if(e==null)return{};var n=nue(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nue(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 rue(e,t){var n=e.x,r=e.y,s=tue(e,Qce),o="".concat(n),i=parseInt(o,10),c="".concat(r),d=parseInt(c,10),f="".concat(t.height||s.height),h=parseInt(f,10),p="".concat(t.width||s.width),x=parseInt(p,10);return gd(gd(gd(gd(gd({},t),s),i?{x:i}:{}),d?{y:d}:{}),{},{height:h,width:x,name:t.name,radius:t.radius})}function aM(e){return Y.createElement(z4,y1({shapeType:"rectangle",propTransformer:rue,activeClassName:"recharts-active-bar"},e))}var aue=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 o=Ge(r)||SX(r);return o?t(r,s):(o||il(),n)}},sue=["value","background"],K4;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 oue(e,t){if(e==null)return{};var n=iue(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function iue(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 $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 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 Hn(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){Qo(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 lue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oM(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 cue(e,t,n){return t&&oM(e.prototype,t),n&&oM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function uue(e,t,n){return t=Dm(t),due(e,G4()?Reflect.construct(t,n||[],Dm(e).constructor):t.apply(e,n))}function due(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 fue(e)}function fue(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 Dm(e){return Dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Dm(e)}function pue(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&&b1(e,t)}function b1(e,t){return b1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},b1(e,t)}function Qo(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=hue(e,"string");return Kc(t)=="symbol"?t:t+""}function hue(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 String(e)}var Al=(function(e){function t(){var n;lue(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=uue(this,t,[].concat(s)),Qo(n,"state",{isAnimationFinished:!1}),Qo(n,"id",gu("recharts-bar-")),Qo(n,"handleAnimationEnd",function(){var i=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),i&&i()}),Qo(n,"handleAnimationStart",function(){var i=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),i&&i()}),n}return pue(t,e),cue(t,[{key:"renderRectanglesStatically",value:function(r){var s=this,o=this.props,i=o.shape,c=o.dataKey,d=o.activeIndex,f=o.activeBar,h=St(this.props,!1);return r&&r.map(function(p,x){var g=x===d,j=g?f:i,b=Hn(Hn(Hn({},h),p),{},{isActive:g,option:j,index:x,dataKey:c,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return Y.createElement(en,$m({className:"recharts-bar-rectangle"},al(s.props,p,x),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(x)}),Y.createElement(aM,b))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,s=this.props,o=s.data,i=s.layout,c=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,p=s.animationId,x=this.state.prevData;return Y.createElement(Ps,{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(g){var j=g.t,b=o.map(function(y,S){var C=x&&x[S];if(C){var N=la(C.x,y.x),E=la(C.y,y.y),A=la(C.width,y.width),k=la(C.height,y.height);return Hn(Hn({},y),{},{x:N(j),y:E(j),width:A(j),height:k(j)})}if(i==="horizontal"){var O=la(0,y.height),T=O(j);return Hn(Hn({},y),{},{y:y.y+y.height-T,height:T})}var $=la(0,y.width),B=$(j);return Hn(Hn({},y),{},{width:B})});return Y.createElement(en,null,r.renderRectanglesStatically(b))})}},{key:"renderRectangles",value:function(){var r=this.props,s=r.data,o=r.isAnimationActive,i=this.state.prevData;return o&&s&&s.length&&(!i||!Uf(i,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}},{key:"renderBackground",value:function(){var r=this,s=this.props,o=s.data,i=s.dataKey,c=s.activeIndex,d=St(this.props.background,!1);return o.map(function(f,h){f.value;var p=f.background,x=oue(f,sue);if(!p)return null;var g=Hn(Hn(Hn(Hn(Hn({},x),{},{fill:"#eee"},p),d),al(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:i,index:h,className:"recharts-bar-background-rectangle"});return Y.createElement(aM,$m({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},g))})}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,i=o.data,c=o.xAxis,d=o.yAxis,f=o.layout,h=o.children,p=pa(h,Wf);if(!p)return null;var x=f==="vertical"?i[0].height/2:i[0].width/2,g=function(y,S){var C=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:C,errorVal:er(y,S)}},j={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Y.createElement(en,j,p.map(function(b){return Y.cloneElement(b,{key:"error-bar-".concat(s,"-").concat(b.props.dataKey),data:i,xAxis:c,yAxis:d,layout:f,offset:x,dataPointFormatter:g})}))}},{key:"render",value:function(){var r=this.props,s=r.hide,o=r.data,i=r.className,c=r.xAxis,d=r.yAxis,f=r.left,h=r.top,p=r.width,x=r.height,g=r.isAnimationActive,j=r.background,b=r.id;if(s||!o||!o.length)return null;var y=this.state.isAnimationFinished,S=Lt("recharts-bar",i),C=c&&c.allowDataOverflow,N=d&&d.allowDataOverflow,E=C||N,A=Mt(b)?this.id:b;return Y.createElement(en,{className:S},C||N?Y.createElement("defs",null,Y.createElement("clipPath",{id:"clipPath-".concat(A)},Y.createElement("rect",{x:C?f:f-p/2,y:N?h:h-x/2,width:C?p:p*2,height:N?x:x*2}))):null,Y.createElement(en,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(A,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,A),(!g||y)&&so.renderCallByParent(this.props,o))}}],[{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);K4=Al;Qo(Al,"displayName","Bar");Qo(Al,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Sl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Qo(Al,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,s=e.bandSize,o=e.xAxis,i=e.yAxis,c=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,h=e.dataStartIndex,p=e.displayedData,x=e.offset,g=Lae(r,n);if(!g)return null;var j=t.layout,b=n.type.defaultProps,y=b!==void 0?Hn(Hn({},b),n.props):n.props,S=y.dataKey,C=y.children,N=y.minPointSize,E=j==="horizontal"?i:o,A=f?E.scale.domain():null,k=Vae({numericAxis:E}),O=pa(C,Bv),T=p.map(function($,B){var q,F,H,U,R,W;f?q=Fae(f[h+B],A):(q=er($,S),Array.isArray(q)||(q=[k,q]));var X=aue(N,K4.defaultProps.minPointSize)(q[1],B);if(j==="horizontal"){var G,z=[i.scale(q[0]),i.scale(q[1])],J=z[0],D=z[1];F=I2({axis:o,ticks:c,bandSize:s,offset:g.offset,entry:$,index:B}),H=(G=D??J)!==null&&G!==void 0?G:void 0,U=g.size;var I=J-D;if(R=Number.isNaN(I)?0:I,W={x:F,y:i.y,width:U,height:i.height},Math.abs(X)>0&&Math.abs(R)<Math.abs(X)){var ne=_r(R||X)*(Math.abs(X)-Math.abs(R));H-=ne,R+=ne}}else{var te=[o.scale(q[0]),o.scale(q[1])],de=te[0],he=te[1];if(F=de,H=I2({axis:i,ticks:d,bandSize:s,offset:g.offset,entry:$,index:B}),U=he-de,R=g.size,W={x:o.x,y:H,width:o.width,height:R},Math.abs(X)>0&&Math.abs(U)<Math.abs(X)){var V=_r(U||X)*(Math.abs(X)-Math.abs(U));U+=V}}return Hn(Hn(Hn({},$),{},{x:F,y:H,width:U,height:R,value:f?q:q[1],payload:$,background:W},O&&O[B]&&O[B].props),{},{tooltipPayload:[j4(n,$)],tooltipPosition:{x:F+U/2,y:H+R/2}})});return Hn({data:T,layout:j},x)});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 mue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iM(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,X4(r.key),r)}}function vue(e,t,n){return t&&iM(e.prototype,t),n&&iM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lM(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?lM(Object(n),!0).forEach(function(r){og(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function og(e,t,n){return t=X4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X4(e){var t=gue(e,"string");return gf(t)=="symbol"?t:t+""}function gue(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)}var Q4=function(t,n,r,s,o){var i=t.width,c=t.height,d=t.layout,f=t.children,h=Object.keys(n),p={left:r.left,leftMirror:r.left,right:i-r.right,rightMirror:i-r.right,top:r.top,topMirror:r.top,bottom:c-r.bottom,bottomMirror:c-r.bottom},x=!!oa(f,Al);return h.reduce(function(g,j){var b=n[j],y=b.orientation,S=b.domain,C=b.padding,N=C===void 0?{}:C,E=b.mirror,A=b.reversed,k="".concat(y).concat(E?"Mirror":""),O,T,$,B,q;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var F=S[1]-S[0],H=1/0,U=b.categoricalDomain.sort(_X);if(U.forEach(function(te,de){de>0&&(H=Math.min((te||0)-(U[de-1]||0),H))}),Number.isFinite(H)){var R=H/F,W=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(O=R*W/2),b.padding==="no-gap"){var X=Ar(t.barCategoryGap,R*W),G=R*W/2;O=G-X-(G-X)/W*X}}}s==="xAxis"?T=[r.left+(N.left||0)+(O||0),r.left+r.width-(N.right||0)-(O||0)]:s==="yAxis"?T=d==="horizontal"?[r.top+r.height-(N.bottom||0),r.top+(N.top||0)]:[r.top+(N.top||0)+(O||0),r.top+r.height-(N.bottom||0)-(O||0)]:T=b.range,A&&(T=[T[1],T[0]]);var z=x4(b,o,x),J=z.scale,D=z.realScaleType;J.domain(S).range(T),y4(J);var I=b4(J,Ga(Ga({},b),{},{realScaleType:D}));s==="xAxis"?(q=y==="top"&&!E||y==="bottom"&&E,$=r.left,B=p[k]-q*b.height):s==="yAxis"&&(q=y==="left"&&!E||y==="right"&&E,$=p[k]-q*b.width,B=r.top);var ne=Ga(Ga(Ga({},b),I),{},{realScaleType:D,x:$,y:B,scale:J,width:s==="xAxis"?r.width:b.width,height:s==="yAxis"?r.height:b.height});return ne.bandSize=ym(ne,I),!b.hide&&s==="xAxis"?p[k]+=(q?-1:1)*ne.height:b.hide||(p[k]+=(q?-1:1)*ne.width),Ga(Ga({},g),{},og({},j,ne))},{})},J4=function(t,n){var r=t.x,s=t.y,o=n.x,i=n.y;return{x:Math.min(r,o),y:Math.min(s,i),width:Math.abs(o-r),height:Math.abs(i-s)}},xue=function(t){var n=t.x1,r=t.y1,s=t.x2,o=t.y2;return J4({x:n,y:r},{x:s,y:o})},Z4=(function(){function e(t){mue(this,e),this.scale=t}return vue(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,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+i}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],o=r[r.length-1];return s<=o?n>=s&&n<=o:n>=o&&n<=s}}],[{key:"create",value:function(n){return new e(n)}}])})();og(Z4,"EPS",1e-4);var kC=function(t){var n=Object.keys(t).reduce(function(r,s){return Ga(Ga({},r),{},og({},s,Z4.create(t[s])))},{});return Ga(Ga({},n),{},{apply:function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=o.bandAware,c=o.position;return Vce(s,function(d,f){return n[f].apply(d,{bandAware:i,position:c})})},isInRange:function(s){return Xce(s,function(o,i){return n[i].isInRange(o)})}})};function yue(e){return(e%180+180)%180}var bue=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=yue(s),i=o*Math.PI/180,c=Math.atan(r/n),d=i>c&&i<Math.PI-c?r/Math.sin(i):n/Math.cos(i);return Math.abs(d)},_j,cM;function wue(){if(cM)return _j;cM=1;var e=$s(),t=Lf(),n=Lv();function r(s){return function(o,i,c){var d=Object(o);if(!t(o)){var f=e(i,3);o=n(o),i=function(p){return f(d[p],p,d)}}var h=s(o,i,c);return h>-1?d[f?o[h]:h]:void 0}}return _j=r,_j}var Aj,uM;function jue(){if(uM)return Aj;uM=1;var e=U4();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return Aj=t,Aj}var Ej,dM;function Sue(){if(dM)return Ej;dM=1;var e=tL(),t=$s(),n=jue(),r=Math.max;function s(o,i,c){var d=o==null?0:o.length;if(!d)return-1;var f=c==null?0:n(c);return f<0&&(f=r(d+f,0)),e(o,t(i,3),f)}return Ej=s,Ej}var kj,fM;function Nue(){if(fM)return kj;fM=1;var e=wue(),t=Sue(),n=e(t);return kj=n,kj}Nue();var Cue=g3();const _ue=un(Cue);var Aue=_ue(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("")}),eF=m.createContext(void 0),tF=m.createContext(void 0),nF=m.createContext(void 0),Eue=m.createContext({}),rF=m.createContext(void 0),aF=m.createContext(0),sF=m.createContext(0),pM=function(t){var n=t.state,r=n.xAxisMap,s=n.yAxisMap,o=n.offset,i=t.clipPathId,c=t.children,d=t.width,f=t.height,h=Aue(o);return Y.createElement(eF.Provider,{value:r},Y.createElement(tF.Provider,{value:s},Y.createElement(Eue.Provider,{value:o},Y.createElement(nF.Provider,{value:h},Y.createElement(rF.Provider,{value:i},Y.createElement(aF.Provider,{value:f},Y.createElement(sF.Provider,{value:d},c)))))))},kue=function(){return m.useContext(rF)},oF=function(t){var n=m.useContext(eF);n==null&&il();var r=n[t];return r==null&&il(),r},iF=function(t){var n=m.useContext(tF);n==null&&il();var r=n[t];return r==null&&il(),r},Pue=function(){var t=m.useContext(nF);return t},lF=function(){return m.useContext(sF)},cF=function(){return m.useContext(aF)};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 Oue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tue(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 Rue(e,t,n){return t&&Tue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Iue(e,t,n){return t=Lm(t),Mue(e,uF()?Reflect.construct(t,n||[],Lm(e).constructor):t.apply(e,n))}function Mue(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 $ue(e)}function $ue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uF=function(){return!!e})()}function Lm(e){return Lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lm(e)}function Due(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 hM(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 mM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hM(Object(n),!0).forEach(function(r){PC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PC(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=Lue(e,"string");return Gc(t)=="symbol"?t:t+""}function Lue(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)}function Fue(e,t){return Uue(e)||que(e,t)||Bue(e,t)||zue()}function zue(){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 Bue(e,t){if(e){if(typeof e=="string")return vM(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 vM(e,t)}}function vM(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 que(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function Uue(e){if(Array.isArray(e))return e}function j1(){return j1=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},j1.apply(this,arguments)}var Wue=function(t,n){var r;return Y.isValidElement(t)?r=Y.cloneElement(t,n):It(t)?r=t(n):r=Y.createElement("line",j1({},n,{className:"recharts-reference-line-line"})),r},Vue=function(t,n,r,s,o,i,c,d,f){var h=o.x,p=o.y,x=o.width,g=o.height;if(r){var j=f.y,b=t.y.apply(j,{position:i});if(Ns(f,"discard")&&!t.y.isInRange(b))return null;var y=[{x:h+x,y:b},{x:h,y:b}];return d==="left"?y.reverse():y}if(n){var S=f.x,C=t.x.apply(S,{position:i});if(Ns(f,"discard")&&!t.x.isInRange(C))return null;var N=[{x:C,y:p+g},{x:C,y:p}];return c==="top"?N.reverse():N}if(s){var E=f.segment,A=E.map(function(k){return t.apply(k,{position:i})});return Ns(f,"discard")&&Bce(A,function(k){return!t.isInRange(k)})?null:A}return null};function Hue(e){var t=e.x,n=e.y,r=e.segment,s=e.xAxisId,o=e.yAxisId,i=e.shape,c=e.className,d=e.alwaysShow,f=kue(),h=oF(s),p=iF(o),x=Pue();if(!f||!x)return null;ro(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=kC({x:h.scale,y:p.scale}),j=tr(t),b=tr(n),y=r&&r.length===2,S=Vue(g,j,b,y,x,e.position,h.orientation,p.orientation,e);if(!S)return null;var C=Fue(S,2),N=C[0],E=N.x,A=N.y,k=C[1],O=k.x,T=k.y,$=Ns(e,"hidden")?"url(#".concat(f,")"):void 0,B=mM(mM({clipPath:$},St(e,!0)),{},{x1:E,y1:A,x2:O,y2:T});return Y.createElement(en,{className:Lt("recharts-reference-line",c)},Wue(i,B),cr.renderCallByParent(e,xue({x1:E,y1:A,x2:O,y2:T})))}var OC=(function(e){function t(){return Oue(this,t),Iue(this,t,arguments)}return Due(t,e),Rue(t,[{key:"render",value:function(){return Y.createElement(Hue,this.props)}}])})(Y.Component);PC(OC,"displayName","ReferenceLine");PC(OC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function S1(){return S1=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},S1.apply(this,arguments)}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 gM(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 xM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gM(Object(n),!0).forEach(function(r){ig(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return 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,pF(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=Fm(t),Que(e,fF()?Reflect.construct(t,n||[],Fm(e).constructor):t.apply(e,n))}function Que(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 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 fF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fF=function(){return!!e})()}function Fm(e){return Fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Fm(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&&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 ig(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=ede(e,"string");return Yc(t)=="symbol"?t:t+""}function ede(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 tde=function(t){var n=t.x,r=t.y,s=t.xAxis,o=t.yAxis,i=kC({x:s.scale,y:o.scale}),c=i.apply({x:n,y:r},{bandAware:!0});return Ns(t,"discard")&&!i.isInRange(c)?null:c},lg=(function(e){function t(){return Kue(this,t),Xue(this,t,arguments)}return Zue(t,e),Yue(t,[{key:"render",value:function(){var r=this.props,s=r.x,o=r.y,i=r.r,c=r.alwaysShow,d=r.clipPathId,f=tr(s),h=tr(o);if(ro(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=tde(this.props);if(!p)return null;var x=p.x,g=p.y,j=this.props,b=j.shape,y=j.className,S=Ns(this.props,"hidden")?"url(#".concat(d,")"):void 0,C=xM(xM({clipPath:S},St(this.props,!0)),{},{cx:x,cy:g});return Y.createElement(en,{className:Lt("recharts-reference-dot",y)},t.renderDot(b,C),cr.renderCallByParent(this.props,{x:x-i,y:g-i,width:2*i,height:2*i}))}}])})(Y.Component);ig(lg,"displayName","ReferenceDot");ig(lg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});ig(lg,"renderDot",function(e,t){var n;return Y.isValidElement(e)?n=Y.cloneElement(e,t):It(e)?n=e(t):n=Y.createElement(Zv,S1({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});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 Xc(e){"@babel/helpers - typeof";return Xc=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},Xc(e)}function yM(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 bM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yM(Object(n),!0).forEach(function(r){cg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rde(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,mF(r.key),r)}}function ade(e,t,n){return t&&rde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function sde(e,t,n){return t=zm(t),ode(e,hF()?Reflect.construct(t,n||[],zm(e).constructor):t.apply(e,n))}function ode(e,t){if(t&&(Xc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ide(e)}function ide(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hF=function(){return!!e})()}function zm(e){return zm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zm(e)}function lde(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 cg(e,t,n){return t=mF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mF(e){var t=cde(e,"string");return Xc(t)=="symbol"?t:t+""}function cde(e,t){if(Xc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ude=function(t,n,r,s,o){var i=o.x1,c=o.x2,d=o.y1,f=o.y2,h=o.xAxis,p=o.yAxis;if(!h||!p)return null;var x=kC({x:h.scale,y:p.scale}),g={x:t?x.x.apply(i,{position:"start"}):x.x.rangeMin,y:r?x.y.apply(d,{position:"start"}):x.y.rangeMin},j={x:n?x.x.apply(c,{position:"end"}):x.x.rangeMax,y:s?x.y.apply(f,{position:"end"}):x.y.rangeMax};return Ns(o,"discard")&&(!x.isInRange(g)||!x.isInRange(j))?null:J4(g,j)},ug=(function(e){function t(){return nde(this,t),sde(this,t,arguments)}return lde(t,e),ade(t,[{key:"render",value:function(){var r=this.props,s=r.x1,o=r.x2,i=r.y1,c=r.y2,d=r.className,f=r.alwaysShow,h=r.clipPathId;ro(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=tr(s),x=tr(o),g=tr(i),j=tr(c),b=this.props.shape;if(!p&&!x&&!g&&!j&&!b)return null;var y=ude(p,x,g,j,this.props);if(!y&&!b)return null;var S=Ns(this.props,"hidden")?"url(#".concat(h,")"):void 0;return Y.createElement(en,{className:Lt("recharts-reference-area",d)},t.renderRect(b,bM(bM({clipPath:S},St(this.props,!0)),y)),cr.renderCallByParent(this.props,y))}}])})(Y.Component);cg(ug,"displayName","ReferenceArea");cg(ug,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});cg(ug,"renderRect",function(e,t){var n;return Y.isValidElement(e)?n=Y.cloneElement(e,t):It(e)?n=e(t):n=Y.createElement(EC,C1({},t,{className:"recharts-reference-area-rect"})),n});function vF(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 dde(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return bue(r,n)}function fde(e,t,n){var r=n==="width",s=e.x,o=e.y,i=e.width,c=e.height;return t===1?{start:r?s:o,end:r?s+i:o+c}:{start:r?s+i:o+c,end:r?s:o}}function Bm(e,t,n,r,s){if(e*t<e*r||e*t>e*s)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-s)<=0}function pde(e,t){return vF(e,t+1)}function hde(e,t,n,r,s){for(var o=(r||[]).slice(),i=t.start,c=t.end,d=0,f=1,h=i,p=function(){var j=r?.[d];if(j===void 0)return{v:vF(r,f)};var b=d,y,S=function(){return y===void 0&&(y=n(j,b)),y},C=j.coordinate,N=d===0||Bm(e,C,S,h,c);N||(d=0,h=i,f+=1),N&&(h=C+e*(S()/2+s),d+=f)},x;f<=o.length;)if(x=p(),x)return x.v;return[]}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 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 br(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){mde(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 mde(e,t,n){return t=vde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vde(e){var t=gde(e,"string");return xf(t)=="symbol"?t:t+""}function gde(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)}function xde(e,t,n,r,s){for(var o=(r||[]).slice(),i=o.length,c=t.start,d=t.end,f=function(x){var g=o[x],j,b=function(){return j===void 0&&(j=n(g,x)),j};if(x===i-1){var y=e*(g.coordinate+e*b()/2-d);o[x]=g=br(br({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else o[x]=g=br(br({},g),{},{tickCoord:g.coordinate});var S=Bm(e,g.tickCoord,b,c,d);S&&(d=g.tickCoord-e*(b()/2+s),o[x]=br(br({},g),{},{isShow:!0}))},h=i-1;h>=0;h--)f(h);return o}function yde(e,t,n,r,s,o){var i=(r||[]).slice(),c=i.length,d=t.start,f=t.end;if(o){var h=r[c-1],p=n(h,c-1),x=e*(h.coordinate+e*p/2-f);i[c-1]=h=br(br({},h),{},{tickCoord:x>0?h.coordinate-x*e:h.coordinate});var g=Bm(e,h.tickCoord,function(){return p},d,f);g&&(f=h.tickCoord-e*(p/2+s),i[c-1]=br(br({},h),{},{isShow:!0}))}for(var j=o?c-1:c,b=function(C){var N=i[C],E,A=function(){return E===void 0&&(E=n(N,C)),E};if(C===0){var k=e*(N.coordinate-e*A()/2-d);i[C]=N=br(br({},N),{},{tickCoord:k<0?N.coordinate-k*e:N.coordinate})}else i[C]=N=br(br({},N),{},{tickCoord:N.coordinate});var O=Bm(e,N.tickCoord,A,d,f);O&&(d=N.tickCoord+e*(A()/2+s),i[C]=br(br({},N),{},{isShow:!0}))},y=0;y<j;y++)b(y);return i}function bde(e,t,n){var r=e.tick,s=e.ticks,o=e.viewBox,i=e.minTickGap,c=e.orientation,d=e.interval,f=e.tickFormatter,h=e.unit,p=e.angle;if(!s||!s.length||!r)return[];if(Ge(d)||Sl.isSsr)return pde(s,typeof d=="number"&&Ge(d)?d:0);var x=[],g=c==="top"||c==="bottom"?"width":"height",j=h&&g==="width"?_d(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(N,E){var A=It(f)?f(N.value,E):N.value;return g==="width"?dde(_d(A,{fontSize:t,letterSpacing:n}),j,p):_d(A,{fontSize:t,letterSpacing:n})[g]},y=s.length>=2?_r(s[1].coordinate-s[0].coordinate):1,S=fde(o,y,g);return d==="equidistantPreserveStart"?hde(y,S,b,s,i):(d==="preserveStart"||d==="preserveStartEnd"?x=yde(y,S,b,s,i,d==="preserveStartEnd"):x=xde(y,S,b,s,i),x.filter(function(C){return C.isShow}))}var wde=["viewBox"],jde=["viewBox"],Sde=["ticks"];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 mc(){return mc=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},mc.apply(this,arguments)}function jM(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 Jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jM(Object(n),!0).forEach(function(r){TC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pj(e,t){if(e==null)return{};var n=Nde(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Nde(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 Cde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SM(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,xF(r.key),r)}}function _de(e,t,n){return t&&SM(e.prototype,t),n&&SM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ade(e,t,n){return t=qm(t),Ede(e,gF()?Reflect.construct(t,n||[],qm(e).constructor):t.apply(e,n))}function Ede(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 kde(e)}function kde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gF=function(){return!!e})()}function qm(e){return qm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qm(e)}function Pde(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 TC(e,t,n){return t=xF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xF(e){var t=Ode(e,"string");return Qc(t)=="symbol"?t:t+""}function Ode(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 dg=(function(e){function t(n){var r;return Cde(this,t),r=Ade(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Pde(t,e),_de(t,[{key:"shouldComponentUpdate",value:function(r,s){var o=r.viewBox,i=Pj(r,wde),c=this.props,d=c.viewBox,f=Pj(c,jde);return!jc(o,d)||!jc(i,f)||!jc(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,o=s.x,i=s.y,c=s.width,d=s.height,f=s.orientation,h=s.tickSize,p=s.mirror,x=s.tickMargin,g,j,b,y,S,C,N=p?-1:1,E=r.tickSize||h,A=Ge(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":g=j=r.coordinate,y=i+ +!p*d,b=y-N*E,C=b-N*x,S=A;break;case"left":b=y=r.coordinate,j=o+ +!p*c,g=j-N*E,S=g-N*x,C=A;break;case"right":b=y=r.coordinate,j=o+ +p*c,g=j+N*E,S=g+N*x,C=A;break;default:g=j=r.coordinate,y=i+ +p*d,b=y+N*E,C=b+N*x,S=A;break}return{line:{x1:g,y1:b,x2:j,y2:y},tick:{x:S,y:C}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,s=r.orientation,o=r.mirror,i;switch(s){case"left":i=o?"start":"end";break;case"right":i=o?"end":"start";break;default:i="middle";break}return i}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,s=r.orientation,o=r.mirror,i="end";switch(s){case"left":case"right":i="middle";break;case"top":i=o?"start":"end";break;default:i=o?"end":"start";break}return i}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.x,o=r.y,i=r.width,c=r.height,d=r.orientation,f=r.mirror,h=r.axisLine,p=Jn(Jn(Jn({},St(this.props,!1)),St(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var x=+(d==="top"&&!f||d==="bottom"&&f);p=Jn(Jn({},p),{},{x1:s,y1:o+x*c,x2:s+i,y2:o+x*c})}else{var g=+(d==="left"&&!f||d==="right"&&f);p=Jn(Jn({},p),{},{x1:s+g*i,y1:o,x2:s+g*i,y2:o+c})}return Y.createElement("line",mc({},p,{className:Lt("recharts-cartesian-axis-line",fa(h,"className"))}))}},{key:"renderTicks",value:function(r,s,o){var i=this,c=this.props,d=c.tickLine,f=c.stroke,h=c.tick,p=c.tickFormatter,x=c.unit,g=bde(Jn(Jn({},this.props),{},{ticks:r}),s,o),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),y=St(this.props,!1),S=St(h,!1),C=Jn(Jn({},y),{},{fill:"none"},St(d,!1)),N=g.map(function(E,A){var k=i.getTickLineCoord(E),O=k.line,T=k.tick,$=Jn(Jn(Jn(Jn({textAnchor:j,verticalAnchor:b},y),{},{stroke:"none",fill:f},S),T),{},{index:A,payload:E,visibleTicksCount:g.length,tickFormatter:p});return Y.createElement(en,mc({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},al(i.props,E,A)),d&&Y.createElement("line",mc({},C,O,{className:Lt("recharts-cartesian-axis-tick-line",fa(d,"className"))})),h&&t.renderTickItem(h,$,"".concat(It(p)?p(E.value,A):E.value).concat(x||"")))});return Y.createElement("g",{className:"recharts-cartesian-axis-ticks"},N)}},{key:"render",value:function(){var r=this,s=this.props,o=s.axisLine,i=s.width,c=s.height,d=s.ticksGenerator,f=s.className,h=s.hide;if(h)return null;var p=this.props,x=p.ticks,g=Pj(p,Sde),j=x;return It(d)&&(j=x&&x.length>0?d(this.props):d(g)),i<=0||c<=0||!j||!j.length?null:Y.createElement(en,{className:Lt("recharts-cartesian-axis",f),ref:function(y){r.layerReference=y}},o&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),cr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,o){var i,c=Lt(s.className,"recharts-cartesian-axis-tick-value");return Y.isValidElement(r)?i=Y.cloneElement(r,Jn(Jn({},s),{},{className:c})):It(r)?i=r(Jn(Jn({},s),{},{className:c})):i=Y.createElement(sl,mc({},s,{className:"recharts-cartesian-axis-tick-value"}),o),i}}])})(m.Component);TC(dg,"displayName","CartesianAxis");TC(dg,"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 Tde=["type","layout","connectNulls","ref"],Rde=["key"];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 NM(e,t){if(e==null)return{};var n=Ide(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ide(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 Td(){return Td=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},Td.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 ra(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){Ya(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 ac(e){return Lde(e)||Dde(e)||$de(e)||Mde()}function Mde(){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 $de(e,t){if(e){if(typeof e=="string")return E1(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 E1(e,t)}}function Dde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Lde(e){if(Array.isArray(e))return E1(e)}function E1(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 Fde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _M(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 zde(e,t,n){return t&&_M(e.prototype,t),n&&_M(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bde(e,t,n){return t=Um(t),qde(e,yF()?Reflect.construct(t,n||[],Um(e).constructor):t.apply(e,n))}function qde(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 Ude(e)}function Ude(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yF=function(){return!!e})()}function Um(e){return Um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Um(e)}function Wde(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&&k1(e,t)}function k1(e,t){return k1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},k1(e,t)}function Ya(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=Vde(e,"string");return Jc(t)=="symbol"?t:t+""}function Vde(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)}var ll=(function(e){function t(){var n;Fde(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=Bde(this,t,[].concat(s)),Ya(n,"state",{isAnimationFinished:!0,totalLength:0}),Ya(n,"generateSimpleStrokeDasharray",function(i,c){return"".concat(c,"px ").concat(i-c,"px")}),Ya(n,"getStrokeDasharray",function(i,c,d){var f=d.reduce(function(S,C){return S+C});if(!f)return n.generateSimpleStrokeDasharray(c,i);for(var h=Math.floor(i/f),p=i%f,x=c-i,g=[],j=0,b=0;j<d.length;b+=d[j],++j)if(b+d[j]>p){g=[].concat(ac(d.slice(0,j)),[p-b]);break}var y=g.length%2===0?[0,x]:[x];return[].concat(ac(t.repeat(d,h)),ac(g),y).map(function(S){return"".concat(S,"px")}).join(", ")}),Ya(n,"id",gu("recharts-line-")),Ya(n,"pathRef",function(i){n.mainCurve=i}),Ya(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Ya(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Wde(t,e),zde(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 o=this.props,i=o.points,c=o.xAxis,d=o.yAxis,f=o.layout,h=o.children,p=pa(h,Wf);if(!p)return null;var x=function(b,y){return{x:b.x,y:b.y,value:b.value,errorVal:er(b.payload,y)}},g={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Y.createElement(en,g,p.map(function(j){return Y.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:i,xAxis:c,yAxis:d,layout:f,dataPointFormatter:x})}))}},{key:"renderDots",value:function(r,s,o){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var c=this.props,d=c.dot,f=c.points,h=c.dataKey,p=St(this.props,!1),x=St(d,!0),g=f.map(function(b,y){var S=ra(ra(ra({key:"dot-".concat(y),r:3},p),x),{},{index:y,cx:b.x,cy:b.y,value:b.value,dataKey:h,payload:b.payload,points:f});return t.renderDotItem(d,S)}),j={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(o,")"):null};return Y.createElement(en,Td({className:"recharts-line-dots",key:"dots"},j),g)}},{key:"renderCurveStatically",value:function(r,s,o,i){var c=this.props,d=c.type,f=c.layout,h=c.connectNulls;c.ref;var p=NM(c,Tde),x=ra(ra(ra({},St(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(o,")"):null,points:r},i),{},{type:d,layout:f,connectNulls:h});return Y.createElement(jm,Td({},x,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,s){var o=this,i=this.props,c=i.points,d=i.strokeDasharray,f=i.isAnimationActive,h=i.animationBegin,p=i.animationDuration,x=i.animationEasing,g=i.animationId,j=i.animateNewValues,b=i.width,y=i.height,S=this.state,C=S.prevPoints,N=S.totalLength;return Y.createElement(Ps,{begin:h,duration:p,isActive:f,easing:x,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var A=E.t;if(C){var k=C.length/c.length,O=c.map(function(F,H){var U=Math.floor(H*k);if(C[U]){var R=C[U],W=la(R.x,F.x),X=la(R.y,F.y);return ra(ra({},F),{},{x:W(A),y:X(A)})}if(j){var G=la(b*2,F.x),z=la(y/2,F.y);return ra(ra({},F),{},{x:G(A),y:z(A)})}return ra(ra({},F),{},{x:F.x,y:F.y})});return o.renderCurveStatically(O,r,s)}var T=la(0,N),$=T(A),B;if(d){var q="".concat(d).split(/[,\s]+/gim).map(function(F){return parseFloat(F)});B=o.getStrokeDasharray($,N,q)}else B=o.generateSimpleStrokeDasharray(N,$);return o.renderCurveStatically(c,r,s,{strokeDasharray:B})})}},{key:"renderCurve",value:function(r,s){var o=this.props,i=o.points,c=o.isAnimationActive,d=this.state,f=d.prevPoints,h=d.totalLength;return c&&i&&i.length&&(!f&&h>0||!Uf(f,i))?this.renderCurveWithAnimation(r,s):this.renderCurveStatically(i,r,s)}},{key:"render",value:function(){var r,s=this.props,o=s.hide,i=s.dot,c=s.points,d=s.className,f=s.xAxis,h=s.yAxis,p=s.top,x=s.left,g=s.width,j=s.height,b=s.isAnimationActive,y=s.id;if(o||!c||!c.length)return null;var S=this.state.isAnimationFinished,C=c.length===1,N=Lt("recharts-line",d),E=f&&f.allowDataOverflow,A=h&&h.allowDataOverflow,k=E||A,O=Mt(y)?this.id:y,T=(r=St(i,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},$=T.r,B=$===void 0?3:$,q=T.strokeWidth,F=q===void 0?2:q,H=MX(i)?i:{},U=H.clipDot,R=U===void 0?!0:U,W=B*2+F;return Y.createElement(en,{className:N},E||A?Y.createElement("defs",null,Y.createElement("clipPath",{id:"clipPath-".concat(O)},Y.createElement("rect",{x:E?x:x-g/2,y:A?p:p-j/2,width:E?g:g*2,height:A?j:j*2})),!R&&Y.createElement("clipPath",{id:"clipPath-dots-".concat(O)},Y.createElement("rect",{x:x-W/2,y:p-W/2,width:g+W,height:j+W}))):null,!C&&this.renderCurve(k,O),this.renderErrorBar(k,O),(C||i)&&this.renderDots(k,R,O),(!b||S)&&so.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 o=r.length%2!==0?[].concat(ac(r),[0]):r,i=[],c=0;c<s;++c)i=[].concat(ac(i),ac(o));return i}},{key:"renderDotItem",value:function(r,s){var o;if(Y.isValidElement(r))o=Y.cloneElement(r,s);else if(It(r))o=r(s);else{var i=s.key,c=NM(s,Rde),d=Lt("recharts-line-dot",typeof r!="boolean"?r.className:"");o=Y.createElement(Zv,Td({key:i},c,{className:d}))}return o}}])})(m.PureComponent);Ya(ll,"displayName","Line");Ya(ll,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Sl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Ya(ll,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,s=e.xAxisTicks,o=e.yAxisTicks,i=e.dataKey,c=e.bandSize,d=e.displayedData,f=e.offset,h=t.layout,p=d.map(function(x,g){var j=er(x,i);return h==="horizontal"?{x:R2({axis:n,ticks:s,bandSize:c,entry:x,index:g}),y:Mt(j)?null:r.scale(j),value:j,payload:x}:{x:Mt(j)?null:n.scale(j),y:R2({axis:r,ticks:o,bandSize:c,entry:x,index:g}),value:j,payload:x}});return ra({points:p,layout:h},f)});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 Hde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kde(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 Gde(e,t,n){return t&&Kde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yde(e,t,n){return t=Wm(t),Xde(e,wF()?Reflect.construct(t,n||[],Wm(e).constructor):t.apply(e,n))}function Xde(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 Qde(e)}function Qde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wF=function(){return!!e})()}function Wm(e){return Wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wm(e)}function Jde(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 jF(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=Zde(e,"string");return Zc(t)=="symbol"?t:t+""}function Zde(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 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 efe(e){var t=e.xAxisId,n=lF(),r=cF(),s=oF(t);return s==null?null:m.createElement(dg,O1({},s,{className:Lt("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(i){return Hi(i,!0)}}))}var ii=(function(e){function t(){return Hde(this,t),Yde(this,t,arguments)}return Jde(t,e),Gde(t,[{key:"render",value:function(){return m.createElement(efe,this.props)}}])})(m.Component);jF(ii,"displayName","XAxis");jF(ii,"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 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 tfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nfe(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 rfe(e,t,n){return t&&nfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function afe(e,t,n){return t=Vm(t),sfe(e,NF()?Reflect.construct(t,n||[],Vm(e).constructor):t.apply(e,n))}function sfe(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 ofe(e)}function ofe(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 Vm(e){return Vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vm(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&&T1(e,t)}function T1(e,t){return T1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},T1(e,t)}function CF(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=lfe(e,"string");return eu(t)=="symbol"?t:t+""}function lfe(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)}function R1(){return R1=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},R1.apply(this,arguments)}var cfe=function(t){var n=t.yAxisId,r=lF(),s=cF(),o=iF(n);return o==null?null:m.createElement(dg,R1({},o,{className:Lt("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:s},ticksGenerator:function(c){return Hi(c,!0)}}))},li=(function(e){function t(){return tfe(this,t),afe(this,t,arguments)}return ife(t,e),rfe(t,[{key:"render",value:function(){return m.createElement(cfe,this.props)}}])})(m.Component);CF(li,"displayName","YAxis");CF(li,"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 AM(e){return pfe(e)||ffe(e)||dfe(e)||ufe()}function ufe(){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 dfe(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 ffe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pfe(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}var M1=function(t,n,r,s,o){var i=pa(t,OC),c=pa(t,lg),d=[].concat(AM(i),AM(c)),f=pa(t,ug),h="".concat(s,"Id"),p=s[0],x=n;if(d.length&&(x=d.reduce(function(b,y){if(y.props[h]===r&&Ns(y.props,"extendDomain")&&Ge(y.props[p])){var S=y.props[p];return[Math.min(b[0],S),Math.max(b[1],S)]}return b},x)),f.length){var g="".concat(p,"1"),j="".concat(p,"2");x=f.reduce(function(b,y){if(y.props[h]===r&&Ns(y.props,"extendDomain")&&Ge(y.props[g])&&Ge(y.props[j])){var S=y.props[g],C=y.props[j];return[Math.min(b[0],S,C),Math.max(b[1],S,C)]}return b},x)}return o&&o.length&&(x=o.reduce(function(b,y){return Ge(y)?[Math.min(b[0],y),Math.max(b[1],y)]:b},x)),x},Oj={exports:{}},EM;function hfe(){return EM||(EM=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 o(d,f,h,p,x){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new s(h,p||d,x),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],g]:d._events[j].push(g):(d._events[j]=g,d._eventsCount++),d}function i(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 x=0,g=p.length,j=new Array(g);x<g;x++)j[x]=p[x].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,x,g,j){var b=n?n+f:f;if(!this._events[b])return!1;var y=this._events[b],S=arguments.length,C,N;if(y.fn){switch(y.once&&this.removeListener(f,y.fn,void 0,!0),S){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,h),!0;case 3:return y.fn.call(y.context,h,p),!0;case 4:return y.fn.call(y.context,h,p,x),!0;case 5:return y.fn.call(y.context,h,p,x,g),!0;case 6:return y.fn.call(y.context,h,p,x,g,j),!0}for(N=1,C=new Array(S-1);N<S;N++)C[N-1]=arguments[N];y.fn.apply(y.context,C)}else{var E=y.length,A;for(N=0;N<E;N++)switch(y[N].once&&this.removeListener(f,y[N].fn,void 0,!0),S){case 1:y[N].fn.call(y[N].context);break;case 2:y[N].fn.call(y[N].context,h);break;case 3:y[N].fn.call(y[N].context,h,p);break;case 4:y[N].fn.call(y[N].context,h,p,x);break;default:if(!C)for(A=1,C=new Array(S-1);A<S;A++)C[A-1]=arguments[A];y[N].fn.apply(y[N].context,C)}}return!0},c.prototype.on=function(f,h,p){return o(this,f,h,p,!1)},c.prototype.once=function(f,h,p){return o(this,f,h,p,!0)},c.prototype.removeListener=function(f,h,p,x){var g=n?n+f:f;if(!this._events[g])return this;if(!h)return i(this,g),this;var j=this._events[g];if(j.fn)j.fn===h&&(!x||j.once)&&(!p||j.context===p)&&i(this,g);else{for(var b=0,y=[],S=j.length;b<S;b++)(j[b].fn!==h||x&&!j[b].once||p&&j[b].context!==p)&&y.push(j[b]);y.length?this._events[g]=y.length===1?y[0]:y:i(this,g)}return this},c.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&i(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})(Oj)),Oj.exports}var mfe=hfe();const vfe=un(mfe);var Tj=new vfe,Rj="recharts.syncMouseEvents";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 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,AF(r.key),r)}}function yfe(e,t,n){return t&&xfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ij(e,t,n){return t=AF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AF(e){var t=bfe(e,"string");return yf(t)=="symbol"?t:t+""}function bfe(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 String(e)}var wfe=(function(){function e(){gfe(this,e),Ij(this,"activeIndex",0),Ij(this,"coordinateList",[]),Ij(this,"layout","horizontal")}return yfe(e,[{key:"setDetails",value:function(n){var r,s=n.coordinateList,o=s===void 0?null:s,i=n.container,c=i===void 0?null:i,d=n.layout,f=d===void 0?null:d,h=n.offset,p=h===void 0?null:h,x=n.mouseHandlerCallback,g=x===void 0?null:x;this.coordinateList=(r=o??this.coordinateList)!==null&&r!==void 0?r:[],this.container=c??this.container,this.layout=f??this.layout,this.offset=p??this.offset,this.mouseHandlerCallback=g??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(),o=s.x,i=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=o+d+f,x=i+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:x})}}}])})();function jfe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],s=e?.[1];if(r&&s&&Ge(r)&&Ge(s))return!0}return!1}function Sfe(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 EF(e){var t=e.cx,n=e.cy,r=e.radius,s=e.startAngle,o=e.endAngle,i=Sn(t,n,r,s),c=Sn(t,n,r,o);return{points:[i,c],cx:t,cy:n,radius:r,startAngle:s,endAngle:o}}function Nfe(e,t,n){var r,s,o,i;if(e==="horizontal")r=t.x,o=r,s=n.top,i=n.top+n.height;else if(e==="vertical")s=t.y,i=s,r=n.left,o=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,x=Sn(c,d,f,p),g=Sn(c,d,h,p);r=x.x,s=x.y,o=g.x,i=g.y}else return EF(t);return[{x:r,y:s},{x:o,y:i}]}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 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 Sh(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){Cfe(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 Cfe(e,t,n){return t=_fe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _fe(e){var t=Afe(e,"string");return bf(t)=="symbol"?t:t+""}function Afe(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(t==="string"?String:Number)(e)}function Efe(e){var t,n,r=e.element,s=e.tooltipEventType,o=e.isActive,i=e.activeCoordinate,c=e.activePayload,d=e.offset,f=e.activeTooltipIndex,h=e.tooltipAxisBandSize,p=e.layout,x=e.chartName,g=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!g||!o||!i||x!=="ScatterChart"&&s!=="axis")return null;var j,b=jm;if(x==="ScatterChart")j=i,b=dle;else if(x==="BarChart")j=Sfe(p,i,d,h),b=EC;else if(p==="radial"){var y=EF(i),S=y.cx,C=y.cy,N=y.radius,E=y.startAngle,A=y.endAngle;j={cx:S,cy:C,startAngle:E,endAngle:A,innerRadius:N,outerRadius:N},b=E4}else j={points:Nfe(p,i,d)},b=jm;var k=Sh(Sh(Sh(Sh({stroke:"#ccc",pointerEvents:"none"},d),j),St(g,!1)),{},{payload:c,payloadIndex:f,className:Lt("recharts-tooltip-cursor",g.className)});return m.isValidElement(g)?m.cloneElement(g,k):m.createElement(b,k)}var kfe=["item"],Pfe=["children","className","width","height","style","compact","title","desc"];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 vc(){return vc=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},vc.apply(this,arguments)}function PM(e,t){return Rfe(e)||Tfe(e,t)||PF(e,t)||Ofe()}function Ofe(){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 Tfe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw s}}return c}}function Rfe(e){if(Array.isArray(e))return e}function OM(e,t){if(e==null)return{};var n=Ife(e,t),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)r=o[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ife(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 Mfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $fe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,OF(r.key),r)}}function Dfe(e,t,n){return t&&$fe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lfe(e,t,n){return t=Hm(t),Ffe(e,kF()?Reflect.construct(t,n||[],Hm(e).constructor):t.apply(e,n))}function Ffe(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 zfe(e)}function zfe(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 Hm(e){return Hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hm(e)}function Bfe(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 nu(e){return Wfe(e)||Ufe(e)||PF(e)||qfe()}function qfe(){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 PF(e,t){if(e){if(typeof e=="string")return D1(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 D1(e,t)}}function Ufe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wfe(e){if(Array.isArray(e))return D1(e)}function D1(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 TM(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 we(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TM(Object(n),!0).forEach(function(r){Ct(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ct(e,t,n){return t=OF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OF(e){var t=Vfe(e,"string");return tu(t)=="symbol"?t:t+""}function Vfe(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(t==="string"?String:Number)(e)}var Hfe={xAxis:["bottom","top"],yAxis:["left","right"]},Kfe={width:"100%",height:"100%"},TF={x:0,y:0};function Nh(e){return e}var Gfe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Yfe=function(t,n,r,s){var o=n.find(function(h){return h&&h.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:s.y};if(t==="vertical")return{x:s.x,y:o.coordinate};if(t==="centric"){var i=o.coordinate,c=s.radius;return we(we(we({},s),Sn(s.cx,s.cy,c,i)),{},{angle:i,radius:c})}var d=o.coordinate,f=s.angle;return we(we(we({},s),Sn(s.cx,s.cy,d,f)),{},{angle:f,radius:d})}return TF},fg=function(t,n){var r=n.graphicalItems,s=n.dataStartIndex,o=n.dataEndIndex,i=(r??[]).reduce(function(c,d){var f=d.props.data;return f&&f.length?[].concat(nu(c),nu(f)):c},[]);return i.length>0?i:t&&t.length&&Ge(s)&&Ge(o)?t.slice(s,o+1):[]};function RF(e){return e==="number"?[0,"auto"]:void 0}var L1=function(t,n,r,s){var o=t.graphicalItems,i=t.tooltipAxis,c=fg(n,t);return r<0||!o||!o.length||r>=c.length?null:o.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 x;if(i.dataKey&&!i.allowDuplicatedCategory){var g=p===void 0?c:p;x=Hh(g,i.dataKey,s)}else x=p&&p[r]||c[r];return x?[].concat(nu(d),[j4(f,x)]):d},[])},RM=function(t,n,r,s){var o=s||{x:t.chartX,y:t.chartY},i=Gfe(o,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=Tae(i,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,x=L1(t,n,h,p),g=Yfe(r,c,h,o);return{activeTooltipIndex:h,activeLabel:p,activePayload:x,activeCoordinate:g}}return null},Xfe=function(t,n){var r=n.axes,s=n.graphicalItems,o=n.axisType,i=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,x=t.stackOffset,g=g4(h,o);return r.reduce(function(j,b){var y,S=b.type.defaultProps!==void 0?we(we({},b.type.defaultProps),b.props):b.props,C=S.type,N=S.dataKey,E=S.allowDataOverflow,A=S.allowDuplicatedCategory,k=S.scale,O=S.ticks,T=S.includeHidden,$=S[i];if(j[$])return j;var B=fg(t.data,{graphicalItems:s.filter(function(I){var ne,te=i in I.props?I.props[i]:(ne=I.type.defaultProps)===null||ne===void 0?void 0:ne[i];return te===$}),dataStartIndex:d,dataEndIndex:f}),q=B.length,F,H,U;jfe(S.domain,E,C)&&(F=JS(S.domain,null,E),g&&(C==="number"||k!=="auto")&&(U=Ed(B,N,"category")));var R=RF(C);if(!F||F.length===0){var W,X=(W=S.domain)!==null&&W!==void 0?W:R;if(N){if(F=Ed(B,N,C),C==="category"&&g){var G=CX(F);A&&G?(H=F,F=Rm(0,q)):A||(F=D2(X,F,b).reduce(function(I,ne){return I.indexOf(ne)>=0?I:[].concat(nu(I),[ne])},[]))}else if(C==="category")A?F=F.filter(function(I){return I!==""&&!Mt(I)}):F=D2(X,F,b).reduce(function(I,ne){return I.indexOf(ne)>=0||ne===""||Mt(ne)?I:[].concat(nu(I),[ne])},[]);else if(C==="number"){var z=Dae(B,s.filter(function(I){var ne,te,de=i in I.props?I.props[i]:(ne=I.type.defaultProps)===null||ne===void 0?void 0:ne[i],he="hide"in I.props?I.props.hide:(te=I.type.defaultProps)===null||te===void 0?void 0:te.hide;return de===$&&(T||!he)}),N,o,h);z&&(F=z)}g&&(C==="number"||k!=="auto")&&(U=Ed(B,N,"category"))}else g?F=Rm(0,q):c&&c[$]&&c[$].hasStack&&C==="number"?F=x==="expand"?[0,1]:w4(c[$].stackGroups,d,f):F=v4(B,s.filter(function(I){var ne=i in I.props?I.props[i]:I.type.defaultProps[i],te="hide"in I.props?I.props.hide:I.type.defaultProps.hide;return ne===$&&(T||!te)}),C,h,!0);if(C==="number")F=M1(p,F,$,o,O),X&&(F=JS(X,F,E));else if(C==="category"&&X){var J=X,D=F.every(function(I){return J.indexOf(I)>=0});D&&(F=J)}}return we(we({},j),{},Ct({},$,we(we({},S),{},{axisType:o,domain:F,categoricalDomain:U,duplicateDomain:H,originalDomain:(y=S.domain)!==null&&y!==void 0?y:R,isCategorical:g,layout:h})))},{})},Qfe=function(t,n){var r=n.graphicalItems,s=n.Axis,o=n.axisType,i=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,x=fg(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),g=x.length,j=g4(h,o),b=-1;return r.reduce(function(y,S){var C=S.type.defaultProps!==void 0?we(we({},S.type.defaultProps),S.props):S.props,N=C[i],E=RF("number");if(!y[N]){b++;var A;return j?A=Rm(0,g):c&&c[N]&&c[N].hasStack?(A=w4(c[N].stackGroups,d,f),A=M1(p,A,N,o)):(A=JS(E,v4(x,r.filter(function(k){var O,T,$=i in k.props?k.props[i]:(O=k.type.defaultProps)===null||O===void 0?void 0:O[i],B="hide"in k.props?k.props.hide:(T=k.type.defaultProps)===null||T===void 0?void 0:T.hide;return $===N&&!B}),"number",h),s.defaultProps.allowDataOverflow),A=M1(p,A,N,o)),we(we({},y),{},Ct({},N,we(we({axisType:o},s.defaultProps),{},{hide:!0,orientation:fa(Hfe,"".concat(o,".").concat(b%2),null),domain:A,originalDomain:E,isCategorical:j,layout:h})))}return y},{})},Jfe=function(t,n){var r=n.axisType,s=r===void 0?"xAxis":r,o=n.AxisComp,i=n.graphicalItems,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.children,p="".concat(s,"Id"),x=pa(h,o),g={};return x&&x.length?g=Xfe(t,{axes:x,graphicalItems:i,axisType:s,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):i&&i.length&&(g=Qfe(t,{Axis:o,graphicalItems:i,axisType:s,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),g},Zfe=function(t){var n=lc(t),r=Hi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:tC(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:ym(n,r)}},IM=function(t){var n=t.children,r=t.defaultShowTooltip,s=oa(n,Hc),o=0,i=0;return t.data&&t.data.length!==0&&(i=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(o=s.props.startIndex),s.props.endIndex>=0&&(i=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:i,activeTooltipIndex:-1,isTooltipActive:!!r}},epe=function(t){return!t||!t.length?!1:t.some(function(n){var r=no(n&&n.type);return r&&r.indexOf("Bar")>=0})},MM=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"}},tpe=function(t,n){var r=t.props,s=t.graphicalItems,o=t.xAxisMap,i=o===void 0?{}:o,c=t.yAxisMap,d=c===void 0?{}:c,f=r.width,h=r.height,p=r.children,x=r.margin||{},g=oa(p,Hc),j=oa(p,Gi),b=Object.keys(d).reduce(function(A,k){var O=d[k],T=O.orientation;return!O.mirror&&!O.hide?we(we({},A),{},Ct({},T,A[T]+O.width)):A},{left:x.left||0,right:x.right||0}),y=Object.keys(i).reduce(function(A,k){var O=i[k],T=O.orientation;return!O.mirror&&!O.hide?we(we({},A),{},Ct({},T,fa(A,"".concat(T))+O.height)):A},{top:x.top||0,bottom:x.bottom||0}),S=we(we({},y),b),C=S.bottom;g&&(S.bottom+=g.props.height||Hc.defaultProps.height),j&&n&&(S=Mae(S,s,r,n));var N=f-S.left-S.right,E=h-S.top-S.bottom;return we(we({brushBottom:C},S),{},{width:Math.max(N,0),height:Math.max(E,0)})},npe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},RC=function(t){var n=t.chartName,r=t.GraphicalChild,s=t.defaultTooltipEventType,o=s===void 0?"axis":s,i=t.validateTooltipEventTypes,c=i===void 0?["axis"]:i,d=t.axisComponents,f=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,x=function(S,C){var N=C.graphicalItems,E=C.stackGroups,A=C.offset,k=C.updateId,O=C.dataStartIndex,T=C.dataEndIndex,$=S.barSize,B=S.layout,q=S.barGap,F=S.barCategoryGap,H=S.maxBarSize,U=MM(B),R=U.numericAxisName,W=U.cateAxisName,X=epe(N),G=[];return N.forEach(function(z,J){var D=fg(S.data,{graphicalItems:[z],dataStartIndex:O,dataEndIndex:T}),I=z.type.defaultProps!==void 0?we(we({},z.type.defaultProps),z.props):z.props,ne=I.dataKey,te=I.maxBarSize,de=I["".concat(R,"Id")],he=I["".concat(W,"Id")],V={},ue=d.reduce(function(ht,gt){var mt=C["".concat(gt.axisType,"Map")],Vt=I["".concat(gt.axisType,"Id")];mt&&mt[Vt]||gt.axisType==="zAxis"||il();var qt=mt[Vt];return we(we({},ht),{},Ct(Ct({},gt.axisType,qt),"".concat(gt.axisType,"Ticks"),Hi(qt)))},V),Q=ue[W],Z=ue["".concat(W,"Ticks")],fe=E&&E[de]&&E[de].hasStack&&Hae(z,E[de].stackGroups),ae=no(z.type).indexOf("Bar")>=0,Re=ym(Q,Z),_e=[],Me=X&&Rae({barSize:$,stackGroups:E,totalSize:npe(ue,W)});if(ae){var L,oe,pe=Mt(te)?H:te,Ee=(L=(oe=ym(Q,Z,!0))!==null&&oe!==void 0?oe:pe)!==null&&L!==void 0?L:0;_e=Iae({barGap:q,barCategoryGap:F,bandSize:Ee!==Re?Ee:Re,sizeList:Me[he],maxBarSize:pe}),Ee!==Re&&(_e=_e.map(function(ht){return we(we({},ht),{},{position:we(we({},ht.position),{},{offset:ht.position.offset-Ee/2})})}))}var Xe=z&&z.type&&z.type.getComposedData;Xe&&G.push({props:we(we({},Xe(we(we({},ue),{},{displayedData:D,props:S,dataKey:ne,item:z,bandSize:Re,barPosition:_e,offset:A,stackedData:fe,layout:B,dataStartIndex:O,dataEndIndex:T}))),{},Ct(Ct(Ct({key:z.key||"item-".concat(J)},R,ue[R]),W,ue[W]),"animationId",k)),childIndex:LX(z,S.children),item:z})}),G},g=function(S,C){var N=S.props,E=S.dataStartIndex,A=S.dataEndIndex,k=S.updateId;if(!QP({props:N}))return null;var O=N.children,T=N.layout,$=N.stackOffset,B=N.data,q=N.reverseStackOrder,F=MM(T),H=F.numericAxisName,U=F.cateAxisName,R=pa(O,r),W=Wae(B,R,"".concat(H,"Id"),"".concat(U,"Id"),$,q),X=d.reduce(function(I,ne){var te="".concat(ne.axisType,"Map");return we(we({},I),{},Ct({},te,Jfe(N,we(we({},ne),{},{graphicalItems:R,stackGroups:ne.axisType===H&&W,dataStartIndex:E,dataEndIndex:A}))))},{}),G=tpe(we(we({},X),{},{props:N,graphicalItems:R}),C?.legendBBox);Object.keys(X).forEach(function(I){X[I]=h(N,X[I],G,I.replace("Map",""),n)});var z=X["".concat(U,"Map")],J=Zfe(z),D=x(N,we(we({},X),{},{dataStartIndex:E,dataEndIndex:A,updateId:k,graphicalItems:R,stackGroups:W,offset:G}));return we(we({formattedGraphicalItems:D,graphicalItems:R,offset:G,stackGroups:W},J),X)},j=(function(y){function S(C){var N,E,A;return Mfe(this,S),A=Lfe(this,S,[C]),Ct(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ct(A,"accessibilityManager",new wfe),Ct(A,"handleLegendBBoxUpdate",function(k){if(k){var O=A.state,T=O.dataStartIndex,$=O.dataEndIndex,B=O.updateId;A.setState(we({legendBBox:k},g({props:A.props,dataStartIndex:T,dataEndIndex:$,updateId:B},we(we({},A.state),{},{legendBBox:k}))))}}),Ct(A,"handleReceiveSyncEvent",function(k,O,T){if(A.props.syncId===k){if(T===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(O)}}),Ct(A,"handleBrushChange",function(k){var O=k.startIndex,T=k.endIndex;if(O!==A.state.dataStartIndex||T!==A.state.dataEndIndex){var $=A.state.updateId;A.setState(function(){return we({dataStartIndex:O,dataEndIndex:T},g({props:A.props,dataStartIndex:O,dataEndIndex:T,updateId:$},A.state))}),A.triggerSyncEvent({dataStartIndex:O,dataEndIndex:T})}}),Ct(A,"handleMouseEnter",function(k){var O=A.getMouseInfo(k);if(O){var T=we(we({},O),{},{isTooltipActive:!0});A.setState(T),A.triggerSyncEvent(T);var $=A.props.onMouseEnter;It($)&&$(T,k)}}),Ct(A,"triggeredAfterMouseMove",function(k){var O=A.getMouseInfo(k),T=O?we(we({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(T),A.triggerSyncEvent(T);var $=A.props.onMouseMove;It($)&&$(T,k)}),Ct(A,"handleItemMouseEnter",function(k){A.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),Ct(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),Ct(A,"handleMouseMove",function(k){k.persist(),A.throttleTriggeredAfterMouseMove(k)}),Ct(A,"handleMouseLeave",function(k){A.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};A.setState(O),A.triggerSyncEvent(O);var T=A.props.onMouseLeave;It(T)&&T(O,k)}),Ct(A,"handleOuterEvent",function(k){var O=DX(k),T=fa(A.props,"".concat(O));if(O&&It(T)){var $,B;/.*touch.*/i.test(O)?B=A.getMouseInfo(k.changedTouches[0]):B=A.getMouseInfo(k),T(($=B)!==null&&$!==void 0?$:{},k)}}),Ct(A,"handleClick",function(k){var O=A.getMouseInfo(k);if(O){var T=we(we({},O),{},{isTooltipActive:!0});A.setState(T),A.triggerSyncEvent(T);var $=A.props.onClick;It($)&&$(T,k)}}),Ct(A,"handleMouseDown",function(k){var O=A.props.onMouseDown;if(It(O)){var T=A.getMouseInfo(k);O(T,k)}}),Ct(A,"handleMouseUp",function(k){var O=A.props.onMouseUp;if(It(O)){var T=A.getMouseInfo(k);O(T,k)}}),Ct(A,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),Ct(A,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&A.handleMouseDown(k.changedTouches[0])}),Ct(A,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&A.handleMouseUp(k.changedTouches[0])}),Ct(A,"handleDoubleClick",function(k){var O=A.props.onDoubleClick;if(It(O)){var T=A.getMouseInfo(k);O(T,k)}}),Ct(A,"handleContextMenu",function(k){var O=A.props.onContextMenu;if(It(O)){var T=A.getMouseInfo(k);O(T,k)}}),Ct(A,"triggerSyncEvent",function(k){A.props.syncId!==void 0&&Tj.emit(Rj,A.props.syncId,k,A.eventEmitterSymbol)}),Ct(A,"applySyncEvent",function(k){var O=A.props,T=O.layout,$=O.syncMethod,B=A.state.updateId,q=k.dataStartIndex,F=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)A.setState(we({dataStartIndex:q,dataEndIndex:F},g({props:A.props,dataStartIndex:q,dataEndIndex:F,updateId:B},A.state)));else if(k.activeTooltipIndex!==void 0){var H=k.chartX,U=k.chartY,R=k.activeTooltipIndex,W=A.state,X=W.offset,G=W.tooltipTicks;if(!X)return;if(typeof $=="function")R=$(G,k);else if($==="value"){R=-1;for(var z=0;z<G.length;z++)if(G[z].value===k.activeLabel){R=z;break}}var J=we(we({},X),{},{x:X.left,y:X.top}),D=Math.min(H,J.x+J.width),I=Math.min(U,J.y+J.height),ne=G[R]&&G[R].value,te=L1(A.state,A.props.data,R),de=G[R]?{x:T==="horizontal"?G[R].coordinate:D,y:T==="horizontal"?I:G[R].coordinate}:TF;A.setState(we(we({},k),{},{activeLabel:ne,activeCoordinate:de,activePayload:te,activeTooltipIndex:R}))}else A.setState(k)}),Ct(A,"renderCursor",function(k){var O,T=A.state,$=T.isTooltipActive,B=T.activeCoordinate,q=T.activePayload,F=T.offset,H=T.activeTooltipIndex,U=T.tooltipAxisBandSize,R=A.getTooltipEventType(),W=(O=k.props.active)!==null&&O!==void 0?O:$,X=A.props.layout,G=k.key||"_recharts-cursor";return Y.createElement(Efe,{key:G,activeCoordinate:B,activePayload:q,activeTooltipIndex:H,chartName:n,element:k,isActive:W,layout:X,offset:F,tooltipAxisBandSize:U,tooltipEventType:R})}),Ct(A,"renderPolarAxis",function(k,O,T){var $=fa(k,"type.axisType"),B=fa(A.state,"".concat($,"Map")),q=k.type.defaultProps,F=q!==void 0?we(we({},q),k.props):k.props,H=B&&B[F["".concat($,"Id")]];return m.cloneElement(k,we(we({},H),{},{className:Lt($,H.className),key:k.key||"".concat(O,"-").concat(T),ticks:Hi(H,!0)}))}),Ct(A,"renderPolarGrid",function(k){var O=k.props,T=O.radialLines,$=O.polarAngles,B=O.polarRadius,q=A.state,F=q.radiusAxisMap,H=q.angleAxisMap,U=lc(F),R=lc(H),W=R.cx,X=R.cy,G=R.innerRadius,z=R.outerRadius;return m.cloneElement(k,{polarAngles:Array.isArray($)?$:Hi(R,!0).map(function(J){return J.coordinate}),polarRadius:Array.isArray(B)?B:Hi(U,!0).map(function(J){return J.coordinate}),cx:W,cy:X,innerRadius:G,outerRadius:z,key:k.key||"polar-grid",radialLines:T})}),Ct(A,"renderLegend",function(){var k=A.state.formattedGraphicalItems,O=A.props,T=O.children,$=O.width,B=O.height,q=A.props.margin||{},F=$-(q.left||0)-(q.right||0),H=h4({children:T,formattedGraphicalItems:k,legendWidth:F,legendContent:f});if(!H)return null;var U=H.item,R=OM(H,kfe);return m.cloneElement(U,we(we({},R),{},{chartWidth:$,chartHeight:B,margin:q,onBBoxUpdate:A.handleLegendBBoxUpdate}))}),Ct(A,"renderTooltip",function(){var k,O=A.props,T=O.children,$=O.accessibilityLayer,B=oa(T,Fr);if(!B)return null;var q=A.state,F=q.isTooltipActive,H=q.activeCoordinate,U=q.activePayload,R=q.activeLabel,W=q.offset,X=(k=B.props.active)!==null&&k!==void 0?k:F;return m.cloneElement(B,{viewBox:we(we({},W),{},{x:W.left,y:W.top}),active:X,label:R,payload:X?U:[],coordinate:H,accessibilityLayer:$})}),Ct(A,"renderBrush",function(k){var O=A.props,T=O.margin,$=O.data,B=A.state,q=B.offset,F=B.dataStartIndex,H=B.dataEndIndex,U=B.updateId;return m.cloneElement(k,{key:k.key||"_recharts-brush",onChange:yh(A.handleBrushChange,k.props.onChange),data:$,x:Ge(k.props.x)?k.props.x:q.left,y:Ge(k.props.y)?k.props.y:q.top+q.height+q.brushBottom-(T.bottom||0),width:Ge(k.props.width)?k.props.width:q.width,startIndex:F,endIndex:H,updateId:"brush-".concat(U)})}),Ct(A,"renderReferenceElement",function(k,O,T){if(!k)return null;var $=A,B=$.clipPathId,q=A.state,F=q.xAxisMap,H=q.yAxisMap,U=q.offset,R=k.type.defaultProps||{},W=k.props,X=W.xAxisId,G=X===void 0?R.xAxisId:X,z=W.yAxisId,J=z===void 0?R.yAxisId:z;return m.cloneElement(k,{key:k.key||"".concat(O,"-").concat(T),xAxis:F[G],yAxis:H[J],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:B})}),Ct(A,"renderActivePoints",function(k){var O=k.item,T=k.activePoint,$=k.basePoint,B=k.childIndex,q=k.isRange,F=[],H=O.props.key,U=O.item.type.defaultProps!==void 0?we(we({},O.item.type.defaultProps),O.item.props):O.item.props,R=U.activeDot,W=U.dataKey,X=we(we({index:B,dataKey:W,cx:T.x,cy:T.y,r:4,fill:AC(O.item),strokeWidth:2,stroke:"#fff",payload:T.payload,value:T.value},St(R,!1)),Kh(R));return F.push(S.renderActiveDot(R,X,"".concat(H,"-activePoint-").concat(B))),$?F.push(S.renderActiveDot(R,we(we({},X),{},{cx:$.x,cy:$.y}),"".concat(H,"-basePoint-").concat(B))):q&&F.push(null),F}),Ct(A,"renderGraphicChild",function(k,O,T){var $=A.filterFormatItem(k,O,T);if(!$)return null;var B=A.getTooltipEventType(),q=A.state,F=q.isTooltipActive,H=q.tooltipAxis,U=q.activeTooltipIndex,R=q.activeLabel,W=A.props.children,X=oa(W,Fr),G=$.props,z=G.points,J=G.isRange,D=G.baseLine,I=$.item.type.defaultProps!==void 0?we(we({},$.item.type.defaultProps),$.item.props):$.item.props,ne=I.activeDot,te=I.hide,de=I.activeBar,he=I.activeShape,V=!!(!te&&F&&X&&(ne||de||he)),ue={};B!=="axis"&&X&&X.props.trigger==="click"?ue={onClick:yh(A.handleItemMouseEnter,k.props.onClick)}:B!=="axis"&&(ue={onMouseLeave:yh(A.handleItemMouseLeave,k.props.onMouseLeave),onMouseEnter:yh(A.handleItemMouseEnter,k.props.onMouseEnter)});var Q=m.cloneElement(k,we(we({},$.props),ue));function Z(gt){return typeof H.dataKey=="function"?H.dataKey(gt.payload):null}if(V)if(U>=0){var fe,ae;if(H.dataKey&&!H.allowDuplicatedCategory){var Re=typeof H.dataKey=="function"?Z:"payload.".concat(H.dataKey.toString());fe=Hh(z,Re,R),ae=J&&D&&Hh(D,Re,R)}else fe=z?.[U],ae=J&&D&&D[U];if(he||de){var _e=k.props.activeIndex!==void 0?k.props.activeIndex:U;return[m.cloneElement(k,we(we(we({},$.props),ue),{},{activeIndex:_e})),null,null]}if(!Mt(fe))return[Q].concat(nu(A.renderActivePoints({item:$,activePoint:fe,basePoint:ae,childIndex:U,isRange:J})))}else{var Me,L=(Me=A.getItemByXY(A.state.activeCoordinate))!==null&&Me!==void 0?Me:{graphicalItem:Q},oe=L.graphicalItem,pe=oe.item,Ee=pe===void 0?k:pe,Xe=oe.childIndex,ht=we(we(we({},$.props),ue),{},{activeIndex:Xe});return[m.cloneElement(Ee,ht),null,null]}return J?[Q,null,null]:[Q,null]}),Ct(A,"renderCustomized",function(k,O,T){return m.cloneElement(k,we(we({key:"recharts-customized-".concat(T)},A.props),A.state))}),Ct(A,"renderMap",{CartesianGrid:{handler:Nh,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Nh},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Nh},YAxis:{handler:Nh},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((N=C.id)!==null&&N!==void 0?N:gu("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=hL(A.triggeredAfterMouseMove,(E=C.throttleDelay)!==null&&E!==void 0?E:1e3/60),A.state={},A}return Bfe(S,y),Dfe(S,[{key:"componentDidMount",value:function(){var N,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(N=this.props.margin.left)!==null&&N!==void 0?N: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 N=this.props,E=N.children,A=N.data,k=N.height,O=N.layout,T=oa(E,Fr);if(T){var $=T.props.defaultIndex;if(!(typeof $!="number"||$<0||$>this.state.tooltipTicks.length-1)){var B=this.state.tooltipTicks[$]&&this.state.tooltipTicks[$].value,q=L1(this.state,A,$,B),F=this.state.tooltipTicks[$].coordinate,H=(this.state.offset.top+k)/2,U=O==="horizontal",R=U?{x:F,y:H}:{y:F,x:H},W=this.state.formattedGraphicalItems.find(function(G){var z=G.item;return z.type.name==="Scatter"});W&&(R=we(we({},R),W.props.points[$].tooltipPosition),q=W.props.points[$].tooltipPayload);var X={activeTooltipIndex:$,isTooltipActive:!0,activeLabel:B,activePayload:q,activeCoordinate:R};this.setState(X),this.renderCursor(T),this.accessibilityManager.setIndex($)}}}},{key:"getSnapshotBeforeUpdate",value:function(N,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==N.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==N.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(N){bS([oa(N.children,Fr)],[oa(this.props.children,Fr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var N=oa(this.props.children,Fr);if(N&&typeof N.props.shared=="boolean"){var E=N.props.shared?"axis":"item";return c.indexOf(E)>=0?E:o}return o}},{key:"getMouseInfo",value:function(N){if(!this.container)return null;var E=this.container,A=E.getBoundingClientRect(),k=Nee(A),O={chartX:Math.round(N.pageX-k.left),chartY:Math.round(N.pageY-k.top)},T=A.width/E.offsetWidth||1,$=this.inRange(O.chartX,O.chartY,T);if(!$)return null;var B=this.state,q=B.xAxisMap,F=B.yAxisMap,H=this.getTooltipEventType(),U=RM(this.state,this.props.data,this.props.layout,$);if(H!=="axis"&&q&&F){var R=lc(q).scale,W=lc(F).scale,X=R&&R.invert?R.invert(O.chartX):null,G=W&&W.invert?W.invert(O.chartY):null;return we(we({},O),{},{xValue:X,yValue:G},U)}return U?we(we({},O),U):null}},{key:"inRange",value:function(N,E){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,O=N/A,T=E/A;if(k==="horizontal"||k==="vertical"){var $=this.state.offset,B=O>=$.left&&O<=$.left+$.width&&T>=$.top&&T<=$.top+$.height;return B?{x:O,y:T}:null}var q=this.state,F=q.angleAxisMap,H=q.radiusAxisMap;if(F&&H){var U=lc(F);return z2({x:O,y:T},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var N=this.props.children,E=this.getTooltipEventType(),A=oa(N,Fr),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 O=Kh(this.props,this.handleOuterEvent);return we(we({},O),k)}},{key:"addListener",value:function(){Tj.on(Rj,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Tj.removeListener(Rj,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(N,E,A){for(var k=this.state.formattedGraphicalItems,O=0,T=k.length;O<T;O++){var $=k[O];if($.item===N||$.props.key===N.key||E===no($.item.type)&&A===$.childIndex)return $}return null}},{key:"renderClipPath",value:function(){var N=this.clipPathId,E=this.state.offset,A=E.left,k=E.top,O=E.height,T=E.width;return Y.createElement("defs",null,Y.createElement("clipPath",{id:N},Y.createElement("rect",{x:A,y:k,height:O,width:T})))}},{key:"getXScales",value:function(){var N=this.state.xAxisMap;return N?Object.entries(N).reduce(function(E,A){var k=PM(A,2),O=k[0],T=k[1];return we(we({},E),{},Ct({},O,T.scale))},{}):null}},{key:"getYScales",value:function(){var N=this.state.yAxisMap;return N?Object.entries(N).reduce(function(E,A){var k=PM(A,2),O=k[0],T=k[1];return we(we({},E),{},Ct({},O,T.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(N){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[N])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(N){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[N])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(N){var E=this.state,A=E.formattedGraphicalItems,k=E.activeItem;if(A&&A.length)for(var O=0,T=A.length;O<T;O++){var $=A[O],B=$.props,q=$.item,F=q.type.defaultProps!==void 0?we(we({},q.type.defaultProps),q.props):q.props,H=no(q.type);if(H==="Bar"){var U=(B.data||[]).find(function(G){return Vie(N,G)});if(U)return{graphicalItem:$,payload:U}}else if(H==="RadialBar"){var R=(B.data||[]).find(function(G){return z2(N,G)});if(R)return{graphicalItem:$,payload:R}}else if(ag($,k)||sg($,k)||hf($,k)){var W=hce({graphicalItem:$,activeTooltipItem:k,itemData:F.data}),X=F.activeIndex===void 0?W:F.activeIndex;return{graphicalItem:we(we({},$),{},{childIndex:X}),payload:hf($,k)?F.data[W]:$.props.data[W]}}}return null}},{key:"render",value:function(){var N=this;if(!QP(this))return null;var E=this.props,A=E.children,k=E.className,O=E.width,T=E.height,$=E.style,B=E.compact,q=E.title,F=E.desc,H=OM(E,Pfe),U=St(H,!1);if(B)return Y.createElement(pM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Y.createElement(jS,vc({},U,{width:O,height:T,title:q,desc:F}),this.renderClipPath(),ZP(A,this.renderMap)));if(this.props.accessibilityLayer){var R,W;U.tabIndex=(R=this.props.tabIndex)!==null&&R!==void 0?R:0,U.role=(W=this.props.role)!==null&&W!==void 0?W:"application",U.onKeyDown=function(G){N.accessibilityManager.keyboardEvent(G)},U.onFocus=function(){N.accessibilityManager.focus()}}var X=this.parseEventsOfWrapper();return Y.createElement(pM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Y.createElement("div",vc({className:Lt("recharts-wrapper",k),style:we({position:"relative",cursor:"default",width:O,height:T},$)},X,{ref:function(z){N.container=z}}),Y.createElement(jS,vc({},U,{width:O,height:T,title:q,desc:F,style:Kfe}),this.renderClipPath(),ZP(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(m.Component);Ct(j,"displayName",n),Ct(j,"defaultProps",we({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),Ct(j,"getDerivedStateFromProps",function(y,S){var C=y.dataKey,N=y.data,E=y.children,A=y.width,k=y.height,O=y.layout,T=y.stackOffset,$=y.margin,B=S.dataStartIndex,q=S.dataEndIndex;if(S.updateId===void 0){var F=IM(y);return we(we(we({},F),{},{updateId:0},g(we(we({props:y},F),{},{updateId:0}),S)),{},{prevDataKey:C,prevData:N,prevWidth:A,prevHeight:k,prevLayout:O,prevStackOffset:T,prevMargin:$,prevChildren:E})}if(C!==S.prevDataKey||N!==S.prevData||A!==S.prevWidth||k!==S.prevHeight||O!==S.prevLayout||T!==S.prevStackOffset||!jc($,S.prevMargin)){var H=IM(y),U={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},R=we(we({},RM(S,N,O)),{},{updateId:S.updateId+1}),W=we(we(we({},H),U),R);return we(we(we({},W),g(we({props:y},W),S)),{},{prevDataKey:C,prevData:N,prevWidth:A,prevHeight:k,prevLayout:O,prevStackOffset:T,prevMargin:$,prevChildren:E})}if(!bS(E,S.prevChildren)){var X,G,z,J,D=oa(E,Hc),I=D&&(X=(G=D.props)===null||G===void 0?void 0:G.startIndex)!==null&&X!==void 0?X:B,ne=D&&(z=(J=D.props)===null||J===void 0?void 0:J.endIndex)!==null&&z!==void 0?z:q,te=I!==B||ne!==q,de=!Mt(N),he=de&&!te?S.updateId:S.updateId+1;return we(we({updateId:he},g(we(we({props:y},S),{},{updateId:he,dataStartIndex:I,dataEndIndex:ne}),S)),{},{prevChildren:E,dataStartIndex:I,dataEndIndex:ne})}return null}),Ct(j,"renderActiveDot",function(y,S,C){var N;return m.isValidElement(y)?N=m.cloneElement(y,S):It(y)?N=y(S):N=Y.createElement(Zv,S),Y.createElement(en,{className:"recharts-active-dot",key:C},N)});var b=m.forwardRef(function(S,C){return Y.createElement(j,vc({},S,{ref:C}))});return b.displayName=j.displayName,b},F1=RC({chartName:"LineChart",GraphicalChild:ll,axisComponents:[{axisType:"xAxis",AxisComp:ii},{axisType:"yAxis",AxisComp:li}],formatAxisMap:Q4}),rpe=RC({chartName:"BarChart",GraphicalChild:Al,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ii},{axisType:"yAxis",AxisComp:li}],formatAxisMap:Q4}),ape=RC({chartName:"PieChart",GraphicalChild:wo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:rg},{axisType:"radiusAxis",AxisComp:tg}],formatAxisMap:nse,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const spe=()=>{const{configs:e}=Mf(),{source:t}=Dn(),[n,r]=m.useState([]),[s,o]=m.useState("timestamp"),[i,c]=m.useState("desc"),d=y=>{if(s===y){c(S=>S==="asc"?"desc":"asc");return}o(y),c("desc")};m.useEffect(()=>{let y=!0;return t.listResults().then(S=>{y&&r(S)}),()=>{y=!1}},[t]);const f=e.length,h=n.length,p=h===0?0:n.reduce((y,S)=>y+S.overallPassRate,0)/h,x=h===0?0:Math.round(n.reduce((y,S)=>y+S.avgLatency,0)/h),g=m.useMemo(()=>[...n].sort((S,C)=>{let N=0;return s==="timestamp"&&(N=new Date(S.timestamp).getTime()-new Date(C.timestamp).getTime()),s==="passRate"&&(N=S.overallPassRate-C.overallPassRate),s==="latency"&&(N=S.avgLatency-C.avgLatency),s==="scenarios"&&(N=S.totalScenarios-C.totalScenarios),i==="asc"?N:-N}),[n,s,i]),j=[...g].reverse().map(y=>({date:new Date(y.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(y.overallPassRate*100),latency:y.avgLatency})),b=y=>{const S=Array.from(new Set(y.scenarios.map(T=>T.scenarioId).filter(Boolean))),C=Array.from(new Set(y.scenarios.map(T=>T.agentName).filter(Boolean))),N=Array.from(new Set(y.scenarios.map(T=>T.model).filter(T=>!!T))),E=S.slice(0,2).join(", "),A=S.length>2?` +${S.length-2}`:"",k=N.slice(0,2).join(", "),O=N.length>2?` +${N.length-2}`:"";return{scenarioCount:S.length,agentCount:C.length,scenarioPreview:E?`${E}${A}`:"n/a",modelSummary:k?`${k}${O}`:""}};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(eD,{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(se,{asChild:!0,children:a.jsxs(_t,{to:"/mcp-evaluations/new",children:[a.jsx(fN,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),a.jsx(se,{variant:"outline",asChild:!0,children:a.jsxs(_t,{to:"/run",children:[a.jsx(to,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),a.jsx(se,{variant:"outline",asChild:!0,children:a.jsxs(_t,{to:"/results",children:[a.jsx(_c,{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(vs,{title:"MCP Evaluations",value:f,icon:Qj,subtitle:`${f} active`}),a.jsx(vs,{title:"Total Runs",value:h,icon:Y$,subtitle:"Last 30 days"}),a.jsx(vs,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:_c,subtitle:"+5% from last week",trend:"up"}),a.jsx(vs,{title:"Avg Latency",value:`${x}ms`,icon:rD,subtitle:"-120ms from last week",trend:"up"})]}),a.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Pass Rate Trend"})}),a.jsx(He,{children:a.jsx(rm,{width:"100%",height:200,children:a.jsxs(F1,{data:j,children:[a.jsx(ii,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(li,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:y=>`${y}%`}),a.jsx(Fr,{formatter:y=>[`${y}%`,"Pass Rate"]}),a.jsx(ll,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Recent Tool Latency (ms)"})}),a.jsx(He,{children:a.jsx(rm,{width:"100%",height:200,children:a.jsxs(F1,{data:j,children:[a.jsx(ii,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(li,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(Fr,{formatter:y=>[`${y}ms`,"Latency"]}),a.jsx(ll,{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(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Recent Runs"})}),a.jsx(He,{className:"p-0",children:a.jsxs(qr,{children:[a.jsx(Ur,{children:a.jsxs(Gt,{children:[a.jsx(at,{children:"Run ID"}),a.jsx(at,{children:"Evaluated"}),a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("timestamp"),children:["Timestamp",s==="timestamp"?i==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}):a.jsx(gc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("passRate"),children:["Pass Rate",s==="passRate"?i==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}):a.jsx(gc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),a.jsx(at,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("scenarios"),children:["Scenarios",s==="scenarios"?i==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}):a.jsx(gc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),a.jsx(Wr,{children:g.map(y=>a.jsxs(Gt,{className:"cursor-pointer",children:[a.jsx(Ue,{children:a.jsx(_t,{to:`/results/${y.id}`,className:"font-mono text-xs text-primary hover:underline",children:y.id})}),a.jsx(Ue,{className:"text-[11px] text-muted-foreground",children:(()=>{const S=b(y);return a.jsxs("div",{className:"space-y-0.5",children:[a.jsxs("div",{children:["Evaluated: ",S.scenarioCount," scenario",S.scenarioCount===1?"":"s"," · ",S.agentCount," agent",S.agentCount===1?"":"s",S.modelSummary?` · ${S.modelSummary}`:""]}),a.jsx("div",{className:"font-mono text-xs text-foreground/80",children:S.scenarioPreview})]})})()}),a.jsx(Ue,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(mo,{className:"h-3 w-3"}),new Date(y.timestamp).toLocaleString()]})}),a.jsx(Ue,{children:a.jsx(Js,{rate:y.overallPassRate})}),a.jsx(Ue,{className:"text-right font-mono text-sm",children:y.totalScenarios})]},y.id))})]})})]})})]})};function IC({value:e,onValueChange:t,placeholder:n="Search...",className:r,inputClassName:s,clearAriaLabel:o="Clear search"}){return a.jsxs("div",{className:je("relative",r),children:[a.jsx(vt,{value:e,onChange:i=>t(i.target.value),placeholder:n,className:je("h-9 w-[240px] pr-8",s)}),e&&a.jsx(se,{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":o,children:a.jsx(As,{className:"h-4 w-4"})})]})}var ope=m.createContext(void 0);function ju(e){const t=m.useContext(ope);return e||t||"ltr"}var Mj="rovingFocusGroup.onEntryFocus",ipe={bubbles:!1,cancelable:!0},Vf="RovingFocusGroup",[z1,IF,lpe]=Cf(Vf),[cpe,pg]=hr(Vf,[lpe]),[upe,dpe]=cpe(Vf),MF=m.forwardRef((e,t)=>a.jsx(z1.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(z1.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(fpe,{...e,ref:t})})}));MF.displayName=Vf;var fpe=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,x=m.useRef(null),g=wt(t,x),j=ju(o),[b,y]=ha({prop:i,defaultProp:c??null,onChange:d,caller:Vf}),[S,C]=m.useState(!1),N=Wn(f),E=IF(n),A=m.useRef(!1),[k,O]=m.useState(0);return m.useEffect(()=>{const T=x.current;if(T)return T.addEventListener(Mj,N),()=>T.removeEventListener(Mj,N)},[N]),a.jsx(upe,{scope:n,orientation:r,dir:j,loop:s,currentTabStopId:b,onItemFocus:m.useCallback(T=>y(T),[y]),onItemShiftTab:m.useCallback(()=>C(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>O(T=>T-1),[]),children:a.jsx(Ye.div,{tabIndex:S||k===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{A.current=!0}),onFocus:Te(e.onFocus,T=>{const $=!A.current;if(T.target===T.currentTarget&&$&&!S){const B=new CustomEvent(Mj,ipe);if(T.currentTarget.dispatchEvent(B),!B.defaultPrevented){const q=E().filter(W=>W.focusable),F=q.find(W=>W.active),H=q.find(W=>W.id===b),R=[F,H,...q].filter(Boolean).map(W=>W.ref.current);LF(R,h)}}A.current=!1}),onBlur:Te(e.onBlur,()=>C(!1))})})}),$F="RovingFocusGroupItem",DF=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:i,...c}=e,d=nr(),f=o||d,h=dpe($F,n),p=h.currentTabStopId===f,x=IF(n),{onFocusableItemAdd:g,onFocusableItemRemove:j,currentTabStopId:b}=h;return m.useEffect(()=>{if(r)return g(),()=>j()},[r,g,j]),a.jsx(z1.ItemSlot,{scope:n,id:f,focusable:r,active:s,children:a.jsx(Ye.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Te(e.onMouseDown,y=>{r?h.onItemFocus(f):y.preventDefault()}),onFocus:Te(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Te(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){h.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const S=mpe(y,h.orientation,h.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let N=x().filter(E=>E.focusable).map(E=>E.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const E=N.indexOf(y.currentTarget);N=h.loop?vpe(N,E+1):N.slice(E+1)}setTimeout(()=>LF(N))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:b!=null}):i})})});DF.displayName=$F;var ppe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hpe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mpe(e,t,n){const r=hpe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ppe[r]}function LF(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function vpe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var FF=MF,zF=DF;function gpe(e){const t=xpe(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(bpe);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,{...i,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function xpe(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=jpe(s),c=wpe(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Pr(r,i):i),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ype=Symbol("radix.slottable");function bpe(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ype}function wpe(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{const d=o(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function jpe(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 B1=["Enter"," "],Spe=["ArrowDown","PageUp","Home"],BF=["ArrowUp","PageDown","End"],Npe=[...Spe,...BF],Cpe={ltr:[...B1,"ArrowRight"],rtl:[...B1,"ArrowLeft"]},_pe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Hf="Menu",[wf,Ape,Epe]=Cf(Hf),[El,qF]=hr(Hf,[Epe,ui,pg]),hg=ui(),UF=pg(),[kpe,kl]=El(Hf),[Ppe,Kf]=El(Hf),WF=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:i=!0}=e,c=hg(t),[d,f]=m.useState(null),h=m.useRef(!1),p=Wn(o),x=ju(s);return m.useEffect(()=>{const g=()=>{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",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),a.jsx(dv,{...c,children:a.jsx(kpe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:a.jsx(Ppe,{scope:t,onClose:m.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:x,modal:i,children:r})})})};WF.displayName=Hf;var Ope="MenuAnchor",MC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=hg(n);return a.jsx(Ef,{...s,...r,ref:t})});MC.displayName=Ope;var $C="MenuPortal",[Tpe,VF]=El($C,{forceMount:void 0}),HF=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=kl($C,t);return a.jsx(Tpe,{scope:t,forceMount:n,children:a.jsx(Gn,{present:n||o.open,children:a.jsx(yl,{asChild:!0,container:s,children:r})})})};HF.displayName=$C;var Pa="MenuContent",[Rpe,DC]=El(Pa),KF=m.forwardRef((e,t)=>{const n=VF(Pa,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=kl(Pa,e.__scopeMenu),i=Kf(Pa,e.__scopeMenu);return a.jsx(wf.Provider,{scope:e.__scopeMenu,children:a.jsx(Gn,{present:r||o.open,children:a.jsx(wf.Slot,{scope:e.__scopeMenu,children:i.modal?a.jsx(Ipe,{...s,ref:t}):a.jsx(Mpe,{...s,ref:t})})})})}),Ipe=m.forwardRef((e,t)=>{const n=kl(Pa,e.__scopeMenu),r=m.useRef(null),s=wt(t,r);return m.useEffect(()=>{const o=r.current;if(o)return Nv(o)},[]),a.jsx(LC,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Mpe=m.forwardRef((e,t)=>{const n=kl(Pa,e.__scopeMenu);return a.jsx(LC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$pe=gpe("MenuContent.ScrollLock"),LC=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:x,onDismiss:g,disableOutsideScroll:j,...b}=e,y=kl(Pa,n),S=Kf(Pa,n),C=hg(n),N=UF(n),E=Ape(n),[A,k]=m.useState(null),O=m.useRef(null),T=wt(t,O,y.onContentChange),$=m.useRef(0),B=m.useRef(""),q=m.useRef(0),F=m.useRef(null),H=m.useRef("right"),U=m.useRef(0),R=j?Of:m.Fragment,W=j?{as:$pe,allowPinchZoom:!0}:void 0,X=z=>{const J=B.current+z,D=E().filter(V=>!V.disabled),I=document.activeElement,ne=D.find(V=>V.ref.current===I)?.textValue,te=D.map(V=>V.textValue),de=Gpe(te,J,ne),he=D.find(V=>V.textValue===de)?.ref.current;(function V(ue){B.current=ue,window.clearTimeout($.current),ue!==""&&($.current=window.setTimeout(()=>V(""),1e3))})(J),he&&setTimeout(()=>he.focus())};m.useEffect(()=>()=>window.clearTimeout($.current),[]),jv();const G=m.useCallback(z=>H.current===F.current?.side&&Xpe(z,F.current?.area),[]);return a.jsx(Rpe,{scope:n,searchRef:B,onItemEnter:m.useCallback(z=>{G(z)&&z.preventDefault()},[G]),onItemLeave:m.useCallback(z=>{G(z)||(O.current?.focus(),k(null))},[G]),onTriggerLeave:m.useCallback(z=>{G(z)&&z.preventDefault()},[G]),pointerGraceTimerRef:q,onPointerGraceIntentChange:m.useCallback(z=>{F.current=z},[]),children:a.jsx(R,{...W,children:a.jsx(Pf,{asChild:!0,trapped:s,onMountAutoFocus:Te(o,z=>{z.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:a.jsx(xl,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:x,onDismiss:g,children:a.jsx(FF,{asChild:!0,...N,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:k,onEntryFocus:Te(d,z=>{S.isUsingKeyboardRef.current||z.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(fv,{role:"menu","aria-orientation":"vertical","data-state":cz(y.open),"data-radix-menu-content":"",dir:S.dir,...C,...b,ref:T,style:{outline:"none",...b.style},onKeyDown:Te(b.onKeyDown,z=>{const D=z.target.closest("[data-radix-menu-content]")===z.currentTarget,I=z.ctrlKey||z.altKey||z.metaKey,ne=z.key.length===1;D&&(z.key==="Tab"&&z.preventDefault(),!I&&ne&&X(z.key));const te=O.current;if(z.target!==te||!Npe.includes(z.key))return;z.preventDefault();const he=E().filter(V=>!V.disabled).map(V=>V.ref.current);BF.includes(z.key)&&he.reverse(),Hpe(he)}),onBlur:Te(e.onBlur,z=>{z.currentTarget.contains(z.target)||(window.clearTimeout($.current),B.current="")}),onPointerMove:Te(e.onPointerMove,jf(z=>{const J=z.target,D=U.current!==z.clientX;if(z.currentTarget.contains(J)&&D){const I=z.clientX>U.current?"right":"left";H.current=I,U.current=z.clientX}}))})})})})})})});KF.displayName=Pa;var Dpe="MenuGroup",FC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Ye.div,{role:"group",...r,ref:t})});FC.displayName=Dpe;var Lpe="MenuLabel",GF=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Ye.div,{...r,ref:t})});GF.displayName=Lpe;var Km="MenuItem",$M="menu.itemSelect",mg=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=m.useRef(null),i=Kf(Km,e.__scopeMenu),c=DC(Km,e.__scopeMenu),d=wt(t,o),f=m.useRef(!1),h=()=>{const p=o.current;if(!n&&p){const x=new CustomEvent($M,{bubbles:!0,cancelable:!0});p.addEventListener($M,g=>r?.(g),{once:!0}),aN(p,x),x.defaultPrevented?f.current=!1:i.onClose()}};return a.jsx(YF,{...s,ref:d,disabled:n,onClick:Te(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Te(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Te(e.onKeyDown,p=>{const x=c.searchRef.current!=="";n||x&&p.key===" "||B1.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});mg.displayName=Km;var YF=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,i=DC(Km,n),c=UF(n),d=m.useRef(null),f=wt(t,d),[h,p]=m.useState(!1),[x,g]=m.useState("");return m.useEffect(()=>{const j=d.current;j&&g((j.textContent??"").trim())},[o.children]),a.jsx(wf.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:a.jsx(zF,{asChild:!0,...c,focusable:!r,children:a.jsx(Ye.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Te(e.onPointerMove,jf(j=>{r?i.onItemLeave(j):(i.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,jf(j=>i.onItemLeave(j))),onFocus:Te(e.onFocus,()=>p(!0)),onBlur:Te(e.onBlur,()=>p(!1))})})})}),Fpe="MenuCheckboxItem",XF=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return a.jsx(tz,{scope:e.__scopeMenu,checked:n,children:a.jsx(mg,{role:"menuitemcheckbox","aria-checked":Gm(n)?"mixed":n,...s,ref:t,"data-state":BC(n),onSelect:Te(s.onSelect,()=>r?.(Gm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});XF.displayName=Fpe;var QF="MenuRadioGroup",[zpe,Bpe]=El(QF,{value:void 0,onValueChange:()=>{}}),JF=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=Wn(r);return a.jsx(zpe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:a.jsx(FC,{...s,ref:t})})});JF.displayName=QF;var ZF="MenuRadioItem",ez=m.forwardRef((e,t)=>{const{value:n,...r}=e,s=Bpe(ZF,e.__scopeMenu),o=n===s.value;return a.jsx(tz,{scope:e.__scopeMenu,checked:o,children:a.jsx(mg,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":BC(o),onSelect:Te(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ez.displayName=ZF;var zC="MenuItemIndicator",[tz,qpe]=El(zC,{checked:!1}),nz=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=qpe(zC,n);return a.jsx(Gn,{present:r||Gm(o.checked)||o.checked===!0,children:a.jsx(Ye.span,{...s,ref:t,"data-state":BC(o.checked)})})});nz.displayName=zC;var Upe="MenuSeparator",rz=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Ye.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});rz.displayName=Upe;var Wpe="MenuArrow",az=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=hg(n);return a.jsx(pv,{...s,...r,ref:t})});az.displayName=Wpe;var Vpe="MenuSub",[eye,sz]=El(Vpe),Sd="MenuSubTrigger",oz=m.forwardRef((e,t)=>{const n=kl(Sd,e.__scopeMenu),r=Kf(Sd,e.__scopeMenu),s=sz(Sd,e.__scopeMenu),o=DC(Sd,e.__scopeMenu),i=m.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},h=m.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return m.useEffect(()=>h,[h]),m.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),d(null)}},[c,d]),a.jsx(MC,{asChild:!0,...f,children:a.jsx(YF,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":cz(n.open),...e,ref:Pr(t,s.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,jf(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Te(e.onPointerLeave,jf(p=>{h();const x=n.content?.getBoundingClientRect();if(x){const g=n.content?.dataset.side,j=g==="right",b=j?-5:5,y=x[j?"left":"right"],S=x[j?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:x.top},{x:S,y:x.top},{x:S,y:x.bottom},{x:y,y:x.bottom}],side:g}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,p=>{const x=o.searchRef.current!=="";e.disabled||x&&p.key===" "||Cpe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});oz.displayName=Sd;var iz="MenuSubContent",lz=m.forwardRef((e,t)=>{const n=VF(Pa,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=kl(Pa,e.__scopeMenu),i=Kf(Pa,e.__scopeMenu),c=sz(iz,e.__scopeMenu),d=m.useRef(null),f=wt(t,d);return a.jsx(wf.Provider,{scope:e.__scopeMenu,children:a.jsx(Gn,{present:r||o.open,children:a.jsx(wf.Slot,{scope:e.__scopeMenu,children:a.jsx(LC,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:f,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{i.isUsingKeyboardRef.current&&d.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Te(e.onFocusOutside,h=>{h.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,h=>{i.onClose(),h.preventDefault()}),onKeyDown:Te(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),x=_pe[i.dir].includes(h.key);p&&x&&(o.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});lz.displayName=iz;function cz(e){return e?"open":"closed"}function Gm(e){return e==="indeterminate"}function BC(e){return Gm(e)?"indeterminate":e?"checked":"unchecked"}function Hpe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Kpe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Gpe(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=Kpe(e,Math.max(o,0));s.length===1&&(i=i.filter(f=>f!==n));const d=i.find(f=>f.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function Ype(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const c=t[o],d=t[i],f=c.x,h=c.y,p=d.x,x=d.y;h>r!=x>r&&n<(p-f)*(r-h)/(x-h)+f&&(s=!s)}return s}function Xpe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Ype(n,t)}function jf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Qpe=WF,Jpe=MC,Zpe=HF,ehe=KF,the=FC,nhe=GF,rhe=mg,ahe=XF,she=JF,ohe=ez,ihe=nz,lhe=rz,che=az,uhe=oz,dhe=lz,vg="DropdownMenu",[fhe]=hr(vg,[qF]),Or=qF(),[phe,uz]=fhe(vg),dz=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:i,modal:c=!0}=e,d=Or(t),f=m.useRef(null),[h,p]=ha({prop:s,defaultProp:o??!1,onChange:i,caller:vg});return a.jsx(phe,{scope:t,triggerId:nr(),triggerRef:f,contentId:nr(),open:h,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(x=>!x),[p]),modal:c,children:a.jsx(Qpe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};dz.displayName=vg;var fz="DropdownMenuTrigger",pz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=uz(fz,n),i=Or(n);return a.jsx(Jpe,{asChild:!0,...i,children:a.jsx(Ye.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Pr(t,o.triggerRef),onPointerDown:Te(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(o.onOpenToggle(),o.open||c.preventDefault())}),onKeyDown:Te(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&o.onOpenToggle(),c.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});pz.displayName=fz;var hhe="DropdownMenuPortal",hz=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Or(t);return a.jsx(Zpe,{...r,...n})};hz.displayName=hhe;var mz="DropdownMenuContent",vz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=uz(mz,n),o=Or(n),i=m.useRef(!1);return a.jsx(ehe,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,c=>{i.current||s.triggerRef.current?.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!s.modal||h)&&(i.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)"}})});vz.displayName=mz;var mhe="DropdownMenuGroup",vhe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(the,{...s,...r,ref:t})});vhe.displayName=mhe;var ghe="DropdownMenuLabel",gz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(nhe,{...s,...r,ref:t})});gz.displayName=ghe;var xhe="DropdownMenuItem",xz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(rhe,{...s,...r,ref:t})});xz.displayName=xhe;var yhe="DropdownMenuCheckboxItem",yz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(ahe,{...s,...r,ref:t})});yz.displayName=yhe;var bhe="DropdownMenuRadioGroup",whe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(she,{...s,...r,ref:t})});whe.displayName=bhe;var jhe="DropdownMenuRadioItem",bz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(ohe,{...s,...r,ref:t})});bz.displayName=jhe;var She="DropdownMenuItemIndicator",wz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(ihe,{...s,...r,ref:t})});wz.displayName=She;var Nhe="DropdownMenuSeparator",jz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(lhe,{...s,...r,ref:t})});jz.displayName=Nhe;var Che="DropdownMenuArrow",_he=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(che,{...s,...r,ref:t})});_he.displayName=Che;var Ahe="DropdownMenuSubTrigger",Sz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(uhe,{...s,...r,ref:t})});Sz.displayName=Ahe;var Ehe="DropdownMenuSubContent",Nz=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(dhe,{...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)"}})});Nz.displayName=Ehe;var khe=dz,Phe=pz,Ohe=hz,Cz=vz,_z=gz,Az=xz,Ez=yz,kz=bz,Pz=wz,Oz=jz,Tz=Sz,Rz=Nz;const Gf=khe,Yf=Phe,The=m.forwardRef(({className:e,inset:t,children:n,...r},s)=>a.jsxs(Tz,{ref:s,className:je("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(lN,{className:"ml-auto h-4 w-4"})]}));The.displayName=Tz.displayName;const Rhe=m.forwardRef(({className:e,...t},n)=>a.jsx(Rz,{ref:n,className:je("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}));Rhe.displayName=Rz.displayName;const Su=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(Ohe,{children:a.jsx(Cz,{ref:r,sideOffset:t,className:je("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})}));Su.displayName=Cz.displayName;const Hr=m.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(Az,{ref:r,className:je("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}));Hr.displayName=Az.displayName;const Ihe=m.forwardRef(({className:e,children:t,checked:n,...r},s)=>a.jsxs(Ez,{ref:s,className:je("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(Pz,{children:a.jsx(Ac,{className:"h-4 w-4"})})}),t]}));Ihe.displayName=Ez.displayName;const Mhe=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(kz,{ref:r,className:je("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(Pz,{children:a.jsx(C7,{className:"h-2 w-2 fill-current"})})}),t]}));Mhe.displayName=kz.displayName;const Iz=m.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(_z,{ref:r,className:je("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Iz.displayName=_z.displayName;const Mz=m.forwardRef(({className:e,...t},n)=>a.jsx(Oz,{ref:n,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));Mz.displayName=Oz.displayName;function Sf(e,[t,n]){return Math.min(n,Math.max(t,e))}function $he(e){const t=Dhe(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(Fhe);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,{...i,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Dhe(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=Bhe(s),c=zhe(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Pr(r,i):i),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Lhe=Symbol("radix.slottable");function Fhe(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lhe}function zhe(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{const d=o(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Bhe(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 gg(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 qhe=[" ","Enter","ArrowUp","ArrowDown"],Uhe=[" ","Enter"],cl="Select",[xg,yg,Whe]=Cf(cl),[Nu]=hr(cl,[Whe,ui]),bg=ui(),[Vhe,vi]=Nu(cl),[Hhe,Khe]=Nu(cl),$z=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:i,defaultValue:c,onValueChange:d,dir:f,name:h,autoComplete:p,disabled:x,required:g,form:j}=e,b=bg(t),[y,S]=m.useState(null),[C,N]=m.useState(null),[E,A]=m.useState(!1),k=ju(f),[O,T]=ha({prop:r,defaultProp:s??!1,onChange:o,caller:cl}),[$,B]=ha({prop:i,defaultProp:c,onChange:d,caller:cl}),q=m.useRef(null),F=y?j||!!y.closest("form"):!0,[H,U]=m.useState(new Set),R=Array.from(H).map(W=>W.props.value).join(";");return a.jsx(dv,{...b,children:a.jsxs(Vhe,{required:g,scope:t,trigger:y,onTriggerChange:S,valueNode:C,onValueNodeChange:N,valueNodeHasChildren:E,onValueNodeHasChildrenChange:A,contentId:nr(),value:$,onValueChange:B,open:O,onOpenChange:T,dir:k,triggerPointerDownPosRef:q,disabled:x,children:[a.jsx(xg.Provider,{scope:t,children:a.jsx(Hhe,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(W=>{U(X=>new Set(X).add(W))},[]),onNativeOptionRemove:m.useCallback(W=>{U(X=>{const G=new Set(X);return G.delete(W),G})},[]),children:n})}),F?a.jsxs(oB,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:p,value:$,onChange:W=>B(W.target.value),disabled:x,form:j,children:[$===void 0?a.jsx("option",{value:""}):null,Array.from(H)]},R):null]})})};$z.displayName=cl;var Dz="SelectTrigger",Lz=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=bg(n),i=vi(Dz,n),c=i.disabled||r,d=wt(t,i.onTriggerChange),f=yg(n),h=m.useRef("touch"),[p,x,g]=lB(b=>{const y=f().filter(N=>!N.disabled),S=y.find(N=>N.value===i.value),C=cB(y,b,S);C!==void 0&&i.onValueChange(C.value)}),j=b=>{c||(i.onOpenChange(!0),g()),b&&(i.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return a.jsx(Ef,{asChild:!0,...o,children:a.jsx(Ye.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":iB(i.value)?"":void 0,...s,ref:d,onClick:Te(s.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&j(b)}),onPointerDown:Te(s.onPointerDown,b=>{h.current=b.pointerType;const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:Te(s.onKeyDown,b=>{const y=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&x(b.key),!(y&&b.key===" ")&&qhe.includes(b.key)&&(j(),b.preventDefault())})})})});Lz.displayName=Dz;var Fz="SelectValue",zz=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:i="",...c}=e,d=vi(Fz,n),{onValueNodeHasChildrenChange:f}=d,h=o!==void 0,p=wt(t,d.onValueNodeChange);return rr(()=>{f(h)},[f,h]),a.jsx(Ye.span,{...c,ref:p,style:{pointerEvents:"none"},children:iB(d.value)?a.jsx(a.Fragment,{children:i}):o})});zz.displayName=Fz;var Ghe="SelectIcon",Bz=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(Ye.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});Bz.displayName=Ghe;var Yhe="SelectPortal",qz=e=>a.jsx(yl,{asChild:!0,...e});qz.displayName=Yhe;var ul="SelectContent",Uz=m.forwardRef((e,t)=>{const n=vi(ul,e.__scopeSelect),[r,s]=m.useState();if(rr(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?iu.createPortal(a.jsx(Wz,{scope:e.__scopeSelect,children:a.jsx(xg.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),o):null}return a.jsx(Vz,{...e,ref:t})});Uz.displayName=ul;var Ha=10,[Wz,gi]=Nu(ul),Xhe="SelectContentImpl",Qhe=$he("SelectContent.RemoveScroll"),Vz=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:x,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:y,...S}=e,C=vi(ul,n),[N,E]=m.useState(null),[A,k]=m.useState(null),O=wt(t,V=>E(V)),[T,$]=m.useState(null),[B,q]=m.useState(null),F=yg(n),[H,U]=m.useState(!1),R=m.useRef(!1);m.useEffect(()=>{if(N)return Nv(N)},[N]),jv();const W=m.useCallback(V=>{const[ue,...Q]=F().map(ae=>ae.ref.current),[Z]=Q.slice(-1),fe=document.activeElement;for(const ae of V)if(ae===fe||(ae?.scrollIntoView({block:"nearest"}),ae===ue&&A&&(A.scrollTop=0),ae===Z&&A&&(A.scrollTop=A.scrollHeight),ae?.focus(),document.activeElement!==fe))return},[F,A]),X=m.useCallback(()=>W([T,N]),[W,T,N]);m.useEffect(()=>{H&&X()},[H,X]);const{onOpenChange:G,triggerPointerDownPosRef:z}=C;m.useEffect(()=>{if(N){let V={x:0,y:0};const ue=Z=>{V={x:Math.abs(Math.round(Z.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(z.current?.y??0))}},Q=Z=>{V.x<=10&&V.y<=10?Z.preventDefault():N.contains(Z.target)||G(!1),document.removeEventListener("pointermove",ue),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",Q,{capture:!0})}}},[N,G,z]),m.useEffect(()=>{const V=()=>G(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[G]);const[J,D]=lB(V=>{const ue=F().filter(fe=>!fe.disabled),Q=ue.find(fe=>fe.ref.current===document.activeElement),Z=cB(ue,V,Q);Z&&setTimeout(()=>Z.ref.current.focus())}),I=m.useCallback((V,ue,Q)=>{const Z=!R.current&&!Q;(C.value!==void 0&&C.value===ue||Z)&&($(V),Z&&(R.current=!0))},[C.value]),ne=m.useCallback(()=>N?.focus(),[N]),te=m.useCallback((V,ue,Q)=>{const Z=!R.current&&!Q;(C.value!==void 0&&C.value===ue||Z)&&q(V)},[C.value]),de=r==="popper"?q1:Hz,he=de===q1?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:x,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:y}:{};return a.jsx(Wz,{scope:n,content:N,viewport:A,onViewportChange:k,itemRefCallback:I,selectedItem:T,onItemLeave:ne,itemTextRefCallback:te,focusSelectedItem:X,selectedItemText:B,position:r,isPositioned:H,searchRef:J,children:a.jsx(Of,{as:Qhe,allowPinchZoom:!0,children:a.jsx(Pf,{asChild:!0,trapped:C.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:Te(s,V=>{C.trigger?.focus({preventScroll:!0}),V.preventDefault()}),children:a.jsx(xl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:a.jsx(de,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:V=>V.preventDefault(),...S,...he,onPlaced:()=>U(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Te(S.onKeyDown,V=>{const ue=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!ue&&V.key.length===1&&D(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let Z=F().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(V.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const fe=V.target,ae=Z.indexOf(fe);Z=Z.slice(ae+1)}setTimeout(()=>W(Z)),V.preventDefault()}})})})})})})});Vz.displayName=Xhe;var Jhe="SelectItemAlignedPosition",Hz=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=vi(ul,n),i=gi(ul,n),[c,d]=m.useState(null),[f,h]=m.useState(null),p=wt(t,O=>h(O)),x=yg(n),g=m.useRef(!1),j=m.useRef(!0),{viewport:b,selectedItem:y,selectedItemText:S,focusSelectedItem:C}=i,N=m.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&f&&b&&y&&S){const O=o.trigger.getBoundingClientRect(),T=f.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),B=S.getBoundingClientRect();if(o.dir!=="rtl"){const fe=B.left-T.left,ae=$.left-fe,Re=O.left-ae,_e=O.width+Re,Me=Math.max(_e,T.width),L=window.innerWidth-Ha,oe=Sf(ae,[Ha,Math.max(Ha,L-Me)]);c.style.minWidth=_e+"px",c.style.left=oe+"px"}else{const fe=T.right-B.right,ae=window.innerWidth-$.right-fe,Re=window.innerWidth-O.right-ae,_e=O.width+Re,Me=Math.max(_e,T.width),L=window.innerWidth-Ha,oe=Sf(ae,[Ha,Math.max(Ha,L-Me)]);c.style.minWidth=_e+"px",c.style.right=oe+"px"}const q=x(),F=window.innerHeight-Ha*2,H=b.scrollHeight,U=window.getComputedStyle(f),R=parseInt(U.borderTopWidth,10),W=parseInt(U.paddingTop,10),X=parseInt(U.borderBottomWidth,10),G=parseInt(U.paddingBottom,10),z=R+W+H+G+X,J=Math.min(y.offsetHeight*5,z),D=window.getComputedStyle(b),I=parseInt(D.paddingTop,10),ne=parseInt(D.paddingBottom,10),te=O.top+O.height/2-Ha,de=F-te,he=y.offsetHeight/2,V=y.offsetTop+he,ue=R+W+V,Q=z-ue;if(ue<=te){const fe=q.length>0&&y===q[q.length-1].ref.current;c.style.bottom="0px";const ae=f.clientHeight-b.offsetTop-b.offsetHeight,Re=Math.max(de,he+(fe?ne:0)+ae+X),_e=ue+Re;c.style.height=_e+"px"}else{const fe=q.length>0&&y===q[0].ref.current;c.style.top="0px";const Re=Math.max(te,R+b.offsetTop+(fe?I:0)+he)+Q;c.style.height=Re+"px",b.scrollTop=ue-te+b.offsetTop}c.style.margin=`${Ha}px 0`,c.style.minHeight=J+"px",c.style.maxHeight=F+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[x,o.trigger,o.valueNode,c,f,b,y,S,o.dir,r]);rr(()=>N(),[N]);const[E,A]=m.useState();rr(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const k=m.useCallback(O=>{O&&j.current===!0&&(N(),C?.(),j.current=!1)},[N,C]);return a.jsx(eme,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:k,children:a.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:a.jsx(Ye.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Hz.displayName=Jhe;var Zhe="SelectPopperPosition",q1=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ha,...o}=e,i=bg(n);return a.jsx(fv,{...i,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});q1.displayName=Zhe;var[eme,qC]=Nu(ul,{}),U1="SelectViewport",Kz=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=gi(U1,n),i=qC(U1,n),c=wt(t,o.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(xg.Slot,{scope:n,children:a.jsx(Ye.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Te(s.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:x}=i;if(x?.current&&p){const g=Math.abs(d.current-h.scrollTop);if(g>0){const j=window.innerHeight-Ha*2,b=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),S=Math.max(b,y);if(S<j){const C=S+g,N=Math.min(j,C),E=C-N;p.style.height=N+"px",p.style.bottom==="0px"&&(h.scrollTop=E>0?E:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});Kz.displayName=U1;var Gz="SelectGroup",[tme,nme]=Nu(Gz),rme=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=nr();return a.jsx(tme,{scope:n,id:s,children:a.jsx(Ye.div,{role:"group","aria-labelledby":s,...r,ref:t})})});rme.displayName=Gz;var Yz="SelectLabel",Xz=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=nme(Yz,n);return a.jsx(Ye.div,{id:s.id,...r,ref:t})});Xz.displayName=Yz;var Ym="SelectItem",[ame,Qz]=Nu(Ym),Jz=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...i}=e,c=vi(Ym,n),d=gi(Ym,n),f=c.value===r,[h,p]=m.useState(o??""),[x,g]=m.useState(!1),j=wt(t,C=>d.itemRefCallback?.(C,r,s)),b=nr(),y=m.useRef("touch"),S=()=>{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(ame,{scope:n,value:r,disabled:s,textId:b,isSelected:f,onItemTextChange:m.useCallback(C=>{p(N=>N||(C?.textContent??"").trim())},[]),children:a.jsx(xg.ItemSlot,{scope:n,value:r,disabled:s,textValue:h,children:a.jsx(Ye.div,{role:"option","aria-labelledby":b,"data-highlighted":x?"":void 0,"aria-selected":f&&x,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:j,onFocus:Te(i.onFocus,()=>g(!0)),onBlur:Te(i.onBlur,()=>g(!1)),onClick:Te(i.onClick,()=>{y.current!=="mouse"&&S()}),onPointerUp:Te(i.onPointerUp,()=>{y.current==="mouse"&&S()}),onPointerDown:Te(i.onPointerDown,C=>{y.current=C.pointerType}),onPointerMove:Te(i.onPointerMove,C=>{y.current=C.pointerType,s?d.onItemLeave?.():y.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(i.onPointerLeave,C=>{C.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Te(i.onKeyDown,C=>{d.searchRef?.current!==""&&C.key===" "||(Uhe.includes(C.key)&&S(),C.key===" "&&C.preventDefault())})})})})});Jz.displayName=Ym;var Nd="SelectItemText",Zz=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,i=vi(Nd,n),c=gi(Nd,n),d=Qz(Nd,n),f=Khe(Nd,n),[h,p]=m.useState(null),x=wt(t,S=>p(S),d.onItemTextChange,S=>c.itemTextRefCallback?.(S,d.value,d.disabled)),g=h?.textContent,j=m.useMemo(()=>a.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=f;return rr(()=>(b(j),()=>y(j)),[b,y,j]),a.jsxs(a.Fragment,{children:[a.jsx(Ye.span,{id:d.textId,...o,ref:x}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?iu.createPortal(o.children,i.valueNode):null]})});Zz.displayName=Nd;var eB="SelectItemIndicator",tB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Qz(eB,n).isSelected?a.jsx(Ye.span,{"aria-hidden":!0,...r,ref:t}):null});tB.displayName=eB;var W1="SelectScrollUpButton",nB=m.forwardRef((e,t)=>{const n=gi(W1,e.__scopeSelect),r=qC(W1,e.__scopeSelect),[s,o]=m.useState(!1),i=wt(t,r.onScrollButtonChange);return rr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollTop>0;o(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?a.jsx(aB,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});nB.displayName=W1;var V1="SelectScrollDownButton",rB=m.forwardRef((e,t)=>{const n=gi(V1,e.__scopeSelect),r=qC(V1,e.__scopeSelect),[s,o]=m.useState(!1),i=wt(t,r.onScrollButtonChange);return rr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<f;o(h)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?a.jsx(aB,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});rB.displayName=V1;var aB=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=gi("SelectScrollButton",n),i=m.useRef(null),c=yg(n),d=m.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return m.useEffect(()=>()=>d(),[d]),rr(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),a.jsx(Ye.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Te(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:Te(s.onPointerMove,()=>{o.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:Te(s.onPointerLeave,()=>{d()})})}),sme="SelectSeparator",sB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(Ye.div,{"aria-hidden":!0,...r,ref:t})});sB.displayName=sme;var H1="SelectArrow",ome=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=bg(n),o=vi(H1,n),i=gi(H1,n);return o.open&&i.position==="popper"?a.jsx(pv,{...s,...r,ref:t}):null});ome.displayName=H1;var ime="SelectBubbleInput",oB=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=m.useRef(null),o=wt(r,s),i=gg(t);return m.useEffect(()=>{const c=s.current;if(!c)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&h){const p=new Event("change",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[i,t]),a.jsx(Ye.select,{...n,style:{...A$,...n.style},ref:o,defaultValue:t})});oB.displayName=ime;function iB(e){return e===""||e===void 0}function lB(e){const t=Wn(e),n=m.useRef(""),r=m.useRef(0),s=m.useCallback(i=>{const c=n.current+i;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function cB(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=lme(e,Math.max(o,0));s.length===1&&(i=i.filter(f=>f!==n));const d=i.find(f=>f.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function lme(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cme=$z,uB=Lz,ume=zz,dme=Bz,fme=qz,dB=Uz,pme=Kz,fB=Xz,pB=Jz,hme=Zz,mme=tB,hB=nB,mB=rB,vB=sB;const wn=cme,jn=ume,hn=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(uB,{ref:r,className:je("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(dme,{asChild:!0,children:a.jsx(Yt,{className:"h-4 w-4 opacity-50"})})]}));hn.displayName=uB.displayName;const gB=m.forwardRef(({className:e,...t},n)=>a.jsx(hB,{ref:n,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(ws,{className:"h-4 w-4"})}));gB.displayName=hB.displayName;const xB=m.forwardRef(({className:e,...t},n)=>a.jsx(mB,{ref:n,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Yt,{className:"h-4 w-4"})}));xB.displayName=mB.displayName;const mn=m.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>a.jsx(fme,{children:a.jsxs(dB,{ref:s,className:je("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(gB,{}),a.jsx(pme,{className:je("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(xB,{})]})}));mn.displayName=dB.displayName;const vme=m.forwardRef(({className:e,...t},n)=>a.jsx(fB,{ref:n,className:je("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));vme.displayName=fB.displayName;const tt=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(pB,{ref:r,className:je("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(mme,{children:a.jsx(Ac,{className:"h-4 w-4"})})}),a.jsx(hme,{children:t})]}));tt.displayName=pB.displayName;const gme=m.forwardRef(({className:e,...t},n)=>a.jsx(vB,{ref:n,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));gme.displayName=vB.displayName;const Ko=e=>e.configName?.trim()||e.name,xme="(root)",yB="__ROOT__",DM="mcplab.configurations.collapsedSuites",$j=e=>e.suitePath&&e.suitePath.trim().length>0?e.suitePath.trim():null,Di=e=>e??xme,Dj=e=>e===null?yB:`suite:${e}`,yme=e=>e===yB?null:e.startsWith("suite:")?e.slice(6):null,bme=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},wme=e=>bme([e]),jme=e=>{const t=wme(e);return t?{href:`/results?scenario=${encodeURIComponent(t)}`,tooltipLabel:`Open results filtered by scenario ${t}`}:{href:"/results",tooltipLabel:"Open results"}},LM=["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 Sme(e){if(e===null)return"bg-slate-400";const t=e.split("").reduce((n,r)=>(n+r.charCodeAt(0))%LM.length,0);return LM[t]??"bg-slate-400"}const Nme=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:s}=Mf(),{source:o}=Dn(),i=Ia(),[c,d]=m.useState("name"),[f,h]=m.useState("asc"),[p,x]=m.useState(""),[g,j]=m.useState("all"),[b,y]=m.useState(()=>{try{const D=window.localStorage.getItem(DM);if(!D)return new Set;const I=JSON.parse(D);return Array.isArray(I)?new Set(I.filter(ne=>typeof ne=="string")):new Set}catch(D){return console.warn("Failed to restore collapsed suites from localStorage",D),new Set}}),[S,C]=m.useState(new Set),[N,E]=m.useState(new Set),[A,k]=m.useState(new Set),O=p.trim().toLowerCase(),T=D=>{if(c===D){h(I=>I==="asc"?"desc":"asc");return}d(D),h(D==="updatedAt"?"desc":"asc")};m.useEffect(()=>{s();const D=()=>{s()};return window.addEventListener("focus",D),()=>{window.removeEventListener("focus",D)}},[s]);const $=async(D,I)=>{await t(D),Ae({title:"Deleted",description:`"${I}" has been removed.`})},B=async D=>{const I=await n(D);Ae({title:"Cloned",description:`Created "${Ko(I)}".`}),i(`/mcp-evaluations/${I.id}`)},q=D=>D.agentEntries?.length??D.agents?.length??0,F=D=>D.scenarioEntries?.length??D.scenarios?.length??0,H=m.useMemo(()=>{const D=new Set;for(const I of e)D.add($j(I));return Array.from(D).sort((I,ne)=>Di(I).localeCompare(Di(ne)))},[e]),U=m.useMemo(()=>e.filter(D=>{const I=$j(D),ne=g==="all"?void 0:yme(g),te=Di(I);return ne!==void 0&&I!==ne?!1:O.length===0?!0:[Ko(D),D.id,D.description??"",D.loadError??"",te,D.relativePath??""].join(" ").toLowerCase().includes(O)}),[e,O,g]),R=m.useMemo(()=>[...U].sort((I,ne)=>{let te=0;return c==="name"&&(te=Ko(I).localeCompare(Ko(ne))),c==="scenarios"&&(te=F(I)-F(ne)),c==="agents"&&(te=q(I)-q(ne)),c==="updatedAt"&&(te=new Date(I.updatedAt).getTime()-new Date(ne.updatedAt).getTime()),f==="asc"?te:-te}),[U,c,f]),W=D=>c!==D?a.jsx(gc,{className:"h-3.5 w-3.5 text-muted-foreground"}):f==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}),X=D=>{y(I=>{const ne=new Set(I);return ne.has(D)?ne.delete(D):ne.add(D),ne})},G=async(D,I,ne)=>{if(!N.has(D)){E(te=>new Set(te).add(D));try{await o.startRun({configPath:I,runsPerScenario:1,applySnapshotEval:!0}),C(te=>new Set(te).add(D)),window.setTimeout(()=>{C(te=>{const de=new Set(te);return de.delete(D),de})},2e3),Ae({title:"Queued",description:`"${ne}" added to run queue.`})}catch(te){Ae({title:"Could not queue evaluation",description:te instanceof Error?te.message:String(te),variant:"destructive"})}finally{E(te=>{const de=new Set(te);return de.delete(D),de})}}};m.useEffect(()=>{try{window.localStorage.setItem(DM,JSON.stringify(Array.from(b)))}catch(D){console.warn("Failed to persist collapsed suites to localStorage (quota/private mode?)",D)}},[b]);const z=async(D,I,ne)=>{if(!A.has(D)){k(te=>new Set(te).add(D));try{const te=ne.filter(Z=>typeof Z.sourcePath=="string"&&Z.sourcePath.trim().length>0);if(te.length===0){Ae({title:"No runnable evaluations",description:`Suite "${I}" has no evaluation files with a source path.`,variant:"destructive"});return}const de=await Promise.allSettled(te.map(Z=>o.startRun({configPath:String(Z.sourcePath),runsPerScenario:1,applySnapshotEval:!0}))),he=de.filter(Z=>Z.status==="fulfilled").length,V=de.length-he,ue=de.find(Z=>Z.status==="rejected"),Q=ue?ue.reason instanceof Error?ue.reason.message:String(ue.reason):void 0;Ae({title:V===0?"Suite queued":"Suite queued with errors",description:V===0?`Queued ${he} evaluation${he===1?"":"s"} for suite "${I}".`:`Queued ${he}/${te.length} evaluations for suite "${I}" (${V} failed${Q?`: ${Q}`:""}).`,variant:V===0?"default":"destructive"})}catch(te){Ae({title:"Could not queue suite",description:te instanceof Error?te.message:String(te),variant:"destructive"})}finally{k(te=>{const de=new Set(te);return de.delete(D),de})}}},J=m.useMemo(()=>{const D=new Map;for(const I of R){const ne=$j(I),te=D.get(ne);te?te.push(I):D.set(ne,[I])}return Array.from(D.entries()).sort((I,ne)=>Di(I[0]).localeCompare(Di(ne[0])))},[R]);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(Z$,{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(IC,{value:p,onValueChange:x,placeholder:"Search evaluations..."}),a.jsxs(wn,{value:g,onValueChange:j,children:[a.jsx(hn,{className:"h-9 w-[200px]",children:a.jsx(jn,{placeholder:"All suites"})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"all",children:"All suites"}),H.map(D=>a.jsx(tt,{value:Dj(D),children:Di(D)},Dj(D)))]})]}),a.jsxs(se,{variant:"outline",size:"sm",onClick:()=>{s()},children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(se,{variant:"outline",size:"sm",children:[a.jsx(F7,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),a.jsx(se,{size:"sm",asChild:!0,children:a.jsxs(_t,{to:"/mcp-evaluations/new",children:[a.jsx(io,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),a.jsx(Ve,{children:a.jsx(He,{className:"p-0",children:a.jsxs(qr,{children:[a.jsx(Ur,{children:a.jsxs(Gt,{children:[a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>T("name"),children:["Name",W("name")]})}),a.jsx(at,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>T("scenarios"),children:["Scenarios",W("scenarios")]})}),a.jsx(at,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>T("agents"),children:["Agents",W("agents")]})}),a.jsx(at,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>T("updatedAt"),children:["Last Updated",W("updatedAt")]})}),a.jsx(at,{className:"w-[220px] text-right"})]})}),a.jsxs(Wr,{children:[J.map(([D,I])=>{const ne=Di(D),te=Dj(D),de=b.has(te),he=A.has(te);return a.jsxs(m.Fragment,{children:[a.jsx(Gt,{className:"bg-muted/40 hover:bg-muted/40",children:a.jsx(Ue,{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:()=>X(te),"aria-expanded":!de,"aria-label":`${de?"Expand":"Collapse"} suite ${ne}`,children:[a.jsx(lN,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${de?"":"rotate-90"}`,"aria-hidden":"true"}),a.jsx("span",{className:`h-2 w-2 rounded-full ${Sme(D)}`,"aria-hidden":"true"}),D===null?a.jsx(P7,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}):a.jsx(E7,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),a.jsx("span",{className:"font-medium",children:ne}),a.jsxs("span",{className:"text-muted-foreground",children:["(",I.length,")"]})]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:he,onClick:()=>{z(te,ne,I)},children:[a.jsx(to,{className:"mr-1 h-3.5 w-3.5"}),he?"Queueing...":"Run Suite"]})]})})},`suite-${te}`),!de&&I.map(V=>{const ue=jme(V);return a.jsxs(Gt,{children:[a.jsx(Ue,{children:a.jsxs("div",{children:[a.jsx(_t,{to:`/mcp-evaluations/${V.id}`,className:"font-medium text-sm hover:text-primary",children:Ko(V)}),V.loadError&&a.jsxs(We,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[a.jsx(Ph,{className:"mr-1 h-3 w-3"}),"Broken"]}),V.relativePath&&a.jsx("div",{className:"mt-0.5",children:a.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:V.relativePath})}),V.loadError&&a.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:V.loadError})]})}),a.jsx(Ue,{className:"text-right font-mono text-sm",children:F(V)}),a.jsx(Ue,{className:"text-right font-mono text-sm",children:q(V)}),a.jsx(Ue,{className:"text-right text-xs text-muted-foreground",children:a.jsxs("div",{className:"inline-flex items-center gap-1",children:[a.jsx(mo,{className:"h-3 w-3"}),new Date(V.updatedAt).toLocaleDateString()]})}),a.jsx(Ue,{className:"w-[220px] whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsxs(Gf,{children:[a.jsx(Yf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(av,{className:"h-4 w-4"})})}),a.jsxs(Su,{align:"end",children:[a.jsxs(Hr,{onClick:()=>i(`/mcp-evaluations/${V.id}`),children:[a.jsx(sv,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),a.jsxs(Hr,{onClick:()=>{B(V.id)},children:[a.jsx(_s,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),a.jsxs(Hr,{className:"text-destructive",onClick:()=>{$(V.id,Ko(V))},children:[a.jsx(Ta,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]}),a.jsx(ai,{children:a.jsxs(si,{children:[a.jsx(oi,{asChild:!0,children:a.jsx(se,{size:"icon",variant:"outline",className:"h-8 w-8",asChild:!0,"aria-label":ue.tooltipLabel,children:a.jsxs(_t,{to:ue.href,children:[a.jsx(_c,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"sr-only",children:ue.tooltipLabel})]})})}),a.jsx(uo,{children:ue.tooltipLabel})]})}),a.jsx(ai,{children:a.jsxs(si,{children:[a.jsx(oi,{asChild:!0,children:a.jsx(se,{size:"sm",variant:"outline",className:`h-8 px-2 text-xs ${S.has(V.id)?"border-green-600 bg-green-600 text-white hover:bg-green-700 hover:text-white":""}`,disabled:N.has(V.id)||!V.sourcePath,onClick:()=>V.sourcePath&&void G(V.id,V.sourcePath,Ko(V)),"aria-label":`Queue ${Ko(V)}`,children:S.has(V.id)?"Queued":N.has(V.id)?"Queueing...":a.jsxs(a.Fragment,{children:[a.jsx(R7,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"sr-only",children:"Queue evaluation"})]})})}),a.jsx(uo,{children:"Queue evaluation run"})]})}),a.jsx(se,{size:"sm",variant:"outline",asChild:!0,children:a.jsxs(_t,{to:`/run?configId=${encodeURIComponent(V.id)}`,children:[a.jsx(to,{className:"h-3.5 w-3.5"}),"Run"]})})]})})]},V.id)})]},`suite-group-${te}`)}),!r&&e.length===0&&a.jsx(Gt,{children:a.jsx(Ue,{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&&R.length===0&&a.jsx(Gt,{children:a.jsx(Ue,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations match this filter."})}),r&&a.jsx(Gt,{children:a.jsx(Ue,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Cme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_me=Cme.reduce((e,t)=>{const n=wv(`Primitive.${t}`),r=m.forwardRef((s,o)=>{const{asChild:i,...c}=s,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ame="Label",bB=m.forwardRef((e,t)=>a.jsx(_me.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));bB.displayName=Ame;var wB=bB;const Eme=bl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Fe=m.forwardRef(({className:e,...t},n)=>a.jsx(wB,{ref:n,className:je(Eme(),e),...t}));Fe.displayName=wB.displayName;const Os=m.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:je("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}));Os.displayName="Textarea";var wg="Switch",[kme]=hr(wg),[Pme,Ome]=kme(wg),jB=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:i,disabled:c,value:d="on",onCheckedChange:f,form:h,...p}=e,[x,g]=m.useState(null),j=wt(t,N=>g(N)),b=m.useRef(!1),y=x?h||!!x.closest("form"):!0,[S,C]=ha({prop:s,defaultProp:o??!1,onChange:f,caller:wg});return a.jsxs(Pme,{scope:n,checked:S,disabled:c,children:[a.jsx(Ye.button,{type:"button",role:"switch","aria-checked":S,"aria-required":i,"data-state":_B(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:Te(e.onClick,N=>{C(E=>!E),y&&(b.current=N.isPropagationStopped(),b.current||N.stopPropagation())})}),y&&a.jsx(CB,{control:x,bubbles:!b.current,name:r,value:d,checked:S,required:i,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});jB.displayName=wg;var SB="SwitchThumb",NB=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=Ome(SB,n);return a.jsx(Ye.span,{"data-state":_B(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});NB.displayName=SB;var Tme="SwitchBubbleInput",CB=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const i=m.useRef(null),c=wt(i,o),d=gg(n),f=uv(t);return m.useEffect(()=>{const h=i.current;if(!h)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&g){const j=new Event("click",{bubbles:r});g.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}})});CB.displayName=Tme;function _B(e){return e?"checked":"unchecked"}var AB=jB,Rme=NB;const Xm=m.forwardRef(({className:e,...t},n)=>a.jsx(AB,{className:je("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(Rme,{className:je("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")})}));Xm.displayName=AB.displayName;var jg="Tabs",[Ime]=hr(jg,[pg]),EB=pg(),[Mme,UC]=Ime(jg),kB=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=ju(c),[p,x]=ha({prop:r,onChange:s,defaultProp:o??"",caller:jg});return a.jsx(Mme,{scope:n,baseId:nr(),value:p,onValueChange:x,orientation:i,dir:h,activationMode:d,children:a.jsx(Ye.div,{dir:h,"data-orientation":i,...f,ref:t})})});kB.displayName=jg;var PB="TabsList",OB=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=UC(PB,n),i=EB(n);return a.jsx(FF,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:a.jsx(Ye.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});OB.displayName=PB;var TB="TabsTrigger",RB=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,i=UC(TB,n),c=EB(n),d=$B(i.baseId,r),f=DB(i.baseId,r),h=r===i.value;return a.jsx(zF,{asChild:!0,...c,focusable:!s,active:h,children:a.jsx(Ye.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,...o,ref:t,onMouseDown:Te(e.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?i.onValueChange(r):p.preventDefault()}),onKeyDown:Te(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(r)}),onFocus:Te(e.onFocus,()=>{const p=i.activationMode!=="manual";!h&&!s&&p&&i.onValueChange(r)})})})});RB.displayName=TB;var IB="TabsContent",MB=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...i}=e,c=UC(IB,n),d=$B(c.baseId,r),f=DB(c.baseId,r),h=r===c.value,p=m.useRef(h);return m.useEffect(()=>{const x=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(x)},[]),a.jsx(Gn,{present:s||h,children:({present:x})=>a.jsx(Ye.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!x,id:f,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:x&&o})})});MB.displayName=IB;function $B(e,t){return`${e}-trigger-${t}`}function DB(e,t){return`${e}-content-${t}`}var $me=kB,LB=OB,FB=RB,zB=MB;const Sg=$me,Xf=m.forwardRef(({className:e,...t},n)=>a.jsx(LB,{ref:n,className:je("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Xf.displayName=LB.displayName;const Cs=m.forwardRef(({className:e,...t},n)=>a.jsx(FB,{ref:n,className:je("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}));Cs.displayName=FB.displayName;const Nf=m.forwardRef(({className:e,...t},n)=>a.jsx(zB,{ref:n,className:je("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Nf.displayName=zB.displayName;const Dme={openai:"OpenAI",anthropic:"Anthropic",azure:"Azure OpenAI",azure_openai:"Azure OpenAI",google:"Google"};function Qm(e){return Dme[e]??e}const FM={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 BB({provider:e}){return a.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${FM[e]??FM.custom}`,children:Qm(e)})}var Ng="Collapsible",[Lme]=hr(Ng),[Fme,WC]=Lme(Ng),qB=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:i,...c}=e,[d,f]=ha({prop:r,defaultProp:s??!1,onChange:i,caller:Ng});return a.jsx(Fme,{scope:n,disabled:o,contentId:nr(),open:d,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),children:a.jsx(Ye.div,{"data-state":HC(d),"data-disabled":o?"":void 0,...c,ref:t})})});qB.displayName=Ng;var UB="CollapsibleTrigger",WB=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=WC(UB,n);return a.jsx(Ye.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":HC(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Te(e.onClick,s.onOpenToggle)})});WB.displayName=UB;var VC="CollapsibleContent",VB=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=WC(VC,e.__scopeCollapsible);return a.jsx(Gn,{present:n||s.open,children:({present:o})=>a.jsx(zme,{...r,ref:t,present:o})})});VB.displayName=VC;var zme=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=e,i=WC(VC,n),[c,d]=m.useState(r),f=m.useRef(null),h=wt(t,f),p=m.useRef(0),x=p.current,g=m.useRef(0),j=g.current,b=i.open||c,y=m.useRef(b),S=m.useRef(void 0);return m.useEffect(()=>{const C=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(C)},[]),rr(()=>{const C=f.current;if(C){S.current=S.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const N=C.getBoundingClientRect();p.current=N.height,g.current=N.width,y.current||(C.style.transitionDuration=S.current.transitionDuration,C.style.animationName=S.current.animationName),d(r)}},[i.open,r]),a.jsx(Ye.div,{"data-state":HC(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!b,...o,ref:h,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:b&&s})});function HC(e){return e?"open":"closed"}var Bme=qB;const Xa=Bme,_a=WB,Qa=VB;function Oa({text:e,variant:t="assistant",className:n}){const r=qme(e);return a.jsx("div",{className:je("space-y-2",t==="system"&&"text-xs",n),children:r.map((s,o)=>a.jsx(m.Fragment,{children:Ume(s,o,t)},`md-${o}`))})}function qme(e){const t=e.replace(/\r\n/g,`
|
|
121
|
-
`).split(`
|
|
122
|
-
`),n=[];let r=0;const s=i=>i.trim()==="",o=i=>i.trimStart().startsWith("```");for(;r<t.length;){const i=t[r],c=i.trim();if(s(i)){r+=1;continue}if(o(i)){const x=c.replace(/^```/,"").trim()||void 0;r+=1;const g=[];for(;r<t.length&&!o(t[r]);)g.push(t[r]),r+=1;r<t.length&&o(t[r])&&(r+=1),n.push({type:"code",lang:x,code:g.join(`
|
|
123
|
-
`)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const x=[];for(;r<t.length&&t[r].trim().startsWith(">");)x.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:x.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(zM(t,r)){const x=BM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!s(t[r]);)g.push(BM(t[r])),r+=1;n.push({type:"table",headers:x,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const x=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(x?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(x?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}s(t[r])&&(r+=1);break}n.push({type:"list",ordered:x,items:g});continue}const p=[i];for(r+=1;r<t.length;){const x=t[r],g=x.trim();if(s(x)||o(x)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||g.startsWith(">")||zM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(x),r+=1}n.push({type:"paragraph",text:p.join(`
|
|
125
|
-
`)})}return n}function zM(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 BM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function Ume(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:sc(e.text,`${t}-h`)})}if(e.type==="paragraph")return a.jsx("p",{className:je("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:sc(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:sc(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:je("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((s,o)=>a.jsx("li",{className:"leading-relaxed",children:sc(s,`${t}-li-${o}`)},`${t}-li-${o}`))})}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:sc(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((o,i)=>a.jsx("td",{className:"px-2 py-1.5 align-top",children:sc(o,`${t}-tdc-${s}-${i}`)},`${t}-td-${s}-${i}`))},`${t}-row-${s}`))})]})}):null}function sc(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 o=r.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return o?a.jsx("a",{href:o[2],target:"_blank",rel:"noreferrer",className:"underline underline-offset-2",children:o[1]},`${t}-${s}`):a.jsx(m.Fragment,{children:r},`${t}-${s}`)})}function HB({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:je("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(Ja,{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:je("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(uN,{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(Oa,{text:e.text,variant:"assistant"})})]});const o=s==="user",i=o?Ec:kr;return a.jsxs("div",{className:je(`flex items-start gap-2 text-xs ${o?"justify-end":"justify-start"}`,t),children:[!o&&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(i,{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 ${o?"border-primary/20 bg-primary/10":"border-border/80 bg-background shadow-sm"}`,children:[!o&&n&&a.jsx("p",{className:"mb-2 text-[11px] font-semibold text-muted-foreground",children:n}),o?a.jsx("p",{className:"whitespace-pre-wrap",children:e.text}):a.jsx(Oa,{text:e.text,variant:"assistant",className:"text-sm"})]}),r]}),o&&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(Ec,{className:"h-3 w-3"})})]})}function K1({call:e,loading:t=!1,onApprove:n,onDeny:r,defaultOpen:s,className:o,description:i}){const c=e.status==="pending",d=e.tool||e.publicToolName||"unknown_tool";return a.jsxs("details",{open:s??c,className:je("group overflow-hidden rounded-md border border-border/60 bg-background",o),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(Ja,{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(Yt,{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:[i&&a.jsx(Oa,{text:i,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(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:t,onClick:()=>r?.(e.id),children:"Deny"}),a.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:t,onClick:()=>n?.(e.id),children:"Approve"})]})]})]})}function KB(){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(kr,{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(wr,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]})}function Wme({snippets:e,snippetsLabel:t,onSnippetSelect:n,disabled:r=!1,contentClassName:s="w-[360px]"}){return a.jsxs(Gf,{children:[a.jsx(Yf,{asChild:!0,children:a.jsxs(se,{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(io,{className:"h-3 w-3"}),"Snippets",a.jsx(Yt,{className:"h-3 w-3"})]})}),a.jsxs(Su,{align:"start",className:s,children:[a.jsx(Iz,{children:t}),a.jsx(Mz,{}),e.map(o=>a.jsx(Hr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>n(o.prompt),children:a.jsxs("div",{className:"space-y-0.5",children:[a.jsx("div",{className:"text-xs font-medium leading-tight",children:o.label}),a.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:o.description})]})},o.label))]})]})}function GB({input:e,onInputChange:t,onSend:n,inputPlaceholder:r,snippets:s,snippetsLabel:o,onSnippetSelect:i,loading:c=!1,disabled:d=!1,inputRef:f,snippetContentClassName:h}){const p=d||c;return a.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[a.jsx(Os,{ref:f,value:e,onChange:x=>t(x.target.value),placeholder:r,disabled:d,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(),p||n())}}),a.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[a.jsx(Wme,{snippets:s,snippetsLabel:o,onSnippetSelect:i,disabled:p,contentClassName:h}),a.jsx(se,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:n,disabled:p||!e.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:c?a.jsx(wr,{className:"h-4 w-4 animate-spin"}):a.jsx(D7,{className:"h-4 w-4"})})]})]})}const Vme=_v,Hme=Av,YB=m.forwardRef(({className:e,...t},n)=>a.jsx(pu,{ref:n,className:je("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}));YB.displayName=pu.displayName;const XB=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Hme,{children:[a.jsx(YB,{}),a.jsxs(hu,{ref:r,className:je("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(Ev,{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(As,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));XB.displayName=hu.displayName;const QB=({className:e,...t})=>a.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});QB.displayName="DialogHeader";const JB=m.forwardRef(({className:e,...t},n)=>a.jsx(Tf,{ref:n,className:je("text-lg font-semibold leading-none tracking-tight",e),...t}));JB.displayName=Tf.displayName;const ZB=m.forwardRef(({className:e,...t},n)=>a.jsx(Rf,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));ZB.displayName=Rf.displayName;function Kme(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var KC="ScrollArea",[e8]=hr(KC),[Gme,$a]=e8(KC),t8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=e,[c,d]=m.useState(null),[f,h]=m.useState(null),[p,x]=m.useState(null),[g,j]=m.useState(null),[b,y]=m.useState(null),[S,C]=m.useState(0),[N,E]=m.useState(0),[A,k]=m.useState(!1),[O,T]=m.useState(!1),$=wt(t,q=>d(q)),B=ju(s);return a.jsx(Gme,{scope:n,type:r,dir:B,scrollHideDelay:o,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:x,scrollbarX:g,onScrollbarXChange:j,scrollbarXEnabled:A,onScrollbarXEnabledChange:k,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:O,onScrollbarYEnabledChange:T,onCornerWidthChange:C,onCornerHeightChange:E,children:a.jsx(Ye.div,{dir:B,...i,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});t8.displayName=KC;var n8="ScrollAreaViewport",r8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,i=$a(n8,n),c=m.useRef(null),d=wt(t,c,i.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(Ye.div,{"data-radix-scroll-area-viewport":"",...o,ref:d,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:a.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});r8.displayName=n8;var Ds="ScrollAreaScrollbar",GC=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=$a(Ds,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,c=e.orientation==="horizontal";return m.useEffect(()=>(c?o(!0):i(!0),()=>{c?o(!1):i(!1)}),[c,o,i]),s.type==="hover"?a.jsx(Yme,{...r,ref:t,forceMount:n}):s.type==="scroll"?a.jsx(Xme,{...r,ref:t,forceMount:n}):s.type==="auto"?a.jsx(a8,{...r,ref:t,forceMount:n}):s.type==="always"?a.jsx(YC,{...r,ref:t}):null});GC.displayName=Ds;var Yme=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=$a(Ds,e.__scopeScrollArea),[o,i]=m.useState(!1);return m.useEffect(()=>{const c=s.scrollArea;let d=0;if(c){const f=()=>{window.clearTimeout(d),i(!0)},h=()=>{d=window.setTimeout(()=>i(!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(Gn,{present:n||o,children:a.jsx(a8,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Xme=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=$a(Ds,e.__scopeScrollArea),o=e.orientation==="horizontal",i=_g(()=>d("SCROLL_END"),100),[c,d]=Kme("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=o?"scrollLeft":"scrollTop";if(f){let p=f[h];const x=()=>{const g=f[h];p!==g&&(d("SCROLL"),i()),p=g};return f.addEventListener("scroll",x),()=>f.removeEventListener("scroll",x)}},[s.viewport,o,d,i]),a.jsx(Gn,{present:n||c!=="hidden",children:a.jsx(YC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Te(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),a8=m.forwardRef((e,t)=>{const n=$a(Ds,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,i]=m.useState(!1),c=e.orientation==="horizontal",d=_g(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;i(c?f:h)}},10);return ru(n.viewport,d),ru(n.content,d),a.jsx(Gn,{present:r||o,children:a.jsx(YC,{"data-state":o?"visible":"hidden",...s,ref:t})})}),YC=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=$a(Ds,e.__scopeScrollArea),o=m.useRef(null),i=m.useRef(0),[c,d]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=c8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:x=>o.current=x,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:x=>i.current=x};function p(x,g){return nve(x,i.current,c,g)}return n==="horizontal"?a.jsx(Qme,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const x=s.viewport.scrollLeft,g=qM(x,c,s.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollLeft=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollLeft=p(x,s.dir))}}):n==="vertical"?a.jsx(Jme,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const x=s.viewport.scrollTop,g=qM(x,c);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollTop=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollTop=p(x))}}):null}),Qme=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=$a(Ds,e.__scopeScrollArea),[i,c]=m.useState(),d=m.useRef(null),f=wt(t,d,o.onScrollbarXChange);return m.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),a.jsx(o8,{"data-orientation":"horizontal",...s,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Cg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(o.viewport){const x=o.viewport.scrollLeft+h.deltaX;e.onWheelScroll(x),d8(x,p)&&h.preventDefault()}},onResize:()=>{d.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Zm(i.paddingLeft),paddingEnd:Zm(i.paddingRight)}})}})}),Jme=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=$a(Ds,e.__scopeScrollArea),[i,c]=m.useState(),d=m.useRef(null),f=wt(t,d,o.onScrollbarYChange);return m.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),a.jsx(o8,{"data-orientation":"vertical",...s,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Cg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(o.viewport){const x=o.viewport.scrollTop+h.deltaY;e.onWheelScroll(x),d8(x,p)&&h.preventDefault()}},onResize:()=>{d.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Zm(i.paddingTop),paddingEnd:Zm(i.paddingBottom)}})}})}),[Zme,s8]=e8(Ds),o8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...x}=e,g=$a(Ds,n),[j,b]=m.useState(null),y=wt(t,$=>b($)),S=m.useRef(null),C=m.useRef(""),N=g.viewport,E=r.content-r.viewport,A=Wn(h),k=Wn(d),O=_g(p,10);function T($){if(S.current){const B=$.clientX-S.current.left,q=$.clientY-S.current.top;f({x:B,y:q})}}return m.useEffect(()=>{const $=B=>{const q=B.target;j?.contains(q)&&A(B,E)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[N,j,E,A]),m.useEffect(k,[r,k]),ru(j,O),ru(g.content,O),a.jsx(Zme,{scope:n,scrollbar:j,hasThumb:s,onThumbChange:Wn(o),onThumbPointerUp:Wn(i),onThumbPositionChange:k,onThumbPointerDown:Wn(c),children:a.jsx(Ye.div,{...x,ref:y,style:{position:"absolute",...x.style},onPointerDown:Te(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),S.current=j.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),T($))}),onPointerMove:Te(e.onPointerMove,T),onPointerUp:Te(e.onPointerUp,$=>{const B=$.target;B.hasPointerCapture($.pointerId)&&B.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=C.current,g.viewport&&(g.viewport.style.scrollBehavior=""),S.current=null})})})}),Jm="ScrollAreaThumb",i8=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=s8(Jm,e.__scopeScrollArea);return a.jsx(Gn,{present:n||s.hasThumb,children:a.jsx(eve,{ref:t,...r})})}),eve=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=$a(Jm,n),i=s8(Jm,n),{onThumbPositionChange:c}=i,d=wt(t,p=>i.onThumbChange(p)),f=m.useRef(void 0),h=_g(()=>{f.current&&(f.current(),f.current=void 0)},100);return m.useEffect(()=>{const p=o.viewport;if(p){const x=()=>{if(h(),!f.current){const g=rve(p,c);f.current=g,c()}};return c(),p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[o.viewport,h,c]),a.jsx(Ye.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Te(e.onPointerDownCapture,p=>{const g=p.target.getBoundingClientRect(),j=p.clientX-g.left,b=p.clientY-g.top;i.onThumbPointerDown({x:j,y:b})}),onPointerUp:Te(e.onPointerUp,i.onThumbPointerUp)})});i8.displayName=Jm;var XC="ScrollAreaCorner",l8=m.forwardRef((e,t)=>{const n=$a(XC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(tve,{...e,ref:t}):null});l8.displayName=XC;var tve=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=$a(XC,n),[o,i]=m.useState(0),[c,d]=m.useState(0),f=!!(o&&c);return ru(s.scrollbarX,()=>{const h=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(h),d(h)}),ru(s.scrollbarY,()=>{const h=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(h),i(h)}),f?a.jsx(Ye.div,{...r,ref:t,style:{width:o,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Zm(e){return e?parseInt(e,10):0}function c8(e,t){const n=e/t;return isNaN(n)?0:n}function Cg(e){const t=c8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function nve(e,t,n,r="ltr"){const s=Cg(n),o=s/2,i=t||o,c=s-i,d=n.scrollbar.paddingStart+i,f=n.scrollbar.size-n.scrollbar.paddingEnd-c,h=n.content-n.viewport,p=r==="ltr"?[0,h]:[h*-1,0];return u8([d,f],p)(e)}function qM(e,t,n="ltr"){const r=Cg(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,c=o-r,d=n==="ltr"?[0,i]:[i*-1,0],f=Sf(e,d);return u8([0,i],[0,c])(f)}function u8(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 d8(e,t){return e>0&&e<t}var rve=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=n.left!==o.left,c=n.top!==o.top;(i||c)&&t(),n=o,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function _g(e,t){const n=Wn(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 ru(e,t){const n=Wn(t);rr(()=>{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 f8=t8,ave=r8,sve=l8;const QC=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(f8,{ref:r,className:je("relative overflow-hidden",e),...n,children:[a.jsx(ave,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(p8,{}),a.jsx(sve,{})]}));QC.displayName=f8.displayName;const p8=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>a.jsx(GC,{ref:r,orientation:t,className:je("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(i8,{className:"relative flex-1 rounded-full bg-border"})}));p8.displayName=GC.displayName;async function ove(e){const{sessionId:t,source:n,serverName:r,onLaunchUrl:s,timeoutMs:o=5*6e4}=e,i=Date.now()+o;let c=!1;for(;Date.now()<i;){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 ive=250;async function oo(e){const{serverNames:t,source:n,onServerAuthStart:r,onServerStatus:s,timeoutMs:o=5*6e4}=e,i=Array.from(new Set(t.filter(Boolean)));if(i.length===0)return;const c=Date.now()+o,d=new Set,f=new Map;for(;Date.now()<c;){const h=await n.ensureOAuthServers({serverNames:i});for(const x of h.servers){const g=`${x.status}:${x.debugState??""}:${x.runtimeSessionId??""}`;f.get(x.serverName)!==g&&(f.set(x.serverName,g),s?.({serverName:x.serverName,status:x.status,debugState:x.debugState,tokenExpiresAt:x.tokenExpiresAt,tokenExpiresInSeconds:x.tokenExpiresInSeconds,message:x.message}))}const p=h.servers.filter(x=>x.status==="auth_required");if(p.length===0&&h.allReady)return;for(const x of p){const g=x.runtimeSessionId;if(!g)throw new Error(x.message||`OAuth login required for '${x.serverName}'.`);d.has(g)||(d.add(g),r?.(x.serverName));const j=(()=>{let b=!1;return y=>{if(b||!y)return;b=!0;const S=y.startsWith("http")?y:`${window.location.origin}${y}`;window.open(S,"_blank","noopener,noreferrer")}})();j(x.authorizeLaunchUrl||x.authorizationUrl||""),await ove({sessionId:g,source:n,serverName:x.serverName,onLaunchUrl:j,timeoutMs:Math.max(1e4,c-Date.now())})}await new Promise(x=>{window.setTimeout(x,ive)})}throw new Error("OAuth login timed out before all required servers were authorized.")}const lve=[{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 cve({open:e,onOpenChange:t,configId:n,configPath:r,scenario:s,agents:o,servers:i,snapshotEval:c,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:h}){const{source:p}=Dn(),[x,g]=m.useState(null),[j,b]=m.useState(null),[y,S]=m.useState(""),[C,N]=m.useState(!1),[E,A]=m.useState(new Set),k=m.useRef(null),O=m.useRef(null),T=m.useRef(null),[$,B]=m.useState(!1),q=m.useRef(!1),F=d||o[0]?.id||"";m.useEffect(()=>{if(!e||!F||x)return;let V=!1;return N(!0),(async()=>{const Q=Array.from(new Set(s.serverIds.filter(fe=>i.find(Re=>Re.id===fe)?.authType==="oauth2")));await oo({serverNames:Q,source:p});const Z=await p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:s.id,selectedAssistantAgentName:F,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:i.map(fe=>({name:fe.name||fe.id,url:fe.url})),availableAgents:o.map(fe=>({name:fe.name||fe.id,provider:fe.provider,model:fe.model}))}});V||(g(Z.sessionId),U(Z.session))})().catch(Q=>{V||Ae({title:"Could not start Scenario Assistant",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}).finally(()=>{V||N(!1)}),()=>{V=!0}},[e,p,x,n,r,s,c,o,i,F]);const H=()=>{g(null),b(null),S(""),A(new Set),T.current=null},U=m.useCallback(V=>{b(ue=>ue&&ue.messages.length>V.messages.length?ue:V)},[]),R=V=>{H(),p.closeScenarioAssistantSession(V).catch(()=>{})};m.useEffect(()=>{e||x&&(q.current||$||R(x))},[e,x,p,$]),m.useEffect(()=>()=>{x&&p.closeScenarioAssistantSession(x).catch(()=>{})},[x,p]),m.useEffect(()=>{if(!e)return;$&&B(!1),q.current&&(q.current=!1);const V=window.setTimeout(()=>{k.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(V)},[e,C,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),m.useEffect(()=>{const V=O.current;if(!V)return;V.style.height="0px";const ue=Math.min(V.scrollHeight,160);V.style.height=`${Math.max(40,ue)}px`},[y,e]);const W=o.length>0&&s.serverIds.length>0&&!!F,X=async V=>{if(!x)return;const ue=V.trim();if(!ue)return;const Q=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,Z={id:Q,role:"user",text:ue,createdAt:new Date().toISOString()};b(fe=>fe&&{...fe,messages:[...fe.messages,Z]}),S(""),N(!0);try{const fe=await p.sendScenarioAssistantMessage(x,ue);U(fe.session)}catch(fe){b(ae=>ae&&{...ae,messages:ae.messages.filter(Re=>Re.id!==Q)}),S(ae=>ae.trim()?ae:ue),Ae({title:"Scenario Assistant error",description:fe instanceof Error?fe.message:String(fe),variant:"destructive"})}finally{N(!1)}},G=V=>{S(V),requestAnimationFrame(()=>O.current?.focus())};m.useEffect(()=>{if(!e||!x||!j||!W||C)return;const V=String(f??"").trim();V&&T.current!==V&&(T.current=V,X(V))},[e,x,j,W,C,f]),m.useEffect(()=>{if(!(!e||!x||!j))return p.subscribeScenarioAssistantSessionEvents(x,V=>{U(V.payload.session)})},[e,x,p,U]);const z=async V=>{if(x){N(!0);try{const ue=await p.approveScenarioAssistantToolCall(x,V);U(ue.session)}catch(ue){Ae({title:"Tool call failed",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{N(!1)}}},J=async V=>{if(x){N(!0);try{const ue=await p.denyScenarioAssistantToolCall(x,V);U(ue.session)}catch(ue){Ae({title:"Could not deny tool call",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{N(!1)}}},D=async()=>{if(x){N(!0);try{const V=await p.approveAllScenarioAssistantToolCalls(x);U(V.session)}catch(V){Ae({title:"Could not approve all tool calls",description:V instanceof Error?V.message:String(V),variant:"destructive"})}finally{N(!1)}}},I=(V,ue,Q)=>{if(!ue)return;if(Q==="prompt"&&ue.prompt&&h({prompt:ue.prompt.replacement}),Q==="evalRules"&&ue.evalRules&&h({evalRules:ue.evalRules.replacement}),Q==="extractRules"&&ue.extractRules&&h({extractRules:ue.extractRules.replacement}),Q==="snapshotEval"&&ue.snapshotEval&&h({snapshotEval:{enabled:ue.snapshotEval.patch.enabled,baselineSnapshotId:ue.snapshotEval.patch.baselineSnapshotId}}),V){const fe=`${V}:${Q}`;A(ae=>new Set([...ae,fe]))}Ae({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[Q]}`})},ne=()=>{const V=document.activeElement;V instanceof HTMLElement&&V.blur()},te=V=>{V||(ne(),B(!1),q.current=!1),t(V)},de=()=>{ne(),q.current=!0,B(!0),t(!1)},he=()=>{ne(),q.current=!1,B(!1),x&&R(x)};return a.jsxs(a.Fragment,{children:[!e&&x&&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(se,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[a.jsx(zr,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),a.jsx(se,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:he,"aria-label":"Discard assistant session",title:"Discard assistant session",children:a.jsx(As,{className:"h-4 w-4"})})]})]}),a.jsx(Vme,{open:e,onOpenChange:te,children:a.jsxs(XB,{className:"max-w-6xl h-[85vh] flex flex-col",children:[x&&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:de,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[a.jsx(I7,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Minimize"})]}),a.jsx(QB,{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(JB,{className:"flex items-center gap-2",children:[a.jsx(zr,{className:"h-4 w-4"}),"Scenario Assistant"]}),a.jsx(ZB,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),W?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(Fe,{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(Ja,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),a.jsx(QC,{className:"min-h-0 flex-1 rounded-md border p-3",children:a.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((V,ue)=>a.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:V},`${V}-${ue}`)),j?.messages.map(V=>a.jsxs(m.Fragment,{children:[(()=>{const ue=V.pendingToolCallIds??(V.pendingToolCallId?[V.pendingToolCallId]:[]),Q=ue.map(_e=>(j?.pendingToolCalls??[]).find(Me=>Me.id===_e)).filter(_e=>!!_e),Z=ue.map(_e=>j.pendingToolCalls.find(Me=>Me.id===_e)??j.pendingToolCalls.find(Me=>Me.id===_e)).filter(Boolean);if(!(V.role==="assistant"&&ue.length>0))return a.jsx("div",{className:"space-y-2",children:a.jsx(uve,{message:V})});const ae=Q.length,Re=Z.length-ae;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(kr,{className:"h-3 w-3"})}),a.jsxs("div",{className:"w-full max-w-[92%] space-y-2",children:[Z.length>1&&ae>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:[Re," of ",Z.length," tool calls resolved"]}),a.jsxs(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ae===0,onClick:()=>{D()},children:["Approve All (",ae,")"]})]}),Z.map((_e,Me)=>a.jsx(K1,{call:_e,loading:C,description:Me===0?V.text:void 0,onApprove:L=>{z(L)},onDeny:L=>{J(L)}},_e.id))]})]})})(),V.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(zr,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),V.suggestions.prompt&&a.jsx(Ch,{title:"Prompt",rationale:V.suggestions.prompt.rationale,preview:V.suggestions.prompt.replacement,applied:E.has(`${V.id}:prompt`),onApply:()=>I(V.id,V.suggestions,"prompt")}),V.suggestions.evalRules&&a.jsx(Ch,{title:"Checks",rationale:V.suggestions.evalRules.rationale,preview:JSON.stringify(V.suggestions.evalRules.replacement,null,2),applied:E.has(`${V.id}:evalRules`),onApply:()=>I(V.id,V.suggestions,"evalRules")}),V.suggestions.extractRules&&a.jsx(Ch,{title:"Value Capture Rules",rationale:V.suggestions.extractRules.rationale,preview:JSON.stringify(V.suggestions.extractRules.replacement,null,2),applied:E.has(`${V.id}:extractRules`),onApply:()=>I(V.id,V.suggestions,"extractRules")}),V.suggestions.snapshotEval&&a.jsx(Ch,{title:"Snapshot Settings",rationale:V.suggestions.snapshotEval.rationale,preview:JSON.stringify(V.suggestions.snapshotEval.patch,null,2),applied:E.has(`${V.id}:snapshotEval`),onApply:()=>I(V.id,V.suggestions,"snapshotEval")}),(()=>{const ue=V.suggestions?.notes,Q=Array.isArray(ue)?ue:typeof ue=="string"?[ue]:[];return Q.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:Q.map((Z,fe)=>a.jsx("li",{children:Z},`${V.id}-note-${fe}`))})]})})()]})]},V.id)),(j?.pendingToolCalls??[]).filter(V=>!(j?.messages??[]).some(ue=>ue.pendingToolCallId===V.id||ue.pendingToolCallIds?.includes(V.id))).map(V=>a.jsx(K1,{call:V,loading:C,onApprove:ue=>{z(ue)},onDeny:ue=>{J(ue)}},V.id)),!j&&C&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(wr,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&C&&a.jsx(KB,{}),a.jsx("div",{ref:k})]})}),a.jsx(GB,{input:y,onInputChange:S,onSend:()=>{X(y)},inputPlaceholder:"Get assistance with creating or refining this scenario ...",snippets:lve,snippetsLabel:"Scenario Assistant Snippets",onSnippetSelect:G,loading:C,disabled:!x,inputRef:O,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 Ch({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(se,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:s,disabled:r,children:r?a.jsxs(a.Fragment,{children:[a.jsx(Jo,{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 uve({message:e}){const t=async s=>{try{await navigator.clipboard.writeText(s),Ae({title:"Copied"})}catch(o){Ae({title:"Could not copy",description:o instanceof Error?o.message:String(o),variant:"destructive"})}},n=e.role==="user"||e.role==="assistant",r=e.role==="user";return a.jsx(HB,{message:e,assistantLabel:e.role==="assistant"?"Assistant":void 0,renderActions:n?a.jsx(se,{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(_s,{className:"h-3.5 w-3.5"})}):void 0})}function aa(e){return typeof e=="number"?e.toLocaleString():"n/a"}function G1(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),o=Math.floor(r%3600/60),i=r%60;return s>0?`${s}h ${o}m ${i}s`:o>0?`${o}m ${i}s`:`${i}s`}function dve({run:e,fallbackUserPrompt:t}){const[n,r]=m.useState(!0),[s,o]=m.useState(!1);return a.jsxs("div",{className:"space-y-2",children:[a.jsx(Xa,{open:n,onOpenChange:r,children:a.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[a.jsx(_a,{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(Yt,{className:`h-3.5 w-3.5 transition-transform ${n?"rotate-180":""}`}),a.jsx(kr,{className:"h-3.5 w-3.5"}),"Final answer"]})})}),a.jsx(Qa,{children:a.jsx(Y1,{text:e.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),a.jsx(Xa,{open:s,onOpenChange:o,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(_a,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[a.jsx(Yt,{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(We,{variant:"outline",className:"h-5 text-[10px]",children:[e.toolCalls.length," tool calls"]})]}),a.jsx(Qa,{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(i=>a.jsx(fve,{item:i,fallbackUserPrompt:t},i.id))})})]})})]})}function fve({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=UM(e,"input");return a.jsx(VM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=UM(e,"output"),f=e.ok?a.jsx(Jo,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):a.jsx(xc,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return a.jsx(VM,{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=WM(e.text,e.kind),s=t?WM(t,"user_prompt"):"",o=n&&!r&&s?s:r,i=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?Ec:kr;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:i}),n?a.jsx(Y1,{text:o,maxLength:280,className:"text-xs"}):a.jsx(Y1,{text:o,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 UM(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · estimated ${aa(n)} tokens`}function WM(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 VM({variant:e,title:t,text:n,icon:r}){const[s,o]=m.useState(!1),i={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(Xa,{open:s,onOpenChange:o,children:a.jsxs("div",{className:`rounded-md border p-2 text-xs ${i[e]}`,children:[a.jsx(_a,{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(Ja,{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(Qa,{children:a.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function Y1({text:e,maxLength:t,className:n}){const[r,s]=m.useState(!1),o=e.length>t,i=r||!o?e:`${e.slice(0,t)}...`;return a.jsxs("div",{children:[a.jsx(Oa,{text:i,className:n}),o&&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 Ag(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 hve=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function X1({scenarios:e,scenarioOrigins:t,scenarioOverrides:n,agents:r,servers:s,configId:o,configPath:i,defaultAssistantAgentName:c,assistantInitialPromptByScenarioId:d,assistantAutoOpenNonceByScenarioId:f,snapshotEval:h,onChange:p,readOnly:x,allowAdd:g=!x,allowStructureEdits:j=!x}){const b=(N,E)=>{const A=e.map((k,O)=>O===N?{...k,...E}:k);p(A)},y=N=>p(e.filter((E,A)=>A!==N)),S=()=>p([...e,hve()]),C=(N,E)=>{const A=N+E;if(A<0||A>=e.length)return;const k=[...e],[O]=k.splice(N,1);k.splice(A,0,O),p(k)};return a.jsxs("div",{className:x?"space-y-2":"space-y-4",children:[!x&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-semibold",children:"Scenarios"}),g&&j&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:S,children:[a.jsx(io,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((N,E)=>a.jsx(mve,{scenario:N,scenarioOrigin:t?.[E],hasMcpServerOverride:n?.[E],index:E,total:e.length,agents:r,servers:s,configId:o,configPath:i,defaultAssistantAgentName:c,assistantInitialPrompt:d?.[N.id],assistantAutoOpenNonce:f?.[N.id],snapshotEval:h,onUpdate:A=>b(E,A),onMoveUp:()=>C(E,-1),onMoveDown:()=>C(E,1),onRemove:()=>y(E),readOnly:x,allowStructureEdits:j},N.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 mve({scenario:e,scenarioOrigin:t,hasMcpServerOverride:n,index:r,total:s,agents:o,servers:i,configId:c,configPath:d,defaultAssistantAgentName:f,assistantInitialPrompt:h,assistantAutoOpenNonce:p,snapshotEval:x,onUpdate:g,onMoveUp:j,onMoveDown:b,onRemove:y,readOnly:S,allowStructureEdits:C}){const{source:N}=Dn(),E=Ag("snapshots",!1),[A,k]=m.useState("required_tool"),[O,T]=m.useState(""),[$,B]=m.useState(""),[q,F]=m.useState(""),[H,U]=m.useState(""),[R,W]=m.useState(null),[X,G]=m.useState(!1),[z,J]=m.useState(null),[D,I]=m.useState(""),[ne,te]=m.useState(""),[de,he]=m.useState(!1),[V,ue]=m.useState(f||o[0]?.id||""),[Q,Z]=m.useState(!1),[fe,ae]=m.useState(null),[Re,_e]=m.useState(""),[Me,L]=m.useState(null),[oe,pe]=m.useState(!S),Ee=()=>{if(A==="response_jsonpath"||A==="response_jsonpath_exists"||A==="response_jsonpath_not_exists"){const be=$.trim();if(!be)return;if(A==="response_jsonpath"){const At=q.trim();let $t;At.length>0&&(At==="true"?$t=!0:At==="false"?$t=!1:Number.isNaN(Number(At))?$t=At:$t=Number(At)),g({evalRules:[...e.evalRules,{type:A,path:be,...$t!==void 0?{equals:$t}:{}}]})}else g({evalRules:[...e.evalRules,{type:A,path:be}]});B(""),F("");return}O.trim()&&(g({evalRules:[...e.evalRules,{type:A,value:O.trim()}]}),T(""),U(""))},Xe=be=>{g({evalRules:e.evalRules.filter((At,$t)=>$t!==be)})},ht=()=>{!D.trim()||!ne.trim()||(g({extractRules:[...e.extractRules,{name:D.trim(),pattern:ne.trim()}]}),I(""),te(""))},gt=be=>{g({extractRules:e.extractRules.filter((At,$t)=>$t!==be)})},mt=be=>{const At=e.serverIds.includes(be)?e.serverIds.filter($t=>$t!==be):[...e.serverIds,be];g({serverIds:At})},Vt={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"},qt={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"},Ft=A==="required_tool"||A==="forbidden_tool",zt=A==="response_jsonpath"||A==="response_jsonpath_exists"||A==="response_jsonpath_not_exists",Ne=e.serverIds.filter(be=>i.some(At=>At.id===be)),et=o.map(be=>be.id).filter(Boolean),Ke=Ne.length>0,ve=e.snapshotEval?.baselineSnapshotId!==void 0,[ze,$e]=m.useState(""),[Qe,Ce]=m.useState(0);m.useEffect(()=>{const be=(h??"").trim();be&&ze!==be&&(he(!0),$e(be))},[h,ze]),m.useEffect(()=>{p&&p!==Qe&&(he(!0),Ce(p))},[p,Qe]),m.useEffect(()=>{W(null),J(null),U("")},[e.serverIds.join("|")]),m.useEffect(()=>{U(""),B(""),F("")},[A]),m.useEffect(()=>{V&&et.includes(V)||ue(f||o[0]?.id||"")},[V,f,o,et]);const qe=async()=>{if(V){Z(!0),ae(null);try{const be=e.serverIds.filter($t=>i.find(nn=>nn.id===$t)?.authType==="oauth2");await oo({serverNames:be,source:N});const At=await N.runScenarioPreview({selectedAgentName:V,scenario:{id:e.id,name:e.name,prompt:e.prompt,serverNames:e.serverIds,evalRules:e.evalRules,extractRules:e.extractRules}});L(At)}catch(be){ae(be instanceof Error?be.message:String(be))}finally{Z(!1)}}},Xt=()=>{if(!Me)return;const be=HM(e.evalRules,Me.run.failureReasons),At=be.length?be.map(kn=>`${kn.status.toUpperCase()} - ${vve(kn.rule)}${kn.failureReason?` (${kn.failureReason})`:""}`).join(`
|
|
126
|
-
`):"No checks configured.",$t=Object.keys(Me.run.extractedValues).length>0?Object.entries(Me.run.extractedValues).map(([kn,pt])=>`${kn}: ${String(pt)}`).join(`
|
|
127
|
-
`):"No extracted values.",Ut=Me.run.toolCalls.length>0?Me.run.toolCalls.map((kn,pt)=>`${pt+1}. ${kn.name} (${kn.duration}ms)`).join(`
|
|
128
|
-
`):"No tool calls.",nn=[`I ran a prompt preview for scenario '${e.id}' and want you to suggest concrete updates.`,`Run ID: ${Me.runId}`,`Agent: ${Me.agentName}`,`Outcome: ${Me.run.passed?"passed":"failed"}`,`Duration: ${Me.run.duration}ms`,"","Current check outcomes:",At,"","Tool sequence:",Ut,"","Extracted values:",$t,"","Final answer:",Me.run.finalAnswer||"(empty)","","Please propose concrete updates to the Prompt, Checks, and/or Value Capture Rules based on this preview."].join(`
|
|
129
|
-
`);_e(nn),he(!0)},gn=async()=>{if(!(!Ke||S)){G(!0),J(null);try{const be=Ne.filter($t=>i.find(nn=>nn.id===$t)?.authType==="oauth2");await oo({serverNames:be,source:N});const At=new Set;for(const $t of Ne){const Ut=await N.discoverToolsForAnalysis({serverNames:[$t]});for(const nn of Ut.servers)for(const kn of nn.tools)At.add(kn.name)}W(Array.from(At).sort(($t,Ut)=>$t.localeCompare(Ut)))}catch(be){J(be instanceof Error?be.message:"Failed to load tools")}finally{G(!1)}}};return a.jsx(Xa,{open:oe,onOpenChange:pe,children:a.jsxs(Ve,{className:S?"rounded-md border shadow-none":"border-dashed",children:[a.jsxs(kt,{className:S?"px-3 py-3 flex-row items-center justify-between space-y-0":"pb-3 flex-row items-center justify-between space-y-0",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!S&&a.jsx(_a,{asChild:!0,children:a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:a.jsx(Yt,{className:`h-3.5 w-3.5 transition-transform ${oe?"rotate-0":"-rotate-90"}`})})}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[r+1,"."]}),a.jsx(Pt,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${r+1}`})]}),S?a.jsxs("div",{className:"flex items-center gap-2",children:[t&&a.jsx(We,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),n&&a.jsx(We,{variant:"secondary",children:"Override"}),a.jsx(_a,{asChild:!0,children:a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":oe?"Collapse scenario details":"Expand scenario details",children:a.jsx(Yt,{className:`h-4 w-4 transition-transform ${oe?"rotate-180":""}`})})})]}):C&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>he(!0),title:o.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(zr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]}),a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:r===0,"aria-label":"Move scenario up",children:a.jsx(ws,{className:"h-3.5 w-3.5"})}),a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:b,disabled:r===s-1,"aria-label":"Move scenario down",children:a.jsx(Yt,{className:"h-3.5 w-3.5"})}),a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:y,children:a.jsx(Ta,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),a.jsx(Qa,{children:a.jsxs(He,{className:"space-y-3",children:[a.jsx(cve,{open:de,onOpenChange:be=>{he(be),be||_e("")},configId:c,configPath:d,scenario:e,agents:o,servers:i,snapshotEval:x,defaultAssistantAgentName:f,initialUserMessage:Re||h,onApplyPatch:be=>g({...be.prompt!==void 0?{prompt:be.prompt}:{},...be.evalRules!==void 0?{evalRules:be.evalRules}:{},...be.extractRules!==void 0?{extractRules:be.extractRules}:{},...be.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...be.snapshotEval}}:{}})}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Name"}),a.jsx(vt,{value:e.name,onChange:be=>g({name:be.target.value}),disabled:S,placeholder:"e.g. List directory"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Servers"}),a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(be=>a.jsx(We,{variant:e.serverIds.includes(be.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(be.id)?"":"opacity-50"}`,onClick:()=>!S&&mt(be.id),children:be.name||be.id},be.id)),i.length===0&&a.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),a.jsxs(Ve,{className:"border bg-card",children:[a.jsxs(kt,{className:"pb-2",children:[a.jsx(Pt,{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(He,{className:"pt-0",children:a.jsx(Os,{value:e.prompt,onChange:be=>g({prompt:be.target.value}),disabled:S,placeholder:"The prompt to send to the agent...",rows:4,className:"text-xs"})})]}),!S&&a.jsxs(Ve,{className:"border bg-muted/20",children:[a.jsxs(kt,{className:"pb-2",children:[a.jsx(Pt,{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(He,{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(Fe,{className:"text-xs",children:"Agent"}),a.jsxs(wn,{value:V,onValueChange:ue,children:[a.jsx(hn,{className:"h-8 text-xs",children:a.jsx(jn,{placeholder:"Select agent"})}),a.jsx(mn,{children:o.map(be=>a.jsx(tt,{value:be.id,children:be.name||be.id},be.id))})]})]}),a.jsx("div",{className:"flex items-end",children:a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>{qe()},disabled:Q||!V||!e.prompt.trim()||e.serverIds.length===0,children:Q?a.jsxs(a.Fragment,{children:[a.jsx(wr,{className:"h-3.5 w-3.5 animate-spin"}),"Running..."]}):a.jsxs(a.Fragment,{children:[a.jsx(to,{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."}),fe&&a.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:fe}),Me&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[a.jsx(We,{variant:Me.run.passed?"default":"destructive",children:Me.run.passed?"Passed":"Failed"}),a.jsxs(We,{variant:"outline",children:[Me.run.duration,"ms"]}),a.jsxs(We,{variant:"outline",children:[Me.run.toolCalls.length," tool calls"]}),a.jsx(We,{variant:"outline",className:"font-mono",children:Me.agentName}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-6 gap-1.5 px-2 text-[11px]",onClick:Xt,children:[a.jsx(zr,{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 be=HM(e.evalRules,Me.run.failureReasons),At=be.filter(Ut=>Ut.status==="passed"),$t=be.filter(Ut=>Ut.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(We,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[At.length," passed"]}),a.jsxs(We,{variant:"outline",className:`h-5 text-[10px] ${$t.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[$t.length," failed"]})]}),a.jsx("div",{className:"space-y-1",children:be.map((Ut,nn)=>a.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Ut.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:[Ut.status==="failed"?a.jsx(xc,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):a.jsx(Jo,{className:"h-3.5 w-3.5 shrink-0 text-success"}),a.jsx("span",{className:"font-medium",children:gve(Ut.rule)})]}),Ut.failureReason&&a.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:xve(Ut.failureReason)})]}),a.jsx(We,{variant:"outline",className:`shrink-0 text-[10px] ${Ut.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Ut.status})]},`${e.id}-preview-check-${nn}`))})]})})(),Me.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:Me.run.failureReasons.map((be,At)=>a.jsx("li",{children:be},`${Me.runId}-failure-${At}`))})]}),Object.keys(Me.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(Me.run.extractedValues).map(([be,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:be}),a.jsx("div",{className:"break-all",children:String(At)})]},be))})]}),a.jsx(dve,{run:Me.run,fallbackUserPrompt:e.prompt})]})]})]}),a.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[a.jsxs(Ve,{className:"border bg-muted/20",children:[a.jsx(kt,{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(Pt,{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."})]}),!S&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>he(!0),title:"Ask for help improving checks",children:[a.jsx(zr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]})]})}),a.jsx(He,{className:"space-y-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(Fe,{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((be,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 ${qt[be.type]}`,children:Vt[be.type]}),a.jsx("span",{className:"font-mono break-all",children:be.path?be.equals!==void 0?`${be.path} == ${String(be.equals)}`:be.path:be.value})]})}),!S&&a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>Xe(At),"aria-label":`Remove check ${At+1}`,children:a.jsx(As,{className:"h-3.5 w-3.5"})})]},At))}),!S&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex gap-2 items-end",children:[a.jsxs(wn,{value:A,onValueChange:be=>k(be),children:[a.jsx(hn,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"required_tool",children:"Required Tool"}),a.jsx(tt,{value:"forbidden_tool",children:"Forbidden Tool"}),a.jsx(tt,{value:"response_contains",children:"Text contains"}),a.jsx(tt,{value:"response_not_contains",children:"Text does not contain"}),a.jsx(tt,{value:"response_starts_with",children:"Text starts with"}),a.jsx(tt,{value:"response_ends_with",children:"Text ends with"}),a.jsx(tt,{value:"response_equals",children:"Text equals"}),a.jsx(tt,{value:"response_regex",children:"Text matches regex"}),a.jsx(tt,{value:"response_jsonpath",children:"JSONPath (optional equals)"}),a.jsx(tt,{value:"response_jsonpath_exists",children:"JSONPath exists"}),a.jsx(tt,{value:"response_jsonpath_not_exists",children:"JSONPath not exists"})]})]}),zt?a.jsxs(a.Fragment,{children:[a.jsx(vt,{value:$,onChange:be=>B(be.target.value),placeholder:"JSONPath (e.g. $.status)",className:"h-8 text-xs font-mono",onKeyDown:be=>be.key==="Enter"&&(be.preventDefault(),Ee())}),A==="response_jsonpath"&&a.jsx(vt,{value:q,onChange:be=>F(be.target.value),placeholder:"Equals (optional)",className:"h-8 w-[12rem] text-xs font-mono",onKeyDown:be=>be.key==="Enter"&&(be.preventDefault(),Ee())})]}):a.jsx(vt,{value:O,onChange:be=>T(be.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:be=>be.key==="Enter"&&(be.preventDefault(),Ee())}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Ee,children:"Add"})]}),Ft&&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(Fe,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),a.jsxs(wn,{value:H,onValueChange:be=>{U(be),T(be)},disabled:X||!R||R.length===0,children:[a.jsx(hn,{className:"h-8 text-xs",children:a.jsx(jn,{placeholder:X?"Loading tools...":R&&R.length>0?"Select tool to insert in value field":"Load tools first"})}),a.jsx(mn,{children:(R??[]).map(be=>a.jsx(tt,{value:be,children:be},be))})]})]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:gn,disabled:!Ke||X,children:X?"Loading...":R?"Refresh tools":"Load tools"})]}),!Ke&&a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),z&&a.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",z]})]})]})]})})]}),a.jsxs(Ve,{className:"border bg-muted/10",children:[a.jsx(kt,{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(Pt,{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."})]}),!S&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>he(!0),title:"Ask for help improving value capture rules",children:[a.jsx(zr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]})]})}),a.jsx(He,{className:"space-y-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(Fe,{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((be,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:be.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:be.pattern})]})}),!S&&a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>gt(At),"aria-label":`Remove value capture rule ${At+1}`,children:a.jsx(As,{className:"h-3.5 w-3.5"})})]},At))}),!S&&a.jsxs("div",{className:"flex gap-2 items-end",children:[a.jsx(vt,{value:D,onChange:be=>I(be.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),a.jsx(vt,{value:ne,onChange:be=>te(be.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:be=>be.key==="Enter"&&(be.preventDefault(),ht())}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ht,children:"Add"})]})]})})]})]}),E&&a.jsxs(Ve,{className:"border bg-amber-50/40",children:[a.jsxs(kt,{className:"pb-2",children:[a.jsx(Pt,{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(He,{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(Xm,{checked:e.snapshotEval?.enabled!==!1,disabled:S,onCheckedChange:be=>g({snapshotEval:{...e.snapshotEval??{},enabled:be}})})]}),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(Xm,{checked:!ve,disabled:S,onCheckedChange:be=>{if(be){g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),ve&&a.jsx(vt,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:be=>g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:be.target.value}}),disabled:S,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||x?.baselineSnapshotId||"Not configured"})]}),a.jsxs("p",{children:["Policy:"," ",a.jsx("span",{className:"font-mono",children:x?.mode??"warn"})," · config-level switch"," ",a.jsx("span",{className:"font-mono",children:x?.enabled?"on":"off"})]})]})]})]})})]})})}function HM(e,t){return e.map(n=>{const r=yve(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function vve(e){return e.path?e.equals!==void 0?`${e.type}: ${e.path} == ${String(e.equals)}`:`${e.type}: ${e.path}`:`${e.type}: ${e.value??""}`}function gve(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 xve(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}function yve(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 h8(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 bve=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),KM=()=>{const{id:e,tab:t}=wl(),n=Ia(),[r,s]=go(),{getConfig:o,addConfig:i,updateConfig:c,loading:d}=Mf(),{source:f}=Dn(),h=Ag("snapshots",!1),{servers:p,agents:x,scenarios:g}=rs(),j=e==="new",b=!j&&!!e,y=b?o(e):void 0,[S,C]=m.useState(j||t==="edit"),[N,E]=m.useState(()=>y?structuredClone(y):bve()),[A,k]=m.useState([]),[O,T]=m.useState(""),[$,B]=m.useState(""),[q,F]=m.useState(""),[H,U]=m.useState(null),[R,W]=m.useState(!1),[X,G]=m.useState(!1),[z,J]=m.useState(""),[D,I]=m.useState(""),[ne,te]=m.useState({}),[de,he]=m.useState({}),[V,ue]=m.useState({}),Q=m.useMemo(()=>{const K=t||r.get("tab");return K==="agents"||K==="scenarios"?K:"scenarios"},[t,r]);m.useEffect(()=>{y&&!S&&E(structuredClone(y))},[y,S]),m.useEffect(()=>{t==="edit"&&!j&&C(!0)},[t,j]),m.useEffect(()=>{let K=!0;return f.listSnapshots().then(ge=>{K&&k(ge)}).catch(()=>{K&&k([])}),()=>{K=!1}},[f]),m.useEffect(()=>{if(!O.trim()){U(null);return}let K=!0;return f.getResult(O.trim()).then(ge=>{if(!K)return;if(!ge){U(!1);return}const De=ge.overallPassRate===1&&ge.scenarios.every(ct=>ct.runs.every(Dt=>Dt.passed));U(De)}).catch(()=>{K&&U(!1)}),()=>{K=!1}},[O,f]);const Z=K=>E(ge=>({...ge,...K})),fe=m.useMemo(()=>N.serverEntries&&N.serverEntries.length>0?N.serverEntries:(N.servers??[]).map(K=>({kind:"inline",server:K})),[N.serverEntries,N.servers]),ae=m.useMemo(()=>N.scenarioEntries&&N.scenarioEntries.length>0?N.scenarioEntries:N.scenarios.map(K=>({kind:"inline",scenario:K})),[N.scenarioEntries,N.scenarios]),Re=K=>{Z({scenarioEntries:K,scenarios:K.filter(ge=>ge.kind==="inline").map(ge=>ge.scenario)})},_e=m.useMemo(()=>N.agentEntries&&N.agentEntries.length>0?N.agentEntries:N.agents.map(K=>({kind:"inline",agent:K})),[N.agentEntries,N.agents]),Me=K=>{Z({agentEntries:K,agents:K.filter(ge=>ge.kind==="inline").map(ge=>ge.agent)})},L=!S,oe=N.runDefaults?.selectedAgentNames??[],pe=async K=>{if(!N.id||L===!1){Z({snapshotEval:{enabled:K.enabled,mode:K.mode,baselineSnapshotId:K.baselineSnapshotId,baselineSourceRunId:K.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}W(!0);try{const ge=await f.updateSnapshotPolicy(N.id,K);E(ge),Ae({title:"Snapshot policy updated"})}catch(ge){Ae({title:"Could not update snapshot policy",description:ge instanceof Error?ge.message:String(ge),variant:"destructive"})}finally{W(!1)}},Ee=async()=>{if(!(!N.id||!O.trim())){G(!0);try{const K=await f.generateSnapshotEvalBaseline(O.trim(),N.id,$.trim()||void 0);E(K.config),F(K.snapshot.id),k(ge=>[K.snapshot,...ge.filter(De=>De.id!==K.snapshot.id)]),Ae({title:"Snapshot baseline generated",description:`${K.snapshot.name} (${K.snapshot.id})`})}catch(K){Ae({title:"Could not generate baseline",description:K instanceof Error?K.message:String(K),variant:"destructive"})}finally{G(!1)}}},Xe=async()=>{if(!N.name.trim()){Ae({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const K=fe.map(ke=>ke.kind==="referenced"?{kind:"referenced",ref:p.find(jt=>jt.id===ke.ref)?.id||ke.ref}:ke),ge=_e.map(ke=>ke.kind==="referenced"?{kind:"referenced",ref:x.find(jt=>jt.id===ke.ref)?.id||ke.ref}:ke),De=ae.map(ke=>{if(ke.kind==="referenced"){const Rn=g.find(Jt=>Jt.id===ke.ref),jt=(ke.mcpServers??[]).map(Jt=>Jt.kind==="referenced"?{kind:"referenced",ref:p.find(_u=>_u.id===Jt.ref)?.id||Jt.ref}:Jt);return{kind:"referenced",ref:Rn?.id||ke.ref,...ke.mcpServers!==void 0?{mcpServers:jt}:{}}}return ke}),ct=K.filter(ke=>ke.kind==="inline").map(ke=>({server:ke.server,error:h8(ke.server)})).find(ke=>!!ke.error);if(ct?.error){Ae({title:"Validation Error",description:ct.error,variant:"destructive"});return}if(De.filter(ke=>ke.kind==="inline").some(ke=>!ke.scenario.name?.trim())){Ae({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const Et=new Set(ge.map(ke=>ke.kind==="inline"?ke.agent.id:ke.ref)),Fn=(N.runDefaults?.selectedAgentNames??[]).filter(ke=>Et.has(ke)),Yn={...N,serverEntries:K,servers:K.filter(ke=>ke.kind==="inline").map(ke=>ke.server),agentEntries:ge,agents:ge.filter(ke=>ke.kind==="inline").map(ke=>ke.agent),scenarioEntries:De,scenarios:De.filter(ke=>ke.kind==="inline").map(ke=>ke.scenario),runDefaults:Fn.length>0?{...N.runDefaults??{},selectedAgentNames:Fn}:void 0,updatedAt:new Date().toISOString()};if(j){const ke=await i(Yn);E(ke);const Rn=ke.configName?.trim()||ke.name;Ae({title:"MCP Evaluation Created",description:`"${Rn}" has been saved.`}),n(`/mcp-evaluations/${ke.id}`)}else{const ke=await c(N.id,Yn);E(ke);const Rn=ke.configName?.trim()||ke.name;Ae({title:"MCP Evaluation Updated",description:`"${Rn}" has been updated.`}),C(!1),n(`/mcp-evaluations/${ke.id}`,{replace:!0})}},ht=N.configName?.trim()||N.name,gt=j?"New MCP Evaluation":S?`Editing: ${ht}`:ht,mt=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(N.id||e||"")}`,Vt=!!y?.loadError,qt=m.useMemo(()=>x.map(K=>({id:K.id,ref:K.id,label:K.name||K.id,model:K.model})).sort((K,ge)=>K.label.localeCompare(ge.label)),[x]),Ft=(K,ge)=>{const De=ge?Array.from(new Set([...oe,K])):oe.filter(ct=>ct!==K);Z({runDefaults:{...N.runDefaults??{},selectedAgentNames:De}})},zt=K=>{const ge=new Set([..._e.filter(Et=>Et.kind==="inline").map(Et=>Et.agent.name||Et.agent.id),...x.map(Et=>Et.name||Et.id)]),De=`${K}-custom`;let ct=De,Dt=2;for(;ge.has(ct);)ct=`${De}-${Dt}`,Dt+=1;return ct},Ne=()=>{const ge={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};Me([{kind:"inline",agent:ge},..._e]),te(De=>({...De,[ge.id]:!0}))},et=()=>{const K=x.find(ct=>ct.id===D);if(!K)return;const ge=K.id;new Set(_e.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(ge)||Me([..._e,{kind:"referenced",ref:ge}]),I("")},Ke=()=>{const K=new Set(_e.filter(De=>De.kind==="referenced").map(De=>De.ref)),ge=x.filter(De=>!K.has(De.id)).map(De=>({kind:"referenced",ref:De.id}));ge.length>0&&Me([..._e,...ge])},ve=()=>{const K=x.find(Dt=>Dt.id===D);if(!K)return;const ge=K.name||K.id,De=zt(ge),ct={...structuredClone(K),id:`agt-${Date.now()}`,name:De};Me([..._e,{kind:"inline",agent:ct}]),te(Dt=>({...Dt,[ct.id]:!0})),I(""),Ae({title:"Imported agent as inline",description:De})},ze=K=>{const ge=_e[K];if(!ge)return;const De=ge.kind==="inline"?ge.agent.id:ge.ref,ct=oe.filter(Dt=>Dt!==De);Z({runDefaults:{...N.runDefaults??{},selectedAgentNames:ct}}),ge.kind==="inline"&&te(Dt=>{const Et={...Dt};return delete Et[ge.agent.id],Et}),Me(_e.filter((Dt,Et)=>Et!==K))},$e=(K,ge)=>{const De=K+ge;if(De<0||De>=_e.length)return;const ct=[..._e],[Dt]=ct.splice(K,1);ct.splice(De,0,Dt),Me(ct)},Qe=K=>{const ge=_e[K];if(!ge||ge.kind!=="referenced")return;const De=Ut(ge.ref);if(!De){Ae({title:"Referenced agent not found",variant:"destructive"});return}const ct=De.name||De.id,Dt=zt(ct),Et={...structuredClone(De),id:`agt-${Date.now()}`,name:Dt},Fn=[..._e];if(Fn[K]={kind:"inline",agent:Et},Me(Fn),oe.includes(ge.ref)){const Yn=oe.map(ke=>ke===ge.ref?Et.id:ke);Z({runDefaults:{...N.runDefaults??{},selectedAgentNames:Array.from(new Set(Yn))}})}te(Yn=>({...Yn,[Et.id]:!0})),Ae({title:"Referenced agent converted to inline",description:Dt})},Ce=()=>{const K=g.find(De=>De.id===z);if(!K)return;const ge={...structuredClone(K),id:`scn-${Date.now()}`,serverIds:[...K.serverIds]};Re([...ae,{kind:"inline",scenario:ge}]),ue(De=>({...De,[ge.id]:!0})),J("")},qe=()=>{const ge={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};Re([{kind:"inline",scenario:ge},...ae]),ue(De=>({...De,[ge.id]:!0}))},Xt=()=>{const K=g.find(ct=>ct.id===z);if(!K)return;const ge=K.id;new Set(ae.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(ge)||Re([...ae,{kind:"referenced",ref:ge}]),J("")},gn=K=>{const ge=ae[K];ge?.kind==="inline"&&ue(De=>{const ct={...De};return delete ct[ge.scenario.id],ct}),Re(ae.filter((De,ct)=>ct!==K))},be=(K,ge)=>{const De=K+ge;if(De<0||De>=ae.length)return;const ct=[...ae],[Dt]=ct.splice(K,1);ct.splice(De,0,Dt),Re(ct)},At=K=>{const ge=ae[K];if(!ge||ge.kind!=="referenced")return;const De=nn(ge.ref);if(!De){Ae({title:"Referenced scenario not found",variant:"destructive"});return}const ct=new Set(ae.filter(jt=>jt.kind==="inline").map(jt=>jt.scenario.name?.trim().toLowerCase()).filter(Boolean)),Dt=`${(De.name||De.id).trim()}-custom`;let Et=Dt,Fn=2;for(;ct.has(Et.toLowerCase());)Et=`${Dt}-${Fn}`,Fn+=1;const Yn=Date.now(),ke={...structuredClone(De),id:`scn-${Yn}`,name:Et,serverIds:ge.mcpServers&&ge.mcpServers.length>0?ge.mcpServers.map(jt=>jt.kind==="referenced"?jt.ref:jt.server.id):[...De.serverIds]},Rn=[...ae];Rn[K]={kind:"inline",scenario:ke},Re(Rn),ue(jt=>({...jt,[ke.id]:!0})),Ae({title:"Referenced scenario converted to inline",description:Et})},$t=K=>p.find(ge=>ge.id===K),Ut=K=>x.find(ge=>ge.id===K),nn=K=>g.find(ge=>ge.id===K),kn=fe.filter(K=>K.kind==="referenced").map(K=>K.ref),pt=kn.map($t).filter(K=>!!K),Rt=_e.filter(K=>K.kind==="referenced").map(K=>K.ref),Bt=Rt.map(Ut).filter(K=>!!K);_e.filter(K=>K.kind==="inline");const rn=_e.flatMap(K=>{if(K.kind==="referenced"){const ge=Ut(K.ref);return ge?[{agent:ge,origin:"referenced",ref:K.ref}]:[]}return[{agent:K.agent,origin:"inline",ref:void 0}]}),qn=ae.filter(K=>K.kind==="referenced").map(K=>K.ref),ce=ae.flatMap(K=>{if(K.kind==="referenced"){const ge=nn(K.ref);if(!ge)return[];if(K.mcpServers===void 0)return[{scenario:ge,origin:"referenced",hasMcpServerOverride:!1}];const De=K.mcpServers.flatMap(ct=>ct.kind==="referenced"?[ct.ref]:[ct.server.id]);return[{scenario:{...ge,serverIds:De},origin:"referenced",hasMcpServerOverride:!0}]}return[{scenario:K.scenario,origin:"inline",hasMcpServerOverride:!1}]}),st=Array.from(new Map([...x,...N.agents,...Bt].map(K=>[K.id,K])).values()),Nt=Array.from(new Map([...p,...N.servers??[],...pt].map(K=>[K.id,K])).values()),on=ae.filter(K=>K.kind==="referenced").flatMap(K=>(K.mcpServers??[]).filter(ge=>ge.kind==="referenced").map(ge=>ge.ref)),xt=Array.from(new Set([...kn,...on].filter(K=>!$t(K)))),Tn=Rt.filter(K=>!Ut(K)),Ln=qn.filter(K=>!nn(K));new Set(xt);const Da=new Set(Ln),So=_e.length,No=ae.length,Fs=[...p],Xr=(K,ge)=>{const De=ae[K];if(!De||De.kind!=="referenced")return;const ct=[...ae];ct[K]={kind:"referenced",ref:De.ref,mcpServers:ge.map(Dt=>({kind:"referenced",ref:Dt}))},Re(ct)},yi=K=>{const ge=ae[K];if(!ge||ge.kind!=="referenced")return;const De=[...ae];De[K]={kind:"referenced",ref:ge.ref},Re(De)};return m.useEffect(()=>{if(!D)return;x.some(ge=>ge.id===D)||I("")},[x,D]),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(se,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:a.jsx(_t,{to:"/mcp-evaluations",children:a.jsx(el,{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:gt}),a.jsx("p",{className:"text-sm text-muted-foreground",children:j?"Create a new MCP evaluation":d?"Loading configuration...":y?y.loadError?"MCP evaluation could not be fully loaded":`Last updated ${new Date(N.updatedAt).toLocaleDateString()}`:"MCP evaluation not found"})]}),a.jsxs("div",{className:"flex gap-2 shrink-0",children:[b&&!S&&a.jsx(se,{size:"sm",onClick:()=>{C(!0),n(`${mt}/edit`)},children:"Edit"}),b&&!S&&y&&!Vt&&a.jsx(se,{size:"sm",variant:"outline",asChild:!0,children:a.jsxs(_t,{to:`/run?configId=${encodeURIComponent(y.id)}`,children:[a.jsx(to,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!S&&Vt&&a.jsxs(We,{variant:"destructive",className:"py-1 px-3 text-xs",children:[a.jsx(Ph,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&a.jsxs(a.Fragment,{children:[!j&&a.jsx(se,{variant:"outline",size:"sm",onClick:()=>{E(structuredClone(y)),C(!1),n(mt)},children:"Cancel"}),a.jsxs(se,{size:"sm",onClick:()=>{Xe()},children:[a.jsx($7,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),Vt&&!S&&a.jsx(Ve,{className:"border-destructive/40",children:a.jsxs(He,{className:"pt-6 space-y-3",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Ph,{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:y?.sourcePath||y?.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:y?.loadError})]}),(xt.length>0||Tn.length>0||Ln.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"}),xt.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",a.jsx("span",{className:"text-destructive",children:xt.join(", ")})]}),Tn.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",a.jsx("span",{className:"text-destructive",children:Tn.join(", ")})]}),Ln.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",a.jsx("span",{className:"text-destructive",children:Ln.join(", ")})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!Vt&&(N.loadWarnings?.length??0)>0&&a.jsx(Ve,{className:"border-amber-500/30",children:a.jsxs(He,{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(Ph,{className:"h-4 w-4"}),"Migration warnings"]}),N.loadWarnings?.map((K,ge)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:K},`${K}-${ge}`))]})}),a.jsxs("div",{className:"flex gap-4",children:[a.jsx(We,{variant:Q==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:a.jsxs(_t,{to:`${mt}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[a.jsx(VE,{className:"h-3 w-3"}),No," scenario",No!==1?"s":""]})}),a.jsx(We,{variant:Q==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:a.jsxs(_t,{to:`${mt}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[a.jsx(kr,{className:"h-3 w-3"}),So," agent",So!==1?"s":""]})})]}),a.jsx(Ve,{children:a.jsx(He,{className:"pt-6 space-y-3",children:a.jsxs("div",{className:`grid gap-4 ${L||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!L&&j&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Config ID"}),a.jsx(vt,{value:N.name,onChange:K=>Z({name:K.target.value}),disabled:L,placeholder:"e.g. check-weather"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Name (optional)"}),a.jsx(vt,{value:N.configName||"",onChange:K=>Z({configName:K.target.value}),disabled:L,placeholder:"e.g. Weather checks baseline"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Description"}),a.jsx(vt,{value:N.description||"",onChange:K=>Z({description:K.target.value}),disabled:L,placeholder:"Brief description..."})]})]})})}),h&&a.jsx(Ve,{children:a.jsxs(He,{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(Fe,{className:"text-xs",children:"Enable snapshot baseline"}),a.jsx(Xm,{checked:N.snapshotEval?.enabled??!1,disabled:R,onCheckedChange:K=>{const ge=N.snapshotEval;pe({enabled:K,mode:ge?.mode??"warn",baselineSnapshotId:ge?.baselineSnapshotId,baselineSourceRunId:ge?.baselineSourceRunId})}})]})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Drift mode"}),a.jsxs(wn,{value:N.snapshotEval?.mode??"warn",onValueChange:K=>{const ge=N.snapshotEval;pe({enabled:ge?.enabled??!1,mode:K,baselineSnapshotId:ge?.baselineSnapshotId,baselineSourceRunId:ge?.baselineSourceRunId})},children:[a.jsx(hn,{className:"h-8",children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"warn",children:"Warn"}),a.jsx(tt,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{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:N.snapshotEval?.baselineSnapshotId??"No baseline linked"})]})]}),N.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(Fe,{className:"text-xs",children:"Generate baseline from passing run"}),a.jsx(vt,{value:O,onChange:K=>T(K.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),H===!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(Fe,{className:"text-xs",children:"Snapshot name (optional)"}),a.jsx(vt,{value:$,onChange:K=>B(K.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Fe,{className:"text-xs",children:"Switch baseline"}),a.jsxs(wn,{value:q||N.snapshotEval?.baselineSnapshotId||"",onValueChange:K=>{F(K),pe({enabled:N.snapshotEval?.enabled??!0,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:K||void 0,baselineSourceRunId:N.snapshotEval?.baselineSourceRunId})},children:[a.jsx(hn,{className:"h-8",children:a.jsx(jn,{placeholder:"Select snapshot"})}),a.jsx(mn,{children:A.map(K=>a.jsx(tt,{value:K.id,children:K.name},K.id))})]})]}),a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{Ee()},disabled:X||!O.trim()||H!==!0,children:X?"Generating...":"Generate Baseline"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{pe({enabled:N.snapshotEval?.enabled??!1,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:R,children:"Clear Baseline"})]})]})]})}),a.jsxs(Sg,{value:Q,onValueChange:K=>{if(K!=="servers"&&K!=="agents"&&K!=="scenarios")return;const ge=new URLSearchParams(r);if(ge.delete("tab"),s(ge,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${K}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${K}`,{replace:!0})},className:"space-y-4",children:[a.jsxs(Xf,{children:[a.jsxs(Cs,{value:"scenarios",className:"gap-1.5",children:[a.jsx(VE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),a.jsxs(Cs,{value:"agents",className:"gap-1.5",children:[a.jsx(kr,{className:"h-3.5 w-3.5"}),"Agents"]})]}),a.jsxs(Nf,{value:"agents",children:[!L&&a.jsx(Ve,{className:"mb-4",children:a.jsxs(He,{className:"pt-4 space-y-3",children:[a.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[a.jsxs(wn,{value:D,onValueChange:I,children:[a.jsx(hn,{className:"h-8",children:a.jsx(jn,{placeholder:"Select agent from library"})}),a.jsx(mn,{children:qt.map(K=>a.jsx(tt,{value:K.id,children:K.label},K.id))})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!D,onClick:et,children:"Add Ref"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!D,onClick:ve,children:"Import Inline"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:x.length===0||x.every(K=>_e.some(ge=>ge.kind==="referenced"&&ge.ref===K.id)),onClick:Ke,children:"Add All Refs"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Ne,children:"Add agent"})]})]}),a.jsxs("div",{className:"space-y-2",children:[_e.map((K,ge)=>{const De=K.kind==="referenced"?Ut(K.ref):null,ct=K.kind==="inline"?K.agent.name?.trim()||K.agent.id:De?.name||K.ref,Dt=K.kind==="inline"?K.agent.model:De?.model||"unknown",Et=K.kind==="inline"?K.agent.id:K.ref,Fn=K.kind==="referenced"&&!De,Yn=K.kind==="inline"?K.agent.id:K.ref,ke=oe.includes(Yn),Rn=K.kind==="inline"&&!!ne[K.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(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>$e(ge,-1),disabled:ge===0,"aria-label":"Move agent up",children:a.jsx(ws,{className:"h-3 w-3"})}),a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>$e(ge,1),disabled:ge===_e.length-1,"aria-label":"Move agent down",children:a.jsx(Yt,{className:"h-3 w-3"})})]}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[ge+1,"."]}),a.jsx("span",{className:"truncate font-medium",children:ct}),a.jsx(We,{variant:K.kind==="inline"?"secondary":"outline",children:K.kind==="inline"?"Inline":"Referenced"}),a.jsx(We,{variant:"outline",className:"font-mono text-[10px]",children:Dt}),ke&&a.jsx(We,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),Fn&&a.jsx(We,{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:ke,onChange:jt=>Ft(Yn,jt.target.checked)}),a.jsx("span",{children:"Default"})]}),K.kind==="inline"&&a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>te(jt=>({...jt,[K.agent.id]:!jt[K.agent.id]})),children:Rn?"Collapse":"Expand"}),K.kind==="referenced"&&a.jsx(a.Fragment,{children:a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>Qe(ge),disabled:Fn,children:"Convert to inline"})}),a.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>ze(ge),"aria-label":"Remove agent entry",children:a.jsx(Ta,{className:"h-3.5 w-3.5"})})]})]}),K.kind==="inline"&&Rn&&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(Fe,{className:"text-xs",children:"Name"}),a.jsx(vt,{value:K.agent.name,onChange:jt=>{const Jt=[..._e];Jt[ge]={kind:"inline",agent:{...K.agent,name:jt.target.value}},Me(Jt)},placeholder:"e.g. GPT-5 Mini custom"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Provider"}),a.jsxs(wn,{value:K.agent.provider,onValueChange:jt=>{const Jt=[..._e];Jt[ge]={kind:"inline",agent:{...K.agent,provider:jt}},Me(Jt)},children:[a.jsx(hn,{children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"openai",children:"OpenAI"}),a.jsx(tt,{value:"anthropic",children:"Anthropic"}),a.jsx(tt,{value:"azure",children:"Azure OpenAI"}),a.jsx(tt,{value:"google",children:"Google"}),a.jsx(tt,{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(Fe,{className:"text-xs",children:"Model"}),a.jsx(vt,{value:K.agent.model,onChange:jt=>{const Jt=[..._e];Jt[ge]={kind:"inline",agent:{...K.agent,model:jt.target.value}},Me(Jt)},className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Max Tokens"}),a.jsx(vt,{type:"number",min:1,max:128e3,value:K.agent.maxTokens,onChange:jt=>{const Jt=[..._e];Jt[ge]={kind:"inline",agent:{...K.agent,maxTokens:parseInt(jt.target.value)||0}},Me(Jt)},className:"font-mono text-xs"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Temperature"}),a.jsx(vt,{type:"number",min:0,max:2,step:.01,value:K.agent.temperature,onChange:jt=>{const Jt=[..._e];Jt[ge]={kind:"inline",agent:{...K.agent,temperature:Number(jt.target.value)||0}},Me(Jt)},className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"System Prompt"}),a.jsx(Os,{value:K.agent.systemPrompt||"",onChange:jt=>{const Jt=[..._e];Jt[ge]={kind:"inline",agent:{...K.agent,systemPrompt:jt.target.value}},Me(Jt)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ge}-${Et}`)}),_e.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),Tn.length>0&&a.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",Tn.join(", ")]})]})}),L?a.jsx(Ve,{children:a.jsx(He,{className:"pt-4",children:a.jsxs("div",{className:"space-y-2",children:[rn.map((K,ge)=>{const De=K.agent.name||K.agent.id,ct=oe.includes(K.origin==="inline"?K.agent.id:K.ref||K.agent.id),Dt=K.ref??K.agent.id,Et=!!de[Dt];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:[ge+1,"."]}),a.jsx("div",{className:"truncate font-medium text-sm",children:De})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[ct&&a.jsx(We,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),a.jsx(We,{variant:K.origin==="inline"?"secondary":"outline",children:K.origin==="inline"?"Inline":"Referenced"}),a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>he(Fn=>({...Fn,[Dt]:!Fn[Dt]})),"aria-label":Et?"Collapse agent details":"Expand agent details",children:a.jsx(Yt,{className:`h-4 w-4 transition-transform ${Et?"rotate-180":""}`})})]})]}),Et&&a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[a.jsx(BB,{provider:K.agent.provider}),a.jsx(We,{variant:"outline",className:"text-xs font-mono",children:K.agent.model}),a.jsxs(We,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",K.agent.maxTokens]}),a.jsxs(We,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",K.agent.temperature]})]})]},`agent-view-${ge}-${K.ref??K.agent.id}`)}),rn.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),a.jsxs(Nf,{value:"scenarios",children:[!L&&a.jsx(Ve,{className:"mb-4",children:a.jsxs(He,{className:"pt-4 space-y-3",children:[a.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[a.jsxs(wn,{value:z,onValueChange:J,children:[a.jsx(hn,{className:"h-8",children:a.jsx(jn,{placeholder:"Select scenario from library"})}),a.jsx(mn,{children:[...g].sort((K,ge)=>(K.name||K.id).localeCompare(ge.name||ge.id)).map(K=>a.jsx(tt,{value:K.id,children:K.name||K.id},K.id))})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!z,onClick:Xt,children:"Add Ref"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!z,onClick:Ce,children:"Import Inline"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:qe,children:"Add scenario"})]})]}),a.jsxs("div",{className:"space-y-2",children:[ae.map((K,ge)=>{const De=K.kind==="referenced"?nn(K.ref):null,ct=K.kind==="inline"?K.scenario.name?.trim()||K.scenario.id:De?.name||K.ref,Dt=K.kind==="inline"&&!K.scenario.name?.trim(),Et=K.kind==="referenced"&&Da.has(K.ref),Fn=K.kind==="referenced"&&Array.isArray(K.mcpServers),Yn=K.kind==="inline"&&!!V[K.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(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>be(ge,-1),disabled:ge===0,"aria-label":"Move scenario up",children:a.jsx(ws,{className:"h-3 w-3"})}),a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>be(ge,1),disabled:ge===ae.length-1,"aria-label":"Move scenario down",children:a.jsx(Yt,{className:"h-3 w-3"})})]}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[ge+1,"."]}),a.jsx("span",{className:"truncate font-medium",children:ct}),a.jsx(We,{variant:K.kind==="inline"?"secondary":"outline",children:K.kind==="inline"?"Inline":"Referenced"}),Fn&&a.jsx(We,{variant:"secondary",children:"Override"}),Dt&&a.jsx(We,{variant:"destructive",children:"Name required"}),Et&&a.jsx(We,{variant:"destructive",children:"Missing"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[K.kind==="inline"&&a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>ue(ke=>({...ke,[K.scenario.id]:!ke[K.scenario.id]})),"aria-label":Yn?"Collapse scenario details":"Expand scenario details",children:a.jsx(Yt,{className:`h-3.5 w-3.5 transition-transform ${Yn?"rotate-180":""}`})}),K.kind==="referenced"&&a.jsx(a.Fragment,{children:a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>At(ge),disabled:Et,children:"Convert to inline"})}),a.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>gn(ge),"aria-label":"Remove scenario entry",children:a.jsx(Ta,{className:"h-3.5 w-3.5"})})]})]}),K.kind==="inline"&&Yn&&a.jsx("div",{className:"border-t px-3 py-3",children:a.jsx(X1,{scenarios:[K.scenario],scenarioOrigins:["inline"],agents:[...N.agents,...Bt],servers:[...N.servers??[],...pt],configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:ke=>{const Rn=ke[0];if(!Rn)return;const jt=[...ae];jt[ge]={kind:"inline",scenario:Rn},Re(jt)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})}),K.kind==="referenced"&&!Et&&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:Fs.map(ke=>{const Rn=(K.mcpServers??[]).some(jt=>jt.kind==="referenced"&&jt.ref===ke.id);return a.jsx(se,{type:"button",size:"sm",variant:Rn?"default":"outline",className:`h-7 text-xs ${Rn?"":"opacity-70"}`,onClick:()=>{const jt=(K.mcpServers??[]).filter(Qr=>Qr.kind==="referenced").map(Qr=>Qr.ref),Jt=jt.includes(ke.id)?jt.filter(Qr=>Qr!==ke.id):[...jt,ke.id];Xr(ge,Jt)},children:ke.name||ke.id},`${K.ref}-override-server-${ke.id}`)})}),Fn&&a.jsx(se,{type:"button",size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>yi(ge),children:"Reset override"})]})]},`scenario-entry-${ge}-${K.kind==="inline"?K.scenario.id:K.ref}`)}),ae.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),Ln.length>0&&a.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",Ln.join(", ")]})]})}),L?a.jsx(Ve,{children:a.jsx(He,{className:"pt-4",children:a.jsx(X1,{scenarios:ce.map(K=>K.scenario),scenarioOrigins:ce.map(K=>K.origin),scenarioOverrides:ce.map(K=>K.hasMcpServerOverride),agents:st,servers:Nt,configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var wve=Symbol("radix.slottable");function jve(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=wve,t}var m8="AlertDialog",[Sve]=hr(m8,[j5]),jo=j5(),v8=e=>{const{__scopeAlertDialog:t,...n}=e,r=jo(t);return a.jsx(_v,{...r,...n,modal:!0})};v8.displayName=m8;var Nve="AlertDialogTrigger",Cve=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=jo(n);return a.jsx(HG,{...s,...r,ref:t})});Cve.displayName=Nve;var _ve="AlertDialogPortal",g8=e=>{const{__scopeAlertDialog:t,...n}=e,r=jo(t);return a.jsx(Av,{...r,...n})};g8.displayName=_ve;var Ave="AlertDialogOverlay",x8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=jo(n);return a.jsx(pu,{...s,...r,ref:t})});x8.displayName=Ave;var Cc="AlertDialogContent",[Eve,kve]=Sve(Cc),Pve=jve("AlertDialogContent"),y8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,o=jo(n),i=m.useRef(null),c=wt(t,i),d=m.useRef(null);return a.jsx(qG,{contentName:Cc,titleName:b8,docsSlug:"alert-dialog",children:a.jsx(Eve,{scope:n,cancelRef:d,children:a.jsxs(hu,{role:"alertdialog",...o,...s,ref:c,onOpenAutoFocus:Te(s.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[a.jsx(Pve,{children:r}),a.jsx(Tve,{contentRef:i})]})})})});y8.displayName=Cc;var b8="AlertDialogTitle",w8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=jo(n);return a.jsx(Tf,{...s,...r,ref:t})});w8.displayName=b8;var j8="AlertDialogDescription",S8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=jo(n);return a.jsx(Rf,{...s,...r,ref:t})});S8.displayName=j8;var Ove="AlertDialogAction",N8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=jo(n);return a.jsx(Ev,{...s,...r,ref:t})});N8.displayName=Ove;var C8="AlertDialogCancel",_8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=kve(C8,n),o=jo(n),i=wt(t,s);return a.jsx(Ev,{...o,...r,ref:i})});_8.displayName=C8;var Tve=({contentRef:e})=>{const t=`\`${Cc}\` requires a description for the component to be accessible for screen reader users.
|
|
130
|
-
|
|
131
|
-
You can add a description to the \`${Cc}\` by passing a \`${j8}\` 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 \`${Cc}\`. 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},Rve=v8,Ive=g8,A8=x8,E8=y8,k8=N8,P8=_8,O8=w8,T8=S8;const Ls=Rve,Mve=Ive,R8=m.forwardRef(({className:e,...t},n)=>a.jsx(A8,{className:je("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}));R8.displayName=A8.displayName;const ss=m.forwardRef(({className:e,...t},n)=>a.jsxs(Mve,{children:[a.jsx(R8,{}),a.jsx(E8,{ref:n,className:je("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})]}));ss.displayName=E8.displayName;const os=({className:e,...t})=>a.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...t});os.displayName="AlertDialogHeader";const is=({className:e,...t})=>a.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});is.displayName="AlertDialogFooter";const ls=m.forwardRef(({className:e,...t},n)=>a.jsx(O8,{ref:n,className:je("text-lg font-semibold",e),...t}));ls.displayName=O8.displayName;const cs=m.forwardRef(({className:e,...t},n)=>a.jsx(T8,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));cs.displayName=T8.displayName;const us=m.forwardRef(({className:e,...t},n)=>a.jsx(k8,{ref:n,className:je(kN(),e),...t}));us.displayName=k8.displayName;const ds=m.forwardRef(({className:e,...t},n)=>a.jsx(P8,{ref:n,className:je(kN({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ds.displayName=P8.displayName;const $ve=()=>{const{servers:e,setServers:t,reload:n,loading:r}=rs(),s=Ia(),[o,i]=m.useState(null),[c,d]=m.useState(""),f=c.trim().toLowerCase(),h=b=>b.name?.trim()||b.id,p=async b=>{const y=`${h(b)}-copy`;let S=y,C=1;for(;e.some(E=>(E.name?.trim()||E.id)===S);)S=`${y}-${C}`,C+=1;const N={...structuredClone(b),id:`srv-${Date.now()}`,name:S};await t([...e,N]),Ae({title:"Server duplicated",description:`Created ${S}.`})},x=async b=>{await t(e.filter(y=>y.id!==b.id)),Ae({title:"Server deleted",description:`${h(b)} was removed.`}),i(null)},g=b=>b.transport==="stdio"?[b.command,...b.args||[]].filter(Boolean).join(" "):b.url||"",j=m.useMemo(()=>[...f.length===0?e:e.filter(y=>[h(y),y.id,y.transport,g(y),y.authType??""].join(" ").toLowerCase().includes(f))].sort((y,S)=>h(y).localeCompare(h(S),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(Q$,{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(IC,{value:c,onValueChange:d,placeholder:"Search MCP servers..."}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(se,{type:"button",size:"sm",onClick:()=>s("/libraries/servers/new"),children:[a.jsx(io,{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(se,{type:"button",size:"sm",className:"mt-4",onClick:()=>s("/libraries/servers/new"),children:[a.jsx(io,{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(Ve,{children:a.jsx(He,{className:"p-0",children:a.jsxs(qr,{children:[a.jsx(Ur,{children:a.jsxs(Gt,{children:[a.jsx(at,{children:"Name"}),a.jsx(at,{children:"Transport"}),a.jsx(at,{children:"Endpoint"}),a.jsx(at,{children:"Auth"}),a.jsx(at,{className:"text-right",children:"Actions"})]})}),a.jsx(Wr,{children:j.map(b=>a.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>s(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[a.jsx(Ue,{className:"font-medium",children:h(b)}),a.jsx(Ue,{children:a.jsx(We,{variant:"secondary",className:"font-mono text-xs",children:b.transport})}),a.jsx(Ue,{children:a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:g(b)})}),a.jsx(Ue,{children:!b.authType||b.authType==="none"?a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):a.jsx(We,{variant:"outline",className:"text-xs",children:b.authType})}),a.jsx(Ue,{className:"text-right",onClick:y=>y.stopPropagation(),children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>i(b),children:[a.jsx(Ta,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(b)},children:[a.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>s(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[a.jsx(sv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},b.id))})]})})}),a.jsx(Ls,{open:!!o,onOpenChange:b=>!b&&i(null),children:a.jsxs(ss,{children:[a.jsxs(os,{children:[a.jsx(ls,{children:"Delete server?"}),a.jsxs(cs,{children:["This will permanently remove"," ",a.jsx("span",{className:"font-mono",children:o?h(o):""})," from the library. This action cannot be undone."]})]}),a.jsxs(is,{children:[a.jsx(ds,{children:"Cancel"}),a.jsx(us,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{o&&x(o)},children:"Delete Server"})]})]})})]})},GM={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"},YM=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none"}),Dve=()=>{const{serverId:e}=wl(),t=Ia(),{servers:n,setServers:r}=rs(),{source:s}=Dn(),o=e==="new",i=e?decodeURIComponent(e):"",c=o?null:n.find(R=>R.id===i||R.name===i),d=R=>R.name?.trim()||R.id,[f,h]=m.useState(()=>c??YM()),[p,x]=m.useState(!1),[g,j]=m.useState(!1),[b,y]=m.useState({status:"idle"}),[S,C]=m.useState(!1),[N,E]=m.useState(!1),[A,k]=m.useState([]),[O,T]=m.useState(!1),$=m.useRef(null);m.useEffect(()=>{const R=o?`new:${i||"new"}`:`srv:${i}`;if($.current!==R){if(o){h(YM()),T(!1),$.current=R;return}c&&(h(c),T(!1),$.current=R)}},[o,i,c]);const B=R=>{T(!1),h(W=>({...W,authType:R,...R!=="bearer"&&R!=="api-key"?{authValue:void 0}:{},...R!=="api-key"?{apiKeyHeaderName:void 0}:{apiKeyHeaderName:W.apiKeyHeaderName||"X-API-Key"},...R!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0,oauthMode:void 0,oauthAuthorizationUrl:void 0,oauthTokenEndpoint:void 0}:{oauthRedirectUrl:W.oauthRedirectUrl||void 0}}))},q=async()=>{if(C(!0),y({status:"loading"}),k([]),f.authType==="oauth2")try{E(!0),await oo({serverNames:[f.id],source:s,onServerStatus:R=>{const W=new Date().toLocaleTimeString(),X=typeof R.tokenExpiresInSeconds=="number"?` (valid ${G1(R.tokenExpiresInSeconds,{nonPositiveLabel:"expired"})}; until ${new Date(R.tokenExpiresAt||Date.now()).toLocaleTimeString()})`:"";if(R.status==="auth_required"){k(G=>[...G,`[${W}] OAuth debug: callback required for '${R.serverName}'`]);return}R.status==="ready"&&(R.debugState==="refreshed"?k(G=>[...G,`[${W}] OAuth debug: token refreshed (no callback)${X}`]):R.debugState==="reused"?k(G=>[...G,`[${W}] OAuth debug: session/token reused${X}`]):k(G=>[...G,`[${W}] OAuth debug: authorized${X}`]))}})}catch(R){y({status:"error",message:`OAuth login failed: ${R instanceof Error?R.message:String(R)}`,testedAt:new Date().toISOString()}),E(!1);return}finally{E(!1)}try{const W=(await s.discoverToolsForAnalysis({serverNames:[f.id]})).servers[0];W&&W.warnings.length===0?y({status:"success",toolNames:W.tools.map(X=>X.name),toolCount:W.tools.length,mcpServerVersion:W.mcpServerVersion,mcpServerImplementation:W.mcpServerImplementation,testedAt:new Date().toISOString()}):y({status:"error",message:W?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(R){y({status:"error",message:R instanceof Error?R.message:String(R),testedAt:new Date().toISOString()})}},F=async()=>{if(!f.name.trim()){Ae({title:"Name is required",variant:"destructive"});return}const R=h8(f);if(R){Ae({title:"Validation Error",description:R,variant:"destructive"});return}const W={...f,authValue:f.authValue?.trim(),apiKeyHeaderName:f.apiKeyHeaderName?.trim()||void 0};j(!0);try{if(o)await r([...n,W]),Ae({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(W.id)}`);else{const X=n.map(G=>G.id===c?.id?W:G);await r(X),Ae({title:"Server saved"}),W.id!==i&&t(`/libraries/servers/${encodeURIComponent(W.id)}`,{replace:!0})}}finally{j(!1)}},H=async()=>{const R=n.filter(W=>W.id!==c?.id);await r(R),Ae({title:"Server deleted"}),t("/libraries/servers")},U=()=>f.transport==="stdio"?[f.command,...f.args||[]].filter(Boolean).join(" "):f.url||"";return!o&&!c?a.jsxs("div",{className:"space-y-4",children:[a.jsxs(_t,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(el,{className:"h-4 w-4"})," Servers"]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:['Server "',i,'" 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(_t,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(el,{className:"h-4 w-4"})," Servers"]}),a.jsx("h1",{className:"text-2xl font-bold",children:o?"New Server":d(f)})]}),!o&&a.jsxs(se,{type:"button",onClick:()=>{q()},disabled:b.status==="loading"||N,children:[a.jsx(aD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&a.jsxs(Ve,{children:[a.jsxs(kt,{className:"flex-row items-center justify-between space-y-0",children:[a.jsx(Pt,{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(As,{className:"h-4 w-4"})})]}),a.jsxs(He,{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}),U()&&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:U()})]})]}),b.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(wr,{className:"h-4 w-4 animate-spin"}),N?"Waiting for OAuth login in browser…":"Connecting to MCP server…"]}),A.length>0&&a.jsx("div",{className:"space-y-0.5",children:A.map((R,W)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:R},W))})]}),b.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(Ac,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",b.toolCount," tool",b.toolCount!==1?"s":""]}),b.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:b.toolNames.slice(0,5).map(R=>a.jsx("li",{className:"font-mono text-xs",children:R},R))})]}),(b.mcpServerImplementation||b.mcpServerVersion)&&a.jsx("div",{className:"rounded-md border bg-muted/40 p-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[b.mcpServerImplementation?.icons?.[0]?.src?a.jsx("img",{src:b.mcpServerImplementation.icons[0].src,alt:b.mcpServerImplementation.title||b.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:b.mcpServerImplementation?b.mcpServerImplementation.title||b.mcpServerImplementation.name:"Unknown MCP server"}),b.mcpServerVersion?a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Version: ",a.jsx("code",{className:"font-mono",children:b.mcpServerVersion})]}):null,b.mcpServerImplementation?.description?a.jsx("p",{className:"text-xs text-muted-foreground",children:b.mcpServerImplementation.description}):null]})]})}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]}),A.length>0&&a.jsx("div",{className:"space-y-0.5",children:A.map((R,W)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:R},W))})]}),b.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"})," — ",b.message]}),GM[f.transport]&&a.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",GM[f.transport]]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]})]})]}),a.jsxs(Ve,{children:[a.jsx(kt,{children:a.jsx(Pt,{className:"text-base",children:"Configuration"})}),a.jsxs(He,{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(Fe,{children:"Name"}),a.jsx(vt,{value:f.name,onChange:R=>h(W=>({...W,name:R.target.value})),placeholder:"e.g. Filesystem MCP"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{children:"Transport"}),a.jsxs(wn,{value:f.transport,onValueChange:R=>h(W=>({...W,transport:R})),children:[a.jsx(hn,{children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"stdio",children:"stdio"}),a.jsx(tt,{value:"sse",children:"SSE"}),a.jsx(tt,{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(Fe,{children:"Command"}),a.jsx(vt,{value:f.command||"",onChange:R=>h(W=>({...W,command:R.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{children:"Args (comma-separated)"}),a.jsx(vt,{value:(f.args||[]).join(", "),onChange:R=>h(W=>({...W,args:R.target.value.split(",").map(X=>X.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{children:"URL"}),a.jsx(vt,{value:f.url||"",onChange:R=>h(W=>({...W,url:R.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(Fe,{children:"Auth Type"}),a.jsxs(wn,{value:f.authType||"none",onValueChange:R=>B(R),children:[a.jsx(hn,{children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"none",children:"None"}),a.jsx(tt,{value:"bearer",children:"Bearer Token"}),a.jsx(tt,{value:"api-key",children:"API Key"}),a.jsx(tt,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType==="bearer"&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{children:"Token"}),a.jsx(vt,{value:f.authValue||"",onChange:R=>h(W=>({...W,authValue:R.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(Fe,{className:"text-xs",children:"Header Name"}),a.jsx(vt,{value:f.apiKeyHeaderName||"X-API-Key",onChange:R=>h(W=>({...W,apiKeyHeaderName:R.target.value})),placeholder:"X-API-Key",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Value"}),a.jsx(vt,{value:f.authValue||"",onChange:R=>h(W=>({...W,authValue:R.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(se,{type:"button",variant:!f.oauthMode||f.oauthMode==="pre_registered"?"default":"outline",size:"sm",onClick:()=>h(R=>({...R,oauthMode:"pre_registered"})),children:"Pre-registered"}),a.jsx(se,{type:"button",variant:f.oauthMode==="dcr"?"default":"outline",size:"sm",onClick:()=>h(R=>({...R,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(Fe,{className:"text-xs",children:"Client ID"}),a.jsx(vt,{value:f.oauthClientId||"",onChange:R=>h(W=>({...W,oauthClientId:R.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Client Secret (optional)"}),a.jsx(vt,{type:"password",value:f.oauthClientSecret||"",onChange:R=>h(W=>({...W,oauthClientSecret:R.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Scope (optional, space-separated)"}),a.jsx(vt,{value:f.oauthScope||"",onChange:R=>h(W=>({...W,oauthScope:R.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:()=>T(R=>!R),children:[a.jsx("span",{children:O?"▾":"▸"}),"Advanced — manual endpoint overrides"]}),O&&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(Fe,{className:"text-xs",children:"Authorization URL"}),a.jsx(vt,{value:f.oauthAuthorizationUrl||"",onChange:R=>h(W=>({...W,oauthAuthorizationUrl:R.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(Fe,{className:"text-xs",children:"Token URL"}),a.jsx(vt,{value:f.oauthTokenEndpoint||"",onChange:R=>h(W=>({...W,oauthTokenEndpoint:R.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:!o&&a.jsx(se,{type:"button",variant:"destructive",size:"sm",onClick:()=>x(!0),children:"Delete"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),a.jsxs(se,{type:"button",size:"sm",onClick:()=>{F()},disabled:g,children:[g&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),o?"Create Server":"Save"]})]})]})]})]}),a.jsx(Ls,{open:p,onOpenChange:x,children:a.jsxs(ss,{children:[a.jsxs(os,{children:[a.jsx(ls,{children:"Delete server?"}),a.jsxs(cs,{children:["This will permanently remove the server"," ",a.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),a.jsxs(is,{children:[a.jsx(ds,{children:"Cancel"}),a.jsx(us,{onClick:()=>{H()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},Lve=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=rs(),s=Ia(),[o,i]=m.useState(null),[c,d]=m.useState(""),f=c.trim().toLowerCase(),h=m.useMemo(()=>f.length===0?e:e.filter(g=>{const j=g.name.toLowerCase(),b=g.model.toLowerCase();return j.includes(f)||b.includes(f)}),[e,f]),p=async g=>{const j=`${g.name}-copy`;let b=j,y=1;for(;e.some(C=>C.name===b);)b=`${j}-${y}`,y+=1;const S={...structuredClone(g),id:`agt-${Date.now()}`,name:b};await t([...e,S]),Ae({title:"Agent duplicated",description:`Created ${b}.`})},x=async g=>{await t(e.filter(j=>j.id!==g.id)),Ae({title:"Agent deleted",description:`${g.name} was removed.`}),i(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(kr,{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(IC,{value:c,onValueChange:d,placeholder:"Search agents..."}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(se,{type:"button",size:"sm",onClick:()=>s("/libraries/agents/new"),children:[a.jsx(io,{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(se,{type:"button",size:"sm",className:"mt-4",onClick:()=>s("/libraries/agents/new"),children:[a.jsx(io,{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(Ve,{children:a.jsx(He,{className:"p-0",children:a.jsxs(qr,{children:[a.jsx(Ur,{children:a.jsxs(Gt,{children:[a.jsx(at,{children:"Name"}),a.jsx(at,{children:"Provider"}),a.jsx(at,{children:"Model"}),a.jsx(at,{children:"Max Tokens"}),a.jsx(at,{children:"Temperature"}),a.jsx(at,{className:"text-right",children:"Actions"})]})}),a.jsx(Wr,{children:h.map(g=>a.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>s(`/libraries/agents/${encodeURIComponent(g.id)}`),children:[a.jsx(Ue,{className:"font-medium",children:g.name}),a.jsx(Ue,{children:a.jsx(BB,{provider:g.provider})}),a.jsx(Ue,{children:a.jsx("span",{className:"font-mono text-xs",children:g.model})}),a.jsx(Ue,{className:"font-mono text-xs",children:g.maxTokens}),a.jsx(Ue,{className:"font-mono text-xs",children:g.temperature.toFixed(2)}),a.jsx(Ue,{className:"text-right",onClick:j=>j.stopPropagation(),children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>i(g),children:[a.jsx(Ta,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(g)},children:[a.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>s(`/libraries/agents/${encodeURIComponent(g.id)}`),children:[a.jsx(sv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},g.id))})]})})}),a.jsx(Ls,{open:!!o,onOpenChange:g=>!g&&i(null),children:a.jsxs(ss,{children:[a.jsxs(os,{children:[a.jsx(ls,{children:"Delete agent?"}),a.jsxs(cs,{children:["This will permanently remove"," ",a.jsx("span",{className:"font-mono",children:o?.name})," from the library. This action cannot be undone."]})]}),a.jsxs(is,{children:[a.jsx(ds,{children:"Cancel"}),a.jsx(us,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{o&&x(o)},children:"Delete Agent"})]})]})})]})};var I8=["PageUp","PageDown"],M8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],$8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Cu="Slider",[Q1,Fve,zve]=Cf(Cu),[D8]=hr(Cu,[zve]),[Bve,Eg]=D8(Cu),L8=m.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:o=1,orientation:i="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:h,onValueChange:p=()=>{},onValueCommit:x=()=>{},inverted:g=!1,form:j,...b}=e,y=m.useRef(new Set),S=m.useRef(0),N=i==="horizontal"?qve:Uve,[E=[],A]=ha({prop:h,defaultProp:f,onChange:q=>{[...y.current][S.current]?.focus(),p(q)}}),k=m.useRef(E);function O(q){const F=Gve(E,q);B(q,F)}function T(q){B(q,S.current)}function $(){const q=k.current[S.current];E[S.current]!==q&&x(E)}function B(q,F,{commit:H}={commit:!1}){const U=Jve(o),R=Zve(Math.round((q-r)/o)*o+r,U),W=Sf(R,[r,s]);A((X=[])=>{const G=Hve(X,W,F);if(Qve(G,d*o)){S.current=G.indexOf(W);const z=String(G)!==String(X);return z&&H&&x(G),z?G:X}else return X})}return a.jsx(Bve,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:s,valueIndexToChangeRef:S,thumbs:y.current,values:E,orientation:i,form:j,children:a.jsx(Q1.Provider,{scope:e.__scopeSlider,children:a.jsx(Q1.Slot,{scope:e.__scopeSlider,children:a.jsx(N,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:Te(b.onPointerDown,()=>{c||(k.current=E)}),min:r,max:s,inverted:g,onSlideStart:c?void 0:O,onSlideMove:c?void 0:T,onSlideEnd:c?void 0:$,onHomeKeyDown:()=>!c&&B(r,0,{commit:!0}),onEndKeyDown:()=>!c&&B(s,E.length-1,{commit:!0}),onStepKeyDown:({event:q,direction:F})=>{if(!c){const R=I8.includes(q.key)||q.shiftKey&&M8.includes(q.key)?10:1,W=S.current,X=E[W],G=o*R*F;B(X+G,W,{commit:!0})}}})})})})});L8.displayName=Cu;var[F8,z8]=D8(Cu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),qve=m.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:o,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,x]=m.useState(null),g=wt(t,N=>x(N)),j=m.useRef(void 0),b=ju(s),y=b==="ltr",S=y&&!o||!y&&o;function C(N){const E=j.current||p.getBoundingClientRect(),A=[0,E.width],O=JC(A,S?[n,r]:[r,n]);return j.current=E,O(N-E.left)}return a.jsx(F8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:a.jsx(B8,{dir:b,"data-orientation":"horizontal",...h,ref:g,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const E=C(N.clientX);i?.(E)},onSlideMove:N=>{const E=C(N.clientX);c?.(E)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:N=>{const A=$8[S?"from-left":"from-right"].includes(N.key);f?.({event:N,direction:A?-1:1})}})})}),Uve=m.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:o,onSlideMove:i,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=m.useRef(null),p=wt(t,h),x=m.useRef(void 0),g=!s;function j(b){const y=x.current||h.current.getBoundingClientRect(),S=[0,y.height],N=JC(S,g?[r,n]:[n,r]);return x.current=y,N(b-y.top)}return a.jsx(F8,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:a.jsx(B8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const y=j(b.clientY);o?.(y)},onSlideMove:b=>{const y=j(b.clientY);i?.(y)},onSlideEnd:()=>{x.current=void 0,c?.()},onStepKeyDown:b=>{const S=$8[g?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),B8=m.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:o,onHomeKeyDown:i,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=Eg(Cu,n);return a.jsx(Ye.span,{...f,ref:t,onKeyDown:Te(e.onKeyDown,p=>{p.key==="Home"?(i(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):I8.concat(M8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Te(e.onPointerDown,p=>{const x=p.target;x.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(x)?x.focus():r(p)}),onPointerMove:Te(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&s(p)}),onPointerUp:Te(e.onPointerUp,p=>{const x=p.target;x.hasPointerCapture(p.pointerId)&&(x.releasePointerCapture(p.pointerId),o(p))})})}),q8="SliderTrack",U8=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Eg(q8,n);return a.jsx(Ye.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});U8.displayName=q8;var J1="SliderRange",W8=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Eg(J1,n),o=z8(J1,n),i=m.useRef(null),c=wt(t,i),d=s.values.length,f=s.values.map(x=>K8(x,s.min,s.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return a.jsx(Ye.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:c,style:{...e.style,[o.startEdge]:h+"%",[o.endEdge]:p+"%"}})});W8.displayName=J1;var Z1="SliderThumb",V8=m.forwardRef((e,t)=>{const n=Fve(e.__scopeSlider),[r,s]=m.useState(null),o=wt(t,c=>s(c)),i=m.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return a.jsx(Wve,{...e,ref:o,index:i})}),Wve=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...o}=e,i=Eg(Z1,n),c=z8(Z1,n),[d,f]=m.useState(null),h=wt(t,C=>f(C)),p=d?i.form||!!d.closest("form"):!0,x=uv(d),g=i.values[r],j=g===void 0?0:K8(g,i.min,i.max),b=Kve(r,i.values.length),y=x?.[c.size],S=y?Yve(y,j,c.direction):0;return m.useEffect(()=>{if(d)return i.thumbs.add(d),()=>{i.thumbs.delete(d)}},[d,i.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${j}% + ${S}px)`},children:[a.jsx(Q1.ItemSlot,{scope:e.__scopeSlider,children:a.jsx(Ye.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":i.min,"aria-valuenow":g,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...o,ref:h,style:g===void 0?{display:"none"}:e.style,onFocus:Te(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})})}),p&&a.jsx(H8,{name:s??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:g},r)]})});V8.displayName=Z1;var Vve="RadioBubbleInput",H8=m.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=m.useRef(null),o=wt(s,r),i=gg(t);return m.useEffect(()=>{const c=s.current;if(!c)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&h){const p=new Event("input",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[i,t]),a.jsx(Ye.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});H8.displayName=Vve;function Hve(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,o)=>s-o)}function K8(e,t,n){const o=100/(n-t)*(e-t);return Sf(o,[0,100])}function Kve(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Gve(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 Yve(e,t,n){const r=e/2,o=JC([0,50],[0,r]);return(r-o(t)*n)*n}function Xve(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Qve(e,t){if(t>0){const n=Xve(e);return Math.min(...n)>=t}return!0}function JC(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 Jve(e){return(String(e).split(".")[1]||"").length}function Zve(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var G8=L8,ege=U8,tge=W8,nge=V8;const Y8=m.forwardRef(({className:e,...t},n)=>a.jsxs(G8,{ref:n,className:je("relative flex w-full touch-none select-none items-center",e),...t,children:[a.jsx(ege,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx(tge,{className:"absolute h-full bg-primary"})}),a.jsx(nge,{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"})]}));Y8.displayName=G8.displayName;function rge(e){const t=age(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(oge);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,{...i,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function age(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=lge(s),c=ige(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Pr(r,i):i),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sge=Symbol("radix.slottable");function oge(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sge}function ige(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{const d=o(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function lge(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 kg="Popover",[X8]=hr(kg,[ui]),Qf=ui(),[cge,xi]=X8(kg),Q8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!1}=e,c=Qf(t),d=m.useRef(null),[f,h]=m.useState(!1),[p,x]=ha({prop:r,defaultProp:s??!1,onChange:o,caller:kg});return a.jsx(dv,{...c,children:a.jsx(cge,{scope:t,contentId:nr(),triggerRef:d,open:p,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(g=>!g),[x]),hasCustomAnchor:f,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:i,children:n})})};Q8.displayName=kg;var J8="PopoverAnchor",uge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xi(J8,n),o=Qf(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=s;return m.useEffect(()=>(i(),()=>c()),[i,c]),a.jsx(Ef,{...o,...r,ref:t})});uge.displayName=J8;var Z8="PopoverTrigger",e6=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xi(Z8,n),o=Qf(n),i=wt(t,s.triggerRef),c=a.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":s6(s.open),...r,ref:i,onClick:Te(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx(Ef,{asChild:!0,...o,children:c})});e6.displayName=Z8;var ZC="PopoverPortal",[dge,fge]=X8(ZC,{forceMount:void 0}),t6=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=xi(ZC,t);return a.jsx(dge,{scope:t,forceMount:n,children:a.jsx(Gn,{present:n||o.open,children:a.jsx(yl,{asChild:!0,container:s,children:r})})})};t6.displayName=ZC;var au="PopoverContent",n6=m.forwardRef((e,t)=>{const n=fge(au,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=xi(au,e.__scopePopover);return a.jsx(Gn,{present:r||o.open,children:o.modal?a.jsx(hge,{...s,ref:t}):a.jsx(mge,{...s,ref:t})})});n6.displayName=au;var pge=rge("PopoverContent.RemoveScroll"),hge=m.forwardRef((e,t)=>{const n=xi(au,e.__scopePopover),r=m.useRef(null),s=wt(t,r),o=m.useRef(!1);return m.useEffect(()=>{const i=r.current;if(i)return Nv(i)},[]),a.jsx(Of,{as:pge,allowPinchZoom:!0,children:a.jsx(r6,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,i=>{i.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Te(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),mge=m.forwardRef((e,t)=>{const n=xi(au,e.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(r6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;n.triggerRef.current?.contains(i)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),r6=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,...p}=e,x=xi(au,n),g=Qf(n);return jv(),a.jsx(Pf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(xl,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),children:a.jsx(fv,{"data-state":s6(x.open),role:"dialog",id:x.contentId,...g,...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)"}})})})}),a6="PopoverClose",vge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xi(a6,n);return a.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});vge.displayName=a6;var gge="PopoverArrow",xge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Qf(n);return a.jsx(pv,{...s,...r,ref:t})});xge.displayName=gge;function s6(e){return e?"open":"closed"}var yge=Q8,bge=e6,wge=t6,o6=n6;const su=yge,ou=bge,dl=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx(wge,{children:a.jsx(o6,{ref:s,align:t,sideOffset:n,className:je("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})}));dl.displayName=o6.displayName;var XM=1,jge=.9,Sge=.8,Nge=.17,Lj=.1,Fj=.999,Cge=.9999,_ge=.99,Age=/[\\\/_+.#"@\[\(\{&]/,Ege=/[\\\/_+.#"@\[\(\{&]/g,kge=/[\s-]/,i6=/[\s-]/g;function eN(e,t,n,r,s,o,i){if(o===t.length)return s===e.length?XM:_ge;var c=`${s},${o}`;if(i[c]!==void 0)return i[c];for(var d=r.charAt(o),f=n.indexOf(d,s),h=0,p,x,g,j;f>=0;)p=eN(e,t,n,r,f+1,o+1,i),p>h&&(f===s?p*=XM:Age.test(e.charAt(f-1))?(p*=Sge,g=e.slice(s,f-1).match(Ege),g&&s>0&&(p*=Math.pow(Fj,g.length))):kge.test(e.charAt(f-1))?(p*=jge,j=e.slice(s,f-1).match(i6),j&&s>0&&(p*=Math.pow(Fj,j.length))):(p*=Nge,s>0&&(p*=Math.pow(Fj,f-s))),e.charAt(f)!==t.charAt(o)&&(p*=Cge)),(p<Lj&&n.charAt(f-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(f-1)!==r.charAt(o))&&(x=eN(e,t,n,r,f+1,o+2,i),x*Lj>p&&(p=x*Lj)),p>h&&(h=p),f=n.indexOf(d,f+1);return i[c]=h,h}function QM(e){return e.toLowerCase().replace(i6," ")}function Pge(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,eN(e,t,QM(e),QM(t),0,0,{})}var xd='[cmdk-group=""]',zj='[cmdk-group-items=""]',Oge='[cmdk-group-heading=""]',l6='[cmdk-item=""]',JM=`${l6}:not([aria-disabled="true"])`,tN="cmdk-item-select",cc="data-value",Tge=(e,t,n)=>Pge(e,t,n),c6=m.createContext(void 0),Jf=()=>m.useContext(c6),u6=m.createContext(void 0),e_=()=>m.useContext(u6),d6=m.createContext(void 0),f6=m.forwardRef((e,t)=>{let n=uc(()=>{var I,ne;return{search:"",value:(ne=(I=e.value)!=null?I:e.defaultValue)!=null?ne:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=uc(()=>new Set),s=uc(()=>new Map),o=uc(()=>new Map),i=uc(()=>new Set),c=p6(e),{label:d,children:f,value:h,onValueChange:p,filter:x,shouldFilter:g,loop:j,disablePointerSelection:b=!1,vimBindings:y=!0,...S}=e,C=nr(),N=nr(),E=nr(),A=m.useRef(null),k=Uge();fl(()=>{if(h!==void 0){let I=h.trim();n.current.value=I,O.emit()}},[h]),fl(()=>{k(6,H)},[]);let O=m.useMemo(()=>({subscribe:I=>(i.current.add(I),()=>i.current.delete(I)),snapshot:()=>n.current,setState:(I,ne,te)=>{var de,he,V,ue;if(!Object.is(n.current[I],ne)){if(n.current[I]=ne,I==="search")F(),B(),k(1,q);else if(I==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Q=document.getElementById(E);Q?Q.focus():(de=document.getElementById(C))==null||de.focus()}if(k(7,()=>{var Q;n.current.selectedItemId=(Q=U())==null?void 0:Q.id,O.emit()}),te||k(5,H),((he=c.current)==null?void 0:he.value)!==void 0){let Q=ne??"";(ue=(V=c.current).onValueChange)==null||ue.call(V,Q);return}}O.emit()}},emit:()=>{i.current.forEach(I=>I())}}),[]),T=m.useMemo(()=>({value:(I,ne,te)=>{var de;ne!==((de=o.current.get(I))==null?void 0:de.value)&&(o.current.set(I,{value:ne,keywords:te}),n.current.filtered.items.set(I,$(ne,te)),k(2,()=>{B(),O.emit()}))},item:(I,ne)=>(r.current.add(I),ne&&(s.current.has(ne)?s.current.get(ne).add(I):s.current.set(ne,new Set([I]))),k(3,()=>{F(),B(),n.current.value||q(),O.emit()}),()=>{o.current.delete(I),r.current.delete(I),n.current.filtered.items.delete(I);let te=U();k(4,()=>{F(),te?.getAttribute("id")===I&&q(),O.emit()})}),group:I=>(s.current.has(I)||s.current.set(I,new Set),()=>{o.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:N,listInnerRef:A}),[]);function $(I,ne){var te,de;let he=(de=(te=c.current)==null?void 0:te.filter)!=null?de:Tge;return I?he(I,n.current.search,ne):0}function B(){if(!n.current.search||c.current.shouldFilter===!1)return;let I=n.current.filtered.items,ne=[];n.current.filtered.groups.forEach(de=>{let he=s.current.get(de),V=0;he.forEach(ue=>{let Q=I.get(ue);V=Math.max(Q,V)}),ne.push([de,V])});let te=A.current;R().sort((de,he)=>{var V,ue;let Q=de.getAttribute("id"),Z=he.getAttribute("id");return((V=I.get(Z))!=null?V:0)-((ue=I.get(Q))!=null?ue:0)}).forEach(de=>{let he=de.closest(zj);he?he.appendChild(de.parentElement===he?de:de.closest(`${zj} > *`)):te.appendChild(de.parentElement===te?de:de.closest(`${zj} > *`))}),ne.sort((de,he)=>he[1]-de[1]).forEach(de=>{var he;let V=(he=A.current)==null?void 0:he.querySelector(`${xd}[${cc}="${encodeURIComponent(de[0])}"]`);V?.parentElement.appendChild(V)})}function q(){let I=R().find(te=>te.getAttribute("aria-disabled")!=="true"),ne=I?.getAttribute(cc);O.setState("value",ne||void 0)}function F(){var I,ne,te,de;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let he=0;for(let V of r.current){let ue=(ne=(I=o.current.get(V))==null?void 0:I.value)!=null?ne:"",Q=(de=(te=o.current.get(V))==null?void 0:te.keywords)!=null?de:[],Z=$(ue,Q);n.current.filtered.items.set(V,Z),Z>0&&he++}for(let[V,ue]of s.current)for(let Q of ue)if(n.current.filtered.items.get(Q)>0){n.current.filtered.groups.add(V);break}n.current.filtered.count=he}function H(){var I,ne,te;let de=U();de&&(((I=de.parentElement)==null?void 0:I.firstChild)===de&&((te=(ne=de.closest(xd))==null?void 0:ne.querySelector(Oge))==null||te.scrollIntoView({block:"nearest"})),de.scrollIntoView({block:"nearest"}))}function U(){var I;return(I=A.current)==null?void 0:I.querySelector(`${l6}[aria-selected="true"]`)}function R(){var I;return Array.from(((I=A.current)==null?void 0:I.querySelectorAll(JM))||[])}function W(I){let ne=R()[I];ne&&O.setState("value",ne.getAttribute(cc))}function X(I){var ne;let te=U(),de=R(),he=de.findIndex(ue=>ue===te),V=de[he+I];(ne=c.current)!=null&&ne.loop&&(V=he+I<0?de[de.length-1]:he+I===de.length?de[0]:de[he+I]),V&&O.setState("value",V.getAttribute(cc))}function G(I){let ne=U(),te=ne?.closest(xd),de;for(;te&&!de;)te=I>0?Bge(te,xd):qge(te,xd),de=te?.querySelector(JM);de?O.setState("value",de.getAttribute(cc)):X(I)}let z=()=>W(R().length-1),J=I=>{I.preventDefault(),I.metaKey?z():I.altKey?G(1):X(1)},D=I=>{I.preventDefault(),I.metaKey?W(0):I.altKey?G(-1):X(-1)};return m.createElement(Ye.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:I=>{var ne;(ne=S.onKeyDown)==null||ne.call(S,I);let te=I.nativeEvent.isComposing||I.keyCode===229;if(!(I.defaultPrevented||te))switch(I.key){case"n":case"j":{y&&I.ctrlKey&&J(I);break}case"ArrowDown":{J(I);break}case"p":case"k":{y&&I.ctrlKey&&D(I);break}case"ArrowUp":{D(I);break}case"Home":{I.preventDefault(),W(0);break}case"End":{I.preventDefault(),z();break}case"Enter":{I.preventDefault();let de=U();if(de){let he=new Event(tN);de.dispatchEvent(he)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Vge},d),Pg(e,I=>m.createElement(u6.Provider,{value:O},m.createElement(c6.Provider,{value:T},I))))}),Rge=m.forwardRef((e,t)=>{var n,r;let s=nr(),o=m.useRef(null),i=m.useContext(d6),c=Jf(),d=p6(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:i?.forceMount;fl(()=>{if(!f)return c.item(s,i?.id)},[f]);let h=h6(s,o,[e.value,e.children,o],e.keywords),p=e_(),x=ci(k=>k.value&&k.value===h.current),g=ci(k=>f||c.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);m.useEffect(()=>{let k=o.current;if(!(!k||e.disabled))return k.addEventListener(tN,j),()=>k.removeEventListener(tN,j)},[g,e.onSelect,e.disabled]);function j(){var k,O;b(),(O=(k=d.current).onSelect)==null||O.call(k,h.current)}function b(){p.setState("value",h.current,!0)}if(!g)return null;let{disabled:y,value:S,onSelect:C,forceMount:N,keywords:E,...A}=e;return m.createElement(Ye.div,{ref:Pr(o,t),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!x,"data-disabled":!!y,"data-selected":!!x,onPointerMove:y||c.getDisablePointerSelection()?void 0:b,onClick:y?void 0:j},e.children)}),Ige=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...o}=e,i=nr(),c=m.useRef(null),d=m.useRef(null),f=nr(),h=Jf(),p=ci(g=>s||h.filter()===!1?!0:g.search?g.filtered.groups.has(i):!0);fl(()=>h.group(i),[]),h6(i,c,[e.value,e.heading,d]);let x=m.useMemo(()=>({id:i,forceMount:s}),[s]);return m.createElement(Ye.div,{ref:Pr(c,t),...o,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&m.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Pg(e,g=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},m.createElement(d6.Provider,{value:x},g))))}),Mge=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=m.useRef(null),o=ci(i=>!i.search);return!n&&!o?null:m.createElement(Ye.div,{ref:Pr(s,t),...r,"cmdk-separator":"",role:"separator"})}),$ge=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,o=e_(),i=ci(f=>f.search),c=ci(f=>f.selectedItemId),d=Jf();return m.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),m.createElement(Ye.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:i,onChange:f=>{s||o.setState("search",f.target.value),n?.(f.target.value)}})}),Dge=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,o=m.useRef(null),i=m.useRef(null),c=ci(f=>f.selectedItemId),d=Jf();return m.useEffect(()=>{if(i.current&&o.current){let f=i.current,h=o.current,p,x=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let g=f.offsetHeight;h.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return x.observe(f),()=>{cancelAnimationFrame(p),x.unobserve(f)}}},[]),m.createElement(Ye.div,{ref:Pr(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},Pg(e,f=>m.createElement("div",{ref:Pr(i,d.listInnerRef),"cmdk-list-sizer":""},f)))}),Lge=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:o,container:i,...c}=e;return m.createElement(_v,{open:n,onOpenChange:r},m.createElement(Av,{container:i},m.createElement(pu,{"cmdk-overlay":"",className:s}),m.createElement(hu,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(f6,{ref:t,...c}))))}),Fge=m.forwardRef((e,t)=>ci(n=>n.filtered.count===0)?m.createElement(Ye.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),zge=m.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...o}=e;return m.createElement(Ye.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Pg(e,i=>m.createElement("div",{"aria-hidden":!0},i)))}),Yr=Object.assign(f6,{List:Dge,Item:Rge,Input:$ge,Group:Ige,Separator:Mge,Dialog:Lge,Empty:Fge,Loading:zge});function Bge(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function qge(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function p6(e){let t=m.useRef(e);return fl(()=>{t.current=e}),t}var fl=typeof window>"u"?m.useEffect:m.useLayoutEffect;function uc(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function ci(e){let t=e_(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function h6(e,t,n,r=[]){let s=m.useRef(),o=Jf();return fl(()=>{var i;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());o.value(e,c,d),(i=t.current)==null||i.setAttribute(cc,c),s.current=c}),s}var Uge=()=>{let[e,t]=m.useState(),n=uc(()=>new Map);return fl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function Wge(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Pg({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(Wge(t),{ref:t.ref},n(t.props.children)):n(t)}var Vge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const pl=m.forwardRef(({className:e,...t},n)=>a.jsx(Yr,{ref:n,className:je("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));pl.displayName=Yr.displayName;const hl=m.forwardRef(({className:e,...t},n)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(dN,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(Yr.Input,{ref:n,className:je("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})]}));hl.displayName=Yr.Input.displayName;const ml=m.forwardRef(({className:e,...t},n)=>a.jsx(Yr.List,{ref:n,className:je("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));ml.displayName=Yr.List.displayName;const vl=m.forwardRef((e,t)=>a.jsx(Yr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));vl.displayName=Yr.Empty.displayName;const gl=m.forwardRef(({className:e,...t},n)=>a.jsx(Yr.Group,{ref:n,className:je("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}));gl.displayName=Yr.Group.displayName;const Hge=m.forwardRef(({className:e,...t},n)=>a.jsx(Yr.Separator,{ref:n,className:je("-mx-1 h-px bg-border",e),...t}));Hge.displayName=Yr.Separator.displayName;const ua=m.forwardRef(({className:e,...t},n)=>a.jsx(Yr.Item,{ref:n,className:je("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}));ua.displayName=Yr.Item.displayName;const ZM={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:[]},e$={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"},t$=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Kge=()=>{const{agentName:e}=wl(),t=Ia(),{agents:n,setAgents:r}=rs(),{source:s}=Dn(),o=e==="new",i=e?decodeURIComponent(e):"",c=o?null:n.find(z=>z.id===i)??n.find(z=>z.name===i),[d,f]=m.useState(()=>c??t$()),[h,p]=m.useState(!1),[x,g]=m.useState(!1),[j,b]=m.useState({status:"idle"}),[y,S]=m.useState(!1),[C,N]=m.useState([]),[E,A]=m.useState(!1),[k,O]=m.useState(!1),[T,$]=m.useState(!1),B=m.useRef(null);m.useEffect(()=>{const z=o?`new:${i||"new"}`:`agt:${i}`;if(B.current!==z){if(o){f(t$()),B.current=z;return}c&&(f(c),B.current=z)}},[o,i,c]);const q=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",F=Array.from(new Set([...ZM[d.provider]||[],...C])),H=F.includes(d.model),U=T||!!d.model&&!H,R=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const z=await s.listProviderModels(d.provider);b({status:"success",items:z.items,source:z.source,kind:z.kind,testedAt:new Date().toISOString()})}catch(z){b({status:"error",message:z instanceof Error?z.message:String(z),testedAt:new Date().toISOString()})}},W=async()=>{if(!q){Ae({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}A(!0);try{const z=await s.listProviderModels(d.provider);N(z.items),Ae({title:z.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${z.items.length} ${z.kind} from ${z.source}`})}catch(z){Ae({title:"Could not load provider models",description:String(z instanceof Error?z.message:z),variant:"destructive"})}finally{A(!1)}},X=async()=>{if(!d.name.trim()){Ae({title:"Name is required",variant:"destructive"});return}g(!0);try{if(o)await r([...n,d]),Ae({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const z=n.map(J=>J.id===c?.id?d:J);await r(z),Ae({title:"Agent saved"}),d.id!==i&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{g(!1)}},G=async()=>{const z=n.filter(J=>J.id!==c?.id);await r(z),Ae({title:"Agent deleted"}),t("/libraries/agents")};return!o&&!c?a.jsxs("div",{className:"space-y-4",children:[a.jsxs(_t,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(el,{className:"h-4 w-4"})," Agents"]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:['Agent "',i,'" 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(_t,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(el,{className:"h-4 w-4"})," Agents"]}),a.jsx("h1",{className:"text-2xl font-bold",children:o?"New Agent":d.name})]}),!o&&a.jsxs(se,{type:"button",onClick:()=>{R()},children:[a.jsx(aD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),y&&a.jsxs(Ve,{children:[a.jsxs(kt,{className:"flex-row items-center justify-between space-y-0",children:[a.jsx(Pt,{className:"text-base",children:"Connection Test"}),a.jsx("button",{type:"button",onClick:()=>S(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:a.jsx(As,{className:"h-4 w-4"})})]}),a.jsxs(He,{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(wr,{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(Ac,{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(z=>a.jsx("li",{className:"font-mono text-xs",children:z},z))})]}),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]}),e$[d.provider]&&a.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",e$[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(Ve,{children:[a.jsx(kt,{children:a.jsx(Pt,{className:"text-base",children:"Configuration"})}),a.jsxs(He,{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(Fe,{children:"Name"}),a.jsx(vt,{value:d.name,onChange:z=>f(J=>({...J,name:z.target.value})),placeholder:"e.g. GPT-4o"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{children:"Provider"}),a.jsxs(wn,{value:d.provider,onValueChange:z=>f(J=>({...J,provider:z,model:ZM[z]?.[0]||""})),children:[a.jsx(hn,{children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"openai",children:"OpenAI"}),a.jsx(tt,{value:"anthropic",children:"Anthropic"}),a.jsx(tt,{value:"azure",children:"Azure OpenAI"}),a.jsx(tt,{value:"google",children:"Google"}),a.jsx(tt,{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(Fe,{children:d.provider==="azure"?"Deployment":"Model"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(su,{open:k,onOpenChange:O,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{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(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(dl,{className:"w-[420px] p-0",align:"start",children:a.jsxs(pl,{children:[a.jsx(hl,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),a.jsxs(ml,{children:[a.jsxs(vl,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),a.jsxs(gl,{heading:d.provider==="azure"?"Deployments":"Models",children:[F.map(z=>a.jsxs(ua,{value:z,onSelect:J=>{f(D=>({...D,model:J})),$(!1),O(!1)},children:[a.jsx(Ac,{className:je("mr-2 h-4 w-4",d.model===z?"opacity-100":"opacity-0")}),a.jsx("span",{className:"font-mono text-xs",children:z})]},z)),a.jsx(ua,{value:"__custom_model_id__",onSelect:()=>{$(!0),O(!1)},children:a.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),q&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{W()},disabled:E,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[E?a.jsx(wr,{className:"mr-1 h-3 w-3 animate-spin"}):a.jsx(ma,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),U&&a.jsx(vt,{value:d.model,onChange:z=>f(J=>({...J,model:z.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(Fe,{children:"Max Tokens"}),a.jsx(vt,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:z=>f(J=>({...J,maxTokens:parseInt(z.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(Fe,{children:"Max Turns"}),a.jsx(vt,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:z=>{const J=z.target.value.trim();f(D=>({...D,maxTurns:J&&parseInt(J)||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(Fe,{children:"Temperature"}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),a.jsx(Y8,{value:[d.temperature],onValueChange:([z])=>f(J=>({...J,temperature:z})),min:0,max:2,step:.01})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{children:"System Prompt"}),a.jsx(Os,{value:d.systemPrompt||"",onChange:z=>f(J=>({...J,systemPrompt:z.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:!o&&a.jsx(se,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),a.jsxs(se,{type:"button",size:"sm",onClick:()=>{X()},disabled:x,children:[x&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),o?"Create Agent":"Save"]})]})]})]})]}),a.jsx(Ls,{open:h,onOpenChange:p,children:a.jsxs(ss,{children:[a.jsxs(os,{children:[a.jsx(ls,{children:"Delete agent?"}),a.jsxs(cs,{children:["This will permanently remove the agent"," ",a.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),a.jsxs(is,{children:[a.jsx(ds,{children:"Cancel"}),a.jsx(us,{onClick:()=>{G()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},n$="mcplab.resultAssistantScenarioHandoff",r$=()=>{const{testCaseId:e}=wl(),[t,n]=go(),r=Ia(),{source:s}=Dn(),{scenarios:o,setScenarios:i,agents:c,servers:d,reload:f,loading:h}=rs(),[p,x]=m.useState(""),[g,j]=m.useState("all"),[b,y]=m.useState("name"),[S,C]=m.useState("asc"),[N,E]=m.useState(""),[A,k]=m.useState(null),[O,T]=m.useState("idle"),[$,B]=m.useState(""),[q,F]=m.useState(""),[H,U]=m.useState(0),[R,W]=m.useState(null),X=m.useRef(null),G=m.useRef(!1),z=m.useRef(!1),J=m.useRef(null),D=m.useRef(0),I=e?decodeURIComponent(e):void 0,ne=I?o.findIndex(L=>L.id===I):-1,te=ne>=0?o[ne]:void 0,de=async L=>{if(!te||ne<0||!L)return;const oe=[...o];oe[ne]=L,await i(oe)},he=async()=>{const L=J.current;if(!L||!te)return;if(G.current){z.current=!0;return}G.current=!0,z.current=!1;const oe=++D.current;T("saving"),B("");try{await de(L),oe===D.current&&T("saved")}catch(pe){const Ee=pe instanceof Error?pe.message:String(pe);oe===D.current&&(T("error"),B(Ee)),Ae({title:"Could not save scenario",description:Ee,variant:"destructive"})}finally{G.current=!1,z.current&&(z.current=!1,he())}},V=L=>{J.current=L,T("dirty"),B(""),X.current&&window.clearTimeout(X.current),X.current=window.setTimeout(()=>{X.current=null,he()},700)},ue=async()=>{const L=`scn-${Date.now()}`;let oe=L,pe=1;for(;o.some(Xe=>Xe.id===oe);)oe=`${L}-${pe}`,pe+=1;const Ee={id:oe,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await i([...o,Ee]),r(`/libraries/test-cases/${encodeURIComponent(oe)}`),Ae({title:"Test case created",description:`Opened ${oe} for editing.`})},Q=L=>{const oe=(L||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let pe=oe,Ee=1;for(;o.some(Xe=>Xe.id===pe);)pe=`${oe}-${Ee}`,Ee+=1;return pe},Z=async(L,oe=!1)=>{const pe=Q(`${L.id}-copy`),Ee={...structuredClone(L),id:pe,name:L.name?`${L.name} (Copy)`:""};await i([...o,Ee]),Ae({title:"Test case duplicated",description:`Created ${Ee.id}.`}),oe&&r(`/libraries/test-cases/${encodeURIComponent(Ee.id)}`)},fe=async L=>{X.current&&(window.clearTimeout(X.current),X.current=null);const oe=o.filter(pe=>pe.id!==L.id);await i(oe),Ae({title:"Test case deleted",description:`${L.id} was removed.`}),te?.id===L.id&&(k(null),J.current=null,T("idle"),B(""),r("/libraries/test-cases"))},ae=L=>L.map(oe=>d.find(pe=>pe.id===oe)).filter(Boolean).map(oe=>oe?.name||oe?.id).filter(Boolean),Re=m.useMemo(()=>{const L=new Set;for(const oe of o)for(const pe of ae(oe.serverIds))L.add(pe);return Array.from(L).sort((oe,pe)=>oe.localeCompare(pe))},[o,d]),_e=m.useMemo(()=>{const L=p.trim().toLowerCase(),oe=o.filter(pe=>{const Ee=(pe.name||"").toLowerCase(),Xe=pe.id.toLowerCase(),ht=(pe.prompt||"").toLowerCase(),gt=ae(pe.serverIds);return g!=="all"&&!gt.includes(g)?!1:L?Ee.includes(L)||Xe.includes(L)||ht.includes(L)||gt.some(mt=>mt.toLowerCase().includes(L)):!0});return oe.sort((pe,Ee)=>{const Xe=ae(pe.serverIds),ht=ae(Ee.serverIds);let gt=0;switch(b){case"id":gt=pe.id.localeCompare(Ee.id);break;case"servers":gt=Xe.length-ht.length;break;case"evalRules":gt=pe.evalRules.length-Ee.evalRules.length;break;case"extractRules":gt=pe.extractRules.length-Ee.extractRules.length;break;default:gt=(pe.name||pe.id).localeCompare(Ee.name||Ee.id);break}return gt===0&&(gt=pe.id.localeCompare(Ee.id)),S==="asc"?gt:-gt}),oe},[o,p,g,b,S,d]);m.useEffect(()=>{let L=!0;return s.getWorkspaceSettings().then(oe=>{!L||!oe||E(oe.scenarioAssistantAgentName??"")}).catch(()=>{L&&E("")}),()=>{L=!1}},[s]),m.useEffect(()=>{if(I&&t.get("assistantHandoff")==="1")try{const L=window.sessionStorage.getItem(n$);if(!L)return;const oe=JSON.parse(L);if(!oe||oe.scenarioId!==I||!oe.prompt)return;F(String(oe.prompt)),U(Date.now()),window.sessionStorage.removeItem(n$);const pe=new URLSearchParams(t);pe.delete("assistantHandoff"),n(pe,{replace:!0}),Ae({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[I,t,n]),m.useEffect(()=>{te?(k(structuredClone(te)),J.current=structuredClone(te),T("idle"),B("")):(k(null),J.current=null,T("idle"),B("")),X.current&&(window.clearTimeout(X.current),X.current=null),G.current=!1,z.current=!1},[te]),m.useEffect(()=>()=>{X.current&&window.clearTimeout(X.current)},[]);const Me=N||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(J$,{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:[te&&a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[a.jsx(el,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!te&&a.jsxs(se,{type:"button",size:"sm",onClick:()=>{ue()},children:[a.jsx(io,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!te&&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(Fe,{className:"text-xs",children:"Search"}),a.jsxs("div",{className:"relative",children:[a.jsx(dN,{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(vt,{value:p,onChange:L=>x(L.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(Fe,{className:"text-xs",children:"Server Filter"}),a.jsxs(wn,{value:g,onValueChange:j,children:[a.jsx(hn,{className:"h-8 text-xs",children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"all",children:"All servers"}),Re.map(L=>a.jsx(tt,{value:L,children:L},L))]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Sort By"}),a.jsxs(wn,{value:b,onValueChange:L=>y(L),children:[a.jsx(hn,{className:"h-8 text-xs",children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"name",children:"Name"}),a.jsx(tt,{value:"id",children:"ID"}),a.jsx(tt,{value:"servers",children:"# Servers"}),a.jsx(tt,{value:"evalRules",children:"# Eval Rules"}),a.jsx(tt,{value:"extractRules",children:"# Extract Rules"})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Fe,{className:"text-xs",children:"Direction"}),a.jsxs(wn,{value:S,onValueChange:L=>C(L),children:[a.jsx(hn,{className:"h-8 w-28 text-xs",children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"asc",children:"Ascending"}),a.jsx(tt,{value:"desc",children:"Descending"})]})]})]})]}),a.jsx(Ve,{children:a.jsxs(He,{className:"space-y-3 pt-6",children:[a.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",_e.length," of ",o.length," test case",o.length!==1?"s":"","."]}),I&&!te&&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."]}),o.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):_e.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:_e.map(L=>{const oe=I===L.id,pe=`/libraries/test-cases/${encodeURIComponent(L.id)}`,Ee=ae(L.serverIds);return a.jsx("div",{className:`rounded-lg border p-3 ${oe?"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(_t,{to:pe,className:"font-medium truncate hover:underline",children:L.name||L.id}),a.jsx(We,{variant:"outline",className:"font-mono text-[10px]",children:L.id}),oe&&a.jsx(We,{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:[L.evalRules.length," eval rule",L.evalRules.length!==1?"s":""]}),a.jsxs("span",{children:[L.extractRules.length," extract rule",L.extractRules.length!==1?"s":""]})]}),Ee.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1",children:Ee.map(Xe=>a.jsx(We,{variant:"secondary",className:"text-[10px]",children:Xe},`${L.id}-${Xe}`))})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>W(L),children:[a.jsx(Ta,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Z(L)},children:[a.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsx(se,{type:"button",size:"sm",variant:oe?"default":"outline",asChild:!0,children:a.jsxs(_t,{to:pe,children:[a.jsx(sv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},L.id)})})]})})]}),te&&A?a.jsxs(Ve,{children:[a.jsx(kt,{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(Pt,{className:"text-base",children:["Edit Test Case ·"," ",a.jsx("code",{className:"font-mono text-muted-foreground",children:te.id})]}),a.jsx(We,{variant:"outline",className:`text-[10px] ${O==="saving"?"border-amber-300 text-amber-700":O==="saved"?"border-emerald-300 text-emerald-700":O==="error"?"border-destructive/40 text-destructive":O==="dirty"?"border-sky-300 text-sky-700":""}`,children:O==="saving"?"Saving...":O==="saved"?"Saved":O==="error"?"Save failed":O==="dirty"?"Unsaved changes":"Ready"})]}),O==="error"&&$&&a.jsx("div",{className:"text-[11px] text-destructive",children:$})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Z(A,!0)},children:[a.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>W(A),children:[a.jsx(Ta,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]})]})]})}),a.jsx(He,{className:"pt-3",children:a.jsx(X1,{scenarios:[A],agents:c,servers:d,defaultAssistantAgentName:Me,assistantInitialPromptByScenarioId:q&&A?.id?{[A.id]:q}:void 0,assistantAutoOpenNonceByScenarioId:A?.id&&H?{[A.id]:H}:void 0,onChange:L=>{const oe=L[0];oe&&(k(oe),V(oe))},allowAdd:!1})})]}):null,a.jsx(Ls,{open:!!R,onOpenChange:L=>!L&&W(null),children:a.jsxs(ss,{children:[a.jsxs(os,{children:[a.jsx(ls,{children:"Delete test case?"}),a.jsxs(cs,{children:["This will permanently remove"," ",a.jsx("span",{className:"font-medium",children:R?.name||R?.id})," ","from the library. This action cannot be undone."]})]}),a.jsxs(is,{children:[a.jsx(ds,{children:"Cancel"}),a.jsx(us,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{R&&(fe(R),W(null))},children:"Delete Test Case"})]})]})})]})},Gge=()=>{const{source:e}=Dn(),{agents:t,reload:n,loading:r}=rs(),[s,o]=m.useState(!1),[i,c]=m.useState(!1),[d,f]=m.useState(""),h=m.useMemo(()=>d||t[0]?.name||"",[d,t]),p=m.useCallback(async()=>{o(!0);try{const j=await e.getWorkspaceSettings();f(j?.scenarioAssistantAgentName??"")}catch(j){f(""),Ae({title:"Could not load settings",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{o(!1)}},[e]);m.useEffect(()=>{p()},[p]);const x=async j=>{f(j),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:j||void 0}),Ae({title:"Settings updated",description:j?`Default assistant agent set to ${j}.`:"Default assistant agent cleared (will use first available agent by default)."})}catch(b){Ae({title:"Could not save settings",description:b instanceof Error?b.message:String(b),variant:"destructive"})}finally{c(!1)}},g=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(fN,{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(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{g()},disabled:r||s,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),a.jsxs(Ve,{children:[a.jsxs(kt,{className:"pb-3",children:[a.jsx(Pt,{className:"text-base",children:"Assistant Defaults"}),a.jsx(Br,{children:"Default assistant agent used across assistant flows. If unset, MCP Lab uses the first available agent automatically."})]}),a.jsxs(He,{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(Fe,{className:"text-xs",children:"Default Assistant Agent"}),a.jsxs(wn,{value:h||"__none__",onValueChange:j=>{x(j==="__none__"?"":j)},disabled:i,children:[a.jsx(hn,{className:"h-9 text-sm",children:a.jsx(jn,{placeholder:"Select assistant agent"})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"__none__",children:"None (use first agent)"}),t.map(j=>a.jsxs(tt,{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"})]})]})]})},Yge=bl("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"}}),Qi=m.forwardRef(({className:e,variant:t,...n},r)=>a.jsx("div",{ref:r,role:"alert",className:je(Yge({variant:t}),e),...n}));Qi.displayName="Alert";const Ji=m.forwardRef(({className:e,...t},n)=>a.jsx("h5",{ref:n,className:je("mb-1 font-medium leading-none tracking-tight",e),...t}));Ji.displayName="AlertTitle";const Zi=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:je("text-sm [&_p]:leading-relaxed",e),...t}));Zi.displayName="AlertDescription";const Xge="127.0.0.1",Qge=3011,Jge="/mcp",Zge=`http://${Xge}:${Qge}${Jge}`;function exe(e){return navigator.clipboard.writeText(e)}function m6({text:e,label:t}){const[n,r]=m.useState(!1),s=async()=>{try{await exe(e),r(!0),Ae({title:"Copied",description:`${t} copied to clipboard.`}),window.setTimeout(()=>r(!1),1500)}catch(o){Ae({title:"Copy failed",description:o instanceof Error?o.message:String(o),variant:"destructive"})}};return a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{s()},children:[a.jsx(_s,{className:"mr-2 h-3.5 w-3.5"}),n?"Copied":"Copy"]})}function Bj({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(m6,{text:n,label:e})]})})}function a$({title:e,description:t,code:n,iconSrc:r}){return a.jsxs(Ve,{children:[a.jsxs(kt,{className:"pb-3",children:[a.jsxs(Pt,{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(Br,{children:t})]}),a.jsxs(He,{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(m6,{text:n,label:e})})]})]})}const txe=()=>{const{source:e}=Dn(),[t,n]=m.useState(!0),[r,s]=m.useState(null),o=m.useCallback(async()=>{n(!0);try{const p=await e.health();s(p)}catch(p){s(null),Ae({title:"Could not load MCP connection info",description:p instanceof Error?p.message:String(p),variant:"destructive"})}finally{n(!1)}},[e]);m.useEffect(()=>{o()},[o]);const i=r?.mcp?.enabled?r.mcp:null,c=i?.directUrl??Zge,d=i?.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(Jj,{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(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{o()},disabled:t,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),!i&&a.jsxs(Qi,{children:[a.jsx(Jj,{className:"h-4 w-4"}),a.jsx(Ji,{children:"MCP server not reported"}),a.jsx(Zi,{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(Ve,{children:[a.jsxs(kt,{className:"pb-3",children:[a.jsx(Pt,{className:"text-base",children:"Connection Details"}),a.jsx(Br,{children:"The local server is exposed over streamable HTTP."})]}),a.jsx(He,{className:"space-y-3",children:a.jsxs("div",{className:"grid gap-3",children:[a.jsx(Bj,{label:"Direct MCP URL",value:c,copyText:c}),a.jsx(Bj,{label:"Transport",value:d}),a.jsx(Bj,{label:"Authentication",value:"none"})]})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(a$,{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(a$,{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 Og="Checkbox",[nxe]=hr(Og),[rxe,t_]=nxe(Og);function axe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:i,name:c,onCheckedChange:d,required:f,value:h="on",internal_do_not_use_render:p}=e,[x,g]=ha({prop:n,defaultProp:s??!1,onChange:d,caller:Og}),[j,b]=m.useState(null),[y,S]=m.useState(null),C=m.useRef(!1),N=j?!!i||!!j.closest("form"):!0,E={checked:x,disabled:o,setChecked:g,control:j,setControl:b,name:c,form:i,value:h,hasConsumerStoppedPropagationRef:C,required:f,defaultChecked:ti(s)?!1:s,isFormControl:N,bubbleInput:y,setBubbleInput:S};return a.jsx(rxe,{scope:t,...E,children:sxe(p)?p(E):r})}var v6="CheckboxTrigger",g6=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:i,disabled:c,checked:d,required:f,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:x,isFormControl:g,bubbleInput:j}=t_(v6,e),b=wt(s,h),y=m.useRef(d);return m.useEffect(()=>{const S=o?.form;if(S){const C=()=>p(y.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[o,p]),a.jsx(Ye.button,{type:"button",role:"checkbox","aria-checked":ti(d)?"mixed":d,"aria-required":f,"data-state":j6(d),"data-disabled":c?"":void 0,disabled:c,value:i,...r,ref:b,onKeyDown:Te(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Te(n,S=>{p(C=>ti(C)?!0:!C),j&&g&&(x.current=S.isPropagationStopped(),x.current||S.stopPropagation())})})});g6.displayName=v6;var n_=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:i,disabled:c,value:d,onCheckedChange:f,form:h,...p}=e;return a.jsx(axe,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:c,required:i,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:x})=>a.jsxs(a.Fragment,{children:[a.jsx(g6,{...p,ref:t,__scopeCheckbox:n}),x&&a.jsx(w6,{__scopeCheckbox:n})]})})});n_.displayName=Og;var x6="CheckboxIndicator",y6=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=t_(x6,n);return a.jsx(Gn,{present:r||ti(o.checked)||o.checked===!0,children:a.jsx(Ye.span,{"data-state":j6(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});y6.displayName=x6;var b6="CheckboxBubbleInput",w6=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:i,required:c,disabled:d,name:f,value:h,form:p,bubbleInput:x,setBubbleInput:g}=t_(b6,e),j=wt(n,g),b=gg(o),y=uv(r);m.useEffect(()=>{const C=x;if(!C)return;const N=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(N,"checked").set,k=!s.current;if(b!==o&&A){const O=new Event("click",{bubbles:k});C.indeterminate=ti(o),A.call(C,ti(o)?!1:o),C.dispatchEvent(O)}},[x,b,o,s]);const S=m.useRef(ti(o)?!1:o);return a.jsx(Ye.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??S.current,required:c,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});w6.displayName=b6;function sxe(e){return typeof e=="function"}function ti(e){return e==="indeterminate"}function j6(e){return ti(e)?"indeterminate":e?"checked":"unchecked"}const Kr=m.forwardRef(({className:e,...t},n)=>a.jsx(n_,{ref:n,className:je("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(y6,{className:je("flex items-center justify-center text-current"),children:a.jsx(Ac,{className:"h-4 w-4"})})}));Kr.displayName=n_.displayName;function oxe(e,t=[]){let n=[];function r(o,i){const c=m.createContext(i);c.displayName=o+"Context";const d=n.length;n=[...n,i];const f=p=>{const{scope:x,children:g,...j}=p,b=x?.[e]?.[d]||c,y=m.useMemo(()=>j,Object.values(j));return a.jsx(b.Provider,{value:y,children:g})};f.displayName=o+"Provider";function h(p,x){const g=x?.[e]?.[d]||c,j=m.useContext(g);if(j)return j;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,h]}const s=()=>{const o=n.map(i=>m.createContext(i));return function(c){const d=c?.[e]||o;return m.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return s.scopeName=e,[r,ixe(s,...t)]}function ixe(...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(o){const i=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(o)[`__scope${f}`];return{...c,...p}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var lxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],S6=lxe.reduce((e,t)=>{const n=wv(`Primitive.${t}`),r=m.forwardRef((s,o)=>{const{asChild:i,...c}=s,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),r_="Progress",a_=100,[cxe]=oxe(r_),[uxe,dxe]=cxe(r_),N6=m.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:o=fxe,...i}=e;(s||s===0)&&!s$(s)&&console.error(pxe(`${s}`,"Progress"));const c=s$(s)?s:a_;r!==null&&!o$(r,c)&&console.error(hxe(`${r}`,"Progress"));const d=o$(r,c)?r:null,f=ev(d)?o(d,c):void 0;return a.jsx(uxe,{scope:n,value:d,max:c,children:a.jsx(S6.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":ev(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":A6(d,c),"data-value":d??void 0,"data-max":c,...i,ref:t})})});N6.displayName=r_;var C6="ProgressIndicator",_6=m.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=dxe(C6,n);return a.jsx(S6.div,{"data-state":A6(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});_6.displayName=C6;function fxe(e,t){return`${Math.round(e/t*100)}%`}function A6(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function ev(e){return typeof e=="number"}function s$(e){return ev(e)&&!isNaN(e)&&e>0}function o$(e,t){return ev(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 \`${a_}\`.`}function hxe(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 ${a_} if no \`max\` prop is set)
|
|
138
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
139
|
-
|
|
140
|
-
Defaulting to \`null\`.`}var E6=N6,mxe=_6;const Tg=m.forwardRef(({className:e,value:t,...n},r)=>a.jsx(E6,{ref:r,className:je("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:a.jsx(mxe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Tg.displayName=E6.displayName;function k6(e){const t=e.toLowerCase();return t.includes("side-effectful prefix")||t.includes("destructive behavior")||t.includes("destructivehint")}function i$(e){try{return JSON.stringify(e,null,2)}catch{return"[schema not serializable]"}}const Li=["critical","high","medium","low","info"];function _h(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 vxe(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 l$(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tool"}function qj({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(T7,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),a.jsx("p",{children:e})]})}function gxe({label:e,reason:t,variantClassName:n}){return a.jsx(ai,{delayDuration:0,children:a.jsxs(si,{children:[a.jsx(oi,{asChild:!0,children:a.jsx(We,{variant:"outline",className:n,children:e})}),a.jsx(uo,{className:"max-w-sm text-xs",children:a.jsx("p",{children:t})})]})})}function s_(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,o])=>`${s}: ${o??"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 o of s.metadataReview.issues)t.push(` - [${o.severity}] ${o.title}: ${o.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 o of s.deeperAnalysis.sampleCalls){t.push(` - Call ${o.callIndex}: ${o.ok?"ok":"error"}${o.durationMs?` (${o.durationMs}ms)`:""}`),o.error&&t.push(` - Error: ${o.error}`);for(const i of o.observations)t.push(` - ${i}`)}}if(s.overallRecommendations.length>0){t.push("#### Recommendations");for(const o of s.overallRecommendations)t.push(` - ${o}`)}if(s.metadataReview?.evalReadinessNotes.length){t.push("#### Agent/Eval readiness notes");for(const o of s.metadataReview.evalReadinessNotes)t.push(` - ${o}`)}t.push("")}}return`${t.join(`
|
|
141
|
-
`)}
|
|
142
|
-
`}function P6({report:e}){const[t,n]=go(),[r,s]=m.useState([...Li]),[o,i]=m.useState(new Set),[c,d]=m.useState(""),[f,h]=m.useState(!1),p=t.get("groupBy")==="severity"?"severity":"tool",x=m.useRef(null),g=c.trim().toLowerCase(),j=m.useMemo(()=>new Set(r),[r]),b=T=>{s($=>{const B=$.includes(T)?$.filter(q=>q!==T):[...$,T];return B.length===0?[...Li]:B})},y=T=>{const $=new URLSearchParams(t);T==="severity"?$.set("groupBy","severity"):$.delete("groupBy"),n($,{replace:!0})},S=m.useMemo(()=>{const T={critical:[],high:[],medium:[],low:[],info:[]};for(const $ of e.servers)for(const B of $.tools){const q=`tool-${l$(`${$.serverName}-${B.publicToolName}`)}`,F=`${$.serverName}::${B.publicToolName}`,H=B.publicToolName.split("::").pop()??B.publicToolName;for(const U of B.metadataReview?.issues??[]){const R=U.severity;T[R].push({key:`${F}-metadata-${U.id}`,toolAnchorId:q,toolLabel:F,toolDisplayName:H,sourceLabel:"Metadata review",issue:{id:U.id,title:U.title,detail:U.detail,severity:R,suggestion:U.suggestion}})}for(const U of B.deeperAnalysis?.sampleCalls??[])for(const R of U.issues){const W=R.severity;T[W].push({key:`${F}-call-${U.callIndex}-${R.id}`,toolAnchorId:q,toolLabel:F,toolDisplayName:H,sourceLabel:`Sample call ${U.callIndex}`,issue:{id:R.id,title:R.title,detail:R.detail,severity:W,suggestion:R.suggestion}})}}return T},[e.servers]),C=m.useMemo(()=>Array.from(new Set(e.servers.flatMap(T=>T.tools.map($=>$.publicToolName)).map(T=>T.split("::").pop()??T))).sort((T,$)=>T.localeCompare($)),[e.servers]),N=T=>g.length===0?!0:(T.toLowerCase().split("::").pop()??T.toLowerCase()).includes(g),E=T=>{if(!x.current)return;x.current.querySelectorAll("details").forEach(B=>{B.open=T})},A=()=>i(new Set(Li)),k=()=>i(new Set),O=T=>{i($=>{const B=new Set($);return B.has(T)?B.delete(T):B.add(T),B})};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[a.jsx(Ve,{children:a.jsxs(He,{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(Ve,{children:a.jsxs(He,{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(Ve,{children:a.jsxs(He,{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(Ve,{children:[a.jsxs(kt,{className:"pb-3",children:[a.jsx(Pt,{className:"text-base",children:"Analysis Overview"}),a.jsx(Br,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),a.jsx(He,{children:a.jsxs("div",{className:"flex flex-wrap gap-2",children:[Li.filter(T=>e.summary.issueCounts[T]>0).map(T=>{const $=j.has(T);return a.jsx("button",{type:"button",onClick:()=>b(T),className:"rounded-full","aria-pressed":$,children:a.jsxs(We,{variant:"outline",className:`capitalize font-normal ${$?_h(T):vxe(T)} ${$?"ring-1 ring-current":"opacity-70"}`,children:[T,": ",e.summary.issueCounts[T]]})},T)}),a.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>s([...Li]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),a.jsxs("div",{className:"space-y-0",children:[a.jsx(Sg,{value:p,onValueChange:T=>{(T==="tool"||T==="severity")&&y(T)},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(Xf,{className:"h-auto justify-start rounded-none bg-transparent p-0",children:[a.jsx(Cs,{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(Cs,{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(su,{open:f,onOpenChange:h,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{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(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(dl,{className:"w-[320px] p-0",align:"end",children:a.jsxs(pl,{children:[a.jsx(hl,{placeholder:"Search tools..."}),a.jsxs(ml,{children:[a.jsx(vl,{children:"No tools found."}),a.jsxs(gl,{children:[a.jsx(ua,{value:"all tools",onSelect:()=>{d(""),h(!1)},children:"All tools"}),C.map(T=>a.jsx(ua,{value:T,onSelect:()=>{d(T),h(!1)},children:T},T))]})]})]})})]}),p==="severity"&&a.jsxs(a.Fragment,{children:[a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:k,children:"Expand all"}),a.jsx(se,{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(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!0),children:"Expand all"}),a.jsx(se,{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:Li.filter(T=>j.has(T)).map(T=>{const $=S[T].filter(q=>N(q.toolLabel));if($.length===0)return null;const B=o.has(T);return a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx(Pt,{className:"text-base capitalize",children:T}),a.jsxs(Br,{children:[$.length," finding(s)"]})]}),a.jsx("div",{className:"flex gap-2",children:a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>O(T),children:B?"Expand":"Collapse"})})]})}),!B&&a.jsx(He,{className:"space-y-2",children:$.map((q,F)=>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:F+1}),a.jsx("span",{className:"min-w-0 font-bold leading-tight",children:q.issue.title})]}),a.jsx(We,{variant:"outline",className:`shrink-0 text-[10px] ${_h(q.issue.severity)}`,children:q.issue.severity})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",q.issue.detail]}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px]",children:[a.jsx(We,{variant:"secondary",className:"font-normal",children:q.sourceLabel}),a.jsx(se,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 font-mono text-[11px]",title:q.toolLabel,onClick:()=>{y("tool"),requestAnimationFrame(()=>{document.getElementById(q.toolAnchorId)?.scrollIntoView({behavior:"smooth",block:"start"})})},children:q.toolDisplayName})]}),q.issue.suggestion&&a.jsx(qj,{text:q.issue.suggestion})]},q.key))})]},T)})}):a.jsx("div",{ref:x,className:"space-y-4",children:e.servers.map(T=>{const $=T.tools.filter(B=>{const q=`${T.serverName}::${B.publicToolName}`;if(!N(q))return!1;const F=[...B.metadataReview?.issues??[],...B.deeperAnalysis?.sampleCalls.flatMap(H=>H.issues)??[]];return F.length===0?r.length===Li.length:F.some(H=>j.has(H.severity))});return $.length===0?null:a.jsxs(Ve,{children:[a.jsxs(kt,{className:"pb-3",children:[a.jsx(Pt,{className:"text-base",children:T.serverName}),a.jsxs(Br,{children:["Discovered ",T.toolCountDiscovered," · Showing ",$.length," of ",T.toolCountAnalyzed," analyzed · Skipped ",T.toolCountSkipped]})]}),a.jsxs(He,{className:"space-y-3",children:[T.warnings.length>0&&a.jsxs(Qi,{children:[a.jsx(Ji,{children:"Warnings"}),a.jsx(Zi,{children:a.jsx("ul",{className:"ml-4 list-disc space-y-1",children:T.warnings.map(B=>a.jsx("li",{children:B},`${T.serverName}-${B}`))})})]}),$.map(B=>{const q=B.publicToolName.split("::").pop()??B.publicToolName,F=k6(B.classificationReason),H=B.safetyClassification==="read_like"?"read-like":F?"write/delete":"unsafe/unknown",U=B.safetyClassification==="read_like"?"border-emerald-200 bg-emerald-50 text-emerald-700":F?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700";return a.jsxs("details",{id:`tool-${l$(`${T.serverName}-${B.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:B.publicToolName,children:q}),a.jsx(gxe,{label:H,reason:B.classificationReason,variantClassName:U})]}),a.jsx(Yt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),B.title&&a.jsx("p",{className:"text-sm text-foreground/85",children:B.title}),B.description&&a.jsx("p",{className:"text-xs text-muted-foreground",children:B.description})]})}),a.jsxs("div",{className:"mt-3 space-y-2",children:[(B.inputSchema!==void 0||B.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(Yt,{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:[B.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:i$(B.inputSchema)})]}),B.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:i$(B.outputSchema)})]})]})]}),B.metadataReview&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),B.metadataReview.issues.filter(R=>j.has(R.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:B.metadataReview.issues.filter(R=>j.has(R.severity)).map((R,W)=>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:W+1}),a.jsx("span",{className:"min-w-0 font-bold leading-tight",children:R.title})]}),a.jsx(We,{variant:"outline",className:`shrink-0 text-[10px] ${_h(R.severity)}`,children:R.severity})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",R.detail]}),R.suggestion&&a.jsx(qj,{text:R.suggestion})]},R.id))})]}),B.deeperAnalysis&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),B.deeperAnalysis.attempted?a.jsx("div",{className:"space-y-2",children:B.deeperAnalysis.sampleCalls.map(R=>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(We,{variant:R.ok?"secondary":"destructive",className:"text-[10px]",children:R.ok?"ok":"error"}),a.jsxs("span",{children:["Call ",R.callIndex]}),R.durationMs!==void 0&&a.jsxs("span",{className:"text-muted-foreground",children:[R.durationMs,"ms"]})]}),R.error&&a.jsx("p",{className:"text-destructive",children:R.error}),R.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:R.observations.map((W,X)=>a.jsx("li",{children:W},`${B.publicToolName}-obs-${R.callIndex}-${X}`))})]}),R.issues.filter(W=>j.has(W.severity)).length>0&&a.jsx("div",{className:"mt-2 space-y-1",children:R.issues.filter(W=>j.has(W.severity)).map((W,X)=>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:X+1}),a.jsx("span",{className:"min-w-0 font-bold leading-tight",children:W.title})]}),a.jsx(We,{variant:"outline",className:`shrink-0 text-[10px] ${_h(W.severity)}`,children:W.severity})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",W.detail]}),W.suggestion&&a.jsx(qj,{text:W.suggestion})]},`${R.callIndex}-${W.id}`))})]},`${B.publicToolName}-call-${R.callIndex}`))}):a.jsx("p",{className:"text-xs text-muted-foreground",children:B.deeperAnalysis.skippedReason??"Skipped"})]})]})]},B.publicToolName)})]})]},T.serverName)})})]})]})}function xxe(e){let t=0;const n=new Set,r=new Set;for(const o of e){const i=typeof o.payload?.message=="string"?o.payload.message:"";if(!i)continue;const c=i.match(/\((\d+)\s+selected\s+of\s+\d+\s+discovered\)/i);c&&(t=Math.max(t,Number(c[1])||0));const d=i.match(/^Started\s+(.+)$/);d&&n.add(d[1]);const f=i.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 Uj="mcplab.toolAnalysis.activeJobId";function c$(e,t,n){const r=new Blob([t],{type:n}),s=URL.createObjectURL(r),o=document.createElement("a");o.href=s,o.download=e,o.click(),URL.revokeObjectURL(s)}function u$({text:e}){return a.jsxs(si,{children:[a.jsx(oi,{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(N7,{className:"h-3.5 w-3.5"})})}),a.jsx(uo,{className:"max-w-xs text-xs",children:a.jsx("p",{children:e})})]})}function yxe(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 bxe({label:e,reason:t,variantClassName:n}){return a.jsx(ai,{delayDuration:0,children:a.jsxs(si,{children:[a.jsx(oi,{asChild:!0,children:a.jsx(We,{variant:"outline",className:n,children:e})}),a.jsx(uo,{className:"max-w-sm text-xs",children:a.jsx("p",{children:t})})]})})}const wxe=()=>{const{source:e}=Dn(),{servers:t,agents:n,loading:r,reload:s}=rs(),[o,i]=m.useState(""),[c,d]=m.useState([]),[f,h]=m.useState(!1),[p,x]=m.useState([]),[g,j]=m.useState({}),[b,y]=m.useState(""),[S,C]=m.useState(!0),[N,E]=m.useState(!1),[A,k]=m.useState(2),[O,T]=m.useState(1),[$,B]=m.useState(1e4),[q,F]=m.useState(null),[H,U]=m.useState([]),[R,W]=m.useState(null),[X,G]=m.useState(null),[z,J]=m.useState(!1),[D,I]=m.useState("configure"),[ne,te]=m.useState("idle"),[de,he]=m.useState(!1),V=m.useRef(null),ue=m.useRef(null),Q=o||n[0]?.name||"",Z=m.useMemo(()=>xxe(H),[H]);m.useEffect(()=>{let Ne=!0;return e.getWorkspaceSettings().then(et=>{!Ne||!et||i(et.scenarioAssistantAgentName??"")}).catch(()=>{Ne&&i("")}),()=>{Ne=!1}},[e]),m.useEffect(()=>()=>{V.current?.()},[]),m.useEffect(()=>{const Ne=ue.current;Ne&&requestAnimationFrame(()=>{Ne.scrollTop=Ne.scrollHeight})},[H.length]);const fe=()=>{try{sessionStorage.removeItem(Uj)}catch{}},ae=Ne=>{try{sessionStorage.setItem(Uj,Ne)}catch{}},Re=Ne=>{V.current?.(),V.current=e.subscribeToolAnalysisJob(Ne,et=>{if(U(Ke=>[...Ke,et]),et.type==="completed")e.getToolAnalysisResult(Ne).then(Ke=>{W(Ke.report),G(Ke.savedReportId??null)}).catch(Ke=>Ae({title:"Could not load analysis report",description:Ke instanceof Error?Ke.message:String(Ke),variant:"destructive"})).finally(()=>{fe(),F(null),J(!1),te("idle"),I("run")});else if(et.type==="error"){const Ke=String(et.payload?.message??"");fe(),te(Ke.toLowerCase().includes("abort")?"stopped":"error"),F(null),J(!1)}})};m.useEffect(()=>{if(q||R)return;let Ne="";try{Ne=sessionStorage.getItem(Uj)??""}catch{Ne=""}if(Ne)return I("run"),te("running"),J(!0),F(Ne),U([]),Re(Ne),()=>{}},[e,q,R]);const _e=async()=>{if(c.length===0){x([]),j({});return}const Ne=c.filter(et=>t.find(ve=>ve.id===et)?.authType==="oauth2");try{Ne.length>0&&(he(!0),await oo({serverNames:Ne,source:e,onServerAuthStart:et=>{Ae({title:`OAuth login required for ${et}`,description:"Complete login in the opened browser tab. Discovery will continue automatically."})}}))}catch(et){Ae({title:"OAuth login failed",description:et instanceof Error?et.message:String(et),variant:"destructive"}),he(!1);return}finally{he(!1)}h(!0);try{const et=await e.discoverToolsForAnalysis({serverNames:c});x(et.servers),j(Ke=>{const ve={};for(const ze of et.servers){const $e=Ke[ze.serverName]??[],Qe=ze.tools.map(qe=>qe.name),Ce=$e.filter(qe=>Qe.includes(qe));ve[ze.serverName]=Ce.length>0?Ce:Qe}return ve})}catch(et){Ae({title:"Could not discover MCP tools",description:et instanceof Error?et.message:String(et),variant:"destructive"})}finally{h(!1)}};m.useEffect(()=>{_e()},[c.join("|")]);const Me=m.useMemo(()=>{const Ne=b.trim().toLowerCase();return Ne?p.map(et=>({...et,tools:et.tools.filter(Ke=>Ke.name.toLowerCase().includes(Ne)||(Ke.description||"").toLowerCase().includes(Ne))})).filter(et=>et.tools.length>0):p},[p,b]),L=m.useMemo(()=>Object.values(g).reduce((Ne,et)=>Ne+et.length,0),[g]),oe=c[0]??"",pe=async()=>{if(!S&&!N){Ae({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){Ae({title:"Select exactly one server",variant:"destructive"});return}if(L===0){Ae({title:"Select at least one tool",variant:"destructive"});return}J(!0),U([]),W(null),G(null),I("run"),te("running");try{const Ne=c[0];t.find(ve=>ve.id===Ne)?.authType==="oauth2"&&(he(!0),await oo({serverNames:[Ne],source:e,onServerAuthStart:ve=>{Ae({title:`OAuth login required for ${ve}`,description:"Complete login in the opened browser tab. Analysis will continue automatically."})}}));const{jobId:Ke}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:g,maxParallelTools:A,modes:{metadataReview:S,deeperAnalysis:N},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:O,toolCallTimeoutMs:$}});F(Ke),ae(Ke),Re(Ke)}catch(Ne){J(!1),te("error"),I("run"),Ae({title:"Could not start tool analysis",description:Ne instanceof Error?Ne.message:String(Ne),variant:"destructive"})}finally{he(!1)}},Ee=async()=>{if(!q)return;const Ne=q;try{const et=await e.stopToolAnalysis(Ne);if(et.status==="completed"){V.current?.(),V.current=null;const Ke=await e.getToolAnalysisResult(Ne);W(Ke.report),G(Ke.savedReportId??null),fe(),F(null),J(!1),te("idle"),I("run"),Ae({title:"Analysis already finished",description:"Showing the result overview."});return}if(et.status==="stopped"){V.current?.(),V.current=null,fe(),F(null),J(!1),te("stopped"),Ae({title:"Analysis stopped"});return}if(et.status==="error"){V.current?.(),V.current=null,fe(),F(null),J(!1),te("error"),Ae({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}Ae({title:"Stopping analysis..."})}catch(et){Ae({title:"Could not stop analysis",description:et instanceof Error?et.message:String(et),variant:"destructive"})}},Xe=()=>{I("configure"),te("idle"),F(null)},ht=(Ne,et)=>{d(Ke=>et?[Ne]:Ke.filter(ve=>ve!==Ne))},gt=(Ne,et,Ke)=>{j(ve=>{const ze=new Set(ve[Ne]??[]);return Ke?ze.add(et):ze.delete(et),{...ve,[Ne]:Array.from(ze)}})},mt=(Ne,et)=>{j(Ke=>({...Ke,[Ne]:et}))},Vt=!0,qt=q!==null||H.length>0||ne==="stopped"||ne==="error",Ft=!!R,zt=Ne=>{if(Ne==="configure"&&Vt){I("configure");return}if(Ne==="run"&&qt){I("run");return}Ne==="report"&&Ft&&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(tD,{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:()=>zt("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:a.jsx(We,{variant:D==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),a.jsx("button",{type:"button",onClick:()=>zt("run"),disabled:!qt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:a.jsx(We,{variant:D==="run"?"default":"outline",className:qt?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),a.jsx("button",{type:"button",onClick:()=>zt("report"),disabled:!Ft,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:a.jsx(We,{variant:D==="report"?"default":"outline",className:Ft?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),D==="configure"&&a.jsxs(Ve,{children:[a.jsxs(kt,{children:[a.jsx(Pt,{className:"text-base",children:"Run MCP analysis"}),a.jsx(Br,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),a.jsxs(He,{className:"space-y-5",children:[!Q&&a.jsxs(Qi,{children:[a.jsx(Ji,{children:"No assistant agent available"}),a.jsxs(Zi,{children:["Add a library agent in"," ",a.jsx(_t,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",a.jsx(_t,{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(Fe,{className:"text-xs",children:"Servers"}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{s()},disabled:r||de,children:[a.jsx(ma,{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(Ne=>{const et=c.includes(Ne.id);return a.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[a.jsx(Kr,{checked:et,onCheckedChange:Ke=>ht(Ne.id,!!Ke)}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-medium",children:Ne.name||Ne.id}),Ne.url&&a.jsx("div",{className:"truncate text-xs text-muted-foreground",children:Ne.url})]})]},Ne.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(Fe,{className:"text-xs",children:"Filter visible tools"}),a.jsxs("div",{className:"relative",children:[a.jsx(dN,{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(vt,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:Ne=>y(Ne.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(Fe,{className:"text-xs",children:oe?`Tools for ${oe}`:"Tools"}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{_e()},disabled:f||de||c.length===0,children:[f&&a.jsx(wr,{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..."}):Me.length===0&&!f?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):Me.map(Ne=>{const et=new Set(g[Ne.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:Ne.serverName}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>mt(Ne.serverName,Ne.tools.map(Ke=>Ke.name)),children:"Select all"}),a.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>mt(Ne.serverName,[]),children:"Clear"})]})]}),Ne.warnings.length>0&&a.jsx("div",{className:"mb-2 space-y-1",children:Ne.warnings.map(Ke=>a.jsx("div",{className:"text-xs text-amber-700",children:yxe(Ne.serverName,Ke)},`${Ne.serverName}-${Ke}`))}),a.jsx("div",{className:"grid gap-2",children:Ne.tools.map(Ke=>{const ve=k6(Ke.classificationReason),ze=Ke.safetyClassification==="read_like"?"read-like":ve?"write/delete":"unsafe/unknown",$e=Ke.safetyClassification==="read_like"?"border-emerald-200 bg-emerald-50 text-emerald-700":ve?"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(Kr,{checked:et.has(Ke.name),onCheckedChange:Qe=>gt(Ne.serverName,Ke.name,!!Qe)}),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:Ke.name}),Ke.title&&a.jsx("span",{className:"text-xs text-muted-foreground",children:Ke.title}),a.jsx(bxe,{label:ze,reason:Ke.classificationReason,variantClassName:$e}),Ke.inputSchema&&a.jsx(We,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: input"}),Ke.outputSchema&&a.jsx(We,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: output"})]}),Ke.description&&a.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ke.description})]})]},`${Ne.serverName}-${Ke.name}`)})})]},Ne.serverName)})}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",L]})]}),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(Kr,{checked:S,onCheckedChange:Ne=>C(!!Ne)}),a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",a.jsx(u$,{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(Kr,{checked:N,onCheckedChange:Ne=>E(!!Ne)}),a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",a.jsx(u$,{text:"Runs sample MCP tool calls automatically for read-like 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(Fe,{className:"text-xs",children:"Max parallel tools"}),a.jsx(vt,{type:"number",min:1,max:8,value:A,onChange:Ne=>k(Math.max(1,Math.min(8,Number(Ne.target.value)||2))),className:"h-8"})]}),N?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Fe,{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(Fe,{className:"text-xs",children:"Sample calls per tool"}),a.jsx(vt,{type:"number",min:1,max:5,value:O,onChange:Ne=>T(Math.max(1,Math.min(5,Number(Ne.target.value)||1))),className:"h-8"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Fe,{className:"text-xs",children:"Tool call timeout (ms)"}),a.jsx(vt,{type:"number",min:1e3,max:6e4,step:500,value:$,onChange:Ne=>B(Math.max(1e3,Math.min(6e4,Number(Ne.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(se,{type:"button",onClick:()=>{pe()},disabled:z||de||!!q,children:[(z||!!q)&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),D==="run"&&a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(Pt,{className:"flex items-center gap-2 text-base",children:a.jsx("span",{children:"Progress"})}),a.jsx(Br,{children:q?"Live tool-analysis job events:":R?"Analysis finished. Review the summary below or open the saved report details.":ne==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":ne==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),q?a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Ee()},children:"Stop Analysis"}):a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:Xe,children:"Back to Configure Analysis"})]})}),a.jsxs(He,{className:"space-y-2",children:[q&&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(wr,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(Z.totalTools>0||q)&&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:Z.totalTools>0?`${Z.finishedTools}/${Z.totalTools} tools finished`:"Preparing analysis..."}),a.jsx("span",{children:Z.totalTools>0?`${Z.percent}%`:"0%"})]}),a.jsx(Tg,{value:Z.totalTools>0?Z.percent:0,className:"h-2"})]}),H.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:q?"Starting analysis...":"No progress events captured."}):a.jsx("div",{ref:ue,className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:H.map((Ne,et)=>a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(Ne.ts).toLocaleTimeString()}),a.jsx(We,{variant:"outline",className:"mr-2 text-[10px]",children:Ne.type}),a.jsx("span",{className:"break-all",children:typeof Ne.payload.message=="string"?Ne.payload.message:JSON.stringify(Ne.payload)})]},`${Ne.ts}-${et}`))}),!q&&R&&a.jsx(Ve,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:a.jsxs(He,{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:[R.summary.toolsAnalyzed," tools analyzed, ",R.summary.toolsSkipped," skipped, across"," ",R.summary.serversAnalyzed," server",R.summary.serversAnalyzed!==1?"s":"","."]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[X&&a.jsx(se,{asChild:!0,size:"sm",children:a.jsx(_t,{to:`/tool-analysis-results/${X}`,children:"Open result details"})}),a.jsx(se,{asChild:!0,size:"sm",variant:"outline",children:a.jsx(_t,{to:"/tool-analysis-results",children:"View all results"})}),a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>zt("report"),children:"View inline report"})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.summary.issueCounts.critical>0&&a.jsxs(We,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",R.summary.issueCounts.critical]}),R.summary.issueCounts.high>0&&a.jsxs(We,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",R.summary.issueCounts.high]}),R.summary.issueCounts.medium>0&&a.jsxs(We,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",R.summary.issueCounts.medium]}),R.summary.issueCounts.low>0&&a.jsxs(We,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",R.summary.issueCounts.low]}),R.summary.issueCounts.info>0&&a.jsxs(We,{variant:"outline",children:["Info: ",R.summary.issueCounts.info]}),Object.values(R.summary.issueCounts).every(Ne=>Ne===0)&&a.jsx(We,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),D==="report"&&R&&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:[R.summary.toolsAnalyzed," tools analyzed across ",R.summary.serversAnalyzed," server",R.summary.serversAnalyzed!==1?"s":"","."]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:Xe,children:"Back to Configure Analysis"}),X&&a.jsxs(a.Fragment,{children:[a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsx(_t,{to:`/tool-analysis-results/${X}`,children:"Open saved report"})}),a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsx(_t,{to:"/tool-analysis-results",children:"View all reports"})})]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>c$(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(R,null,2)}
|
|
143
|
-
`,"application/json"),children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>c$(`tool-analysis-${Date.now()}.md`,s_(R),"text/markdown"),children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),a.jsx(P6,{report:R})]})]})};function d$(e,t,n){const r=new Blob([t],{type:n}),s=URL.createObjectURL(r),o=document.createElement("a");o.href=s,o.download=e,o.click(),URL.revokeObjectURL(s)}function jxe(){const{source:e}=Dn(),[t,n]=m.useState([]),[r,s]=m.useState(!0),[o,i]=m.useState(null),[c,d]=m.useState(!1),[f,h]=m.useState("all"),[p,x]=m.useState(!1),g=async()=>{s(!0);try{n(await e.listToolAnalysisResults())}catch(N){Ae({title:"Could not load tool analysis results",description:N instanceof Error?N.message:String(N),variant:"destructive"})}finally{s(!1)}};m.useEffect(()=>{g()},[]);const j=m.useMemo(()=>Array.from(new Set(t.flatMap(N=>N.serverNames))).sort((N,E)=>N.localeCompare(E)),[t]),b=m.useMemo(()=>f==="all"?t:t.filter(N=>N.serverNames.includes(f)),[t,f]),y=m.useMemo(()=>t.find(N=>N.reportId===o)??null,[t,o]),S=async()=>{if(o){d(!0);try{await e.deleteToolAnalysisSavedResult(o),n(N=>N.filter(E=>E.reportId!==o)),Ae({title:"Tool analysis report deleted"}),i(null)}catch(N){Ae({title:"Could not delete report",description:N instanceof Error?N.message:String(N),variant:"destructive"})}finally{d(!1)}}},C=async(N,E)=>{try{const A=await e.getToolAnalysisSavedResult(N);E==="json"?d$(`${N}.json`,`${JSON.stringify(A,null,2)}
|
|
144
|
-
`,"application/json"):d$(`${N}.md`,s_(A.report),"text/markdown")}catch(A){Ae({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(nD,{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(su,{open:p,onOpenChange:x,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{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(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(dl,{className:"w-[240px] p-0",align:"start",children:a.jsxs(pl,{children:[a.jsx(hl,{placeholder:"Search MCP servers..."}),a.jsxs(ml,{children:[a.jsx(vl,{children:"No servers found."}),a.jsxs(gl,{children:[a.jsx(ua,{value:"all servers",onSelect:()=>{h("all"),x(!1)},children:"All servers"}),j.map(N=>a.jsx(ua,{value:N,onSelect:()=>{h(N),x(!1)},children:N},N))]})]})]})})]})]}),a.jsx(se,{variant:"outline",onClick:()=>{g()},disabled:r,children:r?"Refreshing...":"Refresh"}),a.jsx(se,{asChild:!0,variant:"outline",children:a.jsx(_t,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),a.jsx(Ve,{children:a.jsx(He,{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:b.length})," of"," ",a.jsx("span",{className:"font-medium text-foreground",children:t.length})," reports"]})}),b.length===0?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No reports for the selected MCP server."}):a.jsxs(qr,{children:[a.jsx(Ur,{children:a.jsxs(Gt,{children:[a.jsx(at,{children:"Report ID"}),a.jsx(at,{children:"Evaluated"}),a.jsx(at,{children:"Timestamp"}),a.jsx(at,{children:"Issues"}),a.jsx(at,{children:"Modes"}),a.jsx(at,{className:"w-10"})]})}),a.jsx(Wr,{children:b.map(N=>a.jsxs(Gt,{children:[a.jsx(Ue,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(_t,{to:`/tool-analysis-results/${N.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:N.reportId}),a.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[N.assistantAgentName," · ",N.assistantAgentModel]})]})}),a.jsx(Ue,{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:N.serverNames.length})," · Tools:"," ",a.jsx("span",{className:"font-medium text-foreground",children:N.summary.toolsAnalyzed})," · ","Skipped: ",a.jsx("span",{className:"font-medium text-foreground",children:N.summary.toolsSkipped})]}),a.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[N.serverNames.slice(0,2).join(", "),N.serverNames.length>2?` +${N.serverNames.length-2}`:""]})]})}),a.jsx(Ue,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(mo,{className:"h-3 w-3"}),new Date(N.createdAt).toLocaleString()]})}),a.jsx(Ue,{children:a.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(E=>N.summary.issueCounts[E]>0?a.jsxs(We,{variant:"outline",className:"capitalize",children:[E,": ",N.summary.issueCounts[E]]},`${N.reportId}-${E}`):null),Object.values(N.summary.issueCounts).every(E=>E===0)&&a.jsx(We,{variant:"outline",children:"No issues"})]})}),a.jsx(Ue,{children:a.jsxs("div",{className:"flex flex-wrap gap-1",children:[N.modes.metadataReview&&a.jsx(We,{variant:"outline",children:"metadata"}),N.modes.deeperAnalysis&&a.jsx(We,{variant:"outline",children:"deeper"})]})}),a.jsx(Ue,{children:a.jsxs(Gf,{children:[a.jsx(Yf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(av,{className:"h-4 w-4"})})}),a.jsxs(Su,{align:"end",children:[a.jsx(Hr,{asChild:!0,children:a.jsx(_t,{to:`/tool-analysis-results/${N.reportId}`,children:"View"})}),a.jsxs(Hr,{onSelect:()=>{C(N.reportId,"json")},children:[a.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),a.jsxs(Hr,{onSelect:()=>{C(N.reportId,"markdown")},children:[a.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),a.jsxs(Hr,{className:"text-destructive",onSelect:E=>{E.preventDefault(),i(N.reportId)},children:[a.jsx(Ta,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},N.reportId))})]})]})})}),a.jsx(Ls,{open:!!o,onOpenChange:N=>!N&&i(null),children:a.jsxs(ss,{children:[a.jsxs(os,{children:[a.jsx(ls,{children:"Delete tool analysis report?"}),a.jsx(cs,{children:y?`Delete saved report '${y.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),a.jsxs(is,{children:[a.jsx(ds,{disabled:c,children:"Cancel"}),a.jsx(us,{onClick:N=>{N.preventDefault(),S()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function f$(e,t,n){const r=new Blob([t],{type:n}),s=URL.createObjectURL(r),o=document.createElement("a");o.href=s,o.download=e,o.click(),URL.revokeObjectURL(s)}function Sxe(){const{id:e=""}=wl(),t=Ia(),{source:n}=Dn(),[r,s]=m.useState(null),[o,i]=m.useState(!0),[c,d]=m.useState(!1),[f,h]=m.useState(!1),[p,x]=m.useState(!1);m.useEffect(()=>{let j=!0;return i(!0),d(!1),n.getToolAnalysisSavedResult(e).then(b=>{j&&s(b)}).catch(b=>{if(!j)return;const y=b instanceof Error?b.message:String(b);if(y.includes("(404)")){d(!0),s(null);return}Ae({title:"Could not load saved tool analysis report",description:y,variant:"destructive"})}).finally(()=>{j&&i(!1)}),()=>{j=!1}},[e,n]);const g=async()=>{x(!0);try{await n.deleteToolAnalysisSavedResult(e),Ae({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){Ae({title:"Could not delete report",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{x(!1),h(!1)}};return o?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(se,{asChild:!0,variant:"outline",children:a.jsx(_t,{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(mo,{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,b])=>`${j}: ${b??"unknown"}`).join(", ")})]}),a.jsx(se,{asChild:!0,size:"sm",variant:"outline",children:a.jsx(_t,{to:"/tool-analysis-results",children:"Back to results"})}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>f$(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
|
|
145
|
-
`,"application/json"),children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>f$(`${r.reportId}.md`,s_(r.report),"text/markdown"),children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[a.jsx(Ta,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),a.jsx(P6,{report:r.report}),a.jsx(Ls,{open:f,onOpenChange:h,children:a.jsxs(ss,{children:[a.jsxs(os,{children:[a.jsx(ls,{children:"Delete tool analysis report?"}),a.jsxs(cs,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),a.jsxs(is,{children:[a.jsx(ds,{disabled:p,children:"Cancel"}),a.jsx(us,{onClick:j=>{j.preventDefault(),g()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const Nxe=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function Nr({text:e}){return a.jsx(ai,{delayDuration:200,children:a.jsxs(si,{children:[a.jsx(oi,{type:"button",className:"inline-flex shrink-0 items-center",onClick:t=>t.preventDefault(),children:a.jsx(O7,{className:"h-3.5 w-3.5 text-muted-foreground/50 hover:text-muted-foreground"})}),a.jsx(uo,{className:"max-w-xs text-xs leading-relaxed",children:e})]})})}function p$(e){return navigator.clipboard.writeText(e)}function Wj(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function Cxe(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(`
|
|
146
|
-
`)}
|
|
147
|
-
`}function _xe(){const{source:e}=Dn(),{servers:t,reload:n,loading:r}=rs(),[s,o]=m.useState("configure"),[i,c]=m.useState(""),[d,f]=m.useState("pre_registered"),[h,p]=m.useState("local_callback"),[x,g]=m.useState(!0),[j,b]=m.useState(!0),[y,S]=m.useState(!0),[C,N]=m.useState(""),[E,A]=m.useState(""),[k,O]=m.useState(""),[T,$]=m.useState(""),[B,q]=m.useState("__default__"),[F,H]=m.useState("{}"),[U,R]=m.useState(""),[W,X]=m.useState(""),[G,z]=m.useState(""),[J,D]=m.useState(""),[I,ne]=m.useState(""),[te,de]=m.useState(""),[he,V]=m.useState(""),[ue,Q]=m.useState(""),[Z,fe]=m.useState(null),[ae,Re]=m.useState(null),[_e,Me]=m.useState([]),[L,oe]=m.useState(!1),[pe,Ee]=m.useState(!1),[Xe,ht]=m.useState(!1),[gt,mt]=m.useState("all"),[Vt,qt]=m.useState("all"),[Ft,zt]=m.useState("inspector"),Ne=m.useRef(null),et=m.useRef(null),Ke=m.useRef(!1),ve=m.useRef(j);m.useEffect(()=>{ve.current=j},[j]),m.useEffect(()=>()=>{Ne.current?.(),Ne.current=null},[]),m.useEffect(()=>{et.current?.scrollIntoView({behavior:"smooth",block:"end"})},[_e.length]);const ze=m.useMemo(()=>t.filter(ce=>ce.authType==="oauth2").slice().sort((ce,st)=>(ce.name||ce.id).localeCompare(st.name||st.id,void 0,{sensitivity:"base"})),[t]),$e=ze.find(ce=>ce.id===i);m.useEffect(()=>{i&&(ze.some(ce=>ce.id===i)||c(""))},[ze,i]),m.useEffect(()=>{$e&&($e.oauthMode==="dcr"?(f("dcr"),O(""),$("")):(f("pre_registered"),O($e.oauthClientId??""),$($e.oauthClientSecret??"")),N($e.oauthScope??""),D($e.oauthAuthorizationUrl??""),ne($e.oauthTokenEndpoint??""))},[$e?.id]);const Qe=m.useMemo(()=>{const ce=Z?.stepStates.length??0,st=Z?.stepStates.filter(xt=>xt.status==="completed"||xt.status==="skipped").length??0,Nt=Z?.stepStates.filter(xt=>xt.status==="failed").length??0,on=ce>0?Math.round((st+Nt)/ce*100):0;return{total:ce,completed:st,failed:Nt,percent:on}},[Z]),Ce=m.useMemo(()=>{const ce=Z?.network??[],st=new Map,Nt=[],on=xt=>`${xt.stepId}::${xt.label}::${xt.url}`;for(const xt of ce){if(xt.phase==="request"){const So=Nt.length;Nt.push({key:xt.id,stepId:xt.stepId,label:xt.label,method:xt.method,url:xt.url,request:xt});const No=on(xt),Fs=st.get(No)??[];Fs.push(So),st.set(No,Fs);continue}const Tn=on(xt),Ln=st.get(Tn),Da=Ln?.shift();if(typeof Da=="number"){Nt[Da]={...Nt[Da],response:xt},Ln&&Ln.length>0?st.set(Tn,Ln):st.delete(Tn);continue}Nt.push({key:xt.id,stepId:xt.stepId,label:xt.label,method:xt.method,url:xt.url,response:xt})}return Nt.filter(xt=>gt!=="all"&&xt.stepId!==gt?!1:Vt==="error"?typeof xt.response?.status=="number"&&xt.response.status>=400:Vt==="ok"?typeof xt.response?.status=="number"&&xt.response.status<400:!0)},[Z?.network,gt,Vt]),qe=!!ae,Xt=!!(Z&&(Z.status==="completed"||Z.status==="error"||Z.status==="stopped")),gn=m.useMemo(()=>{const ce=new Map;return(Z?.stepStates??[]).forEach((st,Nt)=>{ce.set(st.id,Nt+1)}),ce},[Z?.stepStates]),be=ce=>{if(ce==="configure"||ce==="run"&&qe||ce==="report"&&Xt)return o(ce)},At=()=>{let ce;if(d==="dcr"&&F.trim())try{ce=JSON.parse(F)}catch{throw new Error("DCR metadata JSON is invalid")}if(!$e)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:$e.id,overrides:{authorizationServerMetadataUrl:G||void 0,authorizationEndpoint:J||void 0,tokenEndpoint:I||void 0,registrationEndpoint:te||void 0,cimdUrl:U||void 0,resourceBaseUrl:he||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:k.trim(),clientSecret:T.trim()||void 0,tokenEndpointAuthMethod:B==="__default__"?void 0:B||void 0}:void 0,dcr:d==="dcr"?{metadata:ce,tokenEndpointAuthMethod:B==="__default__"?void 0:B||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:U||void 0,expectedClientId:W||void 0}:void 0},runtime:{redirectMode:h,scopes:C.split(/[,\s]+/).map(st=>st.trim()).filter(Boolean),resource:E.trim()||void 0,usePkce:y,codeChallengeMethod:"S256"},display:{showSensitiveValues:x}}},$t=ce=>{Ne.current?.(),Ne.current=e.subscribeOAuthDebuggerSession(ce,st=>{Me(on=>[...on,st]),(st.type==="completed"||st.type==="error"||st.type==="stopped")&&oe(!1),e.getOAuthDebuggerSession(ce).then(on=>{fe(on.session),on.session.uiHints.authorizationUrl&&Ut(`${Wj()}/api/oauth-debugger/sessions/${ce}/authorize`),on.session.status==="completed"&&o("report")}).catch(()=>{})})},Ut=ce=>{!ve.current||Ke.current||!ce||(Ke.current=!0,window.open(ce,"_blank","noopener,noreferrer"))},nn=async()=>{Ee(!0),Ke.current=!1;try{const ce=At(),st=await e.createOAuthDebuggerSession(ce);Re(st.sessionId),fe(st.session),Me([]),o("run"),$t(st.sessionId);const Nt=await e.startOAuthDebuggerSession(st.sessionId);fe(Nt.session),oe(!0),(Nt.session.status==="waiting_for_user"||Nt.session.status==="waiting_for_browser_callback")&&(oe(!1),Nt.session.uiHints.authorizationUrl&&Ut(`${Wj()}/api/oauth-debugger/sessions/${st.sessionId}/authorize`))}catch(ce){Ae({title:"Could not start OAuth Debugger session",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{Ee(!1)}},kn=async()=>{if(ae)try{Ee(!0);const ce=await e.submitOAuthDebuggerManualCallback(ae,{redirectUrl:ue.trim()||void 0});fe(ce.session),Q(""),oe(!0)}catch(ce){Ae({title:"Could not submit callback",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{Ee(!1)}},pt=async()=>{if(ae){ht(!0);try{const ce=await e.stopOAuthDebuggerSession(ae);if(oe(!1),ce.status!=="running"){const st=await e.getOAuthDebuggerSession(ae);fe(st.session),st.session.status==="completed"?o("report"):o("run")}}catch(ce){Ae({title:"Could not stop session",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{ht(!1)}}},Rt=async()=>{Ne.current?.(),Ne.current=null,fe(null),Re(null),Me([]),oe(!1),ht(!1),Ee(!1),Q(""),mt("all"),qt("all"),zt("inspector"),o("run"),await nn()},Bt=async ce=>{if(!(!ae||!Z))try{const st=await e.exportOAuthDebuggerSession(ae,ce);let Nt="";const on=ce==="json"?"json":ce==="raw"?"txt":"md";typeof st=="string"?Nt=st:Nt=`${JSON.stringify(st,null,2)}
|
|
148
|
-
`;const xt=new Blob([Nt],{type:"text/plain;charset=utf-8"}),Tn=URL.createObjectURL(xt),Ln=document.createElement("a");Ln.href=Tn,Ln.download=`oauth-debugger-${ae}.${on}`,Ln.click(),URL.revokeObjectURL(Tn)}catch(st){if(ce==="markdown"){const Nt=Cxe(Z,_e),on=new Blob([Nt],{type:"text/markdown;charset=utf-8"}),xt=URL.createObjectURL(on),Tn=document.createElement("a");Tn.href=xt,Tn.download=`oauth-debugger-${Z.id}.md`,Tn.click(),URL.revokeObjectURL(xt);return}Ae({title:"Export failed",description:st instanceof Error?st.message:String(st),variant:"destructive"})}},rn=ae?`${Wj()}/api/oauth-debugger/sessions/${ae}/authorize`:void 0,qn=ce=>ce==="error"?"destructive":ce==="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:Nxe.map(ce=>{const st=s===ce.id,Nt=ce.id==="configure"||ce.id==="run"&&qe||ce.id==="report"&&Xt;return a.jsx("button",{type:"button",onClick:()=>Nt&&be(ce.id),disabled:!Nt,className:"rounded-full",children:a.jsx(We,{variant:st?"default":"outline",className:Nt?"":"opacity-50",children:ce.label})},ce.id)})})]}),s==="configure"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(Pt,{className:"text-base",children:"Target MCP Server"}),a.jsx(Br,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[a.jsx(ma,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),a.jsx(He,{className:"space-y-3",children:a.jsxs("div",{className:"max-w-xl space-y-2",children:[a.jsx(Fe,{children:"MCP Server"}),a.jsxs(wn,{value:i,onValueChange:c,children:[a.jsx(hn,{children:a.jsx(jn,{placeholder:"Select an MCP server"})}),a.jsx(mn,{children:ze.map(ce=>a.jsx(tt,{value:ce.id,children:ce.name||ce.id},ce.id))})]}),ze.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"}),"."]}),$e&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:[$e.transport," · ",$e.url||$e.command||"No URL/command"," · ",a.jsxs("span",{className:"text-primary",children:[$e.oauthMode==="dcr"?"DCR":"pre-registered"," fields pre-filled"]})]})]})})]}),a.jsxs(Ve,{children:[a.jsxs(kt,{className:"pb-3",children:[a.jsx(Pt,{className:"text-base",children:"Client Registration Method"}),a.jsx(Br,{children:"How your OAuth client is identified with the authorization server."})]}),a.jsxs(He,{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(ce=>a.jsxs("button",{type:"button",onClick:()=>f(ce.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===ce.id?"bg-primary":"bg-muted-foreground/30"}`}),a.jsx("span",{className:"text-sm font-medium",children:ce.label})]}),a.jsx("p",{className:"mt-1 pl-5 text-xs text-muted-foreground",children:ce.hint})]},ce.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(Fe,{className:"text-xs flex items-center gap-1",children:["Redirect mode",a.jsx(Nr,{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(wn,{value:h,onValueChange:ce=>p(ce),children:[a.jsx(hn,{children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"local_callback",children:"Local callback (recommended)"}),a.jsx(tt,{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(Fe,{className:"text-xs flex items-center gap-1",children:["client_id",a.jsx(Nr,{text:"The unique identifier for your application, issued by the authorization server when you registered the client."})]}),a.jsx(vt,{value:k,onChange:ce=>O(ce.target.value)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["client_secret",a.jsx(Nr,{text:"Leave empty for public clients (e.g. SPAs or mobile apps). Required for confidential clients that authenticate with the token endpoint."})]}),a.jsx(vt,{value:T,onChange:ce=>$(ce.target.value),type:"password",placeholder:"optional"})]})]}),d==="cimd"&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["CIMD URL",a.jsx(Nr,{text:"A publicly reachable URL hosting a JSON document that describes this client. The authorization server fetches it to identify the client."})]}),a.jsx(vt,{value:U,onChange:ce=>R(ce.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),a.jsxs(Ve,{children:[a.jsxs(kt,{className:"pb-3",children:[a.jsx(Pt,{className:"text-base",children:"Runtime OAuth Inputs"}),a.jsx(Br,{children:"Parameters sent in the authorization request."})]}),a.jsxs(He,{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Fe,{className:"text-xs",children:"Scopes"}),a.jsx(vt,{value:C,onChange:ce=>N(ce.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(Kr,{checked:y,onCheckedChange:ce=>S(!!ce)}),a.jsxs(Fe,{className:"flex items-center gap-1",children:["Use PKCE (S256)",a.jsx(Nr,{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(Kr,{checked:j,onCheckedChange:ce=>b(!!ce)}),a.jsx(Fe,{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(Fe,{className:"text-xs flex items-center gap-1",children:["Token endpoint auth method",a.jsx(Nr,{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(wn,{value:B,onValueChange:q,children:[a.jsx(hn,{children:a.jsx(jn,{placeholder:"Server default (recommended)"})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"__default__",children:"Server default (let the server decide)"}),a.jsx(tt,{value:"client_secret_basic",children:"client_secret_basic — credentials in Authorization header"}),a.jsx(tt,{value:"client_secret_post",children:"client_secret_post — credentials in request body"}),a.jsx(tt,{value:"none",children:"none — public client, no secret"}),a.jsx(tt,{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(Fe,{className:"text-xs flex items-center gap-1",children:["Resource / audience",a.jsx(Nr,{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(vt,{value:E,onChange:ce=>A(ce.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(Fe,{className:"text-xs flex items-center gap-1",children:["DCR metadata JSON",a.jsx(Nr,{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(Os,{value:F,onChange:ce=>H(ce.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(Fe,{className:"text-xs flex items-center gap-1",children:["Expected client_id",a.jsx(Nr,{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(vt,{value:W,onChange:ce=>X(ce.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(Fe,{className:"text-xs flex items-center gap-1",children:["Authorization server metadata URL",a.jsx(Nr,{text:"The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path."})]}),a.jsx(vt,{value:G,onChange:ce=>z(ce.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Resource server base URL",a.jsx(Nr,{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(vt,{value:he,onChange:ce=>V(ce.target.value),placeholder:"https://resource.example.com"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Authorization endpoint",a.jsx(Nr,{text:"The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata."})]}),a.jsx(vt,{value:J,onChange:ce=>D(ce.target.value),placeholder:"https://.../authorize"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Token endpoint",a.jsx(Nr,{text:"The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically."})]}),a.jsx(vt,{value:I,onChange:ce=>ne(ce.target.value),placeholder:"https://.../token"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Registration endpoint (DCR)",a.jsx(Nr,{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(vt,{value:te,onChange:ce=>de(ce.target.value),placeholder:"https://.../register"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["CIMD URL override",a.jsx(Nr,{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(vt,{value:U,onChange:ce=>R(ce.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),a.jsxs(Qi,{children:[a.jsx(yy,{className:"h-4 w-4"}),a.jsx(Ji,{children:"Secrets display"}),a.jsxs(Zi,{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(Kr,{checked:!x,onCheckedChange:ce=>g(ce===!1)}),a.jsx(Fe,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),a.jsx("div",{className:"flex justify-end",children:a.jsxs(se,{type:"button",onClick:()=>{nn()},disabled:pe,children:[pe&&a.jsx(wr,{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(Ve,{className:"xl:col-span-1 min-w-0",children:[a.jsx(kt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(Pt,{className:"text-base",children:"Progress"}),a.jsx(Br,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[Z?.uiHints.authorizationUrl&&rn&&a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsxs("a",{href:rn,target:"_blank",rel:"noopener noreferrer",children:[a.jsx($h,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Rt()},disabled:pe,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Restart"]}),ae&&a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{pt()},disabled:Xe||!ae,children:[(Xe||L)&&Xe&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),a.jsx(kh,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),a.jsxs(He,{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:[Qe.completed+Qe.failed,"/",Qe.total," steps"]}),a.jsxs("span",{children:[Qe.percent,"%"]})]}),a.jsx(Tg,{value:Qe.percent,className:"h-2"})]}),Z?.status==="waiting_for_user"&&a.jsx(Ve,{children:a.jsxs(He,{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(Os,{value:ue,onChange:ce=>Q(ce.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(se,{type:"button",size:"sm",onClick:()=>{kn()},disabled:pe||!ue.trim(),children:[pe&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),Z.uiHints.authorizationUrl&&rn&&a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsx("a",{href:rn,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),Z?.status==="waiting_for_browser_callback"&&a.jsxs(Qi,{children:[a.jsx(yy,{className:"h-4 w-4"}),a.jsx(Ji,{children:"Waiting for browser callback"}),a.jsxs(Zi,{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:Z.uiHints.callbackUrl}),Z.uiHints.authorizationUrl&&rn&&a.jsx("div",{className:"pt-2",children:a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsxs("a",{href:rn,target:"_blank",rel:"noopener noreferrer",children:[a.jsx($h,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),a.jsx("div",{className:"space-y-2",children:Z?.stepStates.map(ce=>{const st=gn.get(ce.id);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:st}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-sm font-medium",children:ce.title}),a.jsx("div",{className:"text-xs text-muted-foreground",children:ce.description})]})]}),a.jsx(We,{variant:ce.status==="failed"?"destructive":ce.status==="completed"?"outline":ce.status==="active"?"secondary":"outline",className:ce.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:ce.status})]}),ce.outcomeSummary&&a.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:ce.outcomeSummary})]},ce.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(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(Pt,{className:"text-base",children:"Inspect"}),a.jsx(Br,{children:"Live events and network requests/responses for the OAuth flow."})]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Bt("raw")},disabled:!ae||!Z,children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})}),a.jsx(He,{className:"space-y-3",children:a.jsxs(Sg,{value:Ft,onValueChange:ce=>zt(ce),className:"min-w-0",children:[a.jsxs(Xf,{className:"grid grid-cols-2",children:[a.jsx(Cs,{value:"inspector",children:"Network Inspector"}),a.jsx(Cs,{value:"events",children:"Live Debug"})]}),a.jsx(Nf,{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:[_e.length===0?a.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):_e.map((ce,st)=>a.jsxs("div",{className:"break-all",children:[a.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ce.ts).toLocaleTimeString()}),a.jsx(We,{variant:"outline",className:"mr-2 text-[10px]",children:ce.type}),typeof ce.payload.message=="string"?ce.payload.message:JSON.stringify(ce.payload)]},`${ce.ts}-${st}`)),a.jsx("div",{ref:et})]})}),a.jsxs(Nf,{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(Fe,{className:"text-xs",children:"Filter by step"}),a.jsxs(wn,{value:gt,onValueChange:mt,children:[a.jsx(hn,{className:"h-8",children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"all",children:"All steps"}),(Z?.stepStates??[]).map(ce=>a.jsxs(tt,{value:ce.id,children:[gn.get(ce.id),". ",ce.title]},ce.id))]})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Fe,{className:"text-xs",children:"Filter by status"}),a.jsxs(wn,{value:Vt,onValueChange:qt,children:[a.jsx(hn,{className:"h-8",children:a.jsx(jn,{})}),a.jsxs(mn,{children:[a.jsx(tt,{value:"all",children:"All"}),a.jsx(tt,{value:"ok",children:"Successful responses"}),a.jsx(tt,{value:"error",children:"Error responses"})]})]})]})]}),a.jsx("div",{className:"max-h-[34rem] min-w-0 space-y-2 overflow-auto",children:Ce.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):Ce.map(ce=>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:gn.get(ce.stepId)}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-sm font-medium",children:ce.label}),a.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[ce.method?`${ce.method} `:"",ce.url]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(We,{variant:"outline",children:"request"}),a.jsx(We,{variant:"outline",children:"response"}),typeof ce.response?.status=="number"&&a.jsx(We,{variant:ce.response.status>=400?"destructive":"secondary",children:ce.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(ce.request?.headers??{},null,2)})]}),ce.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:ce.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(ce.response?.headers??{},null,2)})]}),ce.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:ce.response.bodyText})]}),a.jsx("div",{className:"flex gap-2",children:a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{p$(JSON.stringify(ce,null,2))},children:[a.jsx(_s,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},ce.key))})]})]})})]})})]})}),s==="report"&&Z&&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(se,{type:"button",size:"sm",variant:"outline",onClick:()=>o("configure"),children:"Back to Configure"}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Bt("json")},children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Bt("markdown")},children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Bt("raw")},children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),a.jsxs(Qi,{children:[a.jsx(yy,{className:"h-4 w-4"}),a.jsx(Ji,{children:"Secrets display mode"}),a.jsx(Zi,{children:Z.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(Ve,{children:a.jsxs(He,{className:"pt-4",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),a.jsx("div",{className:"text-lg font-semibold",children:Z.status})]})}),a.jsx(Ve,{children:a.jsxs(He,{className:"pt-4",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),a.jsx("div",{className:"text-lg font-semibold",children:Z.networkSummary.requestCount})]})}),a.jsx(Ve,{children:a.jsxs(He,{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:Z.networkSummary.errorCount})]})}),a.jsx(Ve,{children:a.jsxs(He,{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:Z.validations.length})]})})]}),a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Key values"})}),a.jsxs(He,{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx(Fe,{className:"text-xs",children:"Issuer"}),a.jsx("p",{className:"text-sm break-all",children:Z.summary?.issuer||"-"})]}),a.jsxs("div",{children:[a.jsx(Fe,{className:"text-xs",children:"Client ID"}),a.jsx("p",{className:"text-sm break-all",children:Z.summary?.clientId||"-"})]}),a.jsxs("div",{children:[a.jsx(Fe,{className:"text-xs",children:"Redirect URI"}),a.jsx("p",{className:"text-sm break-all",children:Z.summary?.redirectUri||"-"})]}),a.jsxs("div",{children:[a.jsx(Fe,{className:"text-xs",children:"Token endpoint status"}),a.jsx("p",{className:"text-sm",children:Z.summary?.tokenEndpointStatus??"-"})]}),a.jsxs("div",{children:[a.jsx(Fe,{className:"text-xs",children:"Token type"}),a.jsx("p",{className:"text-sm",children:Z.summary?.tokenType||"-"})]}),a.jsxs("div",{children:[a.jsx(Fe,{className:"text-xs",children:"Scopes granted"}),a.jsx("p",{className:"text-sm break-all",children:(Z.summary?.grantedScopes??[]).join(", ")||"-"})]}),a.jsxs("div",{children:[a.jsx(Fe,{className:"text-xs",children:"Token validity"}),a.jsxs("p",{className:"text-sm",children:[typeof Z.summary?.accessTokenValidForSeconds=="number"?`${G1(Z.summary.accessTokenValidForSeconds)} remaining`:typeof Z.summary?.accessTokenExpiresInSeconds=="number"?`${G1(Z.summary.accessTokenExpiresInSeconds)} from issuance`:"No expiry advertised by token endpoint",Z.summary?.accessTokenExpiresAt?` (until ${new Date(Z.summary.accessTokenExpiresAt).toLocaleTimeString()})`:""]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Source:"," ",Z.summary?.accessTokenExpirySource==="expires_in"?"token endpoint expires_in":Z.summary?.accessTokenExpirySource==="jwt_exp"?"JWT exp claim":"not available"]})]}),a.jsxs("div",{children:[a.jsx(Fe,{className:"text-xs",children:"Refresh option"}),a.jsx("p",{className:"text-sm",children:Z.summary?.refreshTokenAvailable?"Refresh token available (silent refresh possible)":"No refresh token in response (full login likely required after expiry)"})]}),Z.summary?.accessToken&&a.jsxs("div",{className:"md:col-span-2 space-y-1",children:[a.jsx(Fe,{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:[Z.summary.accessToken.slice(0,48),"…"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"shrink-0 h-7 px-2 text-xs",onClick:()=>{p$(Z.summary.accessToken)},children:[a.jsx(_s,{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(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Validation findings"})}),a.jsx(He,{className:"space-y-2",children:Z.validations.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):Z.validations.map((ce,st)=>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:st+1}),a.jsx("span",{className:"font-bold",children:ce.title})]}),a.jsx(We,{variant:qn(ce.severity),children:ce.severity})]}),a.jsxs("p",{className:"text-sm",children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",ce.detail]}),ce.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:ce.recommendation})]}),a.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",ce.stepId,ce.specReference&&a.jsxs(a.Fragment,{children:[" · ",a.jsx("a",{href:ce.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},ce.id))})]})]})]})}const Vj="mcplab.runEvaluation.activeJobId",Axe=()=>{const[e]=go(),[t,n]=m.useState(""),[r,s]=m.useState("1"),[o,i]=m.useState(!1),[c,d]=m.useState(0),[f,h]=m.useState([]),[p,x]=m.useState(!1),[g,j]=m.useState(!1),[b,y]=m.useState(""),[S,C]=m.useState(null),[N,E]=m.useState([]),[A,k]=m.useState([]),[O,T]=m.useState(!0),[$,B]=m.useState(""),[q,F]=m.useState(""),[H,U]=m.useState(!1),[R,W]=m.useState([]),[X,G]=m.useState(null),[z,J]=m.useState(!1),[D,I]=m.useState(null),ne=m.useRef(null),te=m.useRef(null),de=m.useRef(!1),{configs:he,reload:V}=Mf(),{source:ue}=Dn(),Q=Ag("snapshots",!1),{agents:Z,scenarios:fe,servers:ae,reload:Re}=rs(),_e=b.trim(),Me=_e?`/results/${encodeURIComponent(_e)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",L=he.find(ve=>ve.id===t),oe=e.get("configId"),pe=m.useMemo(()=>{if(!L)return[];const ve=new Map,ze=L.agentEntries&&L.agentEntries.length>0?L.agentEntries:L.agents.map($e=>({kind:"inline",agent:$e}));for(const $e of ze){if($e.kind==="inline"){const Ce=$e.agent.id;ve.has(Ce)||ve.set(Ce,$e.agent);continue}const Qe=Z.find(Ce=>Ce.id===$e.ref);Qe&&!ve.has(Qe.id)&&ve.set(Qe.id,Qe)}for(const $e of Z)ve.has($e.id)||ve.set($e.id,$e);return Array.from(ve.values())},[L,Z]),Ee=m.useMemo(()=>{if(!L)return[];const ve=new Map,ze=L.scenarioEntries&&L.scenarioEntries.length>0?L.scenarioEntries:L.scenarios.map($e=>({kind:"inline",scenario:$e}));for(const $e of ze){if($e.kind==="inline"){ve.has($e.scenario.id)||ve.set($e.scenario.id,$e.scenario);continue}const Qe=fe.find(Ce=>Ce.id===$e.ref);Qe&&!ve.has(Qe.id)&&ve.set(Qe.id,Qe)}return Array.from(ve.values())},[L,fe]);m.useEffect(()=>{oe&&he.some(ve=>ve.id===oe)&&n(oe)},[oe,he]);const Xe=m.useRef("");m.useEffect(()=>{const ve=L?`${L.id}::${L.sourcePath??""}`:"";if(ve===Xe.current)return;if(Xe.current=ve,!L){E([]),k([]);return}const ze=pe.filter($e=>(L.runDefaults?.selectedAgentNames??[]).includes($e.id)).map($e=>$e.id);E(ze.length>0?ze:pe.map($e=>$e.id)),k(Ee.map($e=>$e.id)),T(!0)},[L?.id,L?.sourcePath,pe,Ee]);const ht=async()=>{if(!L?.sourcePath){h(Ce=>[...Ce,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const ve=pe.filter(Ce=>N.includes(Ce.id));if(ve.length===0){h(Ce=>[...Ce,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const ze=Ee.filter(Ce=>A.includes(Ce.id));if(ze.length===0){h(Ce=>[...Ce,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}const $e=Array.from(new Set(ze.flatMap(Ce=>Ce.serverIds||[]).filter(Ce=>{const qe=(L.servers??[]).find(gn=>gn.id===Ce),Xt=ae.find(gn=>gn.id===Ce);return(qe||Xt)?.authType==="oauth2"})));try{$e.length>0&&(J(!0),await oo({serverNames:$e,source:ue,onServerAuthStart:Ce=>{h(qe=>[...qe,`[${new Date().toLocaleTimeString()}] OAuth login required for '${Ce}'. Complete the browser sign-in flow...`])}}),h(Ce=>[...Ce,`[${new Date().toLocaleTimeString()}] OAuth login completed for required server(s): ${$e.join(", ")}.`]))}catch(Ce){const qe=Ce instanceof Error?Ce.message:String(Ce);h(Xt=>[...Xt,`[${new Date().toLocaleTimeString()}] OAuth error: ${qe}`]),J(!1);return}finally{J(!1)}i(!0),x(!1),j(!1),y("");const Qe=(L.serverEntries??[]).some(Ce=>Ce.kind==="referenced")||(L.agentEntries??[]).some(Ce=>Ce.kind==="referenced")||(L.scenarioEntries??[]).some(Ce=>Ce.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${L.name} mode=${Qe} agents=${ve.map(Ce=>Ce.name||Ce.id).join(", ")} tests=${ze.map(Ce=>Ce.id).join(", ")} runs=${Number(r)} snapshotEval=${Q&&O?"on":"off"}${$.trim()?` note=${$.trim()}`:""}`]),d(10);try{const{jobId:Ce}=await ue.startRun({configPath:L.sourcePath,runsPerScenario:Number(r),agents:ve.map(qe=>qe.id),scenarioIds:ze.map(qe=>qe.id),applySnapshotEval:Q?O:!1,runNote:$.trim()?$.trim():void 0});C(Ce),Ft(Ce),Ke(Ce),zt()}catch(Ce){const qe=Ce instanceof Error?Ce.message:String(Ce),Xt=qe.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(gn=>[...gn,`[${new Date().toLocaleTimeString()}] Error: ${qe}${Xt}`]),i(!1),d(0),C(null),J(!1)}},gt=()=>{ht()},mt=()=>{S&&ue.stopRun(S),te.current?.(),te.current=null,qt(),C(null),i(!1),x(!1),j(!0),h(ve=>[...ve,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),zt()},Vt=async()=>{if(b){U(!0);try{const ve=await ue.createSnapshotFromRun(b,q.trim()||void 0);Ae({title:"Snapshot saved",description:`Created ${ve.name} (${ve.id})`}),q.trim()||F(ve.name)}catch(ve){Ae({title:"Could not save snapshot",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{U(!1)}}};m.useEffect(()=>{ne.current&&(ne.current.scrollTop=ne.current.scrollHeight)},[f]),m.useEffect(()=>()=>{te.current?.()},[]),m.useEffect(()=>{if(S||p)return;let ve="";try{ve=sessionStorage.getItem(Vj)??""}catch{ve=""}if(ve)return C(ve),i(!0),x(!1),j(!1),h(ze=>ze.length>0?ze:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),Ke(ve),()=>{}},[S,p]);const qt=()=>{try{sessionStorage.removeItem(Vj)}catch{}},Ft=ve=>{try{sessionStorage.setItem(Vj,ve)}catch{}},zt=async()=>{try{const ve=await ue.getRunQueue();W(ve.queued),G(ve.active);const ze=ve.queued.find($e=>$e.status==="blocked_auth"&&$e.blockedReason==="oauth_required");ze&&(ze.requiredServers??[]).length>0?I($e=>$e?.jobId===ze.jobId?$e:{jobId:ze.jobId,servers:ze.requiredServers}):ve.queued.some($e=>$e.status==="blocked_auth")||I(null)}catch{}},Ne=()=>{V(),Re()};m.useEffect(()=>{Ne(),zt();const ve=()=>{Ne(),zt()};return window.addEventListener("focus",ve),()=>{window.removeEventListener("focus",ve)}},[V,Re]);const et=async ve=>{try{await ue.removeQueuedRun(ve),W(ze=>ze.filter($e=>$e.jobId!==ve))}catch(ze){const $e=ze instanceof Error?ze.message:String(ze);if($e.includes("Use the /stop endpoint"))try{await ue.stopRun(ve)}catch{}else Ae({title:"Could not remove queued run",description:$e,variant:"destructive"})}zt()},Ke=ve=>{S===ve&&te.current||(te.current?.(),te.current=ue.subscribeRunJob(ve,ze=>{const $e=new Date(ze.ts).toLocaleTimeString();if(ze.type==="queued"){h(Qe=>{const Ce=ze.payload.position?` (position ${ze.payload.position})`:"",qe=`[${$e}] Run queued${Ce}. Waiting for active run to finish...`;return Qe.includes(qe)?Qe:[...Qe,qe]}),d(5);return}if(ze.type==="oauth_required"){const Qe=Array.isArray(ze.payload.servers)?ze.payload.servers:[],Ce=String(ze.payload.jobId??"");I({jobId:Ce,servers:Qe}),h(qe=>{const Xt=`[${$e}] OAuth required for server(s): ${Qe.join(", ")}. Click "Connect & Resume" to authenticate.`;return qe.includes(Xt)?qe:[...qe,Xt]});return}if(ze.type==="started"&&(I(null),de.current=!1,i(!0),x(!1),j(!1),h(Qe=>{const Ce=`[${$e}] Run started.`;return Qe.includes(Ce)?Qe:[...Qe,Ce]}),d(Qe=>Math.max(Qe,30)),zt()),ze.type==="log"){const Qe=String(ze.payload.message??"").trim();Qe&&(h(Ce=>{const qe=`[${$e}] ${Qe}`;return Ce.includes(qe)?Ce:[...Ce,qe]}),d(Ce=>{const qe=Qe.toLowerCase();if(qe.startsWith("loading mcp evaluation config"))return Math.max(Ce,15);if(qe.startsWith("loaded config"))return Math.max(Ce,20);if(qe.startsWith("selected "))return Math.max(Ce,30);if(qe.startsWith("using requested agents")||qe.startsWith("using resolved default agents"))return Math.max(Ce,35);if(qe.startsWith("expanded to "))return Math.max(Ce,45);if(qe.startsWith("running evaluation"))return Math.max(Ce,50);const Xt=qe.match(/^scenario (\d+)\/(\d+) finished:/);if(Xt){const gn=Number(Xt[1]),be=Number(Xt[2]);return Math.max(Ce,50+Math.round(gn/be*25))}return qe.startsWith("evaluation execution finished")?Math.max(Ce,78):qe.startsWith("applying snapshot evaluation policy")?Math.max(Ce,82):qe.includes("snapshot evaluation applied")||qe.includes("snapshot evaluation enabled")?Math.max(Ce,88):qe.startsWith("writing results to ")?Math.max(Ce,94):qe.startsWith("run finished:")?Math.max(Ce,98):Ce}))}if(ze.type==="completed"){const Qe=String(ze.payload.runId??"").trim();if(I(null),de.current=!1,h(Ce=>{const qe=`[${$e}] Run completed.`;return Ce.includes(qe)?Ce:[...Ce,qe]}),ze.payload.snapshotEval&&typeof ze.payload.snapshotEval=="object"){const Ce=ze.payload.snapshotEval;h(qe=>{const Xt=`[${$e}] Snapshot eval (${Ce.mode??"warn"}) baseline=${Ce.baseline_snapshot_id??"-"} score=${Ce.overall_score??"-"} status=${Ce.status??"-"}`;return qe.includes(Xt)?qe:[...qe,Xt]})}d(100),i(!1),x(!0),j(!1),y(Qe),qt(),C(null),te.current?.(),te.current=null,zt()}if(ze.type==="error"){const Qe=String(ze.payload.message??"Unknown error"),Ce=Qe.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),de.current=!1,h(qe=>[...qe,`[${$e}] Error: ${Qe}${Ce}`]),i(!1),x(!1),j(!1),d(0),qt(),C(null),te.current?.(),te.current=null,zt()}}))};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(to,{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(Ve,{children:a.jsxs(He,{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(Fe,{children:"MCP Evaluation"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(wn,{value:t,onValueChange:n,children:[a.jsx(hn,{children:a.jsx(jn,{placeholder:"Select a config"})}),a.jsx(mn,{children:he.map(ve=>a.jsx(tt,{value:ve.id,children:ve.name},ve.id))})]}),a.jsx(se,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:Ne,"aria-label":"Refresh configs",title:"Refresh configs",children:a.jsx(ma,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Fe,{children:"Variance Runs"}),a.jsx(vt,{type:"number",min:"1",max:"10",value:r,onChange:ve=>s(ve.target.value)})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Fe,{htmlFor:"run-note",children:"Run Note"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[$.length,"/500"]})]}),a.jsx(Os,{id:"run-note",value:$,onChange:ve=>B(ve.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),L&&a.jsxs("div",{className:"space-y-2",children:[Q&&L.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 (",L.snapshotEval.mode,") · baseline:"," ",a.jsx("span",{className:"font-mono",children:L.snapshotEval.baselineSnapshotId??"none"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Fe,{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(pe.map(ve=>ve.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:pe.map(ve=>{const ze=N.includes(ve.id);return a.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[a.jsx(Kr,{checked:ze,onCheckedChange:$e=>{const Qe=$e===!0;E(Ce=>Qe?[...Ce,ve.id]:Ce.filter(qe=>qe!==ve.id))}}),a.jsx("span",{children:ve.name||ve.id})]},ve.id)})}),pe.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."})]}),L&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Fe,{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(Ee.map(ve=>ve.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 ",Ee.length," selected"]}),a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:Ee.map(ve=>{const ze=A.includes(ve.id);return a.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[a.jsx(Kr,{checked:ze,onCheckedChange:$e=>{const Qe=$e===!0;k(Ce=>Qe?[...Ce,ve.id]:Ce.filter(qe=>qe!==ve.id))}}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block font-medium",children:ve.name||ve.id}),a.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:ve.id})]})]},ve.id)})})]}),Q&&a.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[a.jsx(Kr,{checked:O,onCheckedChange:ve=>T(ve===!0)}),a.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(se,{onClick:gt,disabled:!t||z||pe.length>0&&N.length===0||Ee.length>0&&A.length===0,children:[a.jsx(to,{className:"mr-2 h-4 w-4"}),X?"Queue Run":"Run"]}),o&&a.jsxs(se,{variant:"destructive",onClick:mt,children:[a.jsx(kh,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(o||f.length>0)&&a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Pt,{className:"text-base",children:"Progress"}),a.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),a.jsxs(He,{className:"space-y-4",children:[a.jsx(Tg,{value:c,className:"h-2"}),D&&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:D.servers.join(", ")})]}),a.jsx(se,{size:"sm",variant:"outline",disabled:z,onClick:()=>{de.current||(de.current=!0,J(!0),oo({serverNames:D.servers,source:ue,onServerAuthStart:ve=>{h(ze=>[...ze,`[${new Date().toLocaleTimeString()}] OAuth sign-in opened for '${ve}'...`])}}).then(()=>ue.resumeQueue()).then(()=>{const ve=D?.jobId;h(ze=>[...ze,`[${new Date().toLocaleTimeString()}] OAuth complete. Resuming run...`]),ve&&(C(ve),Ft(ve),i(!0),x(!1),Ke(ve))}).catch(ve=>{const ze=ve instanceof Error?ve.message:String(ve);h($e=>[...$e,`[${new Date().toLocaleTimeString()}] OAuth error: ${ze}`]),de.current=!1}).finally(()=>{J(!1)}))},children:z?"Connecting...":"Connect & Resume"})]}),a.jsx("div",{ref:ne,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((ve,ze)=>a.jsx("div",{className:ve.includes("✓")?"text-success":ve.includes("aborted")?"text-destructive":"text-foreground",children:ve},ze))})]})]}),a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Pt,{className:"inline-flex items-center gap-2 text-base",children:[a.jsx(mo,{className:"h-4 w-4"}),"Run Queue"]}),a.jsx(se,{variant:"ghost",size:"sm",onClick:()=>{zt()},children:a.jsx(ma,{className:"h-3 w-3"})})]})}),a.jsx(He,{children:!X&&R.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:[X&&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 ${S===X.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==X.jobId&&(C(X.jobId),Ft(X.jobId),i(!0),x(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${X.jobId}...`]),d(10),Ke(X.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:"font-mono text-xs",children:X.runParams.configPath.split("/").pop()??X.runParams.configPath}),X.runParams.agents&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",X.runParams.agents.join(", ")]}),X.runParams.runNote&&a.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",X.runParams.runNote]})]}),a.jsxs(se,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:ve=>{ve.stopPropagation(),X&&(ue.stopRun(X.jobId),zt())},title:"Stop running job",children:[a.jsx(kh,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),R.map((ve,ze)=>{const $e=ve.runParams.configPath.split("/").pop()??ve.runParams.configPath,Qe=ve.status==="blocked_auth";return a.jsxs("div",{className:`flex items-center justify-between rounded-md border p-2 text-sm ${Qe?"border-yellow-500/40 bg-yellow-500/5":""}`,children:[a.jsxs("div",{className:"min-w-0 flex items-center gap-2 flex-wrap",children:[Qe?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:["#",ze+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:["#",ze+1," Queued"]}),a.jsx("span",{className:"font-mono text-xs",children:$e}),Qe&&(ve.requiredServers??[]).length>0&&a.jsxs("span",{className:"text-xs text-yellow-700 dark:text-yellow-400",children:["OAuth: ",ve.requiredServers.join(", ")]}),!Qe&&ve.runParams.agents&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",ve.runParams.agents.join(", ")]}),ve.runParams.runNote&&a.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",ve.runParams.runNote]})]}),a.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[Qe&&a.jsx(se,{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:z,onClick:()=>{if(de.current)return;const Ce=ve.requiredServers??[];Ce.length!==0&&(de.current=!0,I({jobId:ve.jobId,servers:Ce}),J(!0),oo({serverNames:Ce,source:ue,onServerAuthStart:qe=>{h(Xt=>[...Xt,`[${new Date().toLocaleTimeString()}] OAuth sign-in opened for '${qe}'...`])}}).then(()=>ue.resumeQueue()).then(()=>{h(qe=>[...qe,`[${new Date().toLocaleTimeString()}] OAuth complete. Resuming run...`]),C(ve.jobId),Ft(ve.jobId),i(!0),x(!1),Ke(ve.jobId)}).catch(qe=>{const Xt=qe instanceof Error?qe.message:String(qe);h(gn=>[...gn,`[${new Date().toLocaleTimeString()}] OAuth error: ${Xt}`]),de.current=!1}).finally(()=>{J(!1)}))},children:z&&D?.jobId===ve.jobId?"Connecting...":"Connect & Resume"}),a.jsx(se,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{et(ve.jobId)},title:"Remove from queue",children:a.jsx(As,{className:"h-4 w-4"})})]})]},ve.jobId)})]})})]}),g&&!o&&!p&&a.jsx(Ve,{className:"border-amber-300/60 bg-amber-50/40",children:a.jsx(He,{className:"pt-6",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(kh,{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(se,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),a.jsxs(se,{type:"button",onClick:gt,disabled:!t,children:[a.jsx(to,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&a.jsx(Ve,{className:"border-success/50",children:a.jsxs(He,{className:"pt-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Jo,{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(se,{asChild:!0,className:"ml-auto",children:a.jsx(_t,{to:Me,children:_e?"View Results":"View Runs"})})]}),Q&&_e&&a.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Fe,{className:"text-xs",children:"Snapshot name (optional)"}),a.jsx(vt,{value:q,onChange:ve=>F(ve.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>{Vt()},disabled:H,children:H?"Saving...":"Save Snapshot"})]})]})})]})};function O6({title:e,description:t,expanded:n,onToggleExpanded:r,onHide:s,messages:o,pendingToolCalls:i,loading:c,input:d,onInputChange:f,onSend:h,inputPlaceholder:p,snippets:x,snippetsLabel:g="Result Assistant Snippets",onSnippetSelect:j,onApproveToolCall:b,onDenyToolCall:y,chatEndRef:S,inputRef:C,renderMessage:N,renderMessageExtras:E,className:A="min-w-0 overflow-hidden xl:flex xl:h-full xl:min-h-0 xl:flex-col",contentClassName:k="flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1"}){return a.jsxs(Ve,{className:A,children:[a.jsx(kt,{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(Pt,{className:"flex items-center gap-2 text-base",children:[a.jsx(zr,{className:"h-4 w-4 text-amber-500"}),e]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:r,children:[n?a.jsx(Zj,{className:"h-3.5 w-3.5"}):a.jsx(eS,{className:"h-3.5 w-3.5"}),n?"Compact":"Expand"]}),a.jsx(se,{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(He,{className:k,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:[o.map((O,T)=>{const $=O.role==="user",B=O.role==="assistant",q=O.role==="system",F=O.role==="tool",H=O.pendingToolCallId?i.find(R=>R.id===O.pendingToolCallId):void 0;return N?N({message:O,index:T,linkedPendingToolCall:H,isUser:$,isAssistant:B,isSystem:q,isTool:F}):B&&!!O.pendingToolCallId?a.jsxs("div",{className:"rounded-md border bg-background p-3",children:[a.jsx(Oa,{text:O.text,className:"text-sm"}),H&&a.jsx(K1,{call:H,loading:c,onApprove:b,onDeny:y,className:"mt-3"})]},`${O.id??`${O.role}-${T}`}-tool`):a.jsx(HB,{message:O},O.id??`${O.role}-${T}`)}),E,c&&a.jsx(KB,{}),a.jsx("div",{ref:S})]})}),a.jsx("div",{className:"border-t bg-background px-4 py-3",children:a.jsx(GB,{input:d,onInputChange:f,onSend:h,inputPlaceholder:p,snippets:x,snippetsLabel:g,onSnippetSelect:j,loading:c,inputRef:C})})]})]})}function yd(e){return e instanceof IN&&e.status===404}function T6(e){const{source:t,open:n,scope:r,runId:s,onSessionSync:o}=e,[i,c]=m.useState(null),[d,f]=m.useState([]),[h,p]=m.useState([]),[x,g]=m.useState(""),[j,b]=m.useState(!1),y=m.useRef(null),S=m.useRef(t),C=m.useRef(o),N=m.useRef(null),E=m.useRef(null);m.useEffect(()=>{y.current=i},[i]),m.useEffect(()=>{S.current=t},[t]),m.useEffect(()=>{C.current=o},[o]);const A=m.useCallback((H,U)=>{c(U??H.id),f(R=>R.length>H.messages.length?R:H.messages),p(H.pendingToolCalls),C.current?.(H)},[]),k=m.useCallback(async(H,U)=>{const R=U.session.id||H;A(U.session,R)},[A]),O=m.useCallback(async()=>{const H=x.trim();if(!H||r==="run"&&!s)return;const U=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,R={id:U,role:"user",text:H,createdAt:new Date().toISOString()};g(""),f(W=>[...W,R]),b(!0);try{let W=i;if(!W){const X=r==="run"&&s?await t.createResultAssistantSession({runId:s,scope:"run"}):await t.createResultAssistantSession({scope:"all_runs"});W=X.sessionId||X.session.id,A(X.session,W),f(G=>G.some(J=>J.id===U)?[...X.session.messages,R]:X.session.messages)}try{const X=await t.sendResultAssistantMessage(W,H);await k(W,X)}catch(X){if(!yd(X))throw X;const G=r==="run"&&s?await t.createResultAssistantSession({runId:s,scope:"run"}):await t.createResultAssistantSession({scope:"all_runs"}),z=G.sessionId||G.session.id;A(G.session,z),f(D=>D.some(ne=>ne.id===U)?[...G.session.messages,R]:G.session.messages);const J=await t.sendResultAssistantMessage(z,H);await k(z,J)}}catch(W){f(X=>X.filter(G=>G.id!==U)),Ae({title:"MCP Lab Assistant error",description:W instanceof Error?W.message:String(W),variant:"destructive"})}finally{b(!1)}},[x,r,s,i,t,A,k]),T=m.useCallback(async H=>{if(i){b(!0);try{const U=await t.approveResultAssistantToolCall(i,H);await k(i,U)}catch(U){yd(U)&&(c(null),p([])),Ae({title:"Could not approve assistant action",description:yd(U)?"Assistant session expired. Ask a new question to start a fresh session.":U instanceof Error?U.message:String(U),variant:"destructive"})}finally{b(!1)}}},[i,t,k]),$=m.useCallback(async H=>{if(i){b(!0);try{const U=await t.denyResultAssistantToolCall(i,H);await k(i,U)}catch(U){yd(U)&&(c(null),p([])),Ae({title:"Could not deny assistant action",description:yd(U)?"Assistant session expired. Ask a new question to start a fresh session.":U instanceof Error?U.message:String(U),variant:"destructive"})}finally{b(!1)}}},[i,t,k]),B=m.useCallback(()=>{const H=y.current;H&&t.closeResultAssistantSession(H).catch(()=>{}),y.current=null,c(null),f([]),p([]),g("")},[t]),q=m.useCallback(H=>{f(U=>U.length>0?U:[{id:`msg-${Date.now()}`,role:"assistant",text:H,createdAt:new Date().toISOString()}])},[]),F=m.useCallback(H=>{g(H),requestAnimationFrame(()=>E.current?.focus())},[]);return m.useEffect(()=>{if(!n)return;const H=window.setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(H)},[n,d.length,j]),m.useEffect(()=>{const H=E.current;if(!H)return;H.style.height="0px";const U=Math.min(H.scrollHeight,160);H.style.height=`${Math.max(40,U)}px`},[x,n]),m.useEffect(()=>{if(!(!n||!i))return S.current.subscribeResultAssistantSessionEvents(i,H=>{A(H.payload.session,H.payload.sessionId)})},[n,i,A]),m.useEffect(()=>()=>{const H=y.current;H&&S.current.closeResultAssistantSession(H).catch(()=>{})},[]),{assistantSessionId:i,assistantMessages:d,assistantPendingToolCalls:h,assistantInput:x,assistantLoading:j,assistantChatEndRef:N,assistantInputRef:E,setAssistantInput:g,setAssistantMessages:f,askAssistant:O,approveResultAssistantToolCall:T,denyResultAssistantToolCall:$,applyResultAssistantSnippet:F,ensureIntroMessage:q,resetAssistantSession:B}}function Mh(e){const t=String(e??"").trim();return t&&(t.split("::").pop()??t).replace(/^mcplab__/,"").replace(/^mcplab_/,"").replace(/_/g," ").replace(/\s+/g," ").trim()||"unknown_tool"}function Exe(e){const t=Array.from(new Map(e.scenarios.map(d=>{const f=String(d.scenarioId??"").trim(),h=String(d.scenarioName??"").trim();return!f&&!h?null:[f||h,h||f]}).filter(d=>!!d)).values()),n=Array.from(new Set(e.scenarios.map(d=>d.agentName).filter(Boolean))),r=Array.from(new Set(e.scenarios.map(d=>d.model).filter(d=>!!d))),s=t.slice(0,2).join(", "),o=t.length>2?` +${t.length-2}`:"",i=r.slice(0,2).join(", "),c=r.length>2?` +${r.length-2}`:"";return{scenarioCount:t.length,agentCount:n.length,scenarioPreview:s?`${s}${o}`:"n/a",modelSummary:i?`${i}${c}`:""}}const kxe=[{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."}],Pxe=()=>{const[e]=go(),{source:t}=Dn(),[n,r]=m.useState([]),[s,o]=m.useState(!1),[i,c]=m.useState(null),[d,f]=m.useState(!1),[h,p]=m.useState("timestamp"),[x,g]=m.useState("desc"),[j,b]=m.useState("all"),[y,S]=m.useState(!1),[C,N]=m.useState(!1),[E,A]=m.useState(!1),k=Q=>{if(h===Q){g(Z=>Z==="asc"?"desc":"asc");return}p(Q),g(Q==="timestamp"?"desc":"asc")},O=async()=>{o(!0);try{r(await t.listResults())}catch(Q){Ae({title:"Could not load results",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}finally{o(!1)}};m.useEffect(()=>{let Q=!0;return o(!0),t.listResults().then(Z=>{Q&&r(Z)}).catch(Z=>{Q&&Ae({title:"Could not load results",description:Z instanceof Error?Z.message:String(Z),variant:"destructive"})}).finally(()=>{Q&&o(!1)}),()=>{Q=!1}},[t]);const{assistantMessages:T,assistantPendingToolCalls:$,assistantInput:B,assistantLoading:q,assistantChatEndRef:F,assistantInputRef:H,setAssistantInput:U,askAssistant:R,approveResultAssistantToolCall:W,denyResultAssistantToolCall:X,applyResultAssistantSnippet:G,ensureIntroMessage:z}=T6({source:t,open:C,scope:"all_runs"}),J=m.useMemo(()=>{const Q=new Map;return n.forEach(Z=>{Z.scenarios.forEach(fe=>{const ae=String(fe.scenarioName??"").trim(),Re=String(fe.scenarioId??"").trim();if(Re){Q.set(Re,ae||Re);return}ae&&Q.set(ae,ae)})}),Array.from(Q.entries()).map(([Z,fe])=>({value:Z,label:fe})).sort((Z,fe)=>Z.label.localeCompare(fe.label))},[n]);m.useEffect(()=>{const Q=(e.get("scenario")??"").trim();if(Q){if(J.some(Z=>Z.value===Q||Z.label===Q)){b(Q);return}n.length>0&&b("all")}},[e,J,n.length]);const D=m.useMemo(()=>j==="all"?n:n.filter(Q=>Q.scenarios.some(Z=>{const fe=String(Z.scenarioName??"").trim(),ae=String(Z.scenarioId??"").trim();return fe===j||ae===j})),[n,j]),I=m.useMemo(()=>j==="all"?"All scenarios":J.find(Z=>Z.value===j||Z.label===j)?.label??j,[j,J]),ne=m.useMemo(()=>{const Q=(fe,ae)=>fe===null&&ae===null?0:fe===null?1:ae===null?-1:x==="asc"?fe-ae:ae-fe;return[...D].sort((fe,ae)=>{if(h==="toolTokens")return Q(fe.toolTokenUsage?.totalTokens??null,ae.toolTokenUsage?.totalTokens??null);let Re=0;return h==="id"&&(Re=fe.id.localeCompare(ae.id)),h==="timestamp"&&(Re=new Date(fe.timestamp).getTime()-new Date(ae.timestamp).getTime()),h==="passRate"&&(Re=fe.overallPassRate-ae.overallPassRate),h==="scenarios"&&(Re=fe.totalScenarios-ae.totalScenarios),h==="avgToolCalls"&&(Re=fe.avgToolCalls-ae.avgToolCalls),x==="asc"?Re:-Re})},[D,h,x]),te=Q=>h!==Q?a.jsx(gc,{className:"h-3.5 w-3.5 text-muted-foreground"}):x==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}),de=Q=>{const Z=Q.toolTokenUsage?.totalTokens;return typeof Z=="number"?Z.toLocaleString():"n/a"},he=m.useMemo(()=>{const Q=new Map;for(const Z of ne)Q.set(Z.id,Exe(Z));return Q},[ne]),V=()=>{N(!0),z("Ask me to compare runs, explain regressions over time, or summarize historical drift patterns.")},ue=async Q=>{f(!0);try{await t.deleteResult(Q),r(Z=>Z.filter(fe=>fe.id!==Q)),Ae({title:"Run deleted",description:Q}),c(null)}catch(Z){Ae({title:"Could not delete run",description:Z instanceof Error?Z.message:String(Z),variant:"destructive"})}finally{f(!1)}};return a.jsxs("div",{className:"space-y-6",children:[a.jsx(Ls,{open:i!==null,onOpenChange:Q=>{!Q&&!d&&c(null)},children:a.jsxs(ss,{children:[a.jsxs(os,{children:[a.jsx(ls,{children:"Delete run?"}),a.jsxs(cs,{children:["This will permanently remove the run artifacts from disk for"," ",a.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),a.jsxs(is,{children:[a.jsx(ds,{disabled:d,children:"Cancel"}),a.jsx(us,{disabled:d||!i,onClick:Q=>{Q.preventDefault(),i&&ue(i)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:d?"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(_c,{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 items-center gap-2",children:[a.jsxs(su,{open:y,onOpenChange:S,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":y,className:"w-[260px] justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:I}),a.jsx(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(dl,{className:"w-[260px] p-0",align:"start",children:a.jsxs(pl,{children:[a.jsx(hl,{placeholder:"Search scenarios..."}),a.jsxs(ml,{children:[a.jsx(vl,{children:"No scenarios found."}),a.jsxs(gl,{children:[a.jsx(ua,{value:"all scenarios",onSelect:()=>{b("all"),S(!1)},children:"All scenarios"}),J.map(Q=>a.jsx(ua,{value:`${Q.label} ${Q.value}`,onSelect:()=>{b(Q.value),S(!1)},children:Q.label},Q.value))]})]})]})})]}),a.jsx(se,{variant:"outline",onClick:()=>{O()},disabled:s,children:s?"Refreshing...":"Refresh"}),a.jsxs(se,{type:"button",variant:"outline",className:"gap-1.5",onClick:V,children:[a.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"MCP Lab Assistant"]})]})]}),a.jsxs("div",{className:`grid gap-6 ${C?E?"xl:grid-cols-[minmax(0,1fr)_52rem]":"xl:grid-cols-[minmax(0,1fr)_30rem]":"grid-cols-1"}`,children:[a.jsx(Ve,{children:a.jsx(He,{className:"p-0",children:a.jsxs(qr,{children:[a.jsx(Ur,{children:a.jsxs(Gt,{children:[a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>k("id"),children:["Run ID",te("id")]})}),a.jsx(at,{children:"Evaluated"}),a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>k("timestamp"),children:["Timestamp",te("timestamp")]})}),a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>k("passRate"),children:["Pass Rate",te("passRate")]})}),a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>k("scenarios"),children:["Scenarios",te("scenarios")]})}),a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>k("avgToolCalls"),children:["Avg Tool Calls",te("avgToolCalls")]})}),a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>k("toolTokens"),children:["Tool Tokens",te("toolTokens")]})}),a.jsx(at,{className:"w-10"})]})}),a.jsx(Wr,{children:ne.map(Q=>a.jsxs(Gt,{children:[a.jsx(Ue,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(_t,{to:`/results/${Q.id}`,className:"font-mono text-xs text-primary hover:underline",children:Q.id}),Q.configId?a.jsx("div",{className:"text-[11px] text-muted-foreground",children:Q.configId}):null,Q.runNote?a.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",Q.runNote]}):null]})}),a.jsx(Ue,{className:"text-[11px] text-muted-foreground",children:(()=>{const Z=he.get(Q.id)??{scenarioCount:0,agentCount:0,scenarioPreview:"n/a",modelSummary:""};return a.jsxs("div",{className:"space-y-0.5",children:[a.jsxs("div",{children:["Evaluated: ",Z.scenarioCount," scenario",Z.scenarioCount===1?"":"s"," ·"," ",Z.agentCount," agent",Z.agentCount===1?"":"s",Z.modelSummary?` · ${Z.modelSummary}`:""]}),a.jsx("div",{className:"font-mono text-xs text-foreground/80",children:Z.scenarioPreview})]})})()}),a.jsx(Ue,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(mo,{className:"h-3 w-3"}),new Date(Q.timestamp).toLocaleString()]})}),a.jsx(Ue,{children:a.jsx(Js,{rate:Q.overallPassRate})}),a.jsx(Ue,{className:"font-mono text-sm",children:Q.totalScenarios}),a.jsx(Ue,{className:"font-mono text-sm",children:Q.avgToolCalls.toFixed(0)}),a.jsx(Ue,{className:"font-mono text-sm",children:de(Q)}),a.jsx(Ue,{children:a.jsxs(Gf,{children:[a.jsx(Yf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(av,{className:"h-4 w-4"})})}),a.jsxs(Su,{align:"end",children:[a.jsx(Hr,{asChild:!0,children:a.jsxs(_t,{to:`/results/${Q.id}`,children:[a.jsx(A7,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),a.jsxs(Hr,{children:[a.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),a.jsxs(Hr,{className:"text-destructive",onSelect:Z=>{Z.preventDefault();const fe=document.activeElement;fe instanceof HTMLElement&&fe.blur(),c(Q.id)},children:[a.jsx(Ta,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},Q.id))})]})})}),C&&a.jsx(O6,{title:"MCP Lab Assistant",description:"Analyze historical differences and trends across all result runs.",expanded:E,onToggleExpanded:()=>A(Q=>!Q),onHide:()=>N(!1),messages:T,pendingToolCalls:$,loading:q,input:B,onInputChange:U,onSend:()=>{R()},inputPlaceholder:"Ask about historical run differences...",snippets:kxe,onSnippetSelect:Q=>{N(!0),G(Q)},onApproveToolCall:Q=>{W(Q)},onDenyToolCall:Q=>{X(Q)},chatEndRef:F,inputRef:H,className:"min-w-0 overflow-hidden xl:flex xl:h-[calc(100vh-14rem)] xl:min-h-0 xl:flex-col",renderMessage:({message:Q,index:Z,linkedPendingToolCall:fe,isUser:ae,isAssistant:Re,isSystem:_e,isTool:Me})=>{const L=Re&&!!Q.pendingToolCallId;if(Me&&/^(Approved|Denied) tool call\b/i.test(String(Q.text??"").trim()))return null;if(L){const oe=Mh(fe?.tool??Q.toolRequestName??fe?.publicToolName??Q.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(kr,{className:"h-3 w-3"})}),a.jsxs("details",{open:!!fe,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(Ja,{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 ${oe}`}),a.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${fe?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:fe?"Needs approval":"Completed"})]})}),a.jsx(Yt,{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(Oa,{text:Q.text,className:"text-sm"})})]})]},`${Q.id??`${Q.role}-${Z}`}:tool`)}return a.jsxs("div",{className:`flex items-start gap-2 ${ae?"justify-end":"justify-start"}`,children:[!ae&&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:_e?a.jsx(uN,{className:"h-3 w-3"}):a.jsx(kr,{className:"h-3 w-3"})}),a.jsx("div",{className:`min-w-0 max-w-[92%] break-words rounded-md border p-3 text-sm ${ae?"border-primary/20 bg-primary/10":_e?"border-amber-400/30 bg-amber-50/70":Me?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:a.jsx(Oa,{text:Q.text,className:"text-sm"})}),ae&&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(Ec,{className:"h-3 w-3"})})]},Q.id??`${Q.role}-${Z}`)}})]})]})};function Oxe(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),o=Object.values(r),i=e.scenarios.map(c=>`
|
|
149
|
-
<div class="scenario-card">
|
|
150
|
-
<div class="scenario-header" onclick="this.parentElement.classList.toggle('open')">
|
|
151
|
-
<span class="chevron">▶</span>
|
|
152
|
-
<span class="scenario-name">${Fi(c.scenarioName)}</span>
|
|
153
|
-
<span class="scenario-agent">${Fi(c.agentName)}</span>
|
|
154
|
-
<span class="mono">${c.runs.length} runs</span>
|
|
155
|
-
<span class="badge ${c.passRate>=.8?"badge-pass":c.passRate>=.5?"badge-warn":"badge-fail"}">${Math.round(c.passRate*100)}%</span>
|
|
156
|
-
<span class="mono">${c.avgToolCalls.toFixed(1)} avg tools</span>
|
|
157
|
-
</div>
|
|
158
|
-
<div class="scenario-detail">
|
|
159
|
-
${c.runs.map(d=>`
|
|
160
|
-
<div class="run-row">
|
|
161
|
-
<span class="run-status ${d.passed?"pass":"fail"}">${d.passed?"✓":"✗"}</span>
|
|
162
|
-
<span class="mono run-label">Run #${d.runIndex+1}</span>
|
|
163
|
-
<span class="mono run-duration">${d.duration}ms</span>
|
|
164
|
-
<div class="tool-pills">
|
|
165
|
-
${d.toolCalls.map(f=>`<span class="pill">${Fi(f.name)} <small>${f.duration}ms</small></span>`).join("")}
|
|
166
|
-
</div>
|
|
167
|
-
${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>Fi(f)).join(", ")}</div>`:""}
|
|
168
|
-
</div>`).join("")}
|
|
169
|
-
</div>
|
|
170
|
-
</div>`).join("");return`<!DOCTYPE html>
|
|
171
|
-
<html lang="en">
|
|
172
|
-
<head>
|
|
173
|
-
<meta charset="UTF-8">
|
|
174
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
175
|
-
<title>MCPLab Report — ${Fi(e.id)}</title>
|
|
176
|
-
<script src="https://cdn.jsdelivr.net/npm/chart.js@4"><\/script>
|
|
177
|
-
<style>
|
|
178
|
-
*{box-sizing:border-box;margin:0;padding:0}
|
|
179
|
-
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f9fafb;color:#1f2937;padding:2rem;max-width:1100px;margin:0 auto}
|
|
180
|
-
h1{font-size:1.5rem;font-weight:700}
|
|
181
|
-
.mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.8rem}
|
|
182
|
-
.header{display:flex;align-items:center;gap:1rem;margin-bottom:.25rem}
|
|
183
|
-
.sub{font-size:.75rem;color:#6b7280;margin-bottom:1.5rem}
|
|
184
|
-
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;margin-bottom:2rem}
|
|
185
|
-
.stat{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
186
|
-
.stat-label{font-size:.7rem;color:#6b7280;text-transform:uppercase;letter-spacing:.05em}
|
|
187
|
-
.stat-value{font-size:1.5rem;font-weight:700;margin-top:.25rem}
|
|
188
|
-
.charts{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-bottom:2rem}
|
|
189
|
-
.chart-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
190
|
-
.chart-card h3{font-size:.85rem;font-weight:600;margin-bottom:.75rem}
|
|
191
|
-
canvas{max-height:220px}
|
|
192
|
-
.scenario-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;margin-bottom:.75rem;overflow:hidden}
|
|
193
|
-
.scenario-header{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;cursor:pointer;font-size:.85rem}
|
|
194
|
-
.scenario-header:hover{background:#f9fafb}
|
|
195
|
-
.chevron{font-size:.6rem;transition:transform .15s;color:#9ca3af}
|
|
196
|
-
.scenario-card.open .chevron{transform:rotate(90deg)}
|
|
197
|
-
.scenario-name{font-weight:600;flex:1}
|
|
198
|
-
.scenario-agent{color:#6b7280;font-size:.8rem}
|
|
199
|
-
.scenario-detail{display:none;border-top:1px solid #e5e7eb;padding:.75rem 1rem;background:#fafafa}
|
|
200
|
-
.scenario-card.open .scenario-detail{display:block}
|
|
201
|
-
.run-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.5rem 0;border-bottom:1px solid #f3f4f6;font-size:.8rem}
|
|
202
|
-
.run-row:last-child{border-bottom:none}
|
|
203
|
-
.run-status{font-weight:700;font-size:1rem}
|
|
204
|
-
.run-status.pass{color:#059669}
|
|
205
|
-
.run-status.fail{color:#dc2626}
|
|
206
|
-
.run-duration{color:#6b7280}
|
|
207
|
-
.tool-pills{display:flex;flex-wrap:wrap;gap:.25rem}
|
|
208
|
-
.pill{background:#fef3c7;color:#92400e;padding:2px 8px;border-radius:9999px;font-size:.7rem;font-family:'JetBrains Mono',monospace}
|
|
209
|
-
.pill small{color:#b45309;margin-left:2px}
|
|
210
|
-
.failure-reasons{width:100%;color:#dc2626;font-size:.75rem;margin-top:.25rem}
|
|
211
|
-
.badge{padding:2px 10px;border-radius:9999px;font-size:.75rem;font-weight:600}
|
|
212
|
-
.badge-pass{background:#d1fae5;color:#065f46}
|
|
213
|
-
.badge-warn{background:#fef3c7;color:#92400e}
|
|
214
|
-
.badge-fail{background:#fee2e2;color:#991b1b}
|
|
215
|
-
.footer{text-align:center;color:#9ca3af;font-size:.7rem;margin-top:2rem;padding-top:1rem;border-top:1px solid #e5e7eb}
|
|
216
|
-
</style>
|
|
217
|
-
</head>
|
|
218
|
-
<body>
|
|
219
|
-
<div class="header">
|
|
220
|
-
<h1 class="mono">${Fi(e.id)}</h1>
|
|
221
|
-
<span class="badge ${e.overallPassRate>=.8?"badge-pass":e.overallPassRate>=.5?"badge-warn":"badge-fail"}">${Math.round(e.overallPassRate*100)}% pass</span>
|
|
222
|
-
</div>
|
|
223
|
-
<p class="sub">${new Date(e.timestamp).toLocaleString()} · Config hash: <span class="mono">${Fi(e.configHash)}</span></p>
|
|
224
|
-
|
|
225
|
-
<div class="stats">
|
|
226
|
-
<div class="stat"><div class="stat-label">Scenarios</div><div class="stat-value">${e.totalScenarios}</div></div>
|
|
227
|
-
<div class="stat"><div class="stat-label">Total Runs</div><div class="stat-value">${e.totalRuns}</div></div>
|
|
228
|
-
<div class="stat"><div class="stat-label">Pass Rate</div><div class="stat-value">${Math.round(e.overallPassRate*100)}%</div></div>
|
|
229
|
-
<div class="stat"><div class="stat-label">Avg Tool Calls</div><div class="stat-value">${e.avgToolCalls.toFixed(1)}</div></div>
|
|
230
|
-
<div class="stat"><div class="stat-label">Avg Latency</div><div class="stat-value">${e.avgLatency}ms</div></div>
|
|
231
|
-
</div>
|
|
232
|
-
|
|
233
|
-
<div class="charts">
|
|
234
|
-
<div class="chart-card"><h3>Pass / Fail</h3><canvas id="pieChart"></canvas></div>
|
|
235
|
-
<div class="chart-card"><h3>Tool Usage</h3><canvas id="barChart"></canvas></div>
|
|
236
|
-
</div>
|
|
237
|
-
|
|
238
|
-
<h2 style="font-size:1rem;font-weight:600;margin-bottom:.75rem">Scenarios</h2>
|
|
239
|
-
${i}
|
|
240
|
-
|
|
241
|
-
<div class="footer">Generated by MCPLab · ${new Date().toISOString()}</div>
|
|
242
|
-
|
|
243
|
-
<script>
|
|
244
|
-
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}}}}}});
|
|
245
|
-
new Chart(document.getElementById('barChart'),{type:'bar',data:{labels:${JSON.stringify(s)},datasets:[{data:${JSON.stringify(o)},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}}}}}});
|
|
246
|
-
<\/script>
|
|
247
|
-
</body>
|
|
248
|
-
</html>`}function Fi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const Txe="mcplab.resultAssistantScenarioHandoff",Rxe=[{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 h$(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function m$(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const Ixe=()=>{const{id:e}=wl(),t=Ia(),[n]=go(),{source:r}=Dn(),s=n.get("embed")==="1",o=Ag("snapshots",!1),{configs:i}=Mf(),{scenarios:c}=rs(),[d,f]=m.useState(void 0),[h,p]=m.useState(!0),[x,g]=m.useState(!1),[j,b]=m.useState(""),[y,S]=m.useState(!1),[C,N]=m.useState(new Set),[E,A]=m.useState(new Set),[k,O]=m.useState([]),[T,$]=m.useState(""),[B,q]=m.useState(null),[F,H]=m.useState(!1),[U,R]=m.useState(""),[W,X]=m.useState(""),[G,z]=m.useState(!1),[J,D]=m.useState(!1),[I,ne]=m.useState(!1),[te,de]=m.useState("assistant"),[he,V]=m.useState(null),[ue,Q]=m.useState(!1),[Z,fe]=m.useState(""),[ae,Re]=m.useState(""),[_e,Me]=m.useState(!1),[L,oe]=m.useState(!1),[pe,Ee]=m.useState(!1),[Xe,ht]=m.useState([]),[gt,mt]=m.useState(!1),[Vt,qt]=m.useState(""),[Ft,zt]=m.useState(null),[Ne,et]=m.useState(!1),[Ke,ve]=m.useState(null),{assistantMessages:ze,assistantPendingToolCalls:$e,assistantInput:Qe,assistantLoading:Ce,assistantChatEndRef:qe,assistantInputRef:Xt,setAssistantInput:gn,askAssistant:be,approveResultAssistantToolCall:At,denyResultAssistantToolCall:$t,applyResultAssistantSnippet:Ut,ensureIntroMessage:nn,resetAssistantSession:kn}=T6({source:r,open:J,scope:"run",runId:e,onSessionSync:void 0}),pt=m.useCallback(async(re,Se)=>{mt(!0);try{const Le=(await r.listMarkdownReports()).filter(Ht=>{const Ot=String(Ht.relativePath??""),Nn=String(Ht.name??"");return Ot.includes(re)||Nn.includes(re)});if(ht(Le),Se&&Le.length>0){const Ht=Le.find(Ot=>Ot.relativePath===Se||Ot.path===Se||Ot.relativePath.endsWith(Se)||Ot.path.endsWith(Se));Ht&&qt(Ht.relativePath)}return Le}catch{return ht([]),[]}finally{mt(!1)}},[r]);m.useEffect(()=>{if(!e)return;let re=!0;return kn(),p(!0),r.getResult(e).then(Se=>{re&&(f(Se),b(Se?.runNote??""),g(!1),p(!1))}),()=>{re=!1}},[e,r,kn]),m.useEffect(()=>{let re=!0;return r.listSnapshots().then(Se=>{re&&O(Se)}).catch(()=>{re&&O([])}),()=>{re=!1}},[r]),m.useEffect(()=>{if(!d?.id){ht([]);return}let re=!0;return(async()=>{const Se=await pt(d.id)})(),()=>{re=!1}},[d?.id,pt]),m.useEffect(()=>{if(Xe.length===0){qt(""),zt(null),ve(null);return}(!Vt||!Xe.some(re=>re.relativePath===Vt))&&qt(Xe[0].relativePath)},[Xe,Vt]),m.useEffect(()=>{if(!J||te!=="reports")return;if(!Vt){zt(null),ve(null);return}let re=!0;return et(!0),ve(null),r.getMarkdownReport(Vt).then(Se=>{re&&zt(Se)}).catch(Se=>{re&&(zt(null),ve(Se instanceof Error?Se.message:String(Se)))}).finally(()=>{re&&et(!1)}),()=>{re=!1}},[J,te,Vt,r]);const Rt=n.get("configId")??"",Bt=(n.get("agent")??"").trim(),rn=m.useMemo(()=>{const re=Rt?i.find(Se=>Se.id===Rt):void 0;return re||(d?i.find(Se=>Se.id===d.configId):void 0)},[i,Rt,d]),qn=m.useMemo(()=>{const re=new Map;if(rn){for(const Se of rn.scenarios)re.set(Se.id,Se),Se.name&&!re.has(Se.name)&&re.set(Se.name,Se);for(const Se of rn.scenarioEntries??[]){if(Se.kind!=="referenced")continue;const dt=c.find(Le=>Le.id===Se.ref);dt&&(re.set(dt.id,dt),dt.name&&re.set(dt.name,dt),re.has(Se.ref)||re.set(Se.ref,dt))}}for(const Se of c)re.has(Se.id)||re.set(Se.id,Se),Se.name&&!re.has(Se.name)&&re.set(Se.name,Se);return re},[rn,c]),ce=m.useMemo(()=>{if(!d?.snapshotEval?.baselineSnapshotId)return"";const re=i.filter(Se=>Se.snapshotEval?.baselineSnapshotId===d.snapshotEval?.baselineSnapshotId);return re.length===1?re[0].id:""},[i,d?.snapshotEval?.baselineSnapshotId]);m.useEffect(()=>{d?.snapshotEval?.baselineSnapshotId&&$(re=>re||d.snapshotEval.baselineSnapshotId)},[d?.snapshotEval?.baselineSnapshotId]),m.useEffect(()=>{if(Rt&&i.some(re=>re.id===Rt)){R(Rt);return}ce&&R(re=>re||ce)},[Rt,i,ce]);const{filteredScenarios:st,filteredTotalRuns:Nt,filteredPassCount:on,displayPassRate:xt,displayAvgToolCalls:Tn,displayAvgLatency:Ln,displayToolTokenUsage:Da}=m.useMemo(()=>{if(!d)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayToolTokenUsage:null};const re=Bt?d.scenarios.filter(Ot=>Ot.agentId===Bt||Ot.agentName===Bt):d.scenarios,Se=re.reduce((Ot,Nn)=>Ot+Nn.runs.length,0),dt=re.reduce((Ot,Nn)=>Ot+Nn.runs.filter(mr=>mr.passed).length,0),Le=re.reduce((Ot,Nn)=>Ot+Nn.runs.reduce((mr,dn)=>mr+dn.toolCalls.length,0),0),Ht=re.reduce((Ot,Nn)=>Ot+Nn.runs.reduce((mr,dn)=>mr+dn.duration,0),0);return{filteredScenarios:re,filteredTotalRuns:Se,filteredPassCount:dt,displayPassRate:Se===0?0:dt/Se,displayAvgToolCalls:Se===0?0:Le/Se,displayAvgLatency:Se===0?0:Math.round(Ht/Se),displayToolTokenUsage:vY(re.map(Ot=>Ot.toolTokenUsage))}},[d,Bt]),So=m.useMemo(()=>{const re={};return st.forEach(Se=>Se.runs.forEach(dt=>dt.toolCalls.forEach(Le=>{re[Le.name]=(re[Le.name]||0)+1}))),Object.entries(re).map(([Se,dt])=>({name:Se,count:dt})).sort((Se,dt)=>dt.count-Se.count)},[st]);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 Fs=Object.entries(d.mcpServerVersions??{}).map(([re,Se])=>`${re}: ${Se??"unknown"}`).join(", "),Xr=on,yi=Math.max(0,Nt-Xr),K=[{name:"Pass",value:Xr,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:yi,color:"hsl(0, 72%, 51%)"}],ge=re=>{N(Se=>{const dt=new Set(Se);return dt.has(re)?dt.delete(re):dt.add(re),dt})},De=(re,Se,dt,Le)=>`${re}:${Se}:${dt}:${Le}`,ct=(re,Se)=>`${re}::${Se}`,Dt=re=>{A(Se=>{const dt=new Set(Se);return dt.has(re)?dt.delete(re):dt.add(re),dt})},Et=re=>{const Se=!re.endsWith(":conversation");return E.has(re)?!Se:Se},Fn=new Map((B?.scenario_results??[]).map(re=>[re.scenario_id,re])),Yn=async()=>{if(!(!d||!T)){H(!0);try{const re=await r.compareSnapshot(T,d.id);q(re)}finally{H(!1)}}},ke=async re=>{const Se=re||d.snapshotEval?.baselineSnapshotId;if(Se){$(Se),H(!0);try{const dt=await r.compareSnapshot(Se,d.id);q(dt)}catch(dt){Ae({title:"Could not review drift",description:dt instanceof Error?dt.message:String(dt),variant:"destructive"})}finally{H(!1)}}},Rn=async()=>{if(!U){Ae({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}z(!0);try{const re=await r.generateSnapshotEvalBaseline(d.id,U,W.trim()||void 0);O(Se=>[re.snapshot,...Se.filter(dt=>dt.id!==re.snapshot.id)]),$(re.snapshot.id),Ae({title:"Baseline updated",description:`${re.snapshot.name} is now linked to the selected config.`}),W.trim()||X(re.snapshot.name),d.snapshotEval?.applied&&ke(re.snapshot.id)}catch(re){Ae({title:"Could not accept new baseline",description:re instanceof Error?re.message:String(re),variant:"destructive"})}finally{z(!1)}},jt=(re,Se)=>{de("assistant"),D(!0),V(Se?.scenarioId??null),nn("Ask me to explain failures, tool usage, snapshot drift, or suggest what to inspect next in this result."),re&&gn(re)},Jt=$e.filter(re=>re.status==="pending"&&!ze.some(Se=>Se.pendingToolCallId===re.id)),Qr=re=>{de("reports"),D(!0)},_u=()=>{de("note"),D(!0)},Zf=re=>{if(!d)return;if(!he){Ae({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const Se=c.find(Le=>Le.id===he)??c.find(Le=>Le.name===he);if(!Se){Ae({title:"Scenario not found in library",description:`Could not find library scenario '${he}' to open in Scenario Assistant.`,variant:"destructive"});return}const dt=[`I am sending a suggestion from the Result Assistant for scenario '${he}' 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:",re].join(`
|
|
249
|
-
`);try{window.sessionStorage.setItem(Txe,JSON.stringify({type:"result-assistant-handoff-v1",runId:d.id,configId:Rt||d.configId||"",scenarioId:Se.id,prompt:dt,sourceReply:re})),t(`/libraries/test-cases/${encodeURIComponent(Se.id)}?assistantHandoff=1`)}catch(Le){Ae({title:"Could not create handoff",description:Le instanceof Error?Le.message:String(Le),variant:"destructive"})}},bi=re=>{d&&(Ee(!1),fe(re),Re(h$(d.id)),Me(!1),Q(!0))},va=()=>{d&&(Ee(!0),fe(""),Re(h$(d.id)),Me(!1),Q(!0))},Rg=async()=>{if(!d)return;if(!Z.trim()){Ae({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}oe(!0);try{const Se=await r.applyResultAssistantReport({runId:d.id,markdown:Z,outputPath:ae.trim()||void 0,overwrite:_e});Ae({title:"Markdown report written",description:typeof Se.path=="string"&&Se.path?Se.path:Se.outputPath}),await pt(d.id,typeof Se.path=="string"&&Se.path||Se.outputPath||void 0),J&&de("reports"),Q(!1)}catch(Se){Ae({title:"Could not write markdown report",description:Se instanceof Error?Se.message:String(Se),variant:"destructive"})}finally{oe(!1)}},Jr=async re=>{try{await navigator.clipboard.writeText(re),Ae({title:"Copied"})}catch(Se){Ae({title:"Could not copy",description:Se instanceof Error?Se.message:String(Se),variant:"destructive"})}},Ig=async()=>{if(d){S(!0);try{const re=j.trim();await r.updateRunNote(d.id,re||void 0),f(Se=>Se&&{...Se,runNote:re||void 0}),b(re),g(!1),Ae({title:"Run note saved"})}catch(re){Ae({title:"Could not save run note",description:re instanceof Error?re.message:String(re),variant:"destructive"})}finally{S(!1)}}};return a.jsxs("div",{className:`${J?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[a.jsx("div",{className:`${J?"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(se,{variant:"ghost",size:"icon",asChild:!0,children:a.jsx(_t,{to:"/results",children:a.jsx(el,{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(Js,{rate:xt}),o&&d.snapshotEval?.applied&&a.jsxs(We,{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(_7,{className:"h-3 w-3 shrink-0"}),new Date(d.timestamp).toLocaleString()]}),a.jsx("span",{className:"mx-1",children:"·"}),Bt?a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"inline-flex items-center align-middle",children:["Agent: ",Bt]}),a.jsx("span",{className:"mx-1",children:"·"})]}):null,a.jsxs("span",{className:"inline-flex items-center align-middle",children:["Config hash: ",a.jsx("span",{className:"ml-1 font-mono",children:d.configHash})]})]}),o&&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:[Fs?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:Fs})]}):null,a.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-end gap-2",children:[o&&d.snapshotEval?.applied&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>{ke()},disabled:F,children:[a.jsx(cN,{className:"h-3.5 w-3.5"}),F?"Reviewing drift...":"Review Drift"]}),a.jsxs(se,{variant:"outline",size:"sm",className:`max-w-full gap-1.5 ${s?"px-2":""}`,onClick:()=>{const re=Oxe(d),Se=new Blob([re],{type:"text/html"}),dt=URL.createObjectURL(Se),Le=document.createElement("a");Le.href=dt,Le.download=`mcplab-report-${d.id}.html`,Le.click(),URL.revokeObjectURL(dt)},"aria-label":"Download Report",title:"Download Report",children:[a.jsx(Ea,{className:"h-3.5 w-3.5"}),!s&&"Download Report"]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>Qr(),disabled:gt,children:[a.jsx(dc,{className:"h-3.5 w-3.5"}),gt?"Reference Reports...":`Reference Reports${Xe.length?` (${Xe.length})`:""}`]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>_u(),children:[a.jsx(dc,{className:"h-3.5 w-3.5"}),"Run Note"]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>jt(),children:[a.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"MCP Lab Assistant"]})]})]})]})}),a.jsxs("div",{className:`grid gap-6 items-start ${J?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 ${J?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[o&&d.snapshotEval?.applied&&a.jsxs(Ve,{className:"border-amber-500/30",children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Snapshot Drift Review"})}),a.jsxs(He,{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[a.jsxs(We,{variant:"outline",children:["Mode: ",d.snapshotEval.mode]}),a.jsxs(We,{variant:"outline",children:["Status: ",d.snapshotEval.status]}),a.jsxs(We,{variant:"outline",children:["Overall score: ",d.snapshotEval.overallScore]}),a.jsxs(We,{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(wn,{value:U,onValueChange:R,children:[a.jsx(hn,{className:"h-8",children:a.jsx(jn,{placeholder:"Select config to update"})}),a.jsx(mn,{children:i.map(re=>a.jsx(tt,{value:re.id,children:re.name},re.id))})]}),!U&&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:W,onChange:re=>X(re.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(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{ke()},disabled:F,children:[a.jsx(ma,{className:`h-3.5 w-3.5 ${F?"animate-spin":""}`}),"Review Drift"]}),a.jsx(se,{type:"button",size:"sm",className:"h-8",onClick:()=>{Rn()},disabled:G||xt!==1,children:G?"Accepting...":"Accept as New Baseline"})]})]}),xt!==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 ${J?"grid-cols-3":"sm:grid-cols-2 lg:grid-cols-6"}`,children:[a.jsx(vs,{title:"Scenarios",value:st.length,icon:Qj}),a.jsx(vs,{title:"Total Runs",value:Nt,icon:Y$}),a.jsx(vs,{title:"Pass Rate",value:`${Math.round(xt*100)}%`,icon:_c}),a.jsx(vs,{title:"Avg Tool Calls",value:m$(Tn),icon:Jo}),a.jsx(vs,{title:"Avg Latency",value:`${Ln}ms`,icon:rD}),a.jsx(vs,{title:"Tool Tokens",value:aa(Da?.totalTokens),icon:Ja})]}),a.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-2",children:a.jsx(Pt,{className:"text-base",children:"Pass / Fail"})}),a.jsxs(He,{className:"flex items-center justify-center",children:[a.jsxs(ape,{width:180,height:180,children:[a.jsx(wo,{data:K,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:K.map((re,Se)=>a.jsx(Bv,{fill:re.color},Se))}),a.jsx(Fr,{})]}),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"}),Xr," 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"}),yi," failed"]})]})]})]}),a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-2",children:a.jsx(Pt,{className:"text-base",children:"Tool Usage"})}),a.jsx(He,{children:a.jsx(rm,{width:"100%",height:180,children:a.jsxs(rpe,{data:So,layout:"vertical",children:[a.jsx(ii,{type:"number",tick:{fontSize:11}}),a.jsx(li,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),a.jsx(Fr,{}),a.jsx(Al,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(Pt,{className:"text-base",children:"Scenarios"}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>jt("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[a.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})]})}),a.jsxs(He,{className:"p-0",children:[o&&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(wn,{value:T,onValueChange:$,children:[a.jsx(hn,{className:"h-8",children:a.jsx(jn,{placeholder:"Select snapshot"})}),a.jsx(mn,{children:k.map(re=>a.jsx(tt,{value:re.id,children:re.name},re.id))})]})]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",disabled:!T||F,onClick:()=>{Yn()},children:F?"Comparing...":"Compare Snapshot"}),B&&a.jsxs(We,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",B.overall_score]})]}),a.jsxs(qr,{children:[a.jsx(Ur,{children:a.jsxs(Gt,{children:[a.jsx(at,{className:"w-8"}),a.jsx(at,{children:"Scenario"}),a.jsx(at,{children:"Agent"}),a.jsx(at,{children:"Runs"}),a.jsx(at,{children:"Pass Rate"}),a.jsx(at,{children:"Tool Calls"}),a.jsx(at,{children:"Tool Tokens"}),a.jsx(at,{children:"Snapshot"})]})}),a.jsx(Wr,{children:st.map(re=>{const Se=ct(re.scenarioId,re.agentName),dt=re.scenarioName||re.scenarioId;return a.jsx(Xa,{open:C.has(Se),onOpenChange:()=>ge(Se),asChild:!0,children:a.jsxs(a.Fragment,{children:[a.jsx(_a,{asChild:!0,children:a.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",children:[a.jsx(Ue,{children:a.jsx(Yt,{className:`h-4 w-4 transition-transform ${C.has(Se)?"rotate-180":""}`})}),a.jsx(Ue,{className:"font-medium text-sm",children:re.scenarioName}),a.jsxs(Ue,{className:"text-sm",children:[a.jsx("div",{children:re.agentName}),(re.provider||re.model)&&a.jsx("div",{className:"text-xs text-muted-foreground",children:[re.provider?Qm(re.provider):null,re.model].filter(Boolean).join(" · ")})]}),a.jsx(Ue,{className:"font-mono text-sm",children:re.runs.length}),a.jsx(Ue,{children:a.jsx(Js,{rate:re.passRate})}),a.jsx(Ue,{className:"font-mono text-sm",children:m$(re.avgToolCalls)}),a.jsx(Ue,{className:"font-mono text-sm",children:aa(re.toolTokenUsage?.totalTokens)}),a.jsx(Ue,{children:(()=>{const Le=Fn.get(re.scenarioId);if(!Le)return a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const Ht=Le.status==="Match"?"bg-success/15 text-success":Le.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return a.jsxs(We,{variant:"outline",className:`text-xs ${Ht}`,children:[Le.status," · ",Le.score]})})()})]})}),a.jsx(Qa,{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:[dt," · ",re.agentName," · ",Math.round(re.passRate*100),"% pass rate · ",aa(re.toolTokenUsage?.totalTokens)," tool tokens"]})]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>jt(`Explain why scenario '${dt}' failed (agent: ${re.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:re.scenarioId}),children:[a.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})]}),(()=>{const Le=Fn.get(re.scenarioId);return!Le||Le.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: ",Le.baseline_agents.join(", ")||"—"," · observed agents: ",Le.observed_agents.join(", ")||"—"]}),a.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:Le.reasons.map((Ht,Ot)=>a.jsxs("li",{children:["• ",Ht]},Ot))})]})})(),re.runs.map(Le=>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:Le.passed?a.jsx(Jo,{className:"h-4 w-4 text-success"}):a.jsx(xc,{className:"h-4 w-4 text-destructive"})}),a.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const Ht=qn.get(re.scenarioId),Ot=Ht?Dxe(Ht.evalRules,Le.failureReasons):[],Nn=Ot.filter(dn=>dn.status==="failed"),mr=Ot.filter(dn=>dn.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 #",Le.runIndex+1]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[Le.duration,"ms"]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[aa(Le.toolTokenUsage?.totalTokens)," tool tokens"]}),!Le.passed&&a.jsx(We,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),Le.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(xc,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),a.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:Le.failureReasons.map((dn,Co)=>a.jsxs("li",{children:["• ",y$(dn)]},Co))})]}),Ot.length>0&&a.jsx(Xa,{open:Et(De(re.scenarioId,re.agentName,Le.runIndex,"checks")),onOpenChange:()=>Dt(De(re.scenarioId,re.agentName,Le.runIndex,"checks")),children:a.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[a.jsx(_a,{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(Yt,{className:`h-3.5 w-3.5 transition-transform ${Et(De(re.scenarioId,re.agentName,Le.runIndex,"checks"))?"rotate-180":""}`}),a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),a.jsxs(We,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[mr.length," passed"]}),a.jsxs(We,{variant:"outline",className:`h-5 text-[10px] ${Nn.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[Nn.length," failed"]})]})}),a.jsx(Qa,{children:a.jsx("div",{className:"space-y-1",children:Ot.map((dn,Co)=>a.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${dn.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:[dn.status==="failed"?a.jsx(xc,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):a.jsx(Jo,{className:"h-3.5 w-3.5 shrink-0 text-success"}),a.jsx("span",{className:"font-medium",children:Fxe(dn.rule)})]}),dn.failureReason&&a.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:y$(dn.failureReason)})]}),a.jsx(We,{variant:"outline",className:`shrink-0 text-[10px] ${dn.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:dn.status})]},`${dn.rule.type}-${dn.rule.value??dn.rule.path??""}-${Co}`))})})]})})]})})(),a.jsx(Xa,{open:Et(De(re.scenarioId,re.agentName,Le.runIndex,"extracts")),onOpenChange:()=>Dt(De(re.scenarioId,re.agentName,Le.runIndex,"extracts")),children:a.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[a.jsx(_a,{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(Yt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Et(De(re.scenarioId,re.agentName,Le.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(Qj,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),a.jsxs(We,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(Le.extractedValues??{}).length," total"]})]})}),a.jsx(Qa,{children:Object.keys(Le.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(Le.extractedValues??{}).map(([Ht,Ot])=>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:Ht}),a.jsx("div",{className:"font-mono break-all text-foreground",children:Ot===null?"null":String(Ot)})]},Ht))})})]})}),a.jsx(Xa,{open:Et(De(re.scenarioId,re.agentName,Le.runIndex,"tools")),onOpenChange:()=>Dt(De(re.scenarioId,re.agentName,Le.runIndex,"tools")),children:a.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[a.jsx(_a,{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(Yt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Et(De(re.scenarioId,re.agentName,Le.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(Ja,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),a.jsxs(We,{variant:"outline",className:"h-5 text-[10px]",children:[Le.toolCalls.length," total"]})]})}),a.jsx(Qa,{children:Le.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(ai,{delayDuration:0,children:Le.toolCalls.map((Ht,Ot)=>{const Nn=Le.conversation.filter(dn=>dn.kind==="tool_call")[Ot]?.estimatedTokens,mr=typeof Nn?.totalTokens=="number";return a.jsxs(si,{children:[a.jsx(oi,{asChild:!0,children:a.jsxs(We,{variant:"outline",className:"font-mono text-xs bg-background",children:[a.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",Ot+1]}),Ht.name,a.jsxs("span",{className:"ml-1 text-muted-foreground",children:[Ht.duration,"ms"]}),mr&&a.jsxs("span",{className:"ml-1 text-muted-foreground",children:["· ",aa(Nn?.totalTokens),"tok"]})]})}),mr&&a.jsx(uo,{className:"text-xs",children:`${Ht.name} · tokens total: ${aa(Nn?.totalTokens)} · in: ${aa(Nn?.inputTokens)} · out: ${aa(Nn?.outputTokens)}`})]},Ot)})})}),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(We,{variant:"outline",className:"h-5 text-[10px]",children:"estimated"})]}),Object.keys(Le.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(Le.toolTokenUsageByTool??{}).map(([Ht,Ot])=>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:Ht}),a.jsxs("div",{className:"text-muted-foreground",children:["total: ",aa(Ot.totalTokens)," · in: ",aa(Ot.inputTokens)," · out: ",aa(Ot.outputTokens)]})]},Ht))})]})]})})]})}),a.jsx(Xa,{open:Et(De(re.scenarioId,re.agentName,Le.runIndex,"final")),onOpenChange:()=>Dt(De(re.scenarioId,re.agentName,Le.runIndex,"final")),children:a.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[a.jsx(_a,{asChild:!0,children:a.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[a.jsx(Yt,{className:`h-3.5 w-3.5 transition-transform ${Et(De(re.scenarioId,re.agentName,Le.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(kr,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),a.jsx(Qa,{children:a.jsx(nN,{text:Le.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),a.jsx(Xa,{open:Et(De(re.scenarioId,re.agentName,Le.runIndex,"conversation")),onOpenChange:()=>Dt(De(re.scenarioId,re.agentName,Le.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(_a,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[a.jsx(Yt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Et(De(re.scenarioId,re.agentName,Le.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(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>jt(`Explain Run #${Le.runIndex+1} for scenario '${dt}'. It ${Le.passed?"passed":"failed"} in ${Le.duration}ms. Focus on the tool sequence and ${Le.passed?"why it passed":"what caused the failure"}.`,{scenarioId:re.scenarioId}),children:[a.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})})]}),a.jsx(Qa,{children:a.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:Le.conversation.length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):Le.conversation.map(Ht=>a.jsx(Mxe,{item:Ht,fallbackUserPrompt:qn.get(re.scenarioId)?.prompt},Ht.id))})}),!Et(De(re.scenarioId,re.agentName,Le.runIndex,"conversation"))&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},Le.runIndex))]})})})})]})},Se)})})]})]})]})]}),J&&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(Sg,{value:te,onValueChange:re=>de(re),className:"min-w-0 -mb-px px-3 pt-1",children:a.jsxs(Xf,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[a.jsx(Cs,{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(Cs,{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(Cs,{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"})]})}),te==="assistant"?a.jsx(O6,{title:"MCP Lab Assistant",description:"Ask questions about this run result, failures, tool usage, and snapshot drift.",expanded:I,onToggleExpanded:()=>ne(re=>!re),onHide:()=>D(!1),messages:ze,pendingToolCalls:$e,loading:Ce,input:Qe,onInputChange:gn,onSend:()=>{be()},inputPlaceholder:"Ask about this result...",snippets:Rxe,onSnippetSelect:Ut,onApproveToolCall:re=>{At(re)},onDenyToolCall:re=>{$t(re)},chatEndRef:qe,inputRef:Xt,className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",renderMessage:({message:re,index:Se,linkedPendingToolCall:dt,isUser:Le,isAssistant:Ht,isSystem:Ot,isTool:Nn})=>{const mr=Ht&&!!re.pendingToolCallId;if(Nn&&/^(Approved|Denied) tool call\\b/i.test(String(re.text??"").trim()))return null;const dn=dt?.tool??re.toolRequestName,Co=dt?.publicToolName??re.toolRequestPublicName,Pl=Ht&&!mr&&$xe(re.text,!!he);if(mr){const Au=dt?.status==="pending",Eu=Mh(dn??Co??"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(kr,{className:"h-3 w-3"})}),a.jsxs("details",{open:!!dt,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(Ja,{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 ${Eu}`}),a.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${Au?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:Au?"Needs approval":"Completed"})]})}),a.jsx(Yt,{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(Oa,{text:re.text,className:"text-sm"}),Au&&dt&&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(dt.arguments??{},null,2)})}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:Ce,onClick:()=>{$t(dt.id)},children:"Deny"}),a.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:Ce,onClick:()=>{At(dt.id)},children:"Approve"})]})]})]})]})]},`${re.id??`${re.role}-${Se}`}:${dt?"pending":"completed"}`)}const wi=Le||Ht&&!Nn&&!Ot;return a.jsxs("div",{className:`flex items-start gap-2 ${Le?"justify-end":"justify-start"}`,children:[!Le&&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(uN,{className:"h-3 w-3"}):a.jsx(kr,{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 ${Le?"border-primary/20 bg-primary/10":Ot?"border-amber-400/30 bg-amber-50/70":Nn?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(Le||Ot)&&a.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${Le?"text-right":""}`,children:Nn?"Tool":"Assistant"}),a.jsx(Oa,{text:re.text,className:"text-sm"}),Pl&&a.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Zf(re.text),children:[a.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"Send to Scenario Assistant"]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>bi(re.text),children:[a.jsx(Ja,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!Pl&&Ht&&!mr&&a.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>bi(re.text),children:[a.jsx(Ja,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),wi&&a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{Jr(re.text)},"aria-label":"Copy message",title:"Copy message",children:a.jsx(_s,{className:"h-3.5 w-3.5"})})]}),Le&&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(Ec,{className:"h-3 w-3"})})]},re.id??`${re.role}-${Se}`)},renderMessageExtras:Jt.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)"}),Jt.map(re=>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:Mh(re.publicToolName)}),a.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[re.server,"::",Mh(re.tool)]})]}),a.jsx(Yt,{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(re.arguments??{},null,2)})}),a.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:Ce,onClick:()=>{$t(re.id)},children:"Deny"}),a.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:Ce,onClick:()=>{At(re.id)},children:"Approve"})]})]})]},re.id))]}):null}):te==="reports"?a.jsxs(Ve,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[a.jsx(kt,{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(Pt,{className:"flex items-center gap-2 text-base",children:[a.jsx(dc,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ne(re=>!re),children:[I?a.jsx(Zj,{className:"h-3.5 w-3.5"}):a.jsx(eS,{className:"h-3.5 w-3.5"}),I?"Compact":"Expand"]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>D(!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(He,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(gt||Xe.length===0||Xe.length>1)&&a.jsx("div",{className:"border-b px-4 py-3",children:gt?a.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):Xe.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(se,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>va(),children:[a.jsx(io,{className:"h-3.5 w-3.5"}),"New Report"]})]}):a.jsx("div",{className:"space-y-2",children:Xe.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(wn,{value:Vt,onValueChange:qt,children:[a.jsx(hn,{className:"h-8",children:a.jsx(jn,{placeholder:"Select a report"})}),a.jsx(mn,{children:Xe.map(re=>a.jsx(tt,{value:re.relativePath,children:re.name},re.path))})]})]}):null})}),a.jsx(QC,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:Xe.length===0?a.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):Ne?a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(wr,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):Ke?a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",Ke]}):Ft?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:Ft.name}),a.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:Ft.relativePath}),a.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(Ft.mtime).toLocaleString()})]}),a.jsx("div",{className:"rounded-md border bg-background p-3",children:a.jsx(Oa,{text:Ft.content,className:"text-sm"})})]}):a.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):a.jsxs(Ve,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[a.jsx(kt,{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(Pt,{className:"flex items-center gap-2 text-base",children:[a.jsx(dc,{className:"h-4 w-4 text-muted-foreground"}),"Run Note"]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ne(re=>!re),children:[I?a.jsx(Zj,{className:"h-3.5 w-3.5"}):a.jsx(eS,{className:"h-3.5 w-3.5"}),I?"Compact":"Expand"]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>D(!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(He,{className:"flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1",children:x?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(Os,{value:j,onChange:re=>b(re.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(se,{size:"sm",onClick:()=>{Ig()},disabled:y,children:y?"Saving...":"Save note"}),a.jsx(se,{size:"sm",variant:"outline",onClick:()=>{b(d.runNote??""),g(!1)},disabled:y,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(se,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>g(!0),children:d.runNote?"Edit":"Add note"})]})})]})]}),a.jsx(Ls,{open:ue,onOpenChange:re=>!L&&Q(re),children:a.jsxs(ss,{className:"max-w-2xl",children:[a.jsxs(os,{children:[a.jsx(ls,{children:pe?"Create markdown report":"Approve MCP action: write markdown report"}),a.jsx(cs,{children:pe?"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:[!pe&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),a.jsx(vt,{value:ae,onChange:re=>Re(re.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:L})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Kr,{checked:_e,onCheckedChange:re=>Me(re===!0),disabled:L}),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:pe?"Markdown content":"Markdown preview (to be written)"}),a.jsx(Os,{value:Z,onChange:re=>fe(re.target.value),rows:10,className:"font-mono text-xs",disabled:L})]})]}),a.jsxs(is,{children:[a.jsx(ds,{disabled:L,children:"Cancel"}),a.jsx(us,{onClick:re=>{re.preventDefault(),Rg()},disabled:L,children:L?"Writing...":pe?"Save Report":"Approve & Write"})]})]})})]})]})};function Mxe({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=v$(e,"input");return a.jsx(x$,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=v$(e,"output"),f=e.ok?a.jsx(Jo,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):a.jsx(xc,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return a.jsx(x$,{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=g$(e.text,e.kind),s=t?g$(t,"user_prompt"):"",o=n&&!r&&s?s:r,i=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?Ec:kr;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:i}),n?a.jsx(nN,{text:o,maxLength:280,className:"text-xs"}):a.jsx(nN,{text:o,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 v$(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · ${aa(n)} tokens`}function g$(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 $xe(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 i=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 i&&(c||d||f)}function x$({variant:e,title:t,text:n,icon:r}){const[s,o]=m.useState(!1),i={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(Xa,{open:s,onOpenChange:o,children:a.jsxs("div",{className:`rounded-md border p-2 text-xs ${i[e]}`,children:[a.jsx(_a,{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(Ja,{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(Qa,{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),o=e.length>t,i=r||!o?e:`${e.slice(0,t)}...`;return a.jsxs("div",{children:[a.jsx(Oa,{text:i,className:n}),o&&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 Dxe(e,t){return e.map(n=>{const r=Lxe(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function Lxe(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 Fxe(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 y$(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const Hj=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"];function zxe(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function Bxe(e){const t=Array.from(new Map(e.scenarios.map(d=>{const f=String(d.scenarioId??"").trim(),h=String(d.scenarioName??"").trim();return!f&&!h?null:[f||h,h||f]}).filter(d=>!!d)).values()),n=Array.from(new Set(e.scenarios.map(d=>d.agentId).filter(Boolean))),r=Array.from(new Set(e.scenarios.map(d=>d.model).filter(d=>!!d))),s=t.slice(0,2).join(", "),o=t.length>2?` +${t.length-2}`:"",i=r.slice(0,2).join(", "),c=r.length>2?` +${r.length-2}`:"";return{scenarioCount:t.length,agentCount:n.length,scenarioPreview:s?`${s}${o}`:"n/a",modelSummary:i?`${i}${c}`:""}}function qxe(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 Uxe=()=>{const{source:e}=Dn(),[t,n]=go(),r=t.get("mode")==="within-run"?"within-run":"runs",[s,o]=m.useState([]),[i,c]=m.useState(!1),[d,f]=m.useState(new Set),[h,p]=m.useState("timestamp"),[x,g]=m.useState("desc"),[j,b]=m.useState("all"),[y,S]=m.useState(!1),C=t.get("runId")??"",N=(t.get("agents")??"").split(",").map(L=>L.trim()).filter(Boolean),E=t.get("scenario")??"all",[A,k]=m.useState(C),[O,T]=m.useState(N),[$,B]=m.useState(E),[q,F]=m.useState(!1),H=async()=>{c(!0);try{o(await e.listResults())}catch(L){Ae({title:"Could not load results",description:L instanceof Error?L.message:String(L),variant:"destructive"})}finally{c(!1)}};m.useEffect(()=>{let L=!0;return c(!0),e.listResults().then(oe=>{L&&o(oe)}).catch(oe=>{L&&Ae({title:"Could not load results",description:oe instanceof Error?oe.message:String(oe),variant:"destructive"})}).finally(()=>{L&&c(!1)}),()=>{L=!1}},[e]);const U=L=>{if(h===L){g(oe=>oe==="asc"?"desc":"asc");return}p(L),g(L==="timestamp"?"desc":"asc")},R=L=>{f(oe=>{const pe=new Set(oe);return pe.has(L)?pe.delete(L):pe.add(L),pe})},W=m.useMemo(()=>{const L=new Set;return s.forEach(oe=>{oe.scenarios.forEach(pe=>{const Ee=String(pe.scenarioName??"").trim(),Xe=String(pe.scenarioId??"").trim(),ht=Ee||Xe;ht&&L.add(ht)})}),Array.from(L).sort((oe,pe)=>oe.localeCompare(pe))},[s]),X=m.useMemo(()=>j==="all"?s:s.filter(L=>L.scenarios.some(oe=>{const pe=String(oe.scenarioName??"").trim(),Ee=String(oe.scenarioId??"").trim();return(pe||Ee)===j})),[s,j]),G=m.useMemo(()=>[...X].sort((L,oe)=>{let pe=0;return h==="id"&&(pe=L.id.localeCompare(oe.id)),h==="timestamp"&&(pe=new Date(L.timestamp).getTime()-new Date(oe.timestamp).getTime()),h==="passRate"&&(pe=L.overallPassRate-oe.overallPassRate),h==="scenarios"&&(pe=L.totalScenarios-oe.totalScenarios),x==="asc"?pe:-pe}),[X,h,x]),z=m.useMemo(()=>G.filter(L=>d.has(L.id)),[G,d]),J=L=>h!==L?a.jsx(gc,{className:"h-3.5 w-3.5 text-muted-foreground"}):x==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}),D=m.useMemo(()=>{const L=new Map;for(const oe of G)L.set(oe.id,Bxe(oe));return L},[G]),I=L=>{const oe=Array.from(new Set(L.scenarios.map(pe=>pe.agentId).filter(Boolean)));return oe.slice(0,Math.min(2,oe.length))},ne=L=>{const oe=I(L);k(L.id),T(oe),B("all");const pe=new URLSearchParams(t);pe.set("mode","within-run"),pe.set("runId",L.id),oe.length>0?pe.set("agents",oe.join(",")):pe.delete("agents"),pe.delete("scenario"),n(pe,{replace:!0})},te=m.useMemo(()=>[...new Set(z.flatMap(L=>L.scenarios.map(oe=>oe.scenarioId)))],[z]),de=m.useMemo(()=>{const L=new Map;for(const oe of z)for(const pe of oe.scenarios){const Ee=String(pe.scenarioId??"").trim();if(!Ee)continue;const Xe=String(pe.scenarioName??"").trim();L.set(Ee,Xe||Ee)}return L},[z]),he=m.useMemo(()=>s.find(L=>L.id===A),[s,A]),V=m.useMemo(()=>{if(!he)return[];const L=new Map;for(const oe of he.scenarios)L.set(oe.agentId,oe.agentName||oe.agentId);return Array.from(L.entries()).map(([oe,pe])=>({id:oe,name:pe})).sort((oe,pe)=>oe.name.localeCompare(pe.name))},[he]),ue=m.useMemo(()=>{if(!he)return[];const L=new Set;for(const oe of he.scenarios){const pe=String(oe.scenarioName??"").trim(),Ee=String(oe.scenarioId??"").trim(),Xe=pe||Ee;Xe&&L.add(Xe)}return Array.from(L).sort((oe,pe)=>oe.localeCompare(pe))},[he]),Q=m.useMemo(()=>O.join(","),[O]);m.useEffect(()=>{if(r==="within-run"){const L=t.get("runId")??"",oe=(t.get("agents")??"").split(",").map(Ee=>Ee.trim()).filter(Boolean),pe=t.get("scenario")??"all";k(Ee=>Ee===L?Ee:L),T(Ee=>zxe(Ee,oe)?Ee:oe),B(Ee=>Ee===pe?Ee:pe)}},[r,t]),m.useEffect(()=>{if(r!=="within-run"||s.length===0)return;let L=A;(!L||!s.some(mt=>mt.id===L))&&(L=s[0].id);const oe=s.find(mt=>mt.id===L),pe=(()=>{if(!oe)return[];const mt=new Map;for(const Vt of oe.scenarios)mt.set(Vt.agentId,Vt.agentName||Vt.agentId);return Array.from(mt.keys())})(),Ee=new Set(pe);let Xe=Q.split(",").map(mt=>mt.trim()).filter(mt=>!!mt).filter(mt=>Ee.has(mt));Xe.length===0&&pe.length>0&&(Xe=pe.slice(0,Math.min(2,pe.length)));const ht=(()=>{if(!oe)return new Set;const mt=new Set;for(const Vt of oe.scenarios){const qt=String(Vt.scenarioName??"").trim(),Ft=String(Vt.scenarioId??"").trim(),zt=qt||Ft;zt&&mt.add(zt)}return new Set(mt)})(),gt=$!=="all"&&!ht.has($)?"all":$;L!==A&&k(L),Xe.join(",")!==Q&&T(Xe),gt!==$&&B(gt)},[r,s,A,Q,$]),m.useEffect(()=>{const L=new URLSearchParams(t);r==="within-run"?(L.set("mode","within-run"),A?L.set("runId",A):L.delete("runId"),O.length>0?L.set("agents",O.join(",")):L.delete("agents"),$!=="all"?L.set("scenario",$):L.delete("scenario")):(L.delete("mode"),L.delete("runId"),L.delete("agents"),L.delete("scenario"));const oe=t.toString(),pe=L.toString();oe!==pe&&n(L,{replace:!0})},[r,A,O,$,t,n]);const Z=m.useMemo(()=>{if(!he)return[];const L=new Map;for(const pe of he.scenarios){const Ee=String(pe.scenarioId??"").trim(),Xe=String(pe.scenarioName??"").trim(),ht=Xe||Ee;if(!Ee&&!ht)continue;const gt=Ee||ht,mt=L.get(gt);if(mt){mt.byAgent[pe.agentId]=pe;continue}L.set(gt,{scenarioId:Ee||ht,scenarioName:Xe,displayLabel:ht||Ee,byAgent:{[pe.agentId]:pe}})}const oe=Array.from(L.values()).sort((pe,Ee)=>{const Xe=(pe.displayLabel||pe.scenarioId).toLowerCase(),ht=(Ee.displayLabel||Ee.scenarioId).toLowerCase();return Xe.localeCompare(ht)});return $==="all"?oe:oe.filter(pe=>pe.displayLabel===$)},[he,$]),fe=m.useMemo(()=>{const L=new Map(V.map(oe=>[oe.id,oe]));return O.map(oe=>L.get(oe)).filter(oe=>!!oe)},[O,V]),ae=m.useMemo(()=>{if(!he||fe.length!==2)return null;const[L,oe]=fe;return{left:L,right:oe,link:`/compare/results?left=${encodeURIComponent(he.id)}&right=${encodeURIComponent(he.id)}&leftConfig=${encodeURIComponent(he.configId)}&rightConfig=${encodeURIComponent(he.configId)}&leftAgent=${encodeURIComponent(L.id)}&rightAgent=${encodeURIComponent(oe.id)}`}},[he,fe]),Re=m.useMemo(()=>!he||fe.length===0?[]:fe.map(L=>{const oe=Z.map(qt=>qt.byAgent[L.id]).filter(qt=>!!qt),pe=oe.flatMap(qt=>qt.runs),Ee=pe.length,Xe=pe.filter(qt=>qt.passed).length,ht=pe.reduce((qt,Ft)=>qt+Ft.toolCalls.length,0),gt=pe.reduce((qt,Ft)=>qt+Ft.duration,0),{provider:mt,model:Vt}=qxe(oe);return{agentId:L.id,agentName:L.name,provider:mt,model:Vt,passRate:Ee===0?0:Xe/Ee,totalRuns:Ee,avgToolCalls:Ee===0?0:ht/Ee,avgLatency:Ee===0?0:gt/Ee}}),[he,fe,Z]),_e=L=>{T(oe=>oe.includes(L)?oe.filter(pe=>pe!==L):[...oe,L])},Me=L=>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:["#",L.runIndex+1]})," ",a.jsx("span",{className:L.passed?"text-emerald-700":"text-destructive",children:L.passed?"PASS":"FAIL"})," ","· tools: ",L.toolCalls.length," · ",L.duration,"ms"]}),!L.passed&&L.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:L.failureReasons.join("; ")})]},L.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(cN,{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(se,{variant:"outline",size:"sm",onClick:()=>{const L=new URLSearchParams(t);L.delete("mode"),L.delete("runId"),L.delete("agents"),L.delete("scenario"),n(L,{replace:!0})},children:[a.jsx(X$,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]}),r==="runs"&&a.jsxs(su,{open:y,onOpenChange:S,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":y,className:"w-[260px] justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:j==="all"?"All scenarios":j}),a.jsx(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(dl,{className:"w-[260px] p-0",align:"start",children:a.jsxs(pl,{children:[a.jsx(hl,{placeholder:"Search scenarios..."}),a.jsxs(ml,{children:[a.jsx(vl,{children:"No scenarios found."}),a.jsxs(gl,{children:[a.jsx(ua,{value:"all scenarios",onSelect:()=>{b("all"),S(!1)},children:"All scenarios"}),W.map(L=>a.jsx(ua,{value:L,onSelect:()=>{b(L),S(!1)},children:L},L))]})]})]})})]}),a.jsx(se,{variant:"outline",onClick:()=>{H()},disabled:i,children:i?"Refreshing...":"Refresh"})]})]}),r==="within-run"&&a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Within One Run Controls"})}),a.jsxs(He,{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(wn,{value:A,onValueChange:k,children:[a.jsx(hn,{children:a.jsx(jn,{placeholder:"Select run"})}),a.jsx(mn,{children:s.map(L=>a.jsx(tt,{value:L.id,children:L.id},L.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(su,{open:q,onOpenChange:F,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":q,className:"w-full justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:$==="all"?"All scenarios":$}),a.jsx(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(dl,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:a.jsxs(pl,{children:[a.jsx(hl,{placeholder:"Search scenarios..."}),a.jsxs(ml,{children:[a.jsx(vl,{children:"No scenarios found."}),a.jsxs(gl,{children:[a.jsx(ua,{value:"all scenarios",onSelect:()=>{B("all"),F(!1)},children:"All scenarios"}),ue.map(L=>a.jsx(ua,{value:L,onSelect:()=>{B(L),F(!1)},children:L},L))]})]})]})})]})]})]}),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:[V.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available for selected run."}),V.map(L=>a.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[a.jsx(Kr,{checked:O.includes(L.id),onCheckedChange:()=>_e(L.id)}),a.jsx("span",{children:L.name})]},L.id))]})]})]})]}),r==="runs"&&a.jsx(Ve,{children:a.jsx(He,{className:"p-0",children:a.jsxs(qr,{containerClassName:"max-h-[36rem] overflow-auto",children:[a.jsx(Ur,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(at,{className:"w-10"}),a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>U("id"),children:["Run ID",J("id")]})}),a.jsx(at,{children:"Evaluated"}),a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>U("timestamp"),children:["Timestamp",J("timestamp")]})}),a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>U("passRate"),children:["Pass Rate",J("passRate")]})}),a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>U("scenarios"),children:["Scenarios",J("scenarios")]})}),a.jsx(at,{children:"Agents"}),a.jsx(at,{className:"w-[140px] text-right",children:"Action"})]})}),a.jsx(Wr,{children:G.map(L=>a.jsxs(Gt,{children:[a.jsx(Ue,{children:a.jsx(Kr,{checked:d.has(L.id),onCheckedChange:()=>R(L.id),disabled:!d.has(L.id)&&d.size>=5})}),a.jsx(Ue,{className:"font-mono text-xs",children:L.id}),a.jsx(Ue,{className:"text-[11px] text-muted-foreground",children:(()=>{const oe=D.get(L.id)??{scenarioCount:0,agentCount:0,scenarioPreview:"n/a",modelSummary:""};return a.jsxs("div",{className:"space-y-0.5",children:[a.jsxs("div",{children:["Evaluated: ",oe.scenarioCount," scenario",oe.scenarioCount===1?"":"s"," · ",oe.agentCount," agent",oe.agentCount===1?"":"s",oe.modelSummary?` · ${oe.modelSummary}`:""]}),a.jsx("div",{className:"font-mono text-xs text-foreground/80",children:oe.scenarioPreview})]})})()}),a.jsx(Ue,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(mo,{className:"h-3 w-3"}),new Date(L.timestamp).toLocaleString()]})}),a.jsx(Ue,{children:a.jsx(Js,{rate:L.overallPassRate})}),a.jsx(Ue,{className:"font-mono text-sm",children:L.totalScenarios}),a.jsx(Ue,{className:"font-mono text-sm",children:D.get(L.id)?.agentCount??0}),a.jsx(Ue,{className:"text-right",children:(D.get(L.id)?.agentCount??0)>1?a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>ne(L),children:"Compare agents"}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})]},L.id))})]})})}),r==="runs"&&z.length===0&&a.jsx(Ve,{children:a.jsxs(He,{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"&&z.length>=2&&a.jsxs(a.Fragment,{children:[z.length===2&&a.jsx(Ve,{children:a.jsx(He,{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(se,{asChild:!0,size:"sm",children:a.jsx(_t,{to:`/compare/results?left=${encodeURIComponent(z[0].id)}&right=${encodeURIComponent(z[1].id)}&leftConfig=${encodeURIComponent(z[0].configId)}&rightConfig=${encodeURIComponent(z[1].configId)}`,children:"Compare full results"})})]})})}),a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Summary Comparison"})}),a.jsx(He,{className:"max-h-[24rem] overflow-auto p-0",children:a.jsxs(qr,{className:"table-fixed",children:[a.jsx(Ur,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(at,{className:"w-[220px]",children:"Metric"}),z.map((L,oe)=>a.jsx(at,{style:{color:Hj[oe]},className:"font-mono text-xs",children:L.id},L.id))]})}),a.jsxs(Wr,{children:[a.jsxs(Gt,{children:[a.jsx(Ue,{className:"font-medium",children:"Pass Rate"}),z.map(L=>a.jsx(Ue,{children:a.jsx(Js,{rate:L.overallPassRate})},L.id))]}),a.jsxs(Gt,{children:[a.jsx(Ue,{className:"font-medium",children:"Total Runs"}),z.map(L=>a.jsx(Ue,{className:"font-mono",children:L.totalRuns},L.id))]}),a.jsxs(Gt,{children:[a.jsx(Ue,{className:"font-medium",children:"Tool Calls"}),z.map(L=>a.jsx(Ue,{className:"font-mono",children:L.avgToolCalls.toFixed(1)},L.id))]}),a.jsxs(Gt,{children:[a.jsx(Ue,{className:"font-medium",children:"Avg Latency"}),z.map(L=>a.jsxs(Ue,{className:"font-mono",children:[L.avgLatency,"ms"]},L.id))]})]})]})})]}),a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Scenario Breakdown"})}),a.jsx(He,{className:"max-h-[26rem] overflow-auto p-0",children:a.jsxs(qr,{className:"table-fixed",children:[a.jsx(Ur,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(at,{className:"w-[220px]",children:"Scenario"}),z.map((L,oe)=>a.jsx(at,{style:{color:Hj[oe]},className:"font-mono text-xs",children:L.id},L.id))]})}),a.jsx(Wr,{children:te.map(L=>a.jsxs(Gt,{children:[a.jsx(Ue,{className:"font-medium text-sm",children:de.get(L)??L}),z.map(oe=>{const pe=oe.scenarios.find(Ee=>Ee.scenarioId===L);return a.jsx(Ue,{children:pe?a.jsx(Js,{rate:pe.passRate}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},oe.id)})]},L))})]})})]})]}),r==="runs"&&z.length>=2&&a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Pass Rate Trend"})}),a.jsx(He,{className:"h-72",children:a.jsx(rm,{width:"100%",height:"100%",children:a.jsxs(F1,{data:z.map((L,oe)=>({idx:oe+1,runId:L.id,passRate:Number((L.overallPassRate*100).toFixed(1))})),children:[a.jsx(ii,{dataKey:"idx",tickFormatter:L=>String(L)}),a.jsx(li,{unit:"%",domain:[0,100]}),a.jsx(Fr,{formatter:L=>[`${L}%`,"Pass Rate"],labelFormatter:L=>`Run ${L}`}),a.jsx(Gi,{}),a.jsx(ll,{type:"monotone",dataKey:"passRate",stroke:Hj[0],strokeWidth:2.5,dot:!0})]})})})]}),r==="within-run"&&he&&fe.length<2&&a.jsx(Ve,{children:a.jsx(He,{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"&&he&&fe.length>=2&&a.jsxs(a.Fragment,{children:[a.jsx(Ve,{children:a.jsx(He,{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:ae?"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(se,{asChild:!0,size:"sm",children:ae?a.jsx(_t,{to:ae.link,children:"Compare full results"}):a.jsx(_t,{to:`/results/${encodeURIComponent(he.id)}${he.configId?`?configId=${encodeURIComponent(he.configId)}`:""}`,children:"Open full result"})})]})})}),a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Agent Summary"})}),a.jsx(He,{className:"max-h-[24rem] overflow-auto p-0",children:a.jsxs(qr,{children:[a.jsx(Ur,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(at,{children:"Metric"}),Re.map(L=>a.jsxs(at,{children:[a.jsx("div",{className:"font-medium text-sm",children:L.agentName}),(L.provider||L.model)&&a.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[L.provider?Qm(L.provider):null,L.model].filter(Boolean).join(" · ")})]},L.agentId))]})}),a.jsxs(Wr,{children:[a.jsxs(Gt,{children:[a.jsx(Ue,{className:"font-medium",children:"Pass Rate"}),Re.map(L=>a.jsx(Ue,{children:a.jsx(Js,{rate:L.passRate})},L.agentId))]}),a.jsxs(Gt,{children:[a.jsx(Ue,{className:"font-medium",children:"Total Runs"}),Re.map(L=>a.jsx(Ue,{className:"font-mono",children:L.totalRuns},L.agentId))]}),a.jsxs(Gt,{children:[a.jsx(Ue,{className:"font-medium",children:"Avg Tool Calls"}),Re.map(L=>a.jsx(Ue,{className:"font-mono",children:L.avgToolCalls.toFixed(1)},L.agentId))]}),a.jsxs(Gt,{children:[a.jsx(Ue,{className:"font-medium",children:"Avg Latency"}),Re.map(L=>a.jsxs(Ue,{className:"font-mono",children:[Math.round(L.avgLatency),"ms"]},L.agentId))]})]})]})})]}),a.jsxs(Ve,{children:[a.jsx(kt,{className:"pb-3",children:a.jsx(Pt,{className:"text-base",children:"Scenario × Agent Matrix"})}),a.jsx(He,{className:"max-h-[34rem] overflow-auto p-0",children:a.jsxs(qr,{className:"table-fixed",children:[a.jsx(Ur,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(at,{className:"w-[260px]",children:"Scenario"}),fe.map(L=>{const oe=Re.find(pe=>pe.agentId===L.id);return a.jsxs(at,{children:[a.jsx("div",{className:"font-medium text-sm",children:L.name}),(oe?.provider||oe?.model)&&a.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[oe.provider?Qm(oe.provider):null,oe.model].filter(Boolean).join(" · ")})]},L.id)})]})}),a.jsx(Wr,{children:Z.map(L=>a.jsxs(Gt,{children:[a.jsx(Ue,{className:"font-medium text-sm",children:L.displayLabel}),fe.map(oe=>{const pe=L.byAgent[oe.id];return pe?a.jsx(Ue,{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(Js,{rate:pe.passRate})," ",a.jsxs("span",{className:"ml-2",children:["runs: ",pe.runs.length]})," ","· calls: ",pe.avgToolCalls.toFixed(1)," · latency: ",Math.round(pe.avgDuration),"ms"]}),pe.runs.length>0?a.jsx("div",{className:"space-y-1.5",children:pe.runs.map(Ee=>Me(Ee))}):a.jsx("div",{className:"text-xs text-muted-foreground",children:"No runs captured."})]})},oe.id):a.jsx(Ue,{children:a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},oe.id)})]},L.scenarioId))})]})})]})]})]})},b$=(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()}`},w$=(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}`:""}`},Wxe=()=>{const[e]=go(),t=e.get("left")??"",n=e.get("right")??"",r=e.get("leftConfig"),s=e.get("rightConfig"),o=e.get("leftAgent"),i=e.get("rightAgent"),c=o?`${t} · ${o}`:t,d=i?`${n} · ${i}`:n;return!t||!n?a.jsxs(Ve,{children:[a.jsx(kt,{children:a.jsx(Pt,{className:"text-base",children:"Full Result Compare"})}),a.jsxs(He,{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(se,{asChild:!0,variant:"outline",children:a.jsx(_t,{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:o||i?"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(se,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs(_t,{to:"/compare",children:[a.jsx(X$,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),a.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs("a",{href:w$(t,r,o),target:"_blank",rel:"noreferrer",children:["Open Left",a.jsx($h,{className:"ml-1.5 h-3.5 w-3.5"})]})}),a.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs("a",{href:w$(n,s,i),target:"_blank",rel:"noreferrer",children:["Open Right",a.jsx($h,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[a.jsxs(Ve,{className:"overflow-hidden",children:[a.jsx(kt,{className:"py-3",children:a.jsx(Pt,{className:"text-sm font-mono",children:c})}),a.jsx(He,{className:"p-0",children:a.jsx("iframe",{title:`Result ${c}`,src:b$(t,r,o),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),a.jsxs(Ve,{className:"overflow-hidden",children:[a.jsx(kt,{className:"py-3",children:a.jsx(Pt,{className:"text-sm font-mono",children:d})}),a.jsx(He,{className:"p-0",children:a.jsx("iframe",{title:`Result ${d}`,src:b$(n,s,i),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function Vxe(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function Hxe(){const{source:e}=Dn(),[t,n]=m.useState([]),[r,s]=m.useState(!0),[o,i]=m.useState(null),[c,d]=m.useState(!1),f=async()=>{s(!0);try{n(await e.listMarkdownReports())}catch(g){Ae({title:"Could not load markdown reports",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{s(!1)}};m.useEffect(()=>{f()},[]);const h=m.useMemo(()=>t[0],[t]),p=m.useMemo(()=>t.find(g=>g.relativePath===o)??null,[t,o]),x=async()=>{if(o){d(!0);try{await e.deleteMarkdownReport(o),n(g=>g.filter(j=>j.relativePath!==o)),Ae({title:"Markdown report deleted"}),i(null)}catch(g){Ae({title:"Could not delete markdown report",description:g instanceof Error?g.message:String(g),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(dc,{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(se,{variant:"outline",onClick:()=>{f()},children:"Refresh"}),h?a.jsx(se,{asChild:!0,variant:"outline",children:a.jsx(_t,{to:`/markdown-reports/view?path=${encodeURIComponent(h.relativePath)}`,children:"Open latest"})}):null]})]}),a.jsx(Ve,{children:a.jsx(He,{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(qr,{children:[a.jsx(Ur,{children:a.jsxs(Gt,{children:[a.jsx(at,{children:"Report"}),a.jsx(at,{children:"Result"}),a.jsx(at,{children:"Folder"}),a.jsx(at,{children:"Timestamp"}),a.jsx(at,{className:"w-10"})]})}),a.jsx(Wr,{children:t.map(g=>a.jsxs(Gt,{children:[a.jsx(Ue,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(_t,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:g.name}),a.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:g.relativePath})]})}),a.jsx(Ue,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=Vxe(g.relativePath);return j?a.jsx(_t,{to:`/results/${encodeURIComponent(j)}`,className:"text-primary hover:underline",children:j}):a.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),a.jsx(Ue,{className:"text-xs text-muted-foreground font-mono",children:g.relativePath.includes("/")?g.relativePath.slice(0,g.relativePath.lastIndexOf("/")):"."}),a.jsx(Ue,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(mo,{className:"h-3 w-3"}),new Date(g.mtime).toLocaleString()]})}),a.jsx(Ue,{children:a.jsxs(Gf,{children:[a.jsx(Yf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(av,{className:"h-4 w-4"})})}),a.jsxs(Su,{align:"end",children:[a.jsx(Hr,{asChild:!0,children:a.jsx(_t,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,children:"View"})}),a.jsxs(Hr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),i(g.relativePath)},children:[a.jsx(Ta,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.path))})]})})}),a.jsx(Ls,{open:!!o,onOpenChange:g=>!g&&i(null),children:a.jsxs(ss,{children:[a.jsxs(os,{children:[a.jsx(ls,{children:"Delete markdown report?"}),a.jsx(cs,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),a.jsxs(is,{children:[a.jsx(ds,{disabled:c,children:"Cancel"}),a.jsx(us,{onClick:g=>{g.preventDefault(),x()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function Kxe(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Gxe(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 Yxe(){const{source:e}=Dn(),[t]=go(),n=(t.get("path")??"").trim(),[r,s]=m.useState(null),[o,i]=m.useState(!0),[c,d]=m.useState(!1),[f,h]=m.useState(!1);if(m.useEffect(()=>{let x=!0;if(s(null),d(!1),!n){i(!1);return}return i(!0),e.getMarkdownReport(n).then(g=>{x&&s(g)}).catch(g=>{if(!x)return;const j=g instanceof Error?g.message:String(g);if(j.includes("(404)")){d(!0);return}Ae({title:"Could not load markdown report",description:j,variant:"destructive"})}).finally(()=>{x&&i(!1)}),()=>{x=!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(se,{asChild:!0,variant:"outline",children:a.jsx(_t,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});if(o)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(se,{asChild:!0,variant:"outline",children:a.jsx(_t,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=Gxe(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(mo,{className:"h-3 w-3 shrink-0"}),new Date(r.mtime).toLocaleString()]}),a.jsx("span",{"aria-hidden":!0,children:"·"}),a.jsx("span",{children:Kxe(r.sizeBytes)})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[p?a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),a.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:a.jsx(_t,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,a.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:a.jsx(_t,{to:"/markdown-reports",children:"Back to reports"})})]})]}),a.jsx(Ve,{children:a.jsx(He,{className:"pt-6",children:a.jsx(Oa,{text:r.content,variant:"assistant"})})}),p?a.jsx(L5,{open:f,onOpenChange:h,children:a.jsxs(RN,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[a.jsx(z5,{className:"border-b px-4 py-3 pr-12",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs(B5,{className:"text-base",children:["Result ",p]}),a.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:a.jsx(_t,{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 Xxe=()=>{const e=Is();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"})]})})},Qxe=new mH;function Jxe(){const{scenarioId:e}=wl();return a.jsx(o5,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const Zxe=()=>a.jsx(gH,{client:Qxe,children:a.jsx(ai,{children:a.jsx(EY,{children:a.jsx(TY,{children:a.jsxs(OY,{children:[a.jsx(w9,{}),a.jsx(Z9,{}),a.jsx(xK,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:a.jsxs(cK,{children:[a.jsxs(fn,{element:a.jsx(PY,{}),children:[a.jsx(fn,{path:"/",element:a.jsx(spe,{})}),a.jsx(fn,{path:"/mcp-evaluations",element:a.jsx(Nme,{})}),a.jsx(fn,{path:"/mcp-evaluations/:id",element:a.jsx(KM,{})}),a.jsx(fn,{path:"/mcp-evaluations/:id/:tab",element:a.jsx(KM,{})}),a.jsx(fn,{path:"/tool-analysis",element:a.jsx(wxe,{})}),a.jsx(fn,{path:"/tool-analysis-results",element:a.jsx(jxe,{})}),a.jsx(fn,{path:"/tool-analysis-results/:id",element:a.jsx(Sxe,{})}),a.jsx(fn,{path:"/oauth-debugger",element:a.jsx(_xe,{})}),a.jsx(fn,{path:"/libraries/servers",element:a.jsx($ve,{})}),a.jsx(fn,{path:"/libraries/servers/:serverId",element:a.jsx(Dve,{})}),a.jsx(fn,{path:"/libraries/agents",element:a.jsx(Lve,{})}),a.jsx(fn,{path:"/libraries/agents/:agentName",element:a.jsx(Kge,{})}),a.jsx(fn,{path:"/libraries/test-cases",element:a.jsx(r$,{})}),a.jsx(fn,{path:"/libraries/test-cases/:testCaseId",element:a.jsx(r$,{})}),a.jsx(fn,{path:"/libraries/scenarios",element:a.jsx(o5,{to:"/libraries/test-cases",replace:!0})}),a.jsx(fn,{path:"/libraries/scenarios/:scenarioId",element:a.jsx(Jxe,{})}),a.jsx(fn,{path:"/settings",element:a.jsx(Gge,{})}),a.jsx(fn,{path:"/settings/mcp",element:a.jsx(txe,{})}),a.jsx(fn,{path:"/run",element:a.jsx(Axe,{})}),a.jsx(fn,{path:"/results",element:a.jsx(Pxe,{})}),a.jsx(fn,{path:"/results/:id",element:a.jsx(Ixe,{})}),a.jsx(fn,{path:"/markdown-reports",element:a.jsx(Hxe,{})}),a.jsx(fn,{path:"/markdown-reports/view",element:a.jsx(Yxe,{})}),a.jsx(fn,{path:"/compare",element:a.jsx(Uxe,{})}),a.jsx(fn,{path:"/compare/results",element:a.jsx(Wxe,{})})]}),a.jsx(fn,{path:"*",element:a.jsx(Xxe,{})})]})})]})})})})});yU.createRoot(document.getElementById("root")).render(a.jsx(Zxe,{}));
|