@inspectr/mcplab 1.11.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 uU(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 Jp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dy={exports:{}},ad={},fy={exports:{}},Vt={};var EE;function dU(){if(EE)return Vt;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 g(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,b={};function y(D,R,ne){this.props=D,this.context=R,this.refs=b,this.updater=ne||x}y.prototype.isReactComponent={},y.prototype.setState=function(D,R){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,R,"setState")},y.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=y.prototype;function C(D,R,ne){this.props=D,this.context=R,this.refs=b,this.updater=ne||x}var N=C.prototype=new S;N.constructor=C,j(N,y.prototype),N.isPureReactComponent=!0;var E=Array.isArray,A=Object.prototype.hasOwnProperty,P={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function O(D,R,ne){var te,de={},he=null,H=null;if(R!=null)for(te in R.ref!==void 0&&(H=R.ref),R.key!==void 0&&(he=""+R.key),R)A.call(R,te)&&!T.hasOwnProperty(te)&&(de[te]=R[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:H,props:de,_owner:P.current}}function $(D,R){return{$$typeof:e,type:D.type,key:R,ref:D.ref,props:D.props,_owner:D._owner}}function z(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function U(D){var R={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ne){return R[ne]})}var B=/\/+/g;function V(D,R){return typeof D=="object"&&D!==null&&D.key!=null?U(""+D.key):R.toString(36)}function q(D,R,ne,te,de){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var H=!1;if(D===null)H=!0;else switch(he){case"string":case"number":H=!0;break;case"object":switch(D.$$typeof){case e:case t:H=!0}}if(H)return H=D,de=de(H),D=te===""?"."+V(H,0):te,E(de)?(ne="",D!=null&&(ne=D.replace(B,"$&/")+"/"),q(de,R,ne,"",function(Z){return Z})):de!=null&&(z(de)&&(de=$(de,ne+(!de.key||H&&H.key===de.key?"":(""+de.key).replace(B,"$&/")+"/")+D)),R.push(de)),1;if(H=0,te=te===""?".":te+":",E(D))for(var ue=0;ue<D.length;ue++){he=D[ue];var Q=te+V(he,ue);H+=q(he,R,ne,Q,de)}else if(Q=g(D),typeof Q=="function")for(D=Q.call(D),ue=0;!(he=D.next()).done;)he=he.value,Q=te+V(he,ue++),H+=q(he,R,ne,Q,de);else if(he==="object")throw R=String(D),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.");return H}function I(D,R,ne){if(D==null)return D;var te=[],de=0;return q(D,te,"","",function(he){return R.call(ne,he,de++)}),te}function W(D){if(D._status===-1){var R=D._result;R=R(),R.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=R)}if(D._status===1)return D._result.default;throw D._result}var X={current:null},K={transition:null},F={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:K,ReactCurrentOwner:P};function J(){throw Error("act(...) is not supported in production builds of React.")}return Vt.Children={map:I,forEach:function(D,R,ne){I(D,function(){R.apply(this,arguments)},ne)},count:function(D){var R=0;return I(D,function(){R++}),R},toArray:function(D){return I(D,function(R){return R})||[]},only:function(D){if(!z(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Vt.Component=y,Vt.Fragment=n,Vt.Profiler=s,Vt.PureComponent=C,Vt.StrictMode=r,Vt.Suspense=d,Vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,Vt.act=J,Vt.cloneElement=function(D,R,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,H=D._owner;if(R!=null){if(R.ref!==void 0&&(he=R.ref,H=P.current),R.key!==void 0&&(de=""+R.key),D.type&&D.type.defaultProps)var ue=D.type.defaultProps;for(Q in R)A.call(R,Q)&&!T.hasOwnProperty(Q)&&(te[Q]=R[Q]===void 0&&ue!==void 0?ue[Q]:R[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:H}},Vt.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},Vt.createElement=O,Vt.createFactory=function(D){var R=O.bind(null,D);return R.type=D,R},Vt.createRef=function(){return{current:null}},Vt.forwardRef=function(D){return{$$typeof:c,render:D}},Vt.isValidElement=z,Vt.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:W}},Vt.memo=function(D,R){return{$$typeof:f,type:D,compare:R===void 0?null:R}},Vt.startTransition=function(D){var R=K.transition;K.transition={};try{D()}finally{K.transition=R}},Vt.unstable_act=J,Vt.useCallback=function(D,R){return X.current.useCallback(D,R)},Vt.useContext=function(D){return X.current.useContext(D)},Vt.useDebugValue=function(){},Vt.useDeferredValue=function(D){return X.current.useDeferredValue(D)},Vt.useEffect=function(D,R){return X.current.useEffect(D,R)},Vt.useId=function(){return X.current.useId()},Vt.useImperativeHandle=function(D,R,ne){return X.current.useImperativeHandle(D,R,ne)},Vt.useInsertionEffect=function(D,R){return X.current.useInsertionEffect(D,R)},Vt.useLayoutEffect=function(D,R){return X.current.useLayoutEffect(D,R)},Vt.useMemo=function(D,R){return X.current.useMemo(D,R)},Vt.useReducer=function(D,R,ne){return X.current.useReducer(D,R,ne)},Vt.useRef=function(D){return X.current.useRef(D)},Vt.useState=function(D){return X.current.useState(D)},Vt.useSyncExternalStore=function(D,R,ne){return X.current.useSyncExternalStore(D,R,ne)},Vt.useTransition=function(){return X.current.useTransition()},Vt.version="18.3.1",Vt}var PE;function rN(){return PE||(PE=1,fy.exports=dU()),fy.exports}var kE;function fU(){if(kE)return ad;kE=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={},g=null,x=null;f!==void 0&&(g=""+f),d.key!==void 0&&(g=""+d.key),d.ref!==void 0&&(x=d.ref);for(h in d)r.call(d,h)&&!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:g,ref:x,props:p,_owner:s.current}}return ad.Fragment=n,ad.jsx=i,ad.jsxs=i,ad}var TE;function pU(){return TE||(TE=1,dy.exports=fU()),dy.exports}var a=pU(),Zp={},py={exports:{}},Lr={},hy={exports:{}},my={};var OE;function hU(){return OE||(OE=1,(function(e){function t(K,F){var J=K.length;K.push(F);e:for(;0<J;){var D=J-1>>>1,R=K[D];if(0<s(R,F))K[D]=F,K[J]=R,J=D;else break e}}function n(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var F=K[0],J=K.pop();if(J!==F){K[0]=J;e:for(var D=0,R=K.length,ne=R>>>1;D<ne;){var te=2*(D+1)-1,de=K[te],he=te+1,H=K[he];if(0>s(de,J))he<R&&0>s(H,de)?(K[D]=H,K[he]=J,D=he):(K[D]=de,K[te]=J,D=te);else if(he<R&&0>s(H,J))K[D]=H,K[he]=J,D=he;else break e}}return F}function s(K,F){var J=K.sortIndex-F.sortIndex;return J!==0?J:K.id-F.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,g=3,x=!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(K){for(var F=n(f);F!==null;){if(F.callback===null)r(f);else if(F.startTime<=K)r(f),F.sortIndex=F.expirationTime,t(d,F);else break;F=n(f)}}function E(K){if(b=!1,N(K),!j)if(n(d)!==null)j=!0,W(A);else{var F=n(f);F!==null&&X(E,F.startTime-K)}}function A(K,F){j=!1,b&&(b=!1,S(O),O=-1),x=!0;var J=g;try{for(N(F),p=n(d);p!==null&&(!(p.expirationTime>F)||K&&!U());){var D=p.callback;if(typeof D=="function"){p.callback=null,g=p.priorityLevel;var R=D(p.expirationTime<=F);F=e.unstable_now(),typeof R=="function"?p.callback=R:p===n(d)&&r(d),N(F)}else r(d);p=n(d)}if(p!==null)var ne=!0;else{var te=n(f);te!==null&&X(E,te.startTime-F),ne=!1}return ne}finally{p=null,g=J,x=!1}}var P=!1,T=null,O=-1,$=5,z=-1;function U(){return!(e.unstable_now()-z<$)}function B(){if(T!==null){var K=e.unstable_now();z=K;var F=!0;try{F=T(!0,K)}finally{F?V():(P=!1,T=null)}}else P=!1}var V;if(typeof C=="function")V=function(){C(B)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,I=q.port2;q.port1.onmessage=B,V=function(){I.postMessage(null)}}else V=function(){y(B,0)};function W(K){T=K,P||(P=!0,V())}function X(K,F){O=y(function(){K(e.unstable_now())},F)}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(K){K.callback=null},e.unstable_continueExecution=function(){j||x||(j=!0,W(A))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(K){switch(g){case 1:case 2:case 3:var F=3;break;default:F=g}var J=g;g=F;try{return K()}finally{g=J}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,F){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var J=g;g=K;try{return F()}finally{g=J}},e.unstable_scheduleCallback=function(K,F,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,K){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=J+R,K={id:h++,callback:F,priorityLevel:K,startTime:J,expirationTime:R,sortIndex:-1},J>D?(K.sortIndex=J,t(f,K),n(d)===null&&K===n(f)&&(b?(S(O),O=-1):b=!0,X(E,J-D))):(K.sortIndex=R,t(d,K),j||x||(j=!0,W(A))),K},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(K){var F=g;return function(){var J=g;g=F;try{return K.apply(this,arguments)}finally{g=J}}}})(my)),my}var RE;function mU(){return RE||(RE=1,hy.exports=hU()),hy.exports}var IE;function vU(){if(IE)return Lr;IE=1;var e=rN(),t=mU();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 g(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function x(l,u,v,w){if(v!==null&&v.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return w?!1:v!==null?!v.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function j(l,u,v,w){if(u===null||typeof u>"u"||x(l,u,v,w))return!0;if(w)return!1;if(v!==null)switch(v.type){case 3:return!u;case 4:return u===!1;case 5:return isNaN(u);case 6:return isNaN(u)||1>u}return!1}function b(l,u,v,w,_,k,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=k,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?g(u)&&(v===null?l.removeAttribute(u):l.setAttribute(u,""+v)):_.mustUseProperty?l[_.propertyName]=v===null?_.type===3?!1:"":v:(u=_.attributeName,w=_.attributeNamespace,v===null?l.removeAttribute(u):(_=_.type,v=_===3||_===4&&v===!0?"":""+v,w?l.setAttributeNS(w,u,v):l.setAttribute(u,v))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),P=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),U=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),K=Symbol.iterator;function F(l){return l===null||typeof l!="object"?null:(l=K&&l[K]||l["@@iterator"],typeof l=="function"?l:null)}var J=Object.assign,D;function R(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
- `),k=w.stack.split(`
4
- `),M=_.length-1,ee=k.length-1;1<=M&&0<=ee&&_[M]!==k[ee];)ee--;for(;1<=M&&0<=ee;M--,ee--)if(_[M]!==k[ee]){if(M!==1||ee!==1)do if(M--,ee--,0>ee||_[M]!==k[ee]){var oe=`
5
- `+_[M].replace(" at new "," at ");return l.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",l.displayName)),oe}while(1<=M&&0<=ee);break}}}finally{ne=!1,Error.prepareStackTrace=v}return(l=l?l.displayName||l.name:"")?R(l):""}function de(l){switch(l.tag){case 5:return R(l.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("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 T:return"Fragment";case P:return"Portal";case $:return"Profiler";case O:return"StrictMode";case V:return"Suspense";case q:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case U:return(l.displayName||"Context")+".Consumer";case z:return(l._context.displayName||"Context")+".Provider";case B:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case I: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 H(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===O?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function 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,k=v.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return _.call(this)},set:function(M){w=""+M,k.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 Oe(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 we(l,u){var v=u.checked;return J({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??l._wrapperState.initialChecked})}function Ye(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 ie(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"||Oe(l.ownerDocument)!==l)&&(v==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+v&&(l.defaultValue=""+v))}var Xe=Array.isArray;function pt(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 vt(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return J({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function gt(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 Bt(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 Lt(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function $t(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 Ot(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?$t(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Ce,Je=(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(Ce=Ce||document.createElement("div"),Ce.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=Ce.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function Ue(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},Le=["Webkit","ms","Moz","O"];Object.keys(ve).forEach(function(l){Le.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),ve[u]=ve[l]})});function Ie(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 Ze(l,u){l=l.style;for(var v in u)if(u.hasOwnProperty(v)){var w=v.indexOf("--")===0,_=Ie(v,u[v],w);v==="float"&&(v="cssFloat"),w?l.setProperty(v,_):l[v]=_}}var _e=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 Fe(l,u){if(u){if(_e[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 be=null;function Ct(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var zt=null,Ht=null,an=null;function Qt(l){if(l=Uu(l)){if(typeof zt!="function")throw Error(n(280));var u=l.stateNode;u&&(u=pp(u),zt(l.stateNode,l.type,u))}}function mr(l){Ht?an?an.push(l):an=[l]:Ht=l}function ht(){if(Ht){var l=Ht,u=an;if(an=Ht=null,Qt(l),u)for(l=0;l<u.length;l++)Qt(u[l])}}function Tt(l,u){return l(u)}function Dt(){}var sn=!1;function Bn(l,u,v){if(sn)return l(u,v);sn=!0;try{return Tt(l,u,v)}finally{sn=!1,(Ht!==null||an!==null)&&(Dt(),ht())}}function ce(l,u){var v=l.stateNode;if(v===null)return null;var w=pp(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 St={};Object.defineProperty(St,"passive",{get:function(){st=!0}}),window.addEventListener("test",St,St),window.removeEventListener("test",St,St)}catch{st=!1}function en(l,u,v,w,_,k,M,ee,oe){var ye=Array.prototype.slice.call(arguments,3);try{u.apply(v,ye)}catch(ke){this.onError(ke)}}var xt=!1,Tn=null,ur=!1,ma=null,wo={onError:function(l){xt=!0,Tn=l}};function Y(l,u,v,w,_,k,M,ee,oe){xt=!1,Tn=null,en.apply(wo,arguments)}function xe(l,u,v,w,_,k,M,ee,oe){if(Y.apply(this,arguments),xt){if(xt){var ye=Tn;xt=!1,Tn=null}else throw Error(n(198));ur||(ur=!0,ma=ye)}}function He(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 ft(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 qt(l){if(He(l)!==l)throw Error(n(188))}function Gt(l){var u=l.alternate;if(!u){if(u=He(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 k=_.alternate;if(k===null){if(w=_.return,w!==null){v=w;continue}break}if(_.child===k.child){for(k=_.child;k;){if(k===v)return qt(_),l;if(k===w)return qt(_),u;k=k.sibling}throw Error(n(188))}if(v.return!==w.return)v=_,w=k;else{for(var M=!1,ee=_.child;ee;){if(ee===v){M=!0,v=_,w=k;break}if(ee===w){M=!0,w=_,v=k;break}ee=ee.sibling}if(!M){for(ee=k.child;ee;){if(ee===v){M=!0,v=k,w=_;break}if(ee===w){M=!0,w=k,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 Ut(l){return l=Gt(l),l!==null?zn(l):null}function zn(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=zn(l);if(u!==null)return u;l=l.sibling}return null}var Ke=t.unstable_scheduleCallback,on=t.unstable_cancelCallback,Jt=t.unstable_shouldYield,qn=t.unstable_requestPaint,Cn=t.unstable_now,Tg=t.unstable_getCurrentPriorityLevel,jo=t.unstable_ImmediatePriority,Nu=t.unstable_UserBlockingPriority,Al=t.unstable_NormalPriority,Og=t.unstable_LowPriority,Qf=t.unstable_IdlePriority,gi=null,va=null;function Rg(l){if(va&&typeof va.onCommitFiberRoot=="function")try{va.onCommitFiberRoot(gi,l,void 0,(l.current.flags&128)===128)}catch{}}var Qr=Math.clz32?Math.clz32:Ne,Ig=Math.log,re=Math.LN2;function Ne(l){return l>>>=0,l===0?32:31-(Ig(l)/re|0)|0}var ut=64,Me=4194304;function Wt(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 Pt(l,u){var v=l.pendingLanes;if(v===0)return 0;var w=0,_=l.suspendedLanes,k=l.pingedLanes,M=v&268435455;if(M!==0){var ee=M&~_;ee!==0?w=Wt(ee):(k&=M,k!==0&&(w=Wt(k)))}else M=v&~_,M!==0?w=Wt(M):k!==0&&(w=Wt(k));if(w===0)return 0;if(u!==0&&u!==w&&(u&_)===0&&(_=w&-w,k=u&-u,_>=k||_===16&&(k&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-Qr(u),_=1<<v,w|=l[v],u&=~_;return w}function _n(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 vr(l,u){for(var v=l.suspendedLanes,w=l.pingedLanes,_=l.expirationTimes,k=l.pendingLanes;0<k;){var M=31-Qr(k),ee=1<<M,oe=_[M];oe===-1?((ee&v)===0||(ee&w)!==0)&&(_[M]=_n(ee,u)):oe<=u&&(l.expiredLanes|=ee),k&=~ee}}function fn(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function So(){var l=ut;return ut<<=1,(ut&4194240)===0&&(ut=64),l}function El(l){for(var u=[],v=0;31>v;v++)u.push(l);return u}function xi(l,u,v){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Qr(u),l[u]=v}function Cu(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-Qr(v),k=1<<_;u[_]=0,w[_]=-1,l[_]=-1,v&=~k}}function _u(l,u){var v=l.entangledLanes|=u;for(l=l.entanglements;v;){var w=31-Qr(v),_=1<<w;_&u|l[w]&u&&(l[w]|=u),v&=~_}}var un=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,Jf=[],No=null,Co=null,_o=null,Au=new Map,Eu=new Map,Ao=[],O6="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":No=null;break;case"dragenter":case"dragleave":Co=null;break;case"mouseover":case"mouseout":_o=null;break;case"pointerover":case"pointerout":Au.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Eu.delete(u.pointerId)}}function Pu(l,u,v,w,_,k){return l===null||l.nativeEvent!==k?(l={blockedOn:u,domEventName:v,eventSystemFlags:w,nativeEvent:k,targetContainers:[_]},u!==null&&(u=Uu(u),u!==null&&Mg(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,_!==null&&u.indexOf(_)===-1&&u.push(_),l)}function R6(l,u,v,w,_){switch(u){case"focusin":return No=Pu(No,l,u,v,w,_),!0;case"dragenter":return Co=Pu(Co,l,u,v,w,_),!0;case"mouseover":return _o=Pu(_o,l,u,v,w,_),!0;case"pointerover":var k=_.pointerId;return Au.set(k,Pu(Au.get(k)||null,l,u,v,w,_)),!0;case"gotpointercapture":return k=_.pointerId,Eu.set(k,Pu(Eu.get(k)||null,l,u,v,w,_)),!0}return!1}function f_(l){var u=yi(l.target);if(u!==null){var v=He(u);if(v!==null){if(u=v.tag,u===13){if(u=ft(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 Zf(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);be=w,v.target.dispatchEvent(w),be=null}else return u=Uu(v),u!==null&&Mg(u),l.blockedOn=v,!1;u.shift()}return!0}function p_(l,u,v){Zf(l)&&v.delete(u)}function I6(){$g=!1,No!==null&&Zf(No)&&(No=null),Co!==null&&Zf(Co)&&(Co=null),_o!==null&&Zf(_o)&&(_o=null),Au.forEach(p_),Eu.forEach(p_)}function ku(l,u){l.blockedOn===u&&(l.blockedOn=null,$g||($g=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,I6)))}function Tu(l){function u(_){return ku(_,l)}if(0<Jf.length){ku(Jf[0],l);for(var v=1;v<Jf.length;v++){var w=Jf[v];w.blockedOn===l&&(w.blockedOn=null)}}for(No!==null&&ku(No,l),Co!==null&&ku(Co,l),_o!==null&&ku(_o,l),Au.forEach(u),Eu.forEach(u),v=0;v<Ao.length;v++)w=Ao[v],w.blockedOn===l&&(w.blockedOn=null);for(;0<Ao.length&&(v=Ao[0],v.blockedOn===null);)f_(v),v.blockedOn===null&&Ao.shift()}var Pl=E.ReactCurrentBatchConfig,ep=!0;function M6(l,u,v,w){var _=un,k=Pl.transition;Pl.transition=null;try{un=1,Dg(l,u,v,w)}finally{un=_,Pl.transition=k}}function $6(l,u,v,w){var _=un,k=Pl.transition;Pl.transition=null;try{un=4,Dg(l,u,v,w)}finally{un=_,Pl.transition=k}}function Dg(l,u,v,w){if(ep){var _=Lg(l,u,v,w);if(_===null)tx(l,u,w,tp,v),d_(l,w);else if(R6(_,l,u,v,w))w.stopPropagation();else if(d_(l,w),u&4&&-1<O6.indexOf(l)){for(;_!==null;){var k=Uu(_);if(k!==null&&i_(k),k=Lg(l,u,v,w),k===null&&tx(l,u,w,tp,v),k===_)break;_=k}_!==null&&w.stopPropagation()}else tx(l,u,w,null,v)}}var tp=null;function Lg(l,u,v,w){if(tp=null,l=Ct(w),l=yi(l),l!==null)if(u=He(l),u===null)l=null;else if(v=u.tag,v===13){if(l=ft(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 tp=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(Tg()){case jo:return 1;case Nu:return 4;case Al:case Og:return 16;case Qf:return 536870912;default:return 16}default:return 16}}var Eo=null,Fg=null,np=null;function m_(){if(np)return np;var l,u=Fg,v=u.length,w,_="value"in Eo?Eo.value:Eo.textContent,k=_.length;for(l=0;l<v&&u[l]===_[l];l++);var M=v-l;for(w=1;w<=M&&u[v-w]===_[k-w];w++);return np=_.slice(l,1<w?1-w:void 0)}function rp(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 ap(){return!0}function v_(){return!1}function Jr(l){function u(v,w,_,k,M){this._reactName=v,this._targetInst=_,this.type=w,this.nativeEvent=k,this.target=M,this.currentTarget=null;for(var ee in l)l.hasOwnProperty(ee)&&(v=l[ee],this[ee]=v?v(k):k[ee]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?ap: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=ap)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=ap)},persist:function(){},isPersistent:ap}),u}var kl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bg=Jr(kl),Ou=J({},kl,{view:0,detail:0}),D6=Jr(Ou),zg,qg,Ru,sp=J({},Ou,{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!==Ru&&(Ru&&l.type==="mousemove"?(zg=l.screenX-Ru.screenX,qg=l.screenY-Ru.screenY):qg=zg=0,Ru=l),zg)},movementY:function(l){return"movementY"in l?l.movementY:qg}}),g_=Jr(sp),L6=J({},sp,{dataTransfer:0}),F6=Jr(L6),B6=J({},Ou,{relatedTarget:0}),Ug=Jr(B6),z6=J({},kl,{animationName:0,elapsedTime:0,pseudoElement:0}),q6=Jr(z6),U6=J({},kl,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),W6=Jr(U6),V6=J({},kl,{data:0}),x_=Jr(V6),H6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K6={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"},G6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y6(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=G6[l])?!!u[l]:!1}function Wg(){return Y6}var X6=J({},Ou,{key:function(l){if(l.key){var u=H6[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=rp(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?K6[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"?rp(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?rp(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),Q6=Jr(X6),J6=J({},sp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),y_=Jr(J6),Z6=J({},Ou,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wg}),eq=Jr(Z6),tq=J({},kl,{propertyName:0,elapsedTime:0,pseudoElement:0}),nq=Jr(tq),rq=J({},sp,{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}),aq=Jr(rq),sq=[9,13,27,32],Vg=c&&"CompositionEvent"in window,Iu=null;c&&"documentMode"in document&&(Iu=document.documentMode);var oq=c&&"TextEvent"in window&&!Iu,b_=c&&(!Vg||Iu&&8<Iu&&11>=Iu),w_=" ",j_=!1;function S_(l,u){switch(l){case"keyup":return sq.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 Tl=!1;function iq(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 lq(l,u){if(Tl)return l==="compositionend"||!Vg&&S_(l,u)?(l=m_(),np=Fg=Eo=null,Tl=!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 cq={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"?!!cq[l.type]:u==="textarea"}function __(l,u,v,w){mr(w),u=up(u,"onChange"),0<u.length&&(v=new Bg("onChange","change",null,v,w),l.push({event:v,listeners:u}))}var Mu=null,$u=null;function uq(l){W_(l,0)}function op(l){var u=$l(l);if(ae(u))return l}function dq(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 P_(){Mu&&(Mu.detachEvent("onpropertychange",k_),$u=Mu=null)}function k_(l){if(l.propertyName==="value"&&op($u)){var u=[];__(u,$u,l,Ct(l)),Bn(uq,u)}}function fq(l,u,v){l==="focusin"?(P_(),Mu=u,$u=v,Mu.attachEvent("onpropertychange",k_)):l==="focusout"&&P_()}function pq(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return op($u)}function hq(l,u){if(l==="click")return op(u)}function mq(l,u){if(l==="input"||l==="change")return op(u)}function vq(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Da=typeof Object.is=="function"?Object.is:vq;function Du(l,u){if(Da(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,_)||!Da(l[_],u[_]))return!1}return!0}function T_(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function O_(l,u){var v=T_(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=T_(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=Oe();u instanceof l.HTMLIFrameElement;){try{var v=typeof u.contentWindow.location.href=="string"}catch{v=!1}if(v)l=u.contentWindow;else break;u=Oe(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 gq(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,k=Math.min(w.start,_);w=w.end===void 0?k:Math.min(w.end,_),!l.extend&&k>w&&(_=w,w=k,k=_),_=O_(v,k);var M=O_(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(),k>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 xq=c&&"documentMode"in document&&11>=document.documentMode,Ol=null,Yg=null,Lu=null,Xg=!1;function M_(l,u,v){var w=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Xg||Ol==null||Ol!==Oe(w)||(w=Ol,"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}),Lu&&Du(Lu,w)||(Lu=w,w=up(Yg,"onSelect"),0<w.length&&(u=new Bg("onSelect","select",null,u,v),l.push({event:u,listeners:w}),u.target=Ol)))}function ip(l,u){var v={};return v[l.toLowerCase()]=u.toLowerCase(),v["Webkit"+l]="webkit"+u,v["Moz"+l]="moz"+u,v}var Rl={animationend:ip("Animation","AnimationEnd"),animationiteration:ip("Animation","AnimationIteration"),animationstart:ip("Animation","AnimationStart"),transitionend:ip("Transition","TransitionEnd")},Qg={},$_={};c&&($_=document.createElement("div").style,"AnimationEvent"in window||(delete Rl.animationend.animation,delete Rl.animationiteration.animation,delete Rl.animationstart.animation),"TransitionEvent"in window||delete Rl.transitionend.transition);function lp(l){if(Qg[l])return Qg[l];if(!Rl[l])return l;var u=Rl[l],v;for(v in u)if(u.hasOwnProperty(v)&&v in $_)return Qg[l]=u[v];return l}var D_=lp("animationend"),L_=lp("animationiteration"),F_=lp("animationstart"),B_=lp("transitionend"),z_=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 Po(l,u){z_.set(l,u),o(u,[l])}for(var Jg=0;Jg<q_.length;Jg++){var Zg=q_[Jg],yq=Zg.toLowerCase(),bq=Zg[0].toUpperCase()+Zg.slice(1);Po(yq,"on"+bq)}Po(D_,"onAnimationEnd"),Po(L_,"onAnimationIteration"),Po(F_,"onAnimationStart"),Po("dblclick","onDoubleClick"),Po("focusin","onFocus"),Po("focusout","onBlur"),Po(B_,"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 Fu="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(" "),wq=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fu));function U_(l,u,v){var w=l.type||"unknown-event";l.currentTarget=v,xe(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 k=void 0;if(u)for(var M=w.length-1;0<=M;M--){var ee=w[M],oe=ee.instance,ye=ee.currentTarget;if(ee=ee.listener,oe!==k&&_.isPropagationStopped())break e;U_(_,ee,ye),k=oe}else for(M=0;M<w.length;M++){if(ee=w[M],oe=ee.instance,ye=ee.currentTarget,ee=ee.listener,oe!==k&&_.isPropagationStopped())break e;U_(_,ee,ye),k=oe}}}if(ur)throw l=ma,ur=!1,ma=null,l}function An(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 cp="_reactListening"+Math.random().toString(36).slice(2);function Bu(l){if(!l[cp]){l[cp]=!0,r.forEach(function(v){v!=="selectionchange"&&(wq.has(v)||ex(v,!1,l),ex(v,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[cp]||(u[cp]=!0,ex("selectionchange",!1,u))}}function V_(l,u,v,w){switch(h_(u)){case 1:var _=M6;break;case 4:_=$6;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 k=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 oe=M.tag;if((oe===3||oe===4)&&(oe=M.stateNode.containerInfo,oe===_||oe.nodeType===8&&oe.parentNode===_))return;M=M.return}for(;ee!==null;){if(M=yi(ee),M===null)return;if(oe=M.tag,oe===5||oe===6){w=k=M;continue e}ee=ee.parentNode}}w=w.return}Bn(function(){var ye=k,ke=Ct(v),Re=[];e:{var Pe=z_.get(l);if(Pe!==void 0){var et=Bg,ot=l;switch(l){case"keypress":if(rp(v)===0)break e;case"keydown":case"keyup":et=Q6;break;case"focusin":ot="focus",et=Ug;break;case"focusout":ot="blur",et=Ug;break;case"beforeblur":case"afterblur":et=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":et=g_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":et=F6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":et=eq;break;case D_:case L_:case F_:et=q6;break;case B_:et=nq;break;case"scroll":et=D6;break;case"wheel":et=aq;break;case"copy":case"cut":case"paste":et=W6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":et=y_}var ct=(u&4)!==0,Un=!ct&&l==="scroll",me=ct?Pe!==null?Pe+"Capture":null:Pe;ct=[];for(var le=ye,ge;le!==null;){ge=le;var De=ge.stateNode;if(ge.tag===5&&De!==null&&(ge=De,me!==null&&(De=ce(le,me),De!=null&&ct.push(zu(le,De,ge)))),Un)break;le=le.return}0<ct.length&&(Pe=new et(Pe,ot,null,v,ke),Re.push({event:Pe,listeners:ct}))}}if((u&7)===0){e:{if(Pe=l==="mouseover"||l==="pointerover",et=l==="mouseout"||l==="pointerout",Pe&&v!==be&&(ot=v.relatedTarget||v.fromElement)&&(yi(ot)||ot[Ls]))break e;if((et||Pe)&&(Pe=ke.window===ke?ke:(Pe=ke.ownerDocument)?Pe.defaultView||Pe.parentWindow:window,et?(ot=v.relatedTarget||v.toElement,et=ye,ot=ot?yi(ot):null,ot!==null&&(Un=He(ot),ot!==Un||ot.tag!==5&&ot.tag!==6)&&(ot=null)):(et=null,ot=ye),et!==ot)){if(ct=g_,De="onMouseLeave",me="onMouseEnter",le="mouse",(l==="pointerout"||l==="pointerover")&&(ct=y_,De="onPointerLeave",me="onPointerEnter",le="pointer"),Un=et==null?Pe:$l(et),ge=ot==null?Pe:$l(ot),Pe=new ct(De,le+"leave",et,v,ke),Pe.target=Un,Pe.relatedTarget=ge,De=null,yi(ke)===ye&&(ct=new ct(me,le+"enter",ot,v,ke),ct.target=ge,ct.relatedTarget=Un,De=ct),Un=De,et&&ot)t:{for(ct=et,me=ot,le=0,ge=ct;ge;ge=Il(ge))le++;for(ge=0,De=me;De;De=Il(De))ge++;for(;0<le-ge;)ct=Il(ct),le--;for(;0<ge-le;)me=Il(me),ge--;for(;le--;){if(ct===me||me!==null&&ct===me.alternate)break t;ct=Il(ct),me=Il(me)}ct=null}else ct=null;et!==null&&H_(Re,Pe,et,ct,!1),ot!==null&&Un!==null&&H_(Re,Un,ot,ct,!0)}}e:{if(Pe=ye?$l(ye):window,et=Pe.nodeName&&Pe.nodeName.toLowerCase(),et==="select"||et==="input"&&Pe.type==="file")var dt=dq;else if(C_(Pe))if(A_)dt=mq;else{dt=pq;var yt=fq}else(et=Pe.nodeName)&&et.toLowerCase()==="input"&&(Pe.type==="checkbox"||Pe.type==="radio")&&(dt=hq);if(dt&&(dt=dt(l,ye))){__(Re,dt,v,ke);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?$l(ye):window,l){case"focusin":(C_(yt)||yt.contentEditable==="true")&&(Ol=yt,Yg=ye,Lu=null);break;case"focusout":Lu=Yg=Ol=null;break;case"mousedown":Xg=!0;break;case"contextmenu":case"mouseup":case"dragend":Xg=!1,M_(Re,v,ke);break;case"selectionchange":if(xq)break;case"keydown":case"keyup":M_(Re,v,ke)}var bt;if(Vg)e:{switch(l){case"compositionstart":var kt="onCompositionStart";break e;case"compositionend":kt="onCompositionEnd";break e;case"compositionupdate":kt="onCompositionUpdate";break e}kt=void 0}else Tl?S_(l,v)&&(kt="onCompositionEnd"):l==="keydown"&&v.keyCode===229&&(kt="onCompositionStart");kt&&(b_&&v.locale!=="ko"&&(Tl||kt!=="onCompositionStart"?kt==="onCompositionEnd"&&Tl&&(bt=m_()):(Eo=ke,Fg="value"in Eo?Eo.value:Eo.textContent,Tl=!0)),yt=up(ye,kt),0<yt.length&&(kt=new x_(kt,l,null,v,ke),Re.push({event:kt,listeners:yt}),bt?kt.data=bt:(bt=N_(v),bt!==null&&(kt.data=bt)))),(bt=oq?iq(l,v):lq(l,v))&&(ye=up(ye,"onBeforeInput"),0<ye.length&&(ke=new x_("onBeforeInput","beforeinput",null,v,ke),Re.push({event:ke,listeners:ye}),ke.data=bt))}W_(Re,u)})}function zu(l,u,v){return{instance:l,listener:u,currentTarget:v}}function up(l,u){for(var v=u+"Capture",w=[];l!==null;){var _=l,k=_.stateNode;_.tag===5&&k!==null&&(_=k,k=ce(l,v),k!=null&&w.unshift(zu(l,k,_)),k=ce(l,u),k!=null&&w.push(zu(l,k,_))),l=l.return}return w}function Il(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 k=u._reactName,M=[];v!==null&&v!==w;){var ee=v,oe=ee.alternate,ye=ee.stateNode;if(oe!==null&&oe===w)break;ee.tag===5&&ye!==null&&(ee=ye,_?(oe=ce(v,k),oe!=null&&M.unshift(zu(v,oe,ee))):_||(oe=ce(v,k),oe!=null&&M.push(zu(v,oe,ee)))),v=v.return}M.length!==0&&l.push({event:u,listeners:M})}var jq=/\r\n?/g,Sq=/\u0000|\uFFFD/g;function K_(l){return(typeof l=="string"?l:""+l).replace(jq,`
6
- `).replace(Sq,"")}function dp(l,u,v){if(u=K_(u),K_(l)!==u&&v)throw Error(n(425))}function fp(){}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,Nq=typeof clearTimeout=="function"?clearTimeout:void 0,G_=typeof Promise=="function"?Promise:void 0,Cq=typeof queueMicrotask=="function"?queueMicrotask:typeof G_<"u"?function(l){return G_.resolve(null).then(l).catch(_q)}:sx;function _q(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(_),Tu(u);return}w--}else v!=="$"&&v!=="$?"&&v!=="$!"||w++;v=_}while(v);Tu(u)}function ko(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 Ml=Math.random().toString(36).slice(2),ds="__reactFiber$"+Ml,qu="__reactProps$"+Ml,Ls="__reactContainer$"+Ml,ix="__reactEvents$"+Ml,Aq="__reactListeners$"+Ml,Eq="__reactHandles$"+Ml;function yi(l){var u=l[ds];if(u)return u;for(var v=l.parentNode;v;){if(u=v[Ls]||v[ds]){if(v=u.alternate,u.child!==null||v!==null&&v.child!==null)for(l=Y_(l);l!==null;){if(v=l[ds])return v;l=Y_(l)}return u}l=v,v=l.parentNode}return null}function Uu(l){return l=l[ds]||l[Ls],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function $l(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function pp(l){return l[qu]||null}var lx=[],Dl=-1;function To(l){return{current:l}}function En(l){0>Dl||(l.current=lx[Dl],lx[Dl]=null,Dl--)}function yn(l,u){Dl++,lx[Dl]=l.current,l.current=u}var Oo={},gr=To(Oo),Rr=To(!1),bi=Oo;function Ll(l,u){var v=l.type.contextTypes;if(!v)return Oo;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var _={},k;for(k in v)_[k]=u[k];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=_),_}function Ir(l){return l=l.childContextTypes,l!=null}function hp(){En(Rr),En(gr)}function X_(l,u,v){if(gr.current!==Oo)throw Error(n(168));yn(gr,u),yn(Rr,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,H(l)||"Unknown",_));return J({},v,w)}function mp(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Oo,bi=gr.current,yn(gr,l),yn(Rr,Rr.current),!0}function J_(l,u,v){var w=l.stateNode;if(!w)throw Error(n(169));v?(l=Q_(l,u,bi),w.__reactInternalMemoizedMergedChildContext=l,En(Rr),En(gr),yn(gr,l)):En(Rr),yn(Rr,v)}var Fs=null,vp=!1,cx=!1;function Z_(l){Fs===null?Fs=[l]:Fs.push(l)}function Pq(l){vp=!0,Z_(l)}function Ro(){if(!cx&&Fs!==null){cx=!0;var l=0,u=un;try{var v=Fs;for(un=1;l<v.length;l++){var w=v[l];do w=w(!0);while(w!==null)}Fs=null,vp=!1}catch(_){throw Fs!==null&&(Fs=Fs.slice(l+1)),Ke(jo,Ro),_}finally{un=u,cx=!1}}return null}var Fl=[],Bl=0,gp=null,xp=0,ga=[],xa=0,wi=null,Bs=1,zs="";function ji(l,u){Fl[Bl++]=xp,Fl[Bl++]=gp,gp=l,xp=u}function eA(l,u,v){ga[xa++]=Bs,ga[xa++]=zs,ga[xa++]=wi,wi=l;var w=Bs;l=zs;var _=32-Qr(w)-1;w&=~(1<<_),v+=1;var k=32-Qr(u)+_;if(30<k){var M=_-_%5;k=(w&(1<<M)-1).toString(32),w>>=M,_-=M,Bs=1<<32-Qr(u)+_|v<<_|w,zs=k+l}else Bs=1<<k|v<<_|w,zs=l}function ux(l){l.return!==null&&(ji(l,1),eA(l,1,0))}function dx(l){for(;l===gp;)gp=Fl[--Bl],Fl[Bl]=null,xp=Fl[--Bl],Fl[Bl]=null;for(;l===wi;)wi=ga[--xa],ga[xa]=null,zs=ga[--xa],ga[xa]=null,Bs=ga[--xa],ga[xa]=null}var Zr=null,ea=null,On=!1,La=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,Zr=l,ea=ko(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,Zr=l,ea=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(v=wi!==null?{id:Bs,overflow:zs}:null,l.memoizedState={dehydrated:u,treeContext:v,retryLane:1073741824},v=ja(18,null,null,0),v.stateNode=u,v.return=l,l.child=v,Zr=l,ea=null,!0):!1;default:return!1}}function fx(l){return(l.mode&1)!==0&&(l.flags&128)===0}function px(l){if(On){var u=ea;if(u){var v=u;if(!nA(l,u)){if(fx(l))throw Error(n(418));u=ko(v.nextSibling);var w=Zr;u&&nA(l,u)?tA(w,v):(l.flags=l.flags&-4097|2,On=!1,Zr=l)}}else{if(fx(l))throw Error(n(418));l.flags=l.flags&-4097|2,On=!1,Zr=l}}}function rA(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Zr=l}function yp(l){if(l!==Zr)return!1;if(!On)return rA(l),On=!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=ea)){if(fx(l))throw aA(),Error(n(418));for(;u;)tA(l,u),u=ko(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){ea=ko(l.nextSibling);break e}u--}else v!=="$"&&v!=="$!"&&v!=="$?"||u++}l=l.nextSibling}ea=null}}else ea=Zr?ko(l.stateNode.nextSibling):null;return!0}function aA(){for(var l=ea;l;)l=ko(l.nextSibling)}function zl(){ea=Zr=null,On=!1}function hx(l){La===null?La=[l]:La.push(l)}var kq=E.ReactCurrentBatchConfig;function Wu(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,k=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===k?u.ref:(u=function(M){var ee=_.refs;M===null?delete ee[k]:ee[k]=M},u._stringRef=k,u)}if(typeof l!="string")throw Error(n(284));if(!v._owner)throw Error(n(290,l))}return l}function bp(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 ge=me.deletions;ge===null?(me.deletions=[le],me.flags|=16):ge.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=zo(me,le),me.index=0,me.sibling=null,me}function k(me,le,ge){return me.index=ge,l?(ge=me.alternate,ge!==null?(ge=ge.index,ge<le?(me.flags|=2,le):ge):(me.flags|=2,le)):(me.flags|=1048576,le)}function M(me){return l&&me.alternate===null&&(me.flags|=2),me}function ee(me,le,ge,De){return le===null||le.tag!==6?(le=sy(ge,me.mode,De),le.return=me,le):(le=_(le,ge),le.return=me,le)}function oe(me,le,ge,De){var dt=ge.type;return dt===T?ke(me,le,ge.props.children,De,ge.key):le!==null&&(le.elementType===dt||typeof dt=="object"&&dt!==null&&dt.$$typeof===W&&sA(dt)===le.type)?(De=_(le,ge.props),De.ref=Wu(me,le,ge),De.return=me,De):(De=Wp(ge.type,ge.key,ge.props,null,me.mode,De),De.ref=Wu(me,le,ge),De.return=me,De)}function ye(me,le,ge,De){return le===null||le.tag!==4||le.stateNode.containerInfo!==ge.containerInfo||le.stateNode.implementation!==ge.implementation?(le=oy(ge,me.mode,De),le.return=me,le):(le=_(le,ge.children||[]),le.return=me,le)}function ke(me,le,ge,De,dt){return le===null||le.tag!==7?(le=ki(ge,me.mode,De,dt),le.return=me,le):(le=_(le,ge),le.return=me,le)}function Re(me,le,ge){if(typeof le=="string"&&le!==""||typeof le=="number")return le=sy(""+le,me.mode,ge),le.return=me,le;if(typeof le=="object"&&le!==null){switch(le.$$typeof){case A:return ge=Wp(le.type,le.key,le.props,null,me.mode,ge),ge.ref=Wu(me,null,le),ge.return=me,ge;case P:return le=oy(le,me.mode,ge),le.return=me,le;case W:var De=le._init;return Re(me,De(le._payload),ge)}if(Xe(le)||F(le))return le=ki(le,me.mode,ge,null),le.return=me,le;bp(me,le)}return null}function Pe(me,le,ge,De){var dt=le!==null?le.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return dt!==null?null:ee(me,le,""+ge,De);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case A:return ge.key===dt?oe(me,le,ge,De):null;case P:return ge.key===dt?ye(me,le,ge,De):null;case W:return dt=ge._init,Pe(me,le,dt(ge._payload),De)}if(Xe(ge)||F(ge))return dt!==null?null:ke(me,le,ge,De,null);bp(me,ge)}return null}function et(me,le,ge,De,dt){if(typeof De=="string"&&De!==""||typeof De=="number")return me=me.get(ge)||null,ee(le,me,""+De,dt);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case A:return me=me.get(De.key===null?ge:De.key)||null,oe(le,me,De,dt);case P:return me=me.get(De.key===null?ge:De.key)||null,ye(le,me,De,dt);case W:var yt=De._init;return et(me,le,ge,yt(De._payload),dt)}if(Xe(De)||F(De))return me=me.get(ge)||null,ke(le,me,De,dt,null);bp(le,De)}return null}function ot(me,le,ge,De){for(var dt=null,yt=null,bt=le,kt=le=0,or=null;bt!==null&&kt<ge.length;kt++){bt.index>kt?(or=bt,bt=null):or=bt.sibling;var tn=Pe(me,bt,ge[kt],De);if(tn===null){bt===null&&(bt=or);break}l&&bt&&tn.alternate===null&&u(me,bt),le=k(tn,le,kt),yt===null?dt=tn:yt.sibling=tn,yt=tn,bt=or}if(kt===ge.length)return v(me,bt),On&&ji(me,kt),dt;if(bt===null){for(;kt<ge.length;kt++)bt=Re(me,ge[kt],De),bt!==null&&(le=k(bt,le,kt),yt===null?dt=bt:yt.sibling=bt,yt=bt);return On&&ji(me,kt),dt}for(bt=w(me,bt);kt<ge.length;kt++)or=et(bt,me,kt,ge[kt],De),or!==null&&(l&&or.alternate!==null&&bt.delete(or.key===null?kt:or.key),le=k(or,le,kt),yt===null?dt=or:yt.sibling=or,yt=or);return l&&bt.forEach(function(qo){return u(me,qo)}),On&&ji(me,kt),dt}function ct(me,le,ge,De){var dt=F(ge);if(typeof dt!="function")throw Error(n(150));if(ge=dt.call(ge),ge==null)throw Error(n(151));for(var yt=dt=null,bt=le,kt=le=0,or=null,tn=ge.next();bt!==null&&!tn.done;kt++,tn=ge.next()){bt.index>kt?(or=bt,bt=null):or=bt.sibling;var qo=Pe(me,bt,tn.value,De);if(qo===null){bt===null&&(bt=or);break}l&&bt&&qo.alternate===null&&u(me,bt),le=k(qo,le,kt),yt===null?dt=qo:yt.sibling=qo,yt=qo,bt=or}if(tn.done)return v(me,bt),On&&ji(me,kt),dt;if(bt===null){for(;!tn.done;kt++,tn=ge.next())tn=Re(me,tn.value,De),tn!==null&&(le=k(tn,le,kt),yt===null?dt=tn:yt.sibling=tn,yt=tn);return On&&ji(me,kt),dt}for(bt=w(me,bt);!tn.done;kt++,tn=ge.next())tn=et(bt,me,kt,tn.value,De),tn!==null&&(l&&tn.alternate!==null&&bt.delete(tn.key===null?kt:tn.key),le=k(tn,le,kt),yt===null?dt=tn:yt.sibling=tn,yt=tn);return l&&bt.forEach(function(cU){return u(me,cU)}),On&&ji(me,kt),dt}function Un(me,le,ge,De){if(typeof ge=="object"&&ge!==null&&ge.type===T&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case A:e:{for(var dt=ge.key,yt=le;yt!==null;){if(yt.key===dt){if(dt=ge.type,dt===T){if(yt.tag===7){v(me,yt.sibling),le=_(yt,ge.props.children),le.return=me,me=le;break e}}else if(yt.elementType===dt||typeof dt=="object"&&dt!==null&&dt.$$typeof===W&&sA(dt)===yt.type){v(me,yt.sibling),le=_(yt,ge.props),le.ref=Wu(me,yt,ge),le.return=me,me=le;break e}v(me,yt);break}else u(me,yt);yt=yt.sibling}ge.type===T?(le=ki(ge.props.children,me.mode,De,ge.key),le.return=me,me=le):(De=Wp(ge.type,ge.key,ge.props,null,me.mode,De),De.ref=Wu(me,le,ge),De.return=me,me=De)}return M(me);case P:e:{for(yt=ge.key;le!==null;){if(le.key===yt)if(le.tag===4&&le.stateNode.containerInfo===ge.containerInfo&&le.stateNode.implementation===ge.implementation){v(me,le.sibling),le=_(le,ge.children||[]),le.return=me,me=le;break e}else{v(me,le);break}else u(me,le);le=le.sibling}le=oy(ge,me.mode,De),le.return=me,me=le}return M(me);case W:return yt=ge._init,Un(me,le,yt(ge._payload),De)}if(Xe(ge))return ot(me,le,ge,De);if(F(ge))return ct(me,le,ge,De);bp(me,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,le!==null&&le.tag===6?(v(me,le.sibling),le=_(le,ge),le.return=me,me=le):(v(me,le),le=sy(ge,me.mode,De),le.return=me,me=le),M(me)):v(me,le)}return Un}var ql=oA(!0),iA=oA(!1),wp=To(null),jp=null,Ul=null,mx=null;function vx(){mx=Ul=jp=null}function gx(l){var u=wp.current;En(wp),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 Wl(l,u){jp=l,mx=Ul=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(Mr=!0),l.firstContext=null)}function ya(l){var u=l._currentValue;if(mx!==l)if(l={context:l,memoizedValue:u,next:null},Ul===null){if(jp===null)throw Error(n(308));Ul=l,jp.dependencies={lanes:0,firstContext:l}}else Ul=Ul.next=l;return u}var Si=null;function yx(l){Si===null?Si=[l]:Si.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,qs(l,w)}function qs(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 Io=!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 Us(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function Mo(l,u,v){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(Zt&2)!==0){var _=w.pending;return _===null?u.next=u:(u.next=_.next,_.next=u),w.pending=u,qs(l,v)}return _=w.interleaved,_===null?(u.next=u,yx(w)):(u.next=_.next,_.next=u),w.interleaved=u,qs(l,v)}function Sp(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,_u(l,v)}}function uA(l,u){var v=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,v===w)){var _=null,k=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};k===null?_=k=M:k=k.next=M,v=v.next}while(v!==null);k===null?_=k=u:k=k.next=u}else _=k=u;v={baseState:w.baseState,firstBaseUpdate:_,lastBaseUpdate:k,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 Np(l,u,v,w){var _=l.updateQueue;Io=!1;var k=_.firstBaseUpdate,M=_.lastBaseUpdate,ee=_.shared.pending;if(ee!==null){_.shared.pending=null;var oe=ee,ye=oe.next;oe.next=null,M===null?k=ye:M.next=ye,M=oe;var ke=l.alternate;ke!==null&&(ke=ke.updateQueue,ee=ke.lastBaseUpdate,ee!==M&&(ee===null?ke.firstBaseUpdate=ye:ee.next=ye,ke.lastBaseUpdate=oe))}if(k!==null){var Re=_.baseState;M=0,ke=ye=oe=null,ee=k;do{var Pe=ee.lane,et=ee.eventTime;if((w&Pe)===Pe){ke!==null&&(ke=ke.next={eventTime:et,lane:0,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null});e:{var ot=l,ct=ee;switch(Pe=u,et=v,ct.tag){case 1:if(ot=ct.payload,typeof ot=="function"){Re=ot.call(et,Re,Pe);break e}Re=ot;break e;case 3:ot.flags=ot.flags&-65537|128;case 0:if(ot=ct.payload,Pe=typeof ot=="function"?ot.call(et,Re,Pe):ot,Pe==null)break e;Re=J({},Re,Pe);break e;case 2:Io=!0}}ee.callback!==null&&ee.lane!==0&&(l.flags|=64,Pe=_.effects,Pe===null?_.effects=[ee]:Pe.push(ee))}else et={eventTime:et,lane:Pe,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null},ke===null?(ye=ke=et,oe=Re):ke=ke.next=et,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(ke===null&&(oe=Re),_.baseState=oe,_.firstBaseUpdate=ye,_.lastBaseUpdate=ke,u=_.shared.interleaved,u!==null){_=u;do M|=_.lane,_=_.next;while(_!==u)}else k===null&&(_.shared.lanes=0);_i|=M,l.lanes=M,l.memoizedState=Re}}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 Vu={},fs=To(Vu),Hu=To(Vu),Ku=To(Vu);function Ni(l){if(l===Vu)throw Error(n(174));return l}function wx(l,u){switch(yn(Ku,u),yn(Hu,l),yn(fs,Vu),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Ot(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=Ot(u,l)}En(fs),yn(fs,u)}function Vl(){En(fs),En(Hu),En(Ku)}function fA(l){Ni(Ku.current);var u=Ni(fs.current),v=Ot(u,l.type);u!==v&&(yn(Hu,l),yn(fs,v))}function jx(l){Hu.current===l&&(En(fs),En(Hu))}var In=To(0);function Cp(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 _p=E.ReactCurrentDispatcher,Cx=E.ReactCurrentBatchConfig,Ci=0,Mn=null,Yn=null,ar=null,Ap=!1,Gu=!1,Yu=0,Tq=0;function xr(){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(!Da(l[v],u[v]))return!1;return!0}function Ax(l,u,v,w,_,k){if(Ci=k,Mn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,_p.current=l===null||l.memoizedState===null?Mq:$q,l=v(w,_),Gu){k=0;do{if(Gu=!1,Yu=0,25<=k)throw Error(n(301));k+=1,ar=Yn=null,u.updateQueue=null,_p.current=Dq,l=v(w,_)}while(Gu)}if(_p.current=kp,u=Yn!==null&&Yn.next!==null,Ci=0,ar=Yn=Mn=null,Ap=!1,u)throw Error(n(300));return l}function Ex(){var l=Yu!==0;return Yu=0,l}function ps(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ar===null?Mn.memoizedState=ar=l:ar=ar.next=l,ar}function ba(){if(Yn===null){var l=Mn.alternate;l=l!==null?l.memoizedState:null}else l=Yn.next;var u=ar===null?Mn.memoizedState:ar.next;if(u!==null)ar=u,Yn=l;else{if(l===null)throw Error(n(310));Yn=l,l={memoizedState:Yn.memoizedState,baseState:Yn.baseState,baseQueue:Yn.baseQueue,queue:Yn.queue,next:null},ar===null?Mn.memoizedState=ar=l:ar=ar.next=l}return ar}function Xu(l,u){return typeof u=="function"?u(l):u}function Px(l){var u=ba(),v=u.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=l;var w=Yn,_=w.baseQueue,k=v.pending;if(k!==null){if(_!==null){var M=_.next;_.next=k.next,k.next=M}w.baseQueue=_=k,v.pending=null}if(_!==null){k=_.next,w=w.baseState;var ee=M=null,oe=null,ye=k;do{var ke=ye.lane;if((Ci&ke)===ke)oe!==null&&(oe=oe.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 Re={lane:ke,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};oe===null?(ee=oe=Re,M=w):oe=oe.next=Re,Mn.lanes|=ke,_i|=ke}ye=ye.next}while(ye!==null&&ye!==k);oe===null?M=w:oe.next=ee,Da(w,u.memoizedState)||(Mr=!0),u.memoizedState=w,u.baseState=M,u.baseQueue=oe,v.lastRenderedState=w}if(l=v.interleaved,l!==null){_=l;do k=_.lane,Mn.lanes|=k,_i|=k,_=_.next;while(_!==l)}else _===null&&(v.lanes=0);return[u.memoizedState,v.dispatch]}function kx(l){var u=ba(),v=u.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=l;var w=v.dispatch,_=v.pending,k=u.memoizedState;if(_!==null){v.pending=null;var M=_=_.next;do k=l(k,M.action),M=M.next;while(M!==_);Da(k,u.memoizedState)||(Mr=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),v.lastRenderedState=k}return[k,w]}function pA(){}function hA(l,u){var v=Mn,w=ba(),_=u(),k=!Da(w.memoizedState,_);if(k&&(w.memoizedState=_,Mr=!0),w=w.queue,Tx(gA.bind(null,v,w,l),[l]),w.getSnapshot!==u||k||ar!==null&&ar.memoizedState.tag&1){if(v.flags|=2048,Qu(9,vA.bind(null,v,w,_,u),void 0,null),sr===null)throw Error(n(349));(Ci&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!Da(l,v)}catch{return!0}}function yA(l){var u=qs(l,1);u!==null&&qa(u,l,1,-1)}function bA(l){var u=ps();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xu,lastRenderedState:l},u.queue=l,l=l.dispatch=Iq.bind(null,Mn,l),[u.memoizedState,l]}function Qu(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 Ep(l,u,v,w){var _=ps();Mn.flags|=l,_.memoizedState=Qu(1|u,v,void 0,w===void 0?null:w)}function Pp(l,u,v,w){var _=ba();w=w===void 0?null:w;var k=void 0;if(Yn!==null){var M=Yn.memoizedState;if(k=M.destroy,w!==null&&_x(w,M.deps)){_.memoizedState=Qu(u,v,k,w);return}}Mn.flags|=l,_.memoizedState=Qu(1|u,v,k,w)}function jA(l,u){return Ep(8390656,8,l,u)}function Tx(l,u){return Pp(2048,8,l,u)}function SA(l,u){return Pp(4,2,l,u)}function NA(l,u){return Pp(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,Pp(4,4,CA.bind(null,u,l),v)}function Ox(){}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 PA(l,u,v){return(Ci&21)===0?(l.baseState&&(l.baseState=!1,Mr=!0),l.memoizedState=v):(Da(v,u)||(v=So(),Mn.lanes|=v,_i|=v,l.baseState=!0),u)}function Oq(l,u){var v=un;un=v!==0&&4>v?v:4,l(!0);var w=Cx.transition;Cx.transition={};try{l(!1),u()}finally{un=v,Cx.transition=w}}function kA(){return ba().memoizedState}function Rq(l,u,v){var w=Fo(l);if(v={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null},TA(l))OA(u,v);else if(v=lA(l,u,v,w),v!==null){var _=Nr();qa(v,l,w,_),RA(v,u,w)}}function Iq(l,u,v){var w=Fo(l),_={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null};if(TA(l))OA(u,_);else{var k=l.alternate;if(l.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var M=u.lastRenderedState,ee=k(M,v);if(_.hasEagerState=!0,_.eagerState=ee,Da(ee,M)){var oe=u.interleaved;oe===null?(_.next=_,yx(u)):(_.next=oe.next,oe.next=_),u.interleaved=_;return}}catch{}v=lA(l,u,_,w),v!==null&&(_=Nr(),qa(v,l,w,_),RA(v,u,w))}}function TA(l){var u=l.alternate;return l===Mn||u!==null&&u===Mn}function OA(l,u){Gu=Ap=!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,_u(l,v)}}var kp={readContext:ya,useCallback:xr,useContext:xr,useEffect:xr,useImperativeHandle:xr,useInsertionEffect:xr,useLayoutEffect:xr,useMemo:xr,useReducer:xr,useRef:xr,useState:xr,useDebugValue:xr,useDeferredValue:xr,useTransition:xr,useMutableSource:xr,useSyncExternalStore:xr,useId:xr,unstable_isNewReconciler:!1},Mq={readContext:ya,useCallback:function(l,u){return ps().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,Ep(4194308,4,CA.bind(null,u,l),v)},useLayoutEffect:function(l,u){return Ep(4194308,4,l,u)},useInsertionEffect:function(l,u){return Ep(4,2,l,u)},useMemo:function(l,u){var v=ps();return u=u===void 0?null:u,l=l(),v.memoizedState=[l,u],l},useReducer:function(l,u,v){var w=ps();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=Rq.bind(null,Mn,l),[w.memoizedState,l]},useRef:function(l){var u=ps();return l={current:l},u.memoizedState=l},useState:bA,useDebugValue:Ox,useDeferredValue:function(l){return ps().memoizedState=l},useTransition:function(){var l=bA(!1),u=l[0];return l=Oq.bind(null,l[1]),ps().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,v){var w=Mn,_=ps();if(On){if(v===void 0)throw Error(n(407));v=v()}else{if(v=u(),sr===null)throw Error(n(349));(Ci&30)!==0||mA(w,u,v)}_.memoizedState=v;var k={value:v,getSnapshot:u};return _.queue=k,jA(gA.bind(null,w,k,l),[l]),w.flags|=2048,Qu(9,vA.bind(null,w,k,v,u),void 0,null),v},useId:function(){var l=ps(),u=sr.identifierPrefix;if(On){var v=zs,w=Bs;v=(w&~(1<<32-Qr(w)-1)).toString(32)+v,u=":"+u+"R"+v,v=Yu++,0<v&&(u+="H"+v.toString(32)),u+=":"}else v=Tq++,u=":"+u+"r"+v.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},$q={readContext:ya,useCallback:AA,useContext:ya,useEffect:Tx,useImperativeHandle:_A,useInsertionEffect:SA,useLayoutEffect:NA,useMemo:EA,useReducer:Px,useRef:wA,useState:function(){return Px(Xu)},useDebugValue:Ox,useDeferredValue:function(l){var u=ba();return PA(u,Yn.memoizedState,l)},useTransition:function(){var l=Px(Xu)[0],u=ba().memoizedState;return[l,u]},useMutableSource:pA,useSyncExternalStore:hA,useId:kA,unstable_isNewReconciler:!1},Dq={readContext:ya,useCallback:AA,useContext:ya,useEffect:Tx,useImperativeHandle:_A,useInsertionEffect:SA,useLayoutEffect:NA,useMemo:EA,useReducer:kx,useRef:wA,useState:function(){return kx(Xu)},useDebugValue:Ox,useDeferredValue:function(l){var u=ba();return Yn===null?u.memoizedState=l:PA(u,Yn.memoizedState,l)},useTransition:function(){var l=kx(Xu)[0],u=ba().memoizedState;return[l,u]},useMutableSource:pA,useSyncExternalStore:hA,useId:kA,unstable_isNewReconciler:!1};function Fa(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 Tp={isMounted:function(l){return(l=l._reactInternals)?He(l)===l:!1},enqueueSetState:function(l,u,v){l=l._reactInternals;var w=Nr(),_=Fo(l),k=Us(w,_);k.payload=u,v!=null&&(k.callback=v),u=Mo(l,k,_),u!==null&&(qa(u,l,_,w),Sp(u,l,_))},enqueueReplaceState:function(l,u,v){l=l._reactInternals;var w=Nr(),_=Fo(l),k=Us(w,_);k.tag=1,k.payload=u,v!=null&&(k.callback=v),u=Mo(l,k,_),u!==null&&(qa(u,l,_,w),Sp(u,l,_))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var v=Nr(),w=Fo(l),_=Us(v,w);_.tag=2,u!=null&&(_.callback=u),u=Mo(l,_,w),u!==null&&(qa(u,l,w,v),Sp(u,l,w))}};function IA(l,u,v,w,_,k,M){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,k,M):u.prototype&&u.prototype.isPureReactComponent?!Du(v,w)||!Du(_,k):!0}function MA(l,u,v){var w=!1,_=Oo,k=u.contextType;return typeof k=="object"&&k!==null?k=ya(k):(_=Ir(u)?bi:gr.current,w=u.contextTypes,k=(w=w!=null)?Ll(l,_):Oo),u=new u(v,k),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Tp,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=_,l.__reactInternalMemoizedMaskedChildContext=k),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&&Tp.enqueueReplaceState(u,u.state,null)}function Ix(l,u,v,w){var _=l.stateNode;_.props=v,_.state=l.memoizedState,_.refs={},bx(l);var k=u.contextType;typeof k=="object"&&k!==null?_.context=ya(k):(k=Ir(u)?bi:gr.current,_.context=Ll(l,k)),_.state=l.memoizedState,k=u.getDerivedStateFromProps,typeof k=="function"&&(Rx(l,u,k,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&&Tp.enqueueReplaceState(_,_.state,null),Np(l,v,_,w),_.state=l.memoizedState),typeof _.componentDidMount=="function"&&(l.flags|=4194308)}function Hl(l,u){try{var v="",w=u;do v+=de(w),w=w.return;while(w);var _=v}catch(k){_=`
7
- Error generating stack: `+k.message+`
8
- `+k.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 Lq=typeof WeakMap=="function"?WeakMap:Map;function DA(l,u,v){v=Us(-1,v),v.tag=3,v.payload={element:null};var w=u.value;return v.callback=function(){Lp||(Lp=!0,Qx=w),$x(l,u)},v}function LA(l,u,v){v=Us(-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 k=l.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(v.callback=function(){$x(l,u),typeof w!="function"&&(Do===null?Do=new Set([this]):Do.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 Lq;var _=new Set;w.set(u,_)}else _=w.get(u),_===void 0&&(_=new Set,w.set(u,_));_.has(v)||(_.add(v),l=Jq.bind(null,l,u,v),u.then(l,l))}function BA(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 zA(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=Us(-1,1),u.tag=2,Mo(v,u,1))),v.lanes|=1),l):(l.flags|=65536,l.lanes=_,l)}var Fq=E.ReactCurrentOwner,Mr=!1;function Sr(l,u,v,w){u.child=l===null?iA(u,null,v,w):ql(u,l.child,v,w)}function qA(l,u,v,w,_){v=v.render;var k=u.ref;return Wl(u,_),w=Ax(l,u,v,w,k,_),v=Ex(),l!==null&&!Mr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~_,Ws(l,u,_)):(On&&v&&ux(u),u.flags|=1,Sr(l,u,w,_),u.child)}function UA(l,u,v,w,_){if(l===null){var k=v.type;return typeof k=="function"&&!ay(k)&&k.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(u.tag=15,u.type=k,WA(l,u,k,w,_)):(l=Wp(v.type,null,w,u,u.mode,_),l.ref=u.ref,l.return=u,u.child=l)}if(k=l.child,(l.lanes&_)===0){var M=k.memoizedProps;if(v=v.compare,v=v!==null?v:Du,v(M,w)&&l.ref===u.ref)return Ws(l,u,_)}return u.flags|=1,l=zo(k,w),l.ref=u.ref,l.return=u,u.child=l}function WA(l,u,v,w,_){if(l!==null){var k=l.memoizedProps;if(Du(k,w)&&l.ref===u.ref)if(Mr=!1,u.pendingProps=w=k,(l.lanes&_)!==0)(l.flags&131072)!==0&&(Mr=!0);else return u.lanes=l.lanes,Ws(l,u,_)}return Dx(l,u,v,w,_)}function VA(l,u,v){var w=u.pendingProps,_=w.children,k=l!==null?l.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},yn(Gl,ta),ta|=v;else{if((v&1073741824)===0)return l=k!==null?k.baseLanes|v:v,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,yn(Gl,ta),ta|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=k!==null?k.baseLanes:v,yn(Gl,ta),ta|=w}else k!==null?(w=k.baseLanes|v,u.memoizedState=null):w=v,yn(Gl,ta),ta|=w;return Sr(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 k=Ir(v)?bi:gr.current;return k=Ll(u,k),Wl(u,_),v=Ax(l,u,v,w,k,_),w=Ex(),l!==null&&!Mr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~_,Ws(l,u,_)):(On&&w&&ux(u),u.flags|=1,Sr(l,u,v,_),u.child)}function KA(l,u,v,w,_){if(Ir(v)){var k=!0;mp(u)}else k=!1;if(Wl(u,_),u.stateNode===null)Rp(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 oe=M.context,ye=v.contextType;typeof ye=="object"&&ye!==null?ye=ya(ye):(ye=Ir(v)?bi:gr.current,ye=Ll(u,ye));var ke=v.getDerivedStateFromProps,Re=typeof ke=="function"||typeof M.getSnapshotBeforeUpdate=="function";Re||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(ee!==w||oe!==ye)&&$A(u,M,w,ye),Io=!1;var Pe=u.memoizedState;M.state=Pe,Np(u,w,M,_),oe=u.memoizedState,ee!==w||Pe!==oe||Rr.current||Io?(typeof ke=="function"&&(Rx(u,v,ke,w),oe=u.memoizedState),(ee=Io||IA(u,v,ee,w,Pe,oe,ye))?(Re||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=oe),M.props=w,M.state=oe,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:Fa(u.type,ee),M.props=ye,Re=u.pendingProps,Pe=M.context,oe=v.contextType,typeof oe=="object"&&oe!==null?oe=ya(oe):(oe=Ir(v)?bi:gr.current,oe=Ll(u,oe));var et=v.getDerivedStateFromProps;(ke=typeof et=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(ee!==Re||Pe!==oe)&&$A(u,M,w,oe),Io=!1,Pe=u.memoizedState,M.state=Pe,Np(u,w,M,_);var ot=u.memoizedState;ee!==Re||Pe!==ot||Rr.current||Io?(typeof et=="function"&&(Rx(u,v,et,w),ot=u.memoizedState),(ye=Io||IA(u,v,ye,w,Pe,ot,oe)||!1)?(ke||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(w,ot,oe),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(w,ot,oe)),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=oe,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,k,_)}function Lx(l,u,v,w,_,k){HA(l,u);var M=(u.flags&128)!==0;if(!w&&!M)return _&&J_(u,v,!1),Ws(l,u,k);w=u.stateNode,Fq.current=u;var ee=M&&typeof v.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&M?(u.child=ql(u,l.child,null,k),u.child=ql(u,null,ee,k)):Sr(l,u,ee,k),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 zl(),hx(_),u.flags|=256,Sr(l,u,v,w),u.child}var Fx={dehydrated:null,treeContext:null,retryLane:0};function Bx(l){return{baseLanes:l,cachePool:null,transitions:null}}function XA(l,u,v){var w=u.pendingProps,_=In.current,k=!1,M=(u.flags&128)!==0,ee;if((ee=M)||(ee=l!==null&&l.memoizedState===null?!1:(_&2)!==0),ee?(k=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(_|=1),yn(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,k?(w=u.mode,k=u.child,M={mode:"hidden",children:M},(w&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=M):k=Vp(M,w,0,null),l=ki(l,w,v,null),k.return=u,l.return=u,k.sibling=l,u.child=k,u.child.memoizedState=Bx(v),u.memoizedState=Fx,l):zx(u,M));if(_=l.memoizedState,_!==null&&(ee=_.dehydrated,ee!==null))return Bq(l,u,M,w,ee,_,v);if(k){k=w.fallback,M=u.mode,_=l.child,ee=_.sibling;var oe={mode:"hidden",children:w.children};return(M&1)===0&&u.child!==_?(w=u.child,w.childLanes=0,w.pendingProps=oe,u.deletions=null):(w=zo(_,oe),w.subtreeFlags=_.subtreeFlags&14680064),ee!==null?k=zo(ee,k):(k=ki(k,M,v,null),k.flags|=2),k.return=u,w.return=u,w.sibling=k,u.child=w,w=k,k=u.child,M=l.child.memoizedState,M=M===null?Bx(v):{baseLanes:M.baseLanes|v,cachePool:null,transitions:M.transitions},k.memoizedState=M,k.childLanes=l.childLanes&~v,u.memoizedState=Fx,w}return k=l.child,l=k.sibling,w=zo(k,{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 zx(l,u){return u=Vp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function Op(l,u,v,w){return w!==null&&hx(w),ql(u,l.child,null,v),l=zx(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function Bq(l,u,v,w,_,k,M){if(v)return u.flags&256?(u.flags&=-257,w=Mx(Error(n(422))),Op(l,u,M,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(k=w.fallback,_=u.mode,w=Vp({mode:"visible",children:w.children},_,0,null),k=ki(k,_,M,null),k.flags|=2,w.return=u,k.return=u,w.sibling=k,u.child=w,(u.mode&1)!==0&&ql(u,l.child,null,M),u.child.memoizedState=Bx(M),u.memoizedState=Fx,k);if((u.mode&1)===0)return Op(l,u,M,null);if(_.data==="$!"){if(w=_.nextSibling&&_.nextSibling.dataset,w)var ee=w.dgst;return w=ee,k=Error(n(419)),w=Mx(k,w,void 0),Op(l,u,M,w)}if(ee=(M&l.childLanes)!==0,Mr||ee){if(w=sr,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&&_!==k.retryLane&&(k.retryLane=_,qs(l,_),qa(w,l,_,-1))}return ry(),w=Mx(Error(n(421))),Op(l,u,M,w)}return _.data==="$?"?(u.flags|=128,u.child=l.child,u=Zq.bind(null,l),_._reactRetry=u,null):(l=k.treeContext,ea=ko(_.nextSibling),Zr=u,On=!0,La=null,l!==null&&(ga[xa++]=Bs,ga[xa++]=zs,ga[xa++]=wi,Bs=l.id,zs=l.overflow,wi=u),u=zx(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 k=l.memoizedState;k===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:v,tailMode:_}:(k.isBackwards=u,k.rendering=null,k.renderingStartTime=0,k.last=w,k.tail=v,k.tailMode=_)}function JA(l,u,v){var w=u.pendingProps,_=w.revealOrder,k=w.tail;if(Sr(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(yn(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&&Cp(l)===null&&(_=v),v=v.sibling;v=_,v===null?(_=u.child,u.child=null):(_=v.sibling,v.sibling=null),qx(u,!1,_,v,k);break;case"backwards":for(v=null,_=u.child,u.child=null;_!==null;){if(l=_.alternate,l!==null&&Cp(l)===null){u.child=_;break}l=_.sibling,_.sibling=v,v=_,_=l}qx(u,!0,v,null,k);break;case"together":qx(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Rp(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Ws(l,u,v){if(l!==null&&(u.dependencies=l.dependencies),_i|=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=zo(l,l.pendingProps),u.child=v,v.return=u;l.sibling!==null;)l=l.sibling,v=v.sibling=zo(l,l.pendingProps),v.return=u;v.sibling=null}return u.child}function zq(l,u,v){switch(u.tag){case 3:GA(u),zl();break;case 5:fA(u);break;case 1:Ir(u.type)&&mp(u);break;case 4:wx(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,_=u.memoizedProps.value;yn(wp,w._currentValue),w._currentValue=_;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(yn(In,In.current&1),u.flags|=128,null):(v&u.child.childLanes)!==0?XA(l,u,v):(yn(In,In.current&1),l=Ws(l,u,v),l!==null?l.sibling:null);yn(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),yn(In,In.current),w)break;return null;case 22:case 23:return u.lanes=0,VA(l,u,v)}return Ws(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,Ni(fs.current);var k=null;switch(v){case"input":_=we(l,_),w=we(l,w),k=[];break;case"select":_=J({},_,{value:void 0}),w=J({},w,{value:void 0}),k=[];break;case"textarea":_=vt(l,_),w=vt(l,w),k=[];break;default:typeof _.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=fp)}Fe(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)?k||(k=[]):(k=k||[]).push(ye,null));for(ye in w){var oe=w[ye];if(ee=_?.[ye],w.hasOwnProperty(ye)&&oe!==ee&&(oe!=null||ee!=null))if(ye==="style")if(ee){for(M in ee)!ee.hasOwnProperty(M)||oe&&oe.hasOwnProperty(M)||(v||(v={}),v[M]="");for(M in oe)oe.hasOwnProperty(M)&&ee[M]!==oe[M]&&(v||(v={}),v[M]=oe[M])}else v||(k||(k=[]),k.push(ye,v)),v=oe;else ye==="dangerouslySetInnerHTML"?(oe=oe?oe.__html:void 0,ee=ee?ee.__html:void 0,oe!=null&&ee!==oe&&(k=k||[]).push(ye,oe)):ye==="children"?typeof oe!="string"&&typeof oe!="number"||(k=k||[]).push(ye,""+oe):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(s.hasOwnProperty(ye)?(oe!=null&&ye==="onScroll"&&An("scroll",l),k||ee===oe||(k=[])):(k=k||[]).push(ye,oe))}v&&(k=k||[]).push("style",v);var ye=k;(u.updateQueue=ye)&&(u.flags|=4)}},tE=function(l,u,v,w){v!==w&&(u.flags|=4)};function Ju(l,u){if(!On)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 yr(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 qq(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 yr(u),null;case 1:return Ir(u.type)&&hp(),yr(u),null;case 3:return w=u.stateNode,Vl(),En(Rr),En(gr),Nx(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(yp(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,La!==null&&(ey(La),La=null))),Ux(l,u),yr(u),null;case 5:jx(u);var _=Ni(Ku.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 yr(u),null}if(l=Ni(fs.current),yp(u)){w=u.stateNode,v=u.type;var k=u.memoizedProps;switch(w[ds]=u,w[qu]=k,l=(u.mode&1)!==0,v){case"dialog":An("cancel",w),An("close",w);break;case"iframe":case"object":case"embed":An("load",w);break;case"video":case"audio":for(_=0;_<Fu.length;_++)An(Fu[_],w);break;case"source":An("error",w);break;case"img":case"image":case"link":An("error",w),An("load",w);break;case"details":An("toggle",w);break;case"input":Ye(w,k),An("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!k.multiple},An("invalid",w);break;case"textarea":gt(w,k),An("invalid",w)}Fe(v,k),_=null;for(var M in k)if(k.hasOwnProperty(M)){var ee=k[M];M==="children"?typeof ee=="string"?w.textContent!==ee&&(k.suppressHydrationWarning!==!0&&dp(w.textContent,ee,l),_=["children",ee]):typeof ee=="number"&&w.textContent!==""+ee&&(k.suppressHydrationWarning!==!0&&dp(w.textContent,ee,l),_=["children",""+ee]):s.hasOwnProperty(M)&&ee!=null&&M==="onScroll"&&An("scroll",w)}switch(v){case"input":fe(w),pe(w,k,!0);break;case"textarea":fe(w),Lt(w);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(w.onclick=fp)}w=_,u.updateQueue=w,w!==null&&(u.flags|=4)}else{M=_.nodeType===9?_:_.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=$t(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[ds]=u,l[qu]=w,ZA(l,u,!1,!1),u.stateNode=l;e:{switch(M=Xt(v,w),v){case"dialog":An("cancel",l),An("close",l),_=w;break;case"iframe":case"object":case"embed":An("load",l),_=w;break;case"video":case"audio":for(_=0;_<Fu.length;_++)An(Fu[_],l);_=w;break;case"source":An("error",l),_=w;break;case"img":case"image":case"link":An("error",l),An("load",l),_=w;break;case"details":An("toggle",l),_=w;break;case"input":Ye(l,w),_=we(l,w),An("invalid",l);break;case"option":_=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},_=J({},w,{value:void 0}),An("invalid",l);break;case"textarea":gt(l,w),_=vt(l,w),An("invalid",l);break;default:_=w}Fe(v,_),ee=_;for(k in ee)if(ee.hasOwnProperty(k)){var oe=ee[k];k==="style"?Ze(l,oe):k==="dangerouslySetInnerHTML"?(oe=oe?oe.__html:void 0,oe!=null&&Je(l,oe)):k==="children"?typeof oe=="string"?(v!=="textarea"||oe!=="")&&Ue(l,oe):typeof oe=="number"&&Ue(l,""+oe):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(s.hasOwnProperty(k)?oe!=null&&k==="onScroll"&&An("scroll",l):oe!=null&&N(l,k,oe,M))}switch(v){case"input":fe(l),pe(l,w,!1);break;case"textarea":fe(l),Lt(l);break;case"option":w.value!=null&&l.setAttribute("value",""+ue(w.value));break;case"select":l.multiple=!!w.multiple,k=w.value,k!=null?pt(l,!!w.multiple,k,!1):w.defaultValue!=null&&pt(l,!!w.multiple,w.defaultValue,!0);break;default:typeof _.onClick=="function"&&(l.onclick=fp)}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 yr(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=Ni(Ku.current),Ni(fs.current),yp(u)){if(w=u.stateNode,v=u.memoizedProps,w[ds]=u,(k=w.nodeValue!==v)&&(l=Zr,l!==null))switch(l.tag){case 3:dp(w.nodeValue,v,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&dp(w.nodeValue,v,(l.mode&1)!==0)}k&&(u.flags|=4)}else w=(v.nodeType===9?v:v.ownerDocument).createTextNode(w),w[ds]=u,u.stateNode=w}return yr(u),null;case 13:if(En(In),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(On&&ea!==null&&(u.mode&1)!==0&&(u.flags&128)===0)aA(),zl(),u.flags|=98560,k=!1;else if(k=yp(u),w!==null&&w.dehydrated!==null){if(l===null){if(!k)throw Error(n(318));if(k=u.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[ds]=u}else zl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;yr(u),k=!1}else La!==null&&(ey(La),La=null),k=!0;if(!k)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?Xn===0&&(Xn=3):ry())),u.updateQueue!==null&&(u.flags|=4),yr(u),null);case 4:return Vl(),Ux(l,u),l===null&&Bu(u.stateNode.containerInfo),yr(u),null;case 10:return gx(u.type._context),yr(u),null;case 17:return Ir(u.type)&&hp(),yr(u),null;case 19:if(En(In),k=u.memoizedState,k===null)return yr(u),null;if(w=(u.flags&128)!==0,M=k.rendering,M===null)if(w)Ju(k,!1);else{if(Xn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(M=Cp(l),M!==null){for(u.flags|=128,Ju(k,!1),w=M.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=v,v=u.child;v!==null;)k=v,l=w,k.flags&=14680066,M=k.alternate,M===null?(k.childLanes=0,k.lanes=l,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=M.childLanes,k.lanes=M.lanes,k.child=M.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=M.memoizedProps,k.memoizedState=M.memoizedState,k.updateQueue=M.updateQueue,k.type=M.type,l=M.dependencies,k.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),v=v.sibling;return yn(In,In.current&1|2),u.child}l=l.sibling}k.tail!==null&&Cn()>Yl&&(u.flags|=128,w=!0,Ju(k,!1),u.lanes=4194304)}else{if(!w)if(l=Cp(M),l!==null){if(u.flags|=128,w=!0,v=l.updateQueue,v!==null&&(u.updateQueue=v,u.flags|=4),Ju(k,!0),k.tail===null&&k.tailMode==="hidden"&&!M.alternate&&!On)return yr(u),null}else 2*Cn()-k.renderingStartTime>Yl&&v!==1073741824&&(u.flags|=128,w=!0,Ju(k,!1),u.lanes=4194304);k.isBackwards?(M.sibling=u.child,u.child=M):(v=k.last,v!==null?v.sibling=M:u.child=M,k.last=M)}return k.tail!==null?(u=k.tail,k.rendering=u,k.tail=u.sibling,k.renderingStartTime=Cn(),u.sibling=null,v=In.current,yn(In,w?v&1|2:v&1),u):(yr(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?(ta&1073741824)!==0&&(yr(u),u.subtreeFlags&6&&(u.flags|=8192)):yr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function Uq(l,u){switch(dx(u),u.tag){case 1:return Ir(u.type)&&hp(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return Vl(),En(Rr),En(gr),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(En(In),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));zl()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return En(In),null;case 4:return Vl(),null;case 10:return gx(u.type._context),null;case 22:case 23:return ny(),null;case 24:return null;default:return null}}var Ip=!1,br=!1,Wq=typeof WeakSet=="function"?WeakSet:Set,nt=null;function Kl(l,u){var v=l.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(w){Ln(l,u,w)}else v.current=null}function Wx(l,u,v){try{v()}catch(w){Ln(l,u,w)}}var nE=!1;function Vq(l,u){if(nx=ep,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,k=w.focusNode;w=w.focusOffset;try{v.nodeType,k.nodeType}catch{v=null;break e}var M=0,ee=-1,oe=-1,ye=0,ke=0,Re=l,Pe=null;t:for(;;){for(var et;Re!==v||_!==0&&Re.nodeType!==3||(ee=M+_),Re!==k||w!==0&&Re.nodeType!==3||(oe=M+w),Re.nodeType===3&&(M+=Re.nodeValue.length),(et=Re.firstChild)!==null;)Pe=Re,Re=et;for(;;){if(Re===l)break t;if(Pe===v&&++ye===_&&(ee=M),Pe===k&&++ke===w&&(oe=M),(et=Re.nextSibling)!==null)break;Re=Pe,Pe=Re.parentNode}Re=et}v=ee===-1||oe===-1?null:{start:ee,end:oe}}else v=null}v=v||{start:0,end:0}}else v=null;for(rx={focusedElem:l,selectionRange:v},ep=!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 ct=ot.memoizedProps,Un=ot.memoizedState,me=u.stateNode,le=me.getSnapshotBeforeUpdate(u.elementType===u.type?ct:Fa(u.type,ct),Un);me.__reactInternalSnapshotBeforeUpdate=le}break;case 3:var ge=u.stateNode.containerInfo;ge.nodeType===1?ge.textContent="":ge.nodeType===9&&ge.documentElement&&ge.removeChild(ge.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(De){Ln(u,u.return,De)}if(l=u.sibling,l!==null){l.return=u.return,nt=l;break}nt=u.return}return ot=nE,nE=!1,ot}function Zu(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 k=_.destroy;_.destroy=void 0,k!==void 0&&Wx(u,v,k)}_=_.next}while(_!==w)}}function Mp(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[ds],delete u[qu],delete u[ix],delete u[Aq],delete u[Eq])),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=fp));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 $o(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(gi,v)}catch{}switch(v.tag){case 5:br||Kl(v,u);case 6:var w=dr,_=Ba;dr=null,$o(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),Tu(l)):ox(dr,v.stateNode));break;case 4:w=dr,_=Ba,dr=v.stateNode.containerInfo,Ba=!0,$o(l,u,v),dr=w,Ba=_;break;case 0:case 11:case 14:case 15:if(!br&&(w=v.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){_=w=w.next;do{var k=_,M=k.destroy;k=k.tag,M!==void 0&&((k&2)!==0||(k&4)!==0)&&Wx(v,u,M),_=_.next}while(_!==w)}$o(l,u,v);break;case 1:if(!br&&(Kl(v,u),w=v.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=v.memoizedProps,w.state=v.memoizedState,w.componentWillUnmount()}catch(ee){Ln(v,u,ee)}$o(l,u,v);break;case 21:$o(l,u,v);break;case 22:v.mode&1?(br=(w=br)||v.memoizedState!==null,$o(l,u,v),br=w):$o(l,u,v);break;default:$o(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 Wq),u.forEach(function(w){var _=eU.bind(null,l,w);v.has(w)||(v.add(w),w.then(_,_))})}}function za(l,u){var v=u.deletions;if(v!==null)for(var w=0;w<v.length;w++){var _=v[w];try{var k=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(k,M,_),dr=null,Ba=!1;var oe=_.alternate;oe!==null&&(oe.return=null),_.return=null}catch(ye){Ln(_,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(za(u,l),hs(l),w&4){try{Zu(3,l,l.return),Mp(3,l)}catch(ct){Ln(l,l.return,ct)}try{Zu(5,l,l.return)}catch(ct){Ln(l,l.return,ct)}}break;case 1:za(u,l),hs(l),w&512&&v!==null&&Kl(v,v.return);break;case 5:if(za(u,l),hs(l),w&512&&v!==null&&Kl(v,v.return),l.flags&32){var _=l.stateNode;try{Ue(_,"")}catch(ct){Ln(l,l.return,ct)}}if(w&4&&(_=l.stateNode,_!=null)){var k=l.memoizedProps,M=v!==null?v.memoizedProps:k,ee=l.type,oe=l.updateQueue;if(l.updateQueue=null,oe!==null)try{ee==="input"&&k.type==="radio"&&k.name!=null&&L(_,k),Xt(ee,M);var ye=Xt(ee,k);for(M=0;M<oe.length;M+=2){var ke=oe[M],Re=oe[M+1];ke==="style"?Ze(_,Re):ke==="dangerouslySetInnerHTML"?Je(_,Re):ke==="children"?Ue(_,Re):N(_,ke,Re,ye)}switch(ee){case"input":ie(_,k);break;case"textarea":Bt(_,k);break;case"select":var Pe=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!k.multiple;var et=k.value;et!=null?pt(_,!!k.multiple,et,!1):Pe!==!!k.multiple&&(k.defaultValue!=null?pt(_,!!k.multiple,k.defaultValue,!0):pt(_,!!k.multiple,k.multiple?[]:"",!1))}_[qu]=k}catch(ct){Ln(l,l.return,ct)}}break;case 6:if(za(u,l),hs(l),w&4){if(l.stateNode===null)throw Error(n(162));_=l.stateNode,k=l.memoizedProps;try{_.nodeValue=k}catch(ct){Ln(l,l.return,ct)}}break;case 3:if(za(u,l),hs(l),w&4&&v!==null&&v.memoizedState.isDehydrated)try{Tu(u.containerInfo)}catch(ct){Ln(l,l.return,ct)}break;case 4:za(u,l),hs(l);break;case 13:za(u,l),hs(l),_=l.child,_.flags&8192&&(k=_.memoizedState!==null,_.stateNode.isHidden=k,!k||_.alternate!==null&&_.alternate.memoizedState!==null||(Xx=Cn())),w&4&&iE(l);break;case 22:if(ke=v!==null&&v.memoizedState!==null,l.mode&1?(br=(ye=br)||ke,za(u,l),br=ye):za(u,l),hs(l),w&8192){if(ye=l.memoizedState!==null,(l.stateNode.isHidden=ye)&&!ke&&(l.mode&1)!==0)for(nt=l,ke=l.child;ke!==null;){for(Re=nt=ke;nt!==null;){switch(Pe=nt,et=Pe.child,Pe.tag){case 0:case 11:case 14:case 15:Zu(4,Pe,Pe.return);break;case 1:Kl(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(ct){Ln(w,v,ct)}}break;case 5:Kl(Pe,Pe.return);break;case 22:if(Pe.memoizedState!==null){dE(Re);continue}}et!==null?(et.return=Pe,nt=et):dE(Re)}ke=ke.sibling}e:for(ke=null,Re=l;;){if(Re.tag===5){if(ke===null){ke=Re;try{_=Re.stateNode,ye?(k=_.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(ee=Re.stateNode,oe=Re.memoizedProps.style,M=oe!=null&&oe.hasOwnProperty("display")?oe.display:null,ee.style.display=Ie("display",M))}catch(ct){Ln(l,l.return,ct)}}}else if(Re.tag===6){if(ke===null)try{Re.stateNode.nodeValue=ye?"":Re.memoizedProps}catch(ct){Ln(l,l.return,ct)}}else if((Re.tag!==22&&Re.tag!==23||Re.memoizedState===null||Re===l)&&Re.child!==null){Re.child.return=Re,Re=Re.child;continue}if(Re===l)break e;for(;Re.sibling===null;){if(Re.return===null||Re.return===l)break e;ke===Re&&(ke=null),Re=Re.return}ke===Re&&(ke=null),Re.sibling.return=Re.return,Re=Re.sibling}}break;case 19:za(u,l),hs(l),w&4&&iE(l);break;case 21:break;default:za(u,l),hs(l)}}function hs(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&&(Ue(_,""),w.flags&=-33);var k=sE(l);Kx(l,k,_);break;case 3:case 4:var M=w.stateNode.containerInfo,ee=sE(l);Hx(l,ee,M);break;default:throw Error(n(161))}}catch(oe){Ln(l,l.return,oe)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function Hq(l,u,v){nt=l,cE(l)}function cE(l,u,v){for(var w=(l.mode&1)!==0;nt!==null;){var _=nt,k=_.child;if(_.tag===22&&w){var M=_.memoizedState!==null||Ip;if(!M){var ee=_.alternate,oe=ee!==null&&ee.memoizedState!==null||br;ee=Ip;var ye=br;if(Ip=M,(br=oe)&&!ye)for(nt=_;nt!==null;)M=nt,oe=M.child,M.tag===22&&M.memoizedState!==null?fE(_):oe!==null?(oe.return=M,nt=oe):fE(_);for(;k!==null;)nt=k,cE(k),k=k.sibling;nt=_,Ip=ee,br=ye}uE(l)}else(_.subtreeFlags&8772)!==0&&k!==null?(k.return=_,nt=k):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:br||Mp(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!br)if(v===null)w.componentDidMount();else{var _=u.elementType===u.type?v.memoizedProps:Fa(u.type,v.memoizedProps);w.componentDidUpdate(_,v.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var k=u.updateQueue;k!==null&&dA(u,k,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 oe=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":oe.autoFocus&&v.focus();break;case"img":oe.src&&(v.src=oe.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 ke=ye.memoizedState;if(ke!==null){var Re=ke.dehydrated;Re!==null&&Tu(Re)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}br||u.flags&512&&Vx(u)}catch(Pe){Ln(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{Mp(4,u)}catch(oe){Ln(u,v,oe)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var _=u.return;try{w.componentDidMount()}catch(oe){Ln(u,_,oe)}}var k=u.return;try{Vx(u)}catch(oe){Ln(u,k,oe)}break;case 5:var M=u.return;try{Vx(u)}catch(oe){Ln(u,M,oe)}}}catch(oe){Ln(u,u.return,oe)}if(u===l){nt=null;break}var ee=u.sibling;if(ee!==null){ee.return=u.return,nt=ee;break}nt=u.return}}var Kq=Math.ceil,$p=E.ReactCurrentDispatcher,Gx=E.ReactCurrentOwner,wa=E.ReactCurrentBatchConfig,Zt=0,sr=null,Vn=null,fr=0,ta=0,Gl=To(0),Xn=0,ed=null,_i=0,Dp=0,Yx=0,td=null,$r=null,Xx=0,Yl=1/0,Vs=null,Lp=!1,Qx=null,Do=null,Fp=!1,Lo=null,Bp=0,nd=0,Jx=null,zp=-1,qp=0;function Nr(){return(Zt&6)!==0?Cn():zp!==-1?zp:zp=Cn()}function Fo(l){return(l.mode&1)===0?1:(Zt&2)!==0&&fr!==0?fr&-fr:kq.transition!==null?(qp===0&&(qp=So()),qp):(l=un,l!==0||(l=window.event,l=l===void 0?16:h_(l.type)),l)}function qa(l,u,v,w){if(50<nd)throw nd=0,Jx=null,Error(n(185));xi(l,v,w),((Zt&2)===0||l!==sr)&&(l===sr&&((Zt&2)===0&&(Dp|=v),Xn===4&&Bo(l,fr)),Dr(l,w),v===1&&Zt===0&&(u.mode&1)===0&&(Yl=Cn()+500,vp&&Ro()))}function Dr(l,u){var v=l.callbackNode;vr(l,u);var w=Pt(l,l===sr?fr:0);if(w===0)v!==null&&on(v),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(v!=null&&on(v),u===1)l.tag===0?Pq(hE.bind(null,l)):Z_(hE.bind(null,l)),Cq(function(){(Zt&6)===0&&Ro()}),v=null;else{switch(o_(w)){case 1:v=jo;break;case 4:v=Nu;break;case 16:v=Al;break;case 536870912:v=Qf;break;default:v=Al}v=jE(v,pE.bind(null,l))}l.callbackPriority=u,l.callbackNode=v}}function pE(l,u){if(zp=-1,qp=0,(Zt&6)!==0)throw Error(n(327));var v=l.callbackNode;if(Xl()&&l.callbackNode!==v)return null;var w=Pt(l,l===sr?fr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=Up(l,w);else{u=w;var _=Zt;Zt|=2;var k=vE();(sr!==l||fr!==u)&&(Vs=null,Yl=Cn()+500,Ei(l,u));do try{Xq();break}catch(ee){mE(l,ee)}while(!0);vx(),$p.current=k,Zt=_,Vn!==null?u=0:(sr=null,fr=0,u=Xn)}if(u!==0){if(u===2&&(_=fn(l),_!==0&&(w=_,u=Zx(l,_))),u===1)throw v=ed,Ei(l,0),Bo(l,w),Dr(l,Cn()),v;if(u===6)Bo(l,w);else{if(_=l.current.alternate,(w&30)===0&&!Gq(_)&&(u=Up(l,w),u===2&&(k=fn(l),k!==0&&(w=k,u=Zx(l,k))),u===1))throw v=ed,Ei(l,0),Bo(l,w),Dr(l,Cn()),v;switch(l.finishedWork=_,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:Pi(l,$r,Vs);break;case 3:if(Bo(l,w),(w&130023424)===w&&(u=Xx+500-Cn(),10<u)){if(Pt(l,0)!==0)break;if(_=l.suspendedLanes,(_&w)!==w){Nr(),l.pingedLanes|=l.suspendedLanes&_;break}l.timeoutHandle=sx(Pi.bind(null,l,$r,Vs),u);break}Pi(l,$r,Vs);break;case 4:if(Bo(l,w),(w&4194240)===w)break;for(u=l.eventTimes,_=-1;0<w;){var M=31-Qr(w);k=1<<M,M=u[M],M>_&&(_=M),w&=~k}if(w=_,w=Cn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*Kq(w/1960))-w,10<w){l.timeoutHandle=sx(Pi.bind(null,l,$r,Vs),w);break}Pi(l,$r,Vs);break;case 5:Pi(l,$r,Vs);break;default:throw Error(n(329))}}}return Dr(l,Cn()),l.callbackNode===v?pE.bind(null,l):null}function Zx(l,u){var v=td;return l.current.memoizedState.isDehydrated&&(Ei(l,u).flags|=256),l=Up(l,u),l!==2&&(u=$r,$r=v,u!==null&&ey(u)),l}function ey(l){$r===null?$r=l:$r.push.apply($r,l)}function Gq(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],k=_.getSnapshot;_=_.value;try{if(!Da(k(),_))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 Bo(l,u){for(u&=~Yx,u&=~Dp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var v=31-Qr(u),w=1<<v;l[v]=-1,u&=~w}}function hE(l){if((Zt&6)!==0)throw Error(n(327));Xl();var u=Pt(l,0);if((u&1)===0)return Dr(l,Cn()),null;var v=Up(l,u);if(l.tag!==0&&v===2){var w=fn(l);w!==0&&(u=w,v=Zx(l,w))}if(v===1)throw v=ed,Ei(l,0),Bo(l,u),Dr(l,Cn()),v;if(v===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,Pi(l,$r,Vs),Dr(l,Cn()),null}function ty(l,u){var v=Zt;Zt|=1;try{return l(u)}finally{Zt=v,Zt===0&&(Yl=Cn()+500,vp&&Ro())}}function Ai(l){Lo!==null&&Lo.tag===0&&(Zt&6)===0&&Xl();var u=Zt;Zt|=1;var v=wa.transition,w=un;try{if(wa.transition=null,un=1,l)return l()}finally{un=w,wa.transition=v,Zt=u,(Zt&6)===0&&Ro()}}function ny(){ta=Gl.current,En(Gl)}function Ei(l,u){l.finishedWork=null,l.finishedLanes=0;var v=l.timeoutHandle;if(v!==-1&&(l.timeoutHandle=-1,Nq(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&&hp();break;case 3:Vl(),En(Rr),En(gr),Nx();break;case 5:jx(w);break;case 4:Vl();break;case 13:En(In);break;case 19:En(In);break;case 10:gx(w.type._context);break;case 22:case 23:ny()}v=v.return}if(sr=l,Vn=l=zo(l.current,null),fr=ta=u,Xn=0,ed=null,Yx=Dp=_i=0,$r=td=null,Si!==null){for(u=0;u<Si.length;u++)if(v=Si[u],w=v.interleaved,w!==null){v.interleaved=null;var _=w.next,k=v.pending;if(k!==null){var M=k.next;k.next=_,w.next=M}v.pending=w}Si=null}return l}function mE(l,u){do{var v=Vn;try{if(vx(),_p.current=kp,Ap){for(var w=Mn.memoizedState;w!==null;){var _=w.queue;_!==null&&(_.pending=null),w=w.next}Ap=!1}if(Ci=0,ar=Yn=Mn=null,Gu=!1,Yu=0,Gx.current=null,v===null||v.return===null){Xn=1,ed=u,Vn=null;break}e:{var k=l,M=v.return,ee=v,oe=u;if(u=fr,ee.flags|=32768,oe!==null&&typeof oe=="object"&&typeof oe.then=="function"){var ye=oe,ke=ee,Re=ke.tag;if((ke.mode&1)===0&&(Re===0||Re===11||Re===15)){var Pe=ke.alternate;Pe?(ke.updateQueue=Pe.updateQueue,ke.memoizedState=Pe.memoizedState,ke.lanes=Pe.lanes):(ke.updateQueue=null,ke.memoizedState=null)}var et=BA(M);if(et!==null){et.flags&=-257,zA(et,M,ee,k,u),et.mode&1&&FA(k,ye,u),u=et,oe=ye;var ot=u.updateQueue;if(ot===null){var ct=new Set;ct.add(oe),u.updateQueue=ct}else ot.add(oe);break e}else{if((u&1)===0){FA(k,ye,u),ry();break e}oe=Error(n(426))}}else if(On&&ee.mode&1){var Un=BA(M);if(Un!==null){(Un.flags&65536)===0&&(Un.flags|=256),zA(Un,M,ee,k,u),hx(Hl(oe,ee));break e}}k=oe=Hl(oe,ee),Xn!==4&&(Xn=2),td===null?td=[k]:td.push(k),k=M;do{switch(k.tag){case 3:k.flags|=65536,u&=-u,k.lanes|=u;var me=DA(k,oe,u);uA(k,me);break e;case 1:ee=oe;var le=k.type,ge=k.stateNode;if((k.flags&128)===0&&(typeof le.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(Do===null||!Do.has(ge)))){k.flags|=65536,u&=-u,k.lanes|=u;var De=LA(k,ee,u);uA(k,De);break e}}k=k.return}while(k!==null)}xE(v)}catch(dt){u=dt,Vn===v&&v!==null&&(Vn=v=v.return);continue}break}while(!0)}function vE(){var l=$p.current;return $p.current=kp,l===null?kp:l}function ry(){(Xn===0||Xn===3||Xn===2)&&(Xn=4),sr===null||(_i&268435455)===0&&(Dp&268435455)===0||Bo(sr,fr)}function Up(l,u){var v=Zt;Zt|=2;var w=vE();(sr!==l||fr!==u)&&(Vs=null,Ei(l,u));do try{Yq();break}catch(_){mE(l,_)}while(!0);if(vx(),Zt=v,$p.current=w,Vn!==null)throw Error(n(261));return sr=null,fr=0,Xn}function Yq(){for(;Vn!==null;)gE(Vn)}function Xq(){for(;Vn!==null&&!Jt();)gE(Vn)}function gE(l){var u=wE(l.alternate,l,ta);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=qq(v,u,ta),v!==null){Vn=v;return}}else{if(v=Uq(v,u),v!==null){v.flags&=32767,Vn=v;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Xn=6,Vn=null;return}}if(u=u.sibling,u!==null){Vn=u;return}Vn=u=l}while(u!==null);Xn===0&&(Xn=5)}function Pi(l,u,v){var w=un,_=wa.transition;try{wa.transition=null,un=1,Qq(l,u,v,w)}finally{wa.transition=_,un=w}return null}function Qq(l,u,v,w){do Xl();while(Lo!==null);if((Zt&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 k=v.lanes|v.childLanes;if(Cu(l,k),l===sr&&(Vn=sr=null,fr=0),(v.subtreeFlags&2064)===0&&(v.flags&2064)===0||Fp||(Fp=!0,jE(Al,function(){return Xl(),null})),k=(v.flags&15990)!==0,(v.subtreeFlags&15990)!==0||k){k=wa.transition,wa.transition=null;var M=un;un=1;var ee=Zt;Zt|=4,Gx.current=null,Vq(l,v),lE(v,l),gq(rx),ep=!!nx,rx=nx=null,l.current=v,Hq(v),qn(),Zt=ee,un=M,wa.transition=k}else l.current=v;if(Fp&&(Fp=!1,Lo=l,Bp=_),k=l.pendingLanes,k===0&&(Do=null),Rg(v.stateNode),Dr(l,Cn()),u!==null)for(w=l.onRecoverableError,v=0;v<u.length;v++)_=u[v],w(_.value,{componentStack:_.stack,digest:_.digest});if(Lp)throw Lp=!1,l=Qx,Qx=null,l;return(Bp&1)!==0&&l.tag!==0&&Xl(),k=l.pendingLanes,(k&1)!==0?l===Jx?nd++:(nd=0,Jx=l):nd=0,Ro(),null}function Xl(){if(Lo!==null){var l=o_(Bp),u=wa.transition,v=un;try{if(wa.transition=null,un=16>l?16:l,Lo===null)var w=!1;else{if(l=Lo,Lo=null,Bp=0,(Zt&6)!==0)throw Error(n(331));var _=Zt;for(Zt|=4,nt=l.current;nt!==null;){var k=nt,M=k.child;if((nt.flags&16)!==0){var ee=k.deletions;if(ee!==null){for(var oe=0;oe<ee.length;oe++){var ye=ee[oe];for(nt=ye;nt!==null;){var ke=nt;switch(ke.tag){case 0:case 11:case 15:Zu(8,ke,k)}var Re=ke.child;if(Re!==null)Re.return=ke,nt=Re;else for(;nt!==null;){ke=nt;var Pe=ke.sibling,et=ke.return;if(rE(ke),ke===ye){nt=null;break}if(Pe!==null){Pe.return=et,nt=Pe;break}nt=et}}}var ot=k.alternate;if(ot!==null){var ct=ot.child;if(ct!==null){ot.child=null;do{var Un=ct.sibling;ct.sibling=null,ct=Un}while(ct!==null)}}nt=k}}if((k.subtreeFlags&2064)!==0&&M!==null)M.return=k,nt=M;else e:for(;nt!==null;){if(k=nt,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:Zu(9,k,k.return)}var me=k.sibling;if(me!==null){me.return=k.return,nt=me;break e}nt=k.return}}var le=l.current;for(nt=le;nt!==null;){M=nt;var ge=M.child;if((M.subtreeFlags&2064)!==0&&ge!==null)ge.return=M,nt=ge;else e:for(M=le;nt!==null;){if(ee=nt,(ee.flags&2048)!==0)try{switch(ee.tag){case 0:case 11:case 15:Mp(9,ee)}}catch(dt){Ln(ee,ee.return,dt)}if(ee===M){nt=null;break e}var De=ee.sibling;if(De!==null){De.return=ee.return,nt=De;break e}nt=ee.return}}if(Zt=_,Ro(),va&&typeof va.onPostCommitFiberRoot=="function")try{va.onPostCommitFiberRoot(gi,l)}catch{}w=!0}return w}finally{un=v,wa.transition=u}}return!1}function yE(l,u,v){u=Hl(v,u),u=DA(l,u,1),l=Mo(l,u,1),u=Nr(),l!==null&&(xi(l,1,u),Dr(l,u))}function Ln(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"&&(Do===null||!Do.has(w))){l=Hl(v,l),l=LA(u,l,1),u=Mo(u,l,1),l=Nr(),u!==null&&(xi(u,1,l),Dr(u,l));break}}u=u.return}}function Jq(l,u,v){var w=l.pingCache;w!==null&&w.delete(u),u=Nr(),l.pingedLanes|=l.suspendedLanes&v,sr===l&&(fr&v)===v&&(Xn===4||Xn===3&&(fr&130023424)===fr&&500>Cn()-Xx?Ei(l,0):Yx|=v),Dr(l,u)}function bE(l,u){u===0&&((l.mode&1)===0?u=1:(u=Me,Me<<=1,(Me&130023424)===0&&(Me=4194304)));var v=Nr();l=qs(l,u),l!==null&&(xi(l,u,v),Dr(l,v))}function Zq(l){var u=l.memoizedState,v=0;u!==null&&(v=u.retryLane),bE(l,v)}function eU(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||Rr.current)Mr=!0;else{if((l.lanes&v)===0&&(u.flags&128)===0)return Mr=!1,zq(l,u,v);Mr=(l.flags&131072)!==0}else Mr=!1,On&&(u.flags&1048576)!==0&&eA(u,xp,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;Rp(l,u),l=u.pendingProps;var _=Ll(u,gr.current);Wl(u,v),_=Ax(null,u,w,l,_,v);var k=Ex();return u.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Ir(w)?(k=!0,mp(u)):k=!1,u.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,bx(u),_.updater=Tp,u.stateNode=_,_._reactInternals=u,Ix(u,w,l,v),u=Lx(null,u,w,!0,k,v)):(u.tag=0,On&&k&&ux(u),Sr(null,u,_,v),u=u.child),u;case 16:w=u.elementType;e:{switch(Rp(l,u),l=u.pendingProps,_=w._init,w=_(w._payload),u.type=w,_=u.tag=nU(w),l=Fa(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,Fa(w.type,l),v);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Fa(w,_),Dx(l,u,w,_,v);case 1:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Fa(w,_),KA(l,u,w,_,v);case 3:e:{if(GA(u),l===null)throw Error(n(387));w=u.pendingProps,k=u.memoizedState,_=k.element,cA(l,u),Np(u,w,null,v);var M=u.memoizedState;if(w=M.element,k.isDehydrated)if(k={element:w,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){_=Hl(Error(n(423)),u),u=YA(l,u,w,v,_);break e}else if(w!==_){_=Hl(Error(n(424)),u),u=YA(l,u,w,v,_);break e}else for(ea=ko(u.stateNode.containerInfo.firstChild),Zr=u,On=!0,La=null,v=iA(u,null,w,v),u.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(zl(),w===_){u=Ws(l,u,v);break e}Sr(l,u,w,v)}u=u.child}return u;case 5:return fA(u),l===null&&px(u),w=u.type,_=u.pendingProps,k=l!==null?l.memoizedProps:null,M=_.children,ax(w,_)?M=null:k!==null&&ax(w,k)&&(u.flags|=32),HA(l,u),Sr(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=ql(u,null,w,v):Sr(l,u,w,v),u.child;case 11:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Fa(w,_),qA(l,u,w,_,v);case 7:return Sr(l,u,u.pendingProps,v),u.child;case 8:return Sr(l,u,u.pendingProps.children,v),u.child;case 12:return Sr(l,u,u.pendingProps.children,v),u.child;case 10:e:{if(w=u.type._context,_=u.pendingProps,k=u.memoizedProps,M=_.value,yn(wp,w._currentValue),w._currentValue=M,k!==null)if(Da(k.value,M)){if(k.children===_.children&&!Rr.current){u=Ws(l,u,v);break e}}else for(k=u.child,k!==null&&(k.return=u);k!==null;){var ee=k.dependencies;if(ee!==null){M=k.child;for(var oe=ee.firstContext;oe!==null;){if(oe.context===w){if(k.tag===1){oe=Us(-1,v&-v),oe.tag=2;var ye=k.updateQueue;if(ye!==null){ye=ye.shared;var ke=ye.pending;ke===null?oe.next=oe:(oe.next=ke.next,ke.next=oe),ye.pending=oe}}k.lanes|=v,oe=k.alternate,oe!==null&&(oe.lanes|=v),xx(k.return,v,u),ee.lanes|=v;break}oe=oe.next}}else if(k.tag===10)M=k.type===u.type?null:k.child;else if(k.tag===18){if(M=k.return,M===null)throw Error(n(341));M.lanes|=v,ee=M.alternate,ee!==null&&(ee.lanes|=v),xx(M,v,u),M=k.sibling}else M=k.child;if(M!==null)M.return=k;else for(M=k;M!==null;){if(M===u){M=null;break}if(k=M.sibling,k!==null){k.return=M.return,M=k;break}M=M.return}k=M}Sr(l,u,_.children,v),u=u.child}return u;case 9:return _=u.type,w=u.pendingProps.children,Wl(u,v),_=ya(_),w=w(_),u.flags|=1,Sr(l,u,w,v),u.child;case 14:return w=u.type,_=Fa(w,u.pendingProps),_=Fa(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?_:Fa(w,_),Rp(l,u),u.tag=1,Ir(w)?(l=!0,mp(u)):l=!1,Wl(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 Ke(l,u)}function tU(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 tU(l,u,v,w)}function ay(l){return l=l.prototype,!(!l||!l.isReactComponent)}function nU(l){if(typeof l=="function")return ay(l)?1:0;if(l!=null){if(l=l.$$typeof,l===B)return 11;if(l===I)return 14}return 2}function zo(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 Wp(l,u,v,w,_,k){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 T:return ki(v.children,_,k,u);case O:M=8,_|=8;break;case $:return l=ja(12,v,u,_|2),l.elementType=$,l.lanes=k,l;case V:return l=ja(13,v,u,_),l.elementType=V,l.lanes=k,l;case q:return l=ja(19,v,u,_),l.elementType=q,l.lanes=k,l;case X:return Vp(v,_,k,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case z:M=10;break e;case U:M=9;break e;case B:M=11;break e;case I: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=k,u}function ki(l,u,v,w){return l=ja(7,l,w,u),l.lanes=v,l}function Vp(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 rU(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=El(0),this.expirationTimes=El(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=El(0),this.identifierPrefix=w,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function iy(l,u,v,w,_,k,M,ee,oe){return l=new rU(l,u,v,ee,oe),u===1?(u=1,k===!0&&(u|=8)):u=0,k=ja(3,null,null,u),l.current=k,k.stateNode=l,k.memoizedState={element:w,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},bx(k),l}function aU(l,u,v){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:w==null?null:""+w,children:l,containerInfo:u,implementation:v}}function SE(l){if(!l)return Oo;l=l._reactInternals;e:{if(He(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(Ir(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(Ir(v))return Q_(l,v,u)}return u}function NE(l,u,v,w,_,k,M,ee,oe){return l=iy(v,w,!0,l,_,k,M,ee,oe),l.context=SE(null),v=l.current,w=Nr(),_=Fo(v),k=Us(w,_),k.callback=u??null,Mo(v,k,_),l.current.lanes=_,xi(l,_,w),Dr(l,w),l}function Hp(l,u,v,w){var _=u.current,k=Nr(),M=Fo(_);return v=SE(v),u.context===null?u.context=v:u.pendingContext=v,u=Us(k,M),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=Mo(_,u,M),l!==null&&(qa(l,_,M,k),Sp(l,_,M)),M}function Kp(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 sU(){return null}var _E=typeof reportError=="function"?reportError:function(l){console.error(l)};function cy(l){this._internalRoot=l}Gp.prototype.render=cy.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));Hp(l,u,null,null)},Gp.prototype.unmount=cy.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;Ai(function(){Hp(null,l,null,null)}),u[Ls]=null}};function Gp(l){this._internalRoot=l}Gp.prototype.unstable_scheduleHydration=function(l){if(l){var u=c_();l={blockedOn:null,target:l,priority:u};for(var v=0;v<Ao.length&&u!==0&&u<Ao[v].priority;v++);Ao.splice(v,0,l),v===0&&f_(l)}};function uy(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Yp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function AE(){}function oU(l,u,v,w,_){if(_){if(typeof w=="function"){var k=w;w=function(){var ye=Kp(M);k.call(ye)}}var M=NE(u,w,l,0,null,!1,!1,"",AE);return l._reactRootContainer=M,l[Ls]=M.current,Bu(l.nodeType===8?l.parentNode:l),Ai(),M}for(;_=l.lastChild;)l.removeChild(_);if(typeof w=="function"){var ee=w;w=function(){var ye=Kp(oe);ee.call(ye)}}var oe=iy(l,0,!1,null,null,!1,!1,"",AE);return l._reactRootContainer=oe,l[Ls]=oe.current,Bu(l.nodeType===8?l.parentNode:l),Ai(function(){Hp(u,oe,v,w)}),oe}function Xp(l,u,v,w,_){var k=v._reactRootContainer;if(k){var M=k;if(typeof _=="function"){var ee=_;_=function(){var oe=Kp(M);ee.call(oe)}}Hp(u,M,l,_)}else M=oU(v,u,l,_,w);return Kp(M)}i_=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var v=Wt(u.pendingLanes);v!==0&&(_u(u,v|1),Dr(u,Cn()),(Zt&6)===0&&(Yl=Cn()+500,Ro()))}break;case 13:Ai(function(){var w=qs(l,1);if(w!==null){var _=Nr();qa(w,l,1,_)}}),ly(l,1)}},Mg=function(l){if(l.tag===13){var u=qs(l,134217728);if(u!==null){var v=Nr();qa(u,l,134217728,v)}ly(l,134217728)}},l_=function(l){if(l.tag===13){var u=Fo(l),v=qs(l,u);if(v!==null){var w=Nr();qa(v,l,u,w)}ly(l,u)}},c_=function(){return un},u_=function(l,u){var v=un;try{return un=l,u()}finally{un=v}},zt=function(l,u,v){switch(u){case"input":if(ie(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 _=pp(w);if(!_)throw Error(n(90));ae(w),ie(w,_)}}}break;case"textarea":Bt(l,v);break;case"select":u=v.value,u!=null&&pt(l,!!v.multiple,u,!1)}},Tt=ty,Dt=Ai;var iU={usingClientEntryPoint:!1,Events:[Uu,$l,pp,mr,ht,ty]},rd={findFiberByHostInstance:yi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},lU={bundleType:rd.bundleType,version:rd.version,rendererPackageName:rd.rendererPackageName,rendererConfig:rd.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=Ut(l),l===null?null:l.stateNode},findFiberByHostInstance:rd.findFiberByHostInstance||sU,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 Qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qp.isDisabled&&Qp.supportsFiber)try{gi=Qp.inject(lU),va=Qp}catch{}}return Lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iU,Lr.createPortal=function(l,u){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uy(u))throw Error(n(200));return aU(l,u,null,v)},Lr.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[Ls]=u.current,Bu(l.nodeType===8?l.parentNode:l),new cy(u)},Lr.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=Ut(u),l=l===null?null:l.stateNode,l},Lr.flushSync=function(l){return Ai(l)},Lr.hydrate=function(l,u,v){if(!Yp(u))throw Error(n(200));return Xp(null,l,u,!0,v)},Lr.hydrateRoot=function(l,u,v){if(!uy(l))throw Error(n(405));var w=v!=null&&v.hydratedSources||null,_=!1,k="",M=_E;if(v!=null&&(v.unstable_strictMode===!0&&(_=!0),v.identifierPrefix!==void 0&&(k=v.identifierPrefix),v.onRecoverableError!==void 0&&(M=v.onRecoverableError)),u=NE(u,null,l,1,v??null,_,!1,k,M),l[Ls]=u.current,Bu(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 Gp(u)},Lr.render=function(l,u,v){if(!Yp(u))throw Error(n(200));return Xp(null,l,u,!1,v)},Lr.unmountComponentAtNode=function(l){if(!Yp(l))throw Error(n(40));return l._reactRootContainer?(Ai(function(){Xp(null,null,l,!1,function(){l._reactRootContainer=null,l[Ls]=null})}),!0):!1},Lr.unstable_batchedUpdates=ty,Lr.unstable_renderSubtreeIntoContainer=function(l,u,v,w){if(!Yp(v))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return Xp(l,u,v,!1,w)},Lr.version="18.3.1-next-f1338f8080-20240426",Lr}var ME;function w$(){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=vU(),py.exports}var $E;function gU(){if($E)return Zp;$E=1;var e=w$();return Zp.createRoot=e.createRoot,Zp.hydrateRoot=e.hydrateRoot,Zp}var xU=gU(),m=rN();const G=dn(m),Zm=uU({__proto__:null,default:G},[m]),yU=1,bU=1e6;let vy=0;function wU(){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),Sd({type:"REMOVE_TOAST",toastId:e})},bU);gy.set(e,t)},jU=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,yU)};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)}}},Ch=[];let _h={toasts:[]};function Sd(e){_h=jU(_h,e),Ch.forEach(t=>{t(_h)})}function Ae({...e}){const t=wU(),n=s=>Sd({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Sd({type:"DISMISS_TOAST",toastId:t});return Sd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function SU(){const[e,t]=m.useState(_h);return m.useEffect(()=>(Ch.push(t),()=>{const n=Ch.indexOf(t);n>-1&&Ch.splice(n,1)}),[e]),{...e,toast:Ae,dismiss:n=>Sd({type:"DISMISS_TOAST",toastId:n})}}var su=w$();const j$=dn(su);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 Tr(...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(Tr(...e),e)}function NU(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:g,children:x,...j}=p,b=g?.[e]?.[d]||c,y=m.useMemo(()=>j,Object.values(j));return a.jsx(b.Provider,{value:y,children:x})};f.displayName=o+"Provider";function h(p,g){const x=g?.[e]?.[d]||c,j=m.useContext(x);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,CU(s,...t)]}function CU(...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=_U(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(EU);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 _U(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=kU(s),c=PU(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Tr(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 AU=Symbol("radix.slottable");function EU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AU}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 kU(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Sf(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=G.useRef(null),N=G.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=G.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",g=FE(h),x=G.forwardRef((b,y)=>{const{scope:S,children:C,...N}=b,E=G.useRef(null),A=wt(y,E),P=o(h,S);return G.useEffect(()=>(P.itemMap.set(E,{ref:E,...N}),()=>{P.itemMap.delete(E)})),a.jsx(g,{[p]:"",ref:A,children:C})});x.displayName=h;function j(b){const y=o(e+"CollectionConsumer",b);return G.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const N=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((P,T)=>N.indexOf(P.ref.current)-N.indexOf(T.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:f,ItemSlot:x},j,r]}function TU(e){const t=OU(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(IU);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 OU(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=$U(s),c=MU(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Tr(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 RU=Symbol("radix.slottable");function IU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===RU}function MU(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 $U(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 DU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ge=DU.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&&su.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 LU(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 FU="DismissableLayer",Kj="dismissableLayer.update",BU="dismissableLayer.pointerDownOutside",zU="dismissableLayer.focusOutside",BE,S$=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ml=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:c,...d}=e,f=m.useContext(S$),[h,p]=m.useState(null),g=h?.ownerDocument??globalThis?.document,[,x]=m.useState({}),j=wt(t,T=>p(T)),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=UU(T=>{const O=T.target,$=[...f.branches].some(z=>z.contains(O));!E||$||(s?.(T),i?.(T),T.defaultPrevented||c?.())},g),P=WU(T=>{const O=T.target;[...f.branches].some(z=>z.contains(O))||(o?.(T),i?.(T),T.defaultPrevented||c?.())},g);return LU(T=>{C===f.layers.size-1&&(r?.(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},g),m.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(BE=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),zE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=BE)}},[h,g,n,f]),m.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),zE())},[h,f]),m.useEffect(()=>{const T=()=>x({});return document.addEventListener(Kj,T),()=>document.removeEventListener(Kj,T)},[]),a.jsx(Ge.div,{...d,ref:j,style:{pointerEvents:N?E?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,A.onPointerDownCapture)})});ml.displayName=FU;var qU="DismissableLayerBranch",N$=m.forwardRef((e,t)=>{const n=m.useContext(S$),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(Ge.div,{...e,ref:s})});N$.displayName=qU;function UU(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(){C$(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 WU(e,t=globalThis?.document){const n=Wn(e),r=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!r.current&&C$(zU,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 zE(){const e=new CustomEvent(Kj);document.dispatchEvent(e)}function C$(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 VU=ml,HU=N$,nr=globalThis?.document?m.useLayoutEffect:()=>{},KU="Portal",vl=m.forwardRef((e,t)=>{const{container:n,...r}=e,[s,o]=m.useState(!1);nr(()=>o(!0),[]);const i=n||s&&globalThis?.document?.body;return i?j$.createPortal(a.jsx(Ge.div,{...r,ref:t}),i):null});vl.displayName=KU;function GU(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Gn=e=>{const{present:t,children:n}=e,r=YU(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=wt(r.ref,XU(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:o}):null};Gn.displayName="Presence";function YU(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),o=m.useRef("none"),i=e?"mounted":"unmounted",[c,d]=GU(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const f=eh(r.current);o.current=c==="mounted"?f:"none"},[c]),nr(()=>{const f=r.current,h=s.current;if(h!==e){const g=o.current,x=eh(f);e?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&g!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),nr(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=x=>{const b=eh(r.current).includes(CSS.escape(x.animationName));if(x.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)})}},g=x=>{x.target===t&&(o.current=eh(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:m.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function eh(e){return e?.animationName||"none"}function XU(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 QU=Zm[" useInsertionEffect ".trim().toString()]||nr;function pa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,i]=JU({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=ZU(h)?h(e):h;p!==e&&i.current?.(p)}else o(h)},[c,e,o,i]);return[d,f]}function JU({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),o=m.useRef(t);return QU(()=>{o.current=t},[t]),m.useEffect(()=>{s.current!==n&&(o.current?.(n),s.current=n)},[n,s]),[n,r,o]}function ZU(e){return typeof e=="function"}var _$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),e7="VisuallyHidden",ev=m.forwardRef((e,t)=>a.jsx(Ge.span,{...e,ref:t,style:{..._$,...e.style}}));ev.displayName=e7;var t7=ev,sN="ToastProvider",[oN,n7,r7]=Sf("Toast"),[A$]=hr("Toast",[r7]),[a7,tv]=A$(sN),E$=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),g=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(a7,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:o,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:m.useCallback(()=>h(x=>x+1),[]),onToastRemove:m.useCallback(()=>h(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g,children:i})})};E$.displayName=sN;var P$="ToastViewport",s7=["F8"],Gj="toast.viewportPause",Yj="toast.viewportResume",k$=m.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=s7,label:s="Notifications ({hotkey})",...o}=e,i=tv(P$,n),c=n7(n),d=m.useRef(null),f=m.useRef(null),h=m.useRef(null),p=m.useRef(null),g=wt(t,p,i.onViewportChange),x=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 P=new CustomEvent(Gj);S.dispatchEvent(P),i.isClosePausedRef.current=!0}},N=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Yj);S.dispatchEvent(P),i.isClosePausedRef.current=!1}},E=P=>{!y.contains(P.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,...x7(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,P=C.shiftKey;if(C.target===y&&P){f.current?.focus();return}const $=b({tabbingDirection:P?"backwards":"forwards"}),z=$.findIndex(U=>U===A);xy($.slice(z+1))?C.preventDefault():P?f.current?.focus():h.current?.focus()}};return y.addEventListener("keydown",S),()=>y.removeEventListener("keydown",S)}},[c,b]),a.jsxs(HU,{ref:d,role:"region","aria-label":s.replace("{hotkey}",x),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(Ge.ol,{tabIndex:-1,...o,ref:g})}),j&&a.jsx(Xj,{ref:h,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"backwards"});xy(y)}})]})});k$.displayName=P$;var T$="ToastFocusProxy",Xj=m.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,o=tv(T$,n);return a.jsx(ev,{tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{const c=i.relatedTarget;!o.viewport?.contains(c)&&r()}})});Xj.displayName=T$;var Nf="Toast",o7="toast.swipeStart",i7="toast.swipeMove",l7="toast.swipeCancel",c7="toast.swipeEnd",O$=m.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:o,...i}=e,[c,d]=pa({prop:r,defaultProp:s??!0,onChange:o,caller:Nf});return a.jsx(Gn,{present:n||c,children:a.jsx(f7,{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)})})})});O$.displayName=Nf;var[u7,d7]=A$(Nf,{onClose(){}}),f7=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:g,onSwipeEnd:x,...j}=e,b=tv(Nf,n),[y,S]=m.useState(null),C=wt(t,q=>S(q)),N=m.useRef(null),E=m.useRef(null),A=s||b.duration,P=m.useRef(0),T=m.useRef(A),O=m.useRef(0),{onToastAdd:$,onToastRemove:z}=b,U=Wn(()=>{y?.contains(document.activeElement)&&b.viewport?.focus(),i()}),B=m.useCallback(q=>{!q||q===1/0||(window.clearTimeout(O.current),P.current=new Date().getTime(),O.current=window.setTimeout(U,q))},[U]);m.useEffect(()=>{const q=b.viewport;if(q){const I=()=>{B(T.current),f?.()},W=()=>{const X=new Date().getTime()-P.current;T.current=T.current-X,window.clearTimeout(O.current),d?.()};return q.addEventListener(Gj,W),q.addEventListener(Yj,I),()=>{q.removeEventListener(Gj,W),q.removeEventListener(Yj,I)}}},[b.viewport,A,d,f,B]),m.useEffect(()=>{o&&!b.isClosePausedRef.current&&B(A)},[o,A,b.isClosePausedRef,B]),m.useEffect(()=>($(),()=>z()),[$,z]);const V=m.useMemo(()=>y?F$(y):null,[y]);return b.viewport?a.jsxs(a.Fragment,{children:[V&&a.jsx(p7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:V}),a.jsx(u7,{scope:n,onClose:U,children:su.createPortal(a.jsx(oN.ItemSlot,{scope:n,children:a.jsx(VU,{asChild:!0,onEscapeKeyDown:Te(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||U(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(Ge.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,q=>{q.key==="Escape"&&(c?.(q.nativeEvent),q.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,U()))}),onPointerDown:Te(e.onPointerDown,q=>{q.button===0&&(N.current={x:q.clientX,y:q.clientY})}),onPointerMove:Te(e.onPointerMove,q=>{if(!N.current)return;const I=q.clientX-N.current.x,W=q.clientY-N.current.y,X=!!E.current,K=["left","right"].includes(b.swipeDirection),F=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,J=K?F(0,I):0,D=K?0:F(0,W),R=q.pointerType==="touch"?10:2,ne={x:J,y:D},te={originalEvent:q,delta:ne};X?(E.current=ne,th(i7,p,te,{discrete:!1})):qE(ne,b.swipeDirection,R)?(E.current=ne,th(o7,h,te,{discrete:!1}),q.target.setPointerCapture(q.pointerId)):(Math.abs(I)>R||Math.abs(W)>R)&&(N.current=null)}),onPointerUp:Te(e.onPointerUp,q=>{const I=E.current,W=q.target;if(W.hasPointerCapture(q.pointerId)&&W.releasePointerCapture(q.pointerId),E.current=null,N.current=null,I){const X=q.currentTarget,K={originalEvent:q,delta:I};qE(I,b.swipeDirection,b.swipeThreshold)?th(c7,x,K,{discrete:!0}):th(l7,g,K,{discrete:!0}),X.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),p7=e=>{const{__scopeToast:t,children:n,...r}=e,s=tv(Nf,t),[o,i]=m.useState(!1),[c,d]=m.useState(!1);return v7(()=>i(!0)),m.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:a.jsx(vl,{asChild:!0,children:a.jsx(ev,{...r,children:o&&a.jsxs(a.Fragment,{children:[s.label," ",n]})})})},h7="ToastTitle",R$=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(Ge.div,{...r,ref:t})});R$.displayName=h7;var m7="ToastDescription",I$=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(Ge.div,{...r,ref:t})});I$.displayName=m7;var M$="ToastAction",$$=m.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?a.jsx(L$,{altText:n,asChild:!0,children:a.jsx(iN,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${M$}\`. Expected non-empty \`string\`.`),null)});$$.displayName=M$;var D$="ToastClose",iN=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=d7(D$,n);return a.jsx(L$,{asChild:!0,children:a.jsx(Ge.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,s.onClose)})})});iN.displayName=D$;var L$=m.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return a.jsx(Ge.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function F$(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),g7(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(...F$(r))}}),t}function th(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 v7(e=()=>{}){const t=Wn(e);nr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function g7(e){return e.nodeType===e.ELEMENT_NODE}function x7(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 y7=E$,B$=k$,z$=O$,q$=R$,U$=I$,W$=$$,V$=iN;function H$(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=H$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Mt(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=H$(e))&&(r&&(r+=" "),r+=t);return r}const UE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,WE=Mt,gl=(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 g=UE(h)||UE(p);return s[f][g]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,g]=h;return g===void 0||(f[p]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:g,...x}=h;return Object.entries(x).every(j=>{let[b,y]=j;return Array.isArray(y)?y.includes({...o,...c}[b]):{...o,...c}[b]===y})?[...f,p,g]:f},[]);return WE(e,i,d,n?.class,n?.className)};const b7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),K$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var w7={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 j7=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,...w7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:K$("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(j7,{ref:o,iconNode:t,className:K$(`lucide-${b7(e)}`,r),...s}));return n.displayName=`${e}`,n};const G$=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 Y$=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 Qi=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 Nc=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 Cc=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 bs=it("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const mc=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 Xo=it("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const S7=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 vc=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 N7=it("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const C7=it("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);const po=it("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Cs=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 X$=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 nv=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 Ih=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 _7=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 Q$=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 J$=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 A7=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 E7=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 k7=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 Z$=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 O7=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 jr=it("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const eD=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 R7=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 tD=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 cc=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 I7=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 rv=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 Zs=it("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const so=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 ha=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 M7=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 $7=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 D7=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 Ah=it("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const nD=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 Oa=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 Eh=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 L7=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 _c=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 rD=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 Qa=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 _s=it("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pN="-",F7=e=>{const t=z7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const c=i.split(pN);return c[0]===""&&c.length!==1&&c.shift(),aD(c,t)||B7(i)},getConflictingClassGroupIds:(i,c)=>{const d=n[i]||[];return c&&r[i]?[...d,...r[i]]:d}}},aD=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?aD(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}},z7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return U7(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(q7(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},q7=e=>e.isThemeGetter,U7=(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,W7=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)}}},sD="!",V7=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 g=d.length===0?c:c.substring(h),x=g.startsWith(sD),j=x?g.substring(1):g,b=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:i}):i},H7=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},K7=e=>({cache:W7(e.cacheSize),parseClassName:V7(e),...F7(e)}),G7=/\s+/,Y7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],i=e.trim().split(G7);let c="";for(let d=i.length-1;d>=0;d-=1){const f=i[d],{modifiers:h,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:x}=n(f);let j=!!x,b=r(j?g.substring(0,x):g);if(!b){if(!j){c=f+(c.length>0?" "+c:c);continue}if(b=r(g),!b){c=f+(c.length>0?" "+c:c);continue}j=!1}const y=H7(h).join(":"),S=p?y+sD: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 X7(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=oD(t))&&(r&&(r+=" "),r+=n);return r}const oD=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=oD(e[r]))&&(n&&(n+=" "),n+=t);return n};function Q7(e,...t){let n,r,s,o=i;function i(d){const f=t.reduce((h,p)=>p(h),e());return n=K7(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=Y7(d,n);return s(d,h),h}return function(){return o(X7.apply(null,arguments))}}const Pn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},iD=/^\[(?:([a-z-]+):)?(.+)\]$/i,J7=/^\d+\/\d+$/,Z7=new Set(["px","full","screen"]),e9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,t9=/\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$/,n9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,r9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hs=e=>gc(e)||Z7.has(e)||J7.test(e),Uo=e=>ou(e,"length",f9),gc=e=>!!e&&!Number.isNaN(Number(e)),by=e=>ou(e,"number",gc),sd=e=>!!e&&Number.isInteger(Number(e)),s9=e=>e.endsWith("%")&&gc(e.slice(0,-1)),Ft=e=>iD.test(e),Wo=e=>e9.test(e),o9=new Set(["length","size","percentage"]),i9=e=>ou(e,o9,lD),l9=e=>ou(e,"position",lD),c9=new Set(["image","url"]),u9=e=>ou(e,c9,h9),d9=e=>ou(e,"",p9),od=()=>!0,ou=(e,t,n)=>{const r=iD.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},f9=e=>t9.test(e)&&!n9.test(e),lD=()=>!1,p9=e=>r9.test(e),h9=e=>a9.test(e),m9=()=>{const e=Pn("colors"),t=Pn("spacing"),n=Pn("blur"),r=Pn("brightness"),s=Pn("borderColor"),o=Pn("borderRadius"),i=Pn("borderSpacing"),c=Pn("borderWidth"),d=Pn("contrast"),f=Pn("grayscale"),h=Pn("hueRotate"),p=Pn("invert"),g=Pn("gap"),x=Pn("gradientColorStops"),j=Pn("gradientColorStopPositions"),b=Pn("inset"),y=Pn("margin"),S=Pn("opacity"),C=Pn("padding"),N=Pn("saturate"),E=Pn("scale"),A=Pn("sepia"),P=Pn("skew"),T=Pn("space"),O=Pn("translate"),$=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",Ft,t],B=()=>[Ft,t],V=()=>["",Hs,Uo],q=()=>["auto",gc,Ft],I=()=>["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"],K=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",Ft],J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[gc,Ft];return{cacheSize:500,separator:":",theme:{colors:[od],spacing:[Hs,Uo],blur:["none","",Wo,Ft],brightness:D(),borderColor:[e],borderRadius:["none","","full",Wo,Ft],borderSpacing:B(),borderWidth:V(),contrast:D(),grayscale:F(),hueRotate:D(),invert:F(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[s9,Uo],inset:U(),margin:U(),opacity:D(),padding:B(),saturate:D(),scale:D(),sepia:F(),skew:D(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",Ft]}],container:["container"],columns:[{columns:[Wo]}],"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:[...I(),Ft]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],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",sd,Ft]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ft]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",sd,Ft]}],"grid-cols":[{"grid-cols":[od]}],"col-start-end":[{col:["auto",{span:["full",sd,Ft]},Ft]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[od]}],"row-start-end":[{row:["auto",{span:[sd,Ft]},Ft]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ft]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ft]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"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":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ft,t]}],"min-w":[{"min-w":[Ft,t,"min","max","fit"]}],"max-w":[{"max-w":[Ft,t,"none","full","min","max","fit","prose",{screen:[Wo]},Wo]}],h:[{h:[Ft,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ft,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ft,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ft,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Wo,Uo]}],"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:[od]}],"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",Ft]}],"line-clamp":[{"line-clamp":["none",gc,by]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Hs,Ft]}],"list-image":[{"list-image":["none",Ft]}],"list-style-type":[{list:["none","disc","decimal",Ft]}],"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",Hs,Uo]}],"underline-offset":[{"underline-offset":["auto",Hs,Ft]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ft]}],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",Ft]}],"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:[...I(),l9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",i9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},u9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[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":[Hs,Ft]}],"outline-w":[{outline:[Hs,Uo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Hs,Uo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Wo,d9]}],"shadow-color":[{shadow:[od]}],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",Wo,Ft]}],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",Ft]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",Ft]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ft]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[sd,Ft]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ft]}],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",Ft]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ft]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Hs,Uo,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"]}}},v9=Q7(m9);function Se(...e){return v9(Mt(e))}const g9=y7,cD=m.forwardRef(({className:e,...t},n)=>a.jsx(B$,{ref:n,className:Se("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}));cD.displayName=B$.displayName;const x9=gl("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"}}),uD=m.forwardRef(({className:e,variant:t,...n},r)=>a.jsx(z$,{ref:r,className:Se(x9({variant:t}),e),...n}));uD.displayName=z$.displayName;const y9=m.forwardRef(({className:e,...t},n)=>a.jsx(W$,{ref:n,className:Se("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}));y9.displayName=W$.displayName;const dD=m.forwardRef(({className:e,...t},n)=>a.jsx(V$,{ref:n,className:Se("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(_s,{className:"h-4 w-4"})}));dD.displayName=V$.displayName;const fD=m.forwardRef(({className:e,...t},n)=>a.jsx(q$,{ref:n,className:Se("text-sm font-semibold",e),...t}));fD.displayName=q$.displayName;const pD=m.forwardRef(({className:e,...t},n)=>a.jsx(U$,{ref:n,className:Se("text-sm opacity-90",e),...t}));pD.displayName=U$.displayName;function b9(){const{toasts:e}=SU();return a.jsxs(g9,{children:[e.map(function({id:t,title:n,description:r,action:s,...o}){return a.jsxs(uD,{...o,children:[a.jsxs("div",{className:"grid gap-1",children:[n&&a.jsx(fD,{children:n}),r&&a.jsx(pD,{children:r})]}),s,a.jsx(dD,{})]},t)}),a.jsx(cD,{})]})}var GE=["light","dark"],w9="(prefers-color-scheme: dark)",j9=m.createContext(void 0),S9={setTheme:e=>{},themes:[]},N9=()=>{var e;return(e=m.useContext(j9))!=null?e:S9};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":"",g=(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},x=e?`!function(){${h}${g(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${w9}',m=window.matchMedia(t);if(m.media!==t||m.matches){${g("dark")}}else{${g("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${g(i?"x[e]":"e",!0)}}${f?"":"else{"+g(o,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${g(i?"x[e]":"e",!0)}}else{${g(o,!1,!1)};}${p}}catch(t){}}();`;return m.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:x}})});var C9=e=>{switch(e){case"success":return E9;case"info":return k9;case"warning":return P9;case"error":return T9;default:return null}},_9=Array(12).fill(0),A9=({visible:e,className:t})=>G.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},G.createElement("div",{className:"sonner-spinner"},_9.map((n,r)=>G.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),E9=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},G.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=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},G.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"})),k9=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},G.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=G.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},G.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"})),O9=G.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"},G.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),G.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),R9=()=>{let[e,t]=G.useState(document.hidden);return G.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},nS=1,I9=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],G.isValidElement(d))s=!1,this.create({id:n,type:"default",message:d});else if($9(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}},Fr=new I9,M9=(e,t)=>{let n=t?.id||nS++;return Fr.addToast({title:e,...t,id:n}),n},$9=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",D9=M9,L9=()=>Fr.toasts,F9=()=>Fr.getActiveToasts();Object.assign(D9,{success:Fr.success,info:Fr.info,warning:Fr.warning,error:Fr.error,custom:Fr.custom,message:Fr.message,promise:Fr.promise,dismiss:Fr.dismiss,loading:Fr.loading},{getHistory:L9,getToasts:F9});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 nh(e){return e.label!==void 0}var z9=3,q9="32px",U9="16px",YE=4e3,W9=356,V9=14,H9=20,K9=200;function Ua(...e){return e.filter(Boolean).join(" ")}function G9(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Y9=e=>{var t,n,r,s,o,i,c,d,f,h,p;let{invert:g,toast:x,unstyled:j,interacting:b,setHeights:y,visibleToasts:S,heights:C,index:N,toasts:E,expanded:A,removeToast:P,defaultRichColors:T,closeButton:O,style:$,cancelButtonStyle:z,actionButtonStyle:U,className:B="",descriptionClassName:V="",duration:q,position:I,gap:W,loadingIcon:X,expandByDefault:K,classNames:F,icons:J,closeButtonAriaLabel:D="Close toast",pauseWhenPageIsHidden:R}=e,[ne,te]=G.useState(null),[de,he]=G.useState(null),[H,ue]=G.useState(!1),[Q,Z]=G.useState(!1),[fe,ae]=G.useState(!1),[Oe,we]=G.useState(!1),[Ye,L]=G.useState(!1),[ie,pe]=G.useState(0),[Ee,Xe]=G.useState(0),pt=G.useRef(x.duration||q||YE),vt=G.useRef(null),gt=G.useRef(null),Bt=N===0,Lt=N+1<=S,$t=x.type,Ot=x.dismissible!==!1,Ce=x.className||"",Je=x.descriptionClassName||"",Ue=G.useMemo(()=>C.findIndex(ht=>ht.toastId===x.id)||0,[C,x.id]),ve=G.useMemo(()=>{var ht;return(ht=x.closeButton)!=null?ht:O},[x.closeButton,O]),Le=G.useMemo(()=>x.duration||q||YE,[x.duration,q]),Ie=G.useRef(0),Ze=G.useRef(0),_e=G.useRef(0),Fe=G.useRef(null),[Xt,be]=I.split("-"),Ct=G.useMemo(()=>C.reduce((ht,Tt,Dt)=>Dt>=Ue?ht:ht+Tt.height,0),[C,Ue]),zt=R9(),Ht=x.invert||g,an=$t==="loading";Ze.current=G.useMemo(()=>Ue*W+Ct,[Ue,Ct]),G.useEffect(()=>{pt.current=Le},[Le]),G.useEffect(()=>{ue(!0)},[]),G.useEffect(()=>{let ht=gt.current;if(ht){let Tt=ht.getBoundingClientRect().height;return Xe(Tt),y(Dt=>[{toastId:x.id,height:Tt,position:x.position},...Dt]),()=>y(Dt=>Dt.filter(sn=>sn.toastId!==x.id))}},[y,x.id]),G.useLayoutEffect(()=>{if(!H)return;let ht=gt.current,Tt=ht.style.height;ht.style.height="auto";let Dt=ht.getBoundingClientRect().height;ht.style.height=Tt,Xe(Dt),y(sn=>sn.find(Bn=>Bn.toastId===x.id)?sn.map(Bn=>Bn.toastId===x.id?{...Bn,height:Dt}:Bn):[{toastId:x.id,height:Dt,position:x.position},...sn])},[H,x.title,x.description,y,x.id]);let Qt=G.useCallback(()=>{Z(!0),pe(Ze.current),y(ht=>ht.filter(Tt=>Tt.toastId!==x.id)),setTimeout(()=>{P(x)},K9)},[x,P,y,Ze]);G.useEffect(()=>{if(x.promise&&$t==="loading"||x.duration===1/0||x.type==="loading")return;let ht;return A||b||R&&zt?(()=>{if(_e.current<Ie.current){let Tt=new Date().getTime()-Ie.current;pt.current=pt.current-Tt}_e.current=new Date().getTime()})():pt.current!==1/0&&(Ie.current=new Date().getTime(),ht=setTimeout(()=>{var Tt;(Tt=x.onAutoClose)==null||Tt.call(x,x),Qt()},pt.current)),()=>clearTimeout(ht)},[A,b,x,$t,R,zt,Qt]),G.useEffect(()=>{x.delete&&Qt()},[Qt,x.delete]);function mr(){var ht,Tt,Dt;return J!=null&&J.loading?G.createElement("div",{className:Ua(F?.loader,(ht=x?.classNames)==null?void 0:ht.loader,"sonner-loader"),"data-visible":$t==="loading"},J.loading):X?G.createElement("div",{className:Ua(F?.loader,(Tt=x?.classNames)==null?void 0:Tt.loader,"sonner-loader"),"data-visible":$t==="loading"},X):G.createElement(A9,{className:Ua(F?.loader,(Dt=x?.classNames)==null?void 0:Dt.loader),visible:$t==="loading"})}return G.createElement("li",{tabIndex:0,ref:gt,className:Ua(B,Ce,F?.toast,(t=x?.classNames)==null?void 0:t.toast,F?.default,F?.[$t],(n=x?.classNames)==null?void 0:n[$t]),"data-sonner-toast":"","data-rich-colors":(r=x.richColors)!=null?r:T,"data-styled":!(x.jsx||x.unstyled||j),"data-mounted":H,"data-promise":!!x.promise,"data-swiped":Ye,"data-removed":Q,"data-visible":Lt,"data-y-position":Xt,"data-x-position":be,"data-index":N,"data-front":Bt,"data-swiping":fe,"data-dismissible":Ot,"data-type":$t,"data-invert":Ht,"data-swipe-out":Oe,"data-swipe-direction":de,"data-expanded":!!(A||K&&H),style:{"--index":N,"--toasts-before":N,"--z-index":E.length-N,"--offset":`${Q?ie:Ze.current}px`,"--initial-height":K?"auto":`${Ee}px`,...$,...x.style},onDragEnd:()=>{ae(!1),te(null),Fe.current=null},onPointerDown:ht=>{an||!Ot||(vt.current=new Date,pe(Ze.current),ht.target.setPointerCapture(ht.pointerId),ht.target.tagName!=="BUTTON"&&(ae(!0),Fe.current={x:ht.clientX,y:ht.clientY}))},onPointerUp:()=>{var ht,Tt,Dt,sn;if(Oe||!Ot)return;Fe.current=null;let Bn=Number(((ht=gt.current)==null?void 0:ht.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ce=Number(((Tt=gt.current)==null?void 0:Tt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),st=new Date().getTime()-((Dt=vt.current)==null?void 0:Dt.getTime()),St=ne==="x"?Bn:ce,en=Math.abs(St)/st;if(Math.abs(St)>=H9||en>.11){pe(Ze.current),(sn=x.onDismiss)==null||sn.call(x,x),he(ne==="x"?Bn>0?"right":"left":ce>0?"down":"up"),Qt(),we(!0),L(!1);return}ae(!1),te(null)},onPointerMove:ht=>{var Tt,Dt,sn,Bn;if(!Fe.current||!Ot||((Tt=window.getSelection())==null?void 0:Tt.toString().length)>0)return;let ce=ht.clientY-Fe.current.y,st=ht.clientX-Fe.current.x,St=(Dt=e.swipeDirections)!=null?Dt:G9(I);!ne&&(Math.abs(st)>1||Math.abs(ce)>1)&&te(Math.abs(st)>Math.abs(ce)?"x":"y");let en={x:0,y:0};ne==="y"?(St.includes("top")||St.includes("bottom"))&&(St.includes("top")&&ce<0||St.includes("bottom")&&ce>0)&&(en.y=ce):ne==="x"&&(St.includes("left")||St.includes("right"))&&(St.includes("left")&&st<0||St.includes("right")&&st>0)&&(en.x=st),(Math.abs(en.x)>0||Math.abs(en.y)>0)&&L(!0),(sn=gt.current)==null||sn.style.setProperty("--swipe-amount-x",`${en.x}px`),(Bn=gt.current)==null||Bn.style.setProperty("--swipe-amount-y",`${en.y}px`)}},ve&&!x.jsx?G.createElement("button",{"aria-label":D,"data-disabled":an,"data-close-button":!0,onClick:an||!Ot?()=>{}:()=>{var ht;Qt(),(ht=x.onDismiss)==null||ht.call(x,x)},className:Ua(F?.closeButton,(s=x?.classNames)==null?void 0:s.closeButton)},(o=J?.close)!=null?o:O9):null,x.jsx||m.isValidElement(x.title)?x.jsx?x.jsx:typeof x.title=="function"?x.title():x.title:G.createElement(G.Fragment,null,$t||x.icon||x.promise?G.createElement("div",{"data-icon":"",className:Ua(F?.icon,(i=x?.classNames)==null?void 0:i.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||mr():null,x.type!=="loading"?x.icon||J?.[$t]||C9($t):null):null,G.createElement("div",{"data-content":"",className:Ua(F?.content,(c=x?.classNames)==null?void 0:c.content)},G.createElement("div",{"data-title":"",className:Ua(F?.title,(d=x?.classNames)==null?void 0:d.title)},typeof x.title=="function"?x.title():x.title),x.description?G.createElement("div",{"data-description":"",className:Ua(V,Je,F?.description,(f=x?.classNames)==null?void 0:f.description)},typeof x.description=="function"?x.description():x.description):null),m.isValidElement(x.cancel)?x.cancel:x.cancel&&nh(x.cancel)?G.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||z,onClick:ht=>{var Tt,Dt;nh(x.cancel)&&Ot&&((Dt=(Tt=x.cancel).onClick)==null||Dt.call(Tt,ht),Qt())},className:Ua(F?.cancelButton,(h=x?.classNames)==null?void 0:h.cancelButton)},x.cancel.label):null,m.isValidElement(x.action)?x.action:x.action&&nh(x.action)?G.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||U,onClick:ht=>{var Tt,Dt;nh(x.action)&&((Dt=(Tt=x.action).onClick)==null||Dt.call(Tt,ht),!ht.defaultPrevented&&Qt())},className:Ua(F?.actionButton,(p=x?.classNames)==null?void 0:p.actionButton)},x.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 X9(e,t){let n={};return[e,t].forEach((r,s)=>{let o=s===1,i=o?"--mobile-offset":"--offset",c=o?U9:q9;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 Q9=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:g,style:x,visibleToasts:j=z9,toastOptions:b,dir:y=XE(),gap:S=V9,loadingIcon:C,icons:N,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:A}=e,[P,T]=G.useState([]),O=G.useMemo(()=>Array.from(new Set([r].concat(P.filter(R=>R.position).map(R=>R.position)))),[P,r]),[$,z]=G.useState([]),[U,B]=G.useState(!1),[V,q]=G.useState(!1),[I,W]=G.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=G.useRef(null),K=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=G.useRef(null),J=G.useRef(!1),D=G.useCallback(R=>{T(ne=>{var te;return(te=ne.find(de=>de.id===R.id))!=null&&te.delete||Fr.dismiss(R.id),ne.filter(({id:de})=>de!==R.id)})},[]);return G.useEffect(()=>Fr.subscribe(R=>{if(R.dismiss){T(ne=>ne.map(te=>te.id===R.id?{...te,delete:!0}:te));return}setTimeout(()=>{j$.flushSync(()=>{T(ne=>{let te=ne.findIndex(de=>de.id===R.id);return te!==-1?[...ne.slice(0,te),{...ne[te],...R},...ne.slice(te+1)]:[R,...ne]})})})}),[]),G.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 R=window.matchMedia("(prefers-color-scheme: dark)");try{R.addEventListener("change",({matches:ne})=>{W(ne?"dark":"light")})}catch{R.addListener(({matches:te})=>{try{W(te?"dark":"light")}catch(de){console.error(de)}})}},[h]),G.useEffect(()=>{P.length<=1&&B(!1)},[P]),G.useEffect(()=>{let R=ne=>{var te,de;s.every(he=>ne[he]||ne.code===he)&&(B(!0),(te=X.current)==null||te.focus()),ne.code==="Escape"&&(document.activeElement===X.current||(de=X.current)!=null&&de.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[s]),G.useEffect(()=>{if(X.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,J.current=!1)}},[X.current]),G.createElement("section",{ref:t,"aria-label":`${E} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((R,ne)=>{var te;let[de,he]=R.split("-");return P.length?G.createElement("ol",{key:R,dir:y==="auto"?XE():y,tabIndex:-1,ref:X,className:c,"data-sonner-toaster":!0,"data-theme":I,"data-y-position":de,"data-lifted":U&&P.length>1&&!o,"data-x-position":he,style:{"--front-toast-height":`${((te=$[0])==null?void 0:te.height)||0}px`,"--width":`${W9}px`,"--gap":`${S}px`,...x,...X9(d,f)},onBlur:H=>{J.current&&!H.currentTarget.contains(H.relatedTarget)&&(J.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||J.current||(J.current=!0,F.current=H.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{V||B(!1)},onDragEnd:()=>B(!1),onPointerDown:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},P.filter(H=>!H.position&&ne===0||H.position===R).map((H,ue)=>{var Q,Z;return G.createElement(Y9,{key:H.id,icons:N,index:ue,toast:H,defaultRichColors:p,duration:(Q=b?.duration)!=null?Q:g,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(Z=b?.closeButton)!=null?Z:i,interacting:V,position:R,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:D,toasts:P.filter(fe=>fe.position==H.position),heights:$.filter(fe=>fe.position==H.position),setHeights:z,expandByDefault:o,gap:S,loadingIcon:C,expanded:U,pauseWhenPageIsHidden:A,swipeDirections:e.swipeDirections})})):null}))});const J9=({...e})=>{const{theme:t="system"}=N9();return a.jsx(Q9,{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 Z9=Zm[" useId ".trim().toString()]||(()=>{}),eW=0;function tr(e){const[t,n]=m.useState(Z9());return nr(()=>{n(r=>r??String(eW++))},[e]),e||(t?`radix-${t}`:"")}const tW=["top","right","bottom","left"],ei=Math.min,oa=Math.max,Mh=Math.round,rh=Math.floor,ws=e=>({x:e,y:e}),nW={left:"right",right:"left",bottom:"top",top:"bottom"},rW={start:"end",end:"start"};function rS(e,t,n){return oa(e,ei(t,n))}function oo(e,t){return typeof e=="function"?e(t):e}function io(e){return e.split("-")[0]}function iu(e){return e.split("-")[1]}function hN(e){return e==="x"?"y":"x"}function mN(e){return e==="y"?"height":"width"}const aW=new Set(["top","bottom"]);function xs(e){return aW.has(io(e))?"y":"x"}function vN(e){return hN(xs(e))}function sW(e,t,n){n===void 0&&(n=!1);const r=iu(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=$h(i)),[i,$h(i)]}function oW(e){const t=$h(e);return[aS(e),t,aS(t)]}function aS(e){return e.replace(/start|end/g,t=>rW[t])}const QE=["left","right"],JE=["right","left"],iW=["top","bottom"],lW=["bottom","top"];function cW(e,t,n){switch(e){case"top":case"bottom":return n?t?JE:QE:t?QE:JE;case"left":case"right":return t?iW:lW;default:return[]}}function uW(e,t,n,r){const s=iu(e);let o=cW(io(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(aS)))),o}function $h(e){return e.replace(/left|right|bottom|top/g,t=>nW[t])}function dW(e){return{top:0,right:0,bottom:0,left:0,...e}}function hD(e){return typeof e!="number"?dW(e):{top:e,right:e,bottom:e,left:e}}function Dh(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=xs(t),i=vN(t),c=mN(i),d=io(t),f=o==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,g=r[c]/2-s[c]/2;let x;switch(d){case"top":x={x:h,y:r.y-s.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-s.width,y:p};break;default:x={x:r.x,y:r.y}}switch(iu(t)){case"start":x[i]-=g*(n&&f?-1:1);break;case"end":x[i]+=g*(n&&f?-1:1);break}return x}async function fW(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:g=!1,padding:x=0}=oo(t,e),j=hD(x),y=c[g?p==="floating"?"reference":"floating":p],S=Dh(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=Dh(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 pW=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),g=r,x={},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:P}=await C({x:h,y:p,initialPlacement:r,placement:g,strategy:s,middlewareData:x,rects:f,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:fW},elements:{reference:e,floating:t}});h=N??h,p=E??p,x={...x,[S]:{...x[S],...A}},P&&j<=50&&(j++,typeof P=="object"&&(P.placement&&(g=P.placement),P.rects&&(f=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):P.rects),{x:h,y:p}=ZE(f,g,d)),y=-1)}return{x:h,y:p,placement:g,strategy:s,middlewareData:x}},hW=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}=oo(e,t)||{};if(f==null)return{};const p=hD(h),g={x:n,y:r},x=vN(s),j=mN(x),b=await i.getDimensions(f),y=x==="y",S=y?"top":"left",C=y?"bottom":"right",N=y?"clientHeight":"clientWidth",E=o.reference[j]+o.reference[x]-g[x]-o.floating[j],A=g[x]-o.reference[x],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let T=P?P[N]:0;(!T||!await(i.isElement==null?void 0:i.isElement(P)))&&(T=c.floating[N]||o.floating[j]);const O=E/2-A/2,$=T/2-b[j]/2-1,z=ei(p[S],$),U=ei(p[C],$),B=z,V=T-b[j]-U,q=T/2-b[j]/2+O,I=rS(B,q,V),W=!d.arrow&&iu(s)!=null&&q!==I&&o.reference[j]/2-(q<B?z:U)-b[j]/2<0,X=W?q<B?q-B:q-V:0;return{[x]:g[x]+X,data:{[x]:I,centerOffset:q-I-X,...W&&{alignmentOffset:X}},reset:W}}}),mW=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:g,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:b=!0,...y}=oo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=io(s),C=xs(c),N=io(c)===c,E=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=g||(N||!b?[$h(c)]:oW(c)),P=j!=="none";!g&&P&&A.push(...uW(c,b,j,E));const T=[c,...A],O=await d.detectOverflow(t,y),$=[];let z=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&$.push(O[S]),p){const q=sW(s,i,E);$.push(O[q[0]],O[q[1]])}if(z=[...z,{placement:s,overflows:$}],!$.every(q=>q<=0)){var U,B;const q=(((U=o.flip)==null?void 0:U.index)||0)+1,I=T[q];if(I&&(!(p==="alignment"?C!==xs(I):!1)||z.every(K=>xs(K.placement)===C?K.overflows[0]>0:!0)))return{data:{index:q,overflows:z},reset:{placement:I}};let W=(B=z.filter(X=>X.overflows[0]<=0).sort((X,K)=>X.overflows[1]-K.overflows[1])[0])==null?void 0:B.placement;if(!W)switch(x){case"bestFit":{var V;const X=(V=z.filter(K=>{if(P){const F=xs(K.placement);return F===C||F==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(F=>F>0).reduce((F,J)=>F+J,0)]).sort((K,F)=>K[1]-F[1])[0])==null?void 0:V[0];X&&(W=X);break}case"initialPlacement":W=c;break}if(s!==W)return{reset:{placement:W}}}return{}}}};function eP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tP(e){return tW.some(t=>e[t]>=0)}const vW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...o}=oo(e,t);switch(s){case"referenceHidden":{const i=await r.detectOverflow(t,{...o,elementContext:"reference"}),c=eP(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:tP(c)}}}case"escaped":{const i=await r.detectOverflow(t,{...o,altBoundary:!0}),c=eP(i,n.floating);return{data:{escapedOffsets:c,escaped:tP(c)}}}default:return{}}}}},mD=new Set(["left","top"]);async function gW(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=io(n),c=iu(n),d=xs(n)==="y",f=mD.has(i)?-1:1,h=o&&d?-1:1,p=oo(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof j=="number"&&(x=c==="end"?j*-1:j),d?{x:x*h,y:g*f}:{x:g*f,y:x*h}}const xW=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 gW(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}}}}},yW=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}=oo(e,t),h={x:n,y:r},p=await o.detectOverflow(t,f),g=xs(io(s)),x=hN(g);let j=h[x],b=h[g];if(i){const S=x==="y"?"top":"left",C=x==="y"?"bottom":"right",N=j+p[S],E=j-p[C];j=rS(N,j,E)}if(c){const S=g==="y"?"top":"left",C=g==="y"?"bottom":"right",N=b+p[S],E=b-p[C];b=rS(N,b,E)}const y=d.fn({...t,[x]:j,[g]:b});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[x]:i,[g]:c}}}}}},bW=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}=oo(e,t),h={x:n,y:r},p=xs(s),g=hN(p);let x=h[g],j=h[p];const b=oo(c,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const N=g==="y"?"height":"width",E=o.reference[g]-o.floating[N]+y.mainAxis,A=o.reference[g]+o.reference[N]-y.mainAxis;x<E?x=E:x>A&&(x=A)}if(f){var S,C;const N=g==="y"?"width":"height",E=mD.has(io(s)),A=o.reference[p]-o.floating[N]+(E&&((S=i.offset)==null?void 0:S[p])||0)+(E?0:y.crossAxis),P=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>P&&(j=P)}return{[g]:x,[p]:j}}}},wW=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}=oo(e,t),h=await i.detectOverflow(t,f),p=io(s),g=iu(s),x=xs(s)==="y",{width:j,height:b}=o.floating;let y,S;p==="top"||p==="bottom"?(y=p,S=g===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,y=g==="end"?"top":"bottom");const C=b-h.top-h.bottom,N=j-h.left-h.right,E=ei(b-h[y],C),A=ei(j-h[S],N),P=!t.middlewareData.shift;let T=E,O=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),P&&!g){const z=oa(h.left,0),U=oa(h.right,0),B=oa(h.top,0),V=oa(h.bottom,0);x?O=j-2*(z!==0||U!==0?z+U:oa(h.left,h.right)):T=b-2*(B!==0||V!==0?B+V:oa(h.top,h.bottom))}await d({...t,availableWidth:O,availableHeight:T});const $=await i.getDimensions(c.floating);return j!==$.width||b!==$.height?{reset:{rects:!0}}:{}}}};function av(){return typeof window<"u"}function lu(e){return vD(e)?(e.nodeName||"").toLowerCase():"#document"}function ua(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ts(e){var t;return(t=(vD(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vD(e){return av()?e instanceof Node||e instanceof ua(e).Node:!1}function Za(e){return av()?e instanceof Element||e instanceof ua(e).Element:!1}function As(e){return av()?e instanceof HTMLElement||e instanceof ua(e).HTMLElement:!1}function nP(e){return!av()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ua(e).ShadowRoot}const jW=new Set(["inline","contents"]);function Cf(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=es(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!jW.has(s)}const SW=new Set(["table","td","th"]);function NW(e){return SW.has(lu(e))}const CW=[":popover-open",":modal"];function sv(e){return CW.some(t=>{try{return e.matches(t)}catch{return!1}})}const _W=["transform","translate","scale","rotate","perspective"],AW=["transform","translate","scale","rotate","perspective","filter"],EW=["paint","layout","strict","content"];function gN(e){const t=xN(),n=Za(e)?es(e):e;return _W.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)||AW.some(r=>(n.willChange||"").includes(r))||EW.some(r=>(n.contain||"").includes(r))}function PW(e){let t=ti(e);for(;As(t)&&!Ac(t);){if(gN(t))return t;if(sv(t))return null;t=ti(t)}return null}function xN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const kW=new Set(["html","body","#document"]);function Ac(e){return kW.has(lu(e))}function es(e){return ua(e).getComputedStyle(e)}function ov(e){return Za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ti(e){if(lu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nP(e)&&e.host||Ts(e);return nP(t)?t.host:t}function gD(e){const t=ti(e);return Ac(t)?e.ownerDocument?e.ownerDocument.body:e.body:As(t)&&Cf(t)?t:gD(t)}function Td(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=gD(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=ua(s);if(o){const c=sS(i);return t.concat(i,i.visualViewport||[],Cf(s)?s:[],c&&n?Td(c):[])}return t.concat(s,Td(s,[],n))}function sS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xD(e){const t=es(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=As(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,c=Mh(n)!==o||Mh(r)!==i;return c&&(n=o,r=i),{width:n,height:r,$:c}}function yN(e){return Za(e)?e:e.contextElement}function xc(e){const t=yN(e);if(!As(t))return ws(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=xD(t);let i=(o?Mh(n.width):n.width)/r,c=(o?Mh(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const TW=ws(0);function yD(e){const t=ua(e);return!xN()||!t.visualViewport?TW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ua(e)?!1:t}function Ji(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=yN(e);let i=ws(1);t&&(r?Za(r)&&(i=xc(r)):i=xc(e));const c=OW(o,n,r)?yD(o):ws(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 g=ua(o),x=r&&Za(r)?ua(r):r;let j=g,b=sS(j);for(;b&&r&&x!==j;){const y=xc(b),S=b.getBoundingClientRect(),C=es(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=ua(b),b=sS(j)}}return Dh({width:h,height:p,x:d,y:f})}function iv(e,t){const n=ov(e).scrollLeft;return t?t.left+n:Ji(Ts(e)).left+n}function bD(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-iv(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function RW(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=Ts(r),c=t?sv(t.floating):!1;if(r===i||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=ws(1);const h=ws(0),p=As(r);if((p||!p&&!o)&&((lu(r)!=="body"||Cf(i))&&(d=ov(r)),As(r))){const x=Ji(r);f=xc(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const g=i&&!p&&!o?bD(i,d):ws(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+g.x,y:n.y*f.y-d.scrollTop*f.y+h.y+g.y}}function IW(e){return Array.from(e.getClientRects())}function MW(e){const t=Ts(e),n=ov(e),r=e.ownerDocument.body,s=oa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=oa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+iv(e);const c=-n.scrollTop;return es(r).direction==="rtl"&&(i+=oa(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:c}}const rP=25;function $W(e,t){const n=ua(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=iv(r);if(f<=0){const h=r.ownerDocument,p=h.body,g=getComputedStyle(p),x=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-x);j<=rP&&(o-=j)}else f<=rP&&(o+=f);return{width:o,height:i,x:c,y:d}}const DW=new Set(["absolute","fixed"]);function LW(e,t){const n=Ji(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=As(e)?xc(e):ws(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 aP(e,t,n){let r;if(t==="viewport")r=$W(e,n);else if(t==="document")r=MW(Ts(e));else if(Za(t))r=LW(t,n);else{const s=yD(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Dh(r)}function wD(e,t){const n=ti(e);return n===t||!Za(n)||Ac(n)?!1:es(n).position==="fixed"||wD(n,t)}function FW(e,t){const n=t.get(e);if(n)return n;let r=Td(e,[],!1).filter(c=>Za(c)&&lu(c)!=="body"),s=null;const o=es(e).position==="fixed";let i=o?ti(e):e;for(;Za(i)&&!Ac(i);){const c=es(i),d=gN(i);!d&&c.position==="fixed"&&(s=null),(o?!d&&!s:!d&&c.position==="static"&&!!s&&DW.has(s.position)||Cf(i)&&!d&&wD(e,i))?r=r.filter(h=>h!==i):s=c,i=ti(i)}return t.set(e,r),r}function BW(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?sv(t)?[]:FW(t,this._c):[].concat(n),r],c=i[0],d=i.reduce((f,h)=>{const p=aP(t,h,s);return f.top=oa(p.top,f.top),f.right=ei(p.right,f.right),f.bottom=ei(p.bottom,f.bottom),f.left=oa(p.left,f.left),f},aP(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function zW(e){const{width:t,height:n}=xD(e);return{width:t,height:n}}function qW(e,t,n){const r=As(t),s=Ts(t),o=n==="fixed",i=Ji(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=ws(0);function f(){d.x=iv(s)}if(r||!r&&!o)if((lu(t)!=="body"||Cf(s))&&(c=ov(t)),r){const x=Ji(t,!0,o,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else s&&f();o&&!r&&s&&f();const h=s&&!r&&!o?bD(s,c):ws(0),p=i.left+c.scrollLeft-d.x-h.x,g=i.top+c.scrollTop-d.y-h.y;return{x:p,y:g,width:i.width,height:i.height}}function wy(e){return es(e).position==="static"}function sP(e,t){if(!As(e)||es(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ts(e)===n&&(n=n.ownerDocument.body),n}function jD(e,t){const n=ua(e);if(sv(e))return n;if(!As(e)){let s=ti(e);for(;s&&!Ac(s);){if(Za(s)&&!wy(s))return s;s=ti(s)}return n}let r=sP(e,t);for(;r&&NW(r)&&wy(r);)r=sP(r,t);return r&&Ac(r)&&wy(r)&&!gN(r)?n:r||PW(e)||n}const UW=async function(e){const t=this.getOffsetParent||jD,n=this.getDimensions,r=await n(e.floating);return{reference:qW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function WW(e){return es(e).direction==="rtl"}const VW={convertOffsetParentRelativeRectToViewportRelativeRect:RW,getDocumentElement:Ts,getClippingRect:BW,getOffsetParent:jD,getElementRects:UW,getClientRects:IW,getDimensions:zW,getScale:xc,isElement:Za,isRTL:WW};function SD(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function HW(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:g,height:x}=f;if(c||t(),!g||!x)return;const j=rh(p),b=rh(s.clientWidth-(h+g)),y=rh(s.clientHeight-(p+x)),S=rh(h),N={rootMargin:-j+"px "+-b+"px "+-y+"px "+-S+"px",threshold:oa(0,ei(1,d))||1};let E=!0;function A(P){const T=P[0].intersectionRatio;if(T!==d){if(!E)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!SD(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 KW(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?Td(f):[],...Td(t)]:[];h.forEach(S=>{s&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const p=f&&c?HW(f,n):null;let g=-1,x=null;i&&(x=new ResizeObserver(S=>{let[C]=S;C&&C.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(t)})),n()}),f&&!d&&x.observe(f),x.observe(t));let j,b=d?Ji(e):null;d&&y();function y(){const S=Ji(e);b&&!SD(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=x)==null||S.disconnect(),x=null,d&&cancelAnimationFrame(j)}}const GW=xW,YW=yW,XW=mW,QW=wW,JW=vW,oP=hW,ZW=bW,eV=(e,t,n)=>{const r=new Map,s={platform:VW,...n},o={...s.platform,_c:r};return pW(e,t,{...s,platform:o})};var tV=typeof document<"u",nV=function(){},Ph=tV?m.useLayoutEffect:nV;function Lh(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(!Lh(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)&&!Lh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ND(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iP(e,t){const n=ND(e);return Math.round(t*n)/n}function jy(e){const t=m.useRef(e);return Ph(()=>{t.current=e}),t}function rV(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}),[g,x]=m.useState(r);Lh(g,r)||x(r);const[j,b]=m.useState(null),[y,S]=m.useState(null),C=m.useCallback(K=>{K!==P.current&&(P.current=K,b(K))},[]),N=m.useCallback(K=>{K!==T.current&&(T.current=K,S(K))},[]),E=o||j,A=i||y,P=m.useRef(null),T=m.useRef(null),O=m.useRef(h),$=d!=null,z=jy(d),U=jy(s),B=jy(f),V=m.useCallback(()=>{if(!P.current||!T.current)return;const K={placement:t,strategy:n,middleware:g};U.current&&(K.platform=U.current),eV(P.current,T.current,K).then(F=>{const J={...F,isPositioned:B.current!==!1};q.current&&!Lh(O.current,J)&&(O.current=J,su.flushSync(()=>{p(J)}))})},[g,t,n,U,B]);Ph(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(K=>({...K,isPositioned:!1})))},[f]);const q=m.useRef(!1);Ph(()=>(q.current=!0,()=>{q.current=!1}),[]),Ph(()=>{if(E&&(P.current=E),A&&(T.current=A),E&&A){if(z.current)return z.current(E,A,V);V()}},[E,A,V,z,$]);const I=m.useMemo(()=>({reference:P,floating:T,setReference:C,setFloating:N}),[C,N]),W=m.useMemo(()=>({reference:E,floating:A}),[E,A]),X=m.useMemo(()=>{const K={position:n,left:0,top:0};if(!W.floating)return K;const F=iP(W.floating,h.x),J=iP(W.floating,h.y);return c?{...K,transform:"translate("+F+"px, "+J+"px)",...ND(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:J}},[n,c,W.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:V,refs:I,elements:W,floatingStyles:X}),[h,V,I,W,X])}const aV=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?oP({element:r.current,padding:s}).fn(n):{}:r?oP({element:r,padding:s}).fn(n):{}}}},sV=(e,t)=>({...GW(e),options:[e,t]}),oV=(e,t)=>({...YW(e),options:[e,t]}),iV=(e,t)=>({...ZW(e),options:[e,t]}),lV=(e,t)=>({...XW(e),options:[e,t]}),cV=(e,t)=>({...QW(e),options:[e,t]}),uV=(e,t)=>({...JW(e),options:[e,t]}),dV=(e,t)=>({...aV(e),options:[e,t]});var fV="Arrow",CD=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return a.jsx(Ge.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"})})});CD.displayName=fV;var pV=CD;function lv(e){const[t,n]=m.useState(void 0);return nr(()=>{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",[_D,li]=hr(bN),[hV,AD]=_D(bN),ED=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return a.jsx(hV,{scope:t,anchor:r,onAnchorChange:s,children:n})};ED.displayName=bN;var PD="PopperAnchor",kD=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=AD(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(Ge.div,{...s,ref:c})});kD.displayName=PD;var wN="PopperContent",[mV,vV]=_D(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:g=!1,updatePositionStrategy:x="optimized",onPlaced:j,...b}=e,y=AD(wN,n),[S,C]=m.useState(null),N=wt(t,H=>C(H)),[E,A]=m.useState(null),P=lv(E),T=P?.width??0,O=P?.height??0,$=r+(o!=="center"?"-"+o:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},U=Array.isArray(f)?f:[f],B=U.length>0,V={padding:z,boundary:U.filter(xV),altBoundary:B},{refs:q,floatingStyles:I,placement:W,isPositioned:X,middlewareData:K}=rV({strategy:"fixed",placement:$,whileElementsMounted:(...H)=>KW(...H,{animationFrame:x==="always"}),elements:{reference:y.anchor},middleware:[sV({mainAxis:s+O,alignmentAxis:i}),d&&oV({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?iV():void 0,...V}),d&&lV({...V}),cV({...V,apply:({elements:H,rects:ue,availableWidth:Q,availableHeight:Z})=>{const{width:fe,height:ae}=ue.reference,Oe=H.floating.style;Oe.setProperty("--radix-popper-available-width",`${Q}px`),Oe.setProperty("--radix-popper-available-height",`${Z}px`),Oe.setProperty("--radix-popper-anchor-width",`${fe}px`),Oe.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),E&&dV({element:E,padding:c}),yV({arrowWidth:T,arrowHeight:O}),g&&uV({strategy:"referenceHidden",...V})]}),[F,J]=ID(W),D=Wn(j);nr(()=>{X&&D?.()},[X,D]);const R=K.arrow?.x,ne=K.arrow?.y,te=K.arrow?.centerOffset!==0,[de,he]=m.useState();return nr(()=>{S&&he(window.getComputedStyle(S).zIndex)},[S]),a.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:X?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[K.transformOrigin?.x,K.transformOrigin?.y].join(" "),...K.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(mV,{scope:n,placedSide:F,onArrowChange:A,arrowX:R,arrowY:ne,shouldHideArrow:te,children:a.jsx(Ge.div,{"data-side":F,"data-align":J,...b,ref:N,style:{...b.style,animation:X?void 0:"none"}})})})});TD.displayName=wN;var OD="PopperArrow",gV={top:"bottom",right:"left",bottom:"top",left:"right"},RD=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=vV(OD,r),i=gV[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(pV,{...s,ref:n,style:{...s.style,display:"block"}})})});RD.displayName=OD;function xV(e){return e!==null}var yV=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]=ID(n),p={start:"0%",center:"50%",end:"100%"}[h],g=(s.arrow?.x??0)+c/2,x=(s.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=i?p:`${g}px`,b=`${-d}px`):f==="top"?(j=i?p:`${g}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=i?p:`${x}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=i?p:`${x}px`),{data:{x:j,y:b}}}});function ID(e){const[t,n="center"]=e.split("-");return[t,n]}var cv=ED,_f=kD,uv=TD,dv=RD,bV=Symbol("radix.slottable");function wV(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=bV,t}var[fv]=hr("Tooltip",[li]),pv=li(),MD="TooltipProvider",jV=700,oS="tooltip.open",[SV,jN]=fv(MD),$D=e=>{const{__scopeTooltip:t,delayDuration:n=jV,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(SV,{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})};$D.displayName=MD;var Od="Tooltip",[NV,Af]=fv(Od),DD=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:o,disableHoverableContent:i,delayDuration:c}=e,d=jN(Od,e.__scopeTooltip),f=pv(t),[h,p]=m.useState(null),g=tr(),x=m.useRef(0),j=i??d.disableHoverableContent,b=c??d.delayDuration,y=m.useRef(!1),[S,C]=pa({prop:r,defaultProp:s??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(oS))):d.onClose(),o?.(T)},caller:Od}),N=m.useMemo(()=>S?y.current?"delayed-open":"instant-open":"closed",[S]),E=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,y.current=!1,C(!0)},[C]),A=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,C(!1)},[C]),P=m.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{y.current=!0,C(!0),x.current=0},b)},[b,C]);return m.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),a.jsx(cv,{...f,children:a.jsx(NV,{scope:t,contentId:g,open:S,stateAttribute:N,trigger:h,onTriggerChange:p,onTriggerEnter:m.useCallback(()=>{d.isOpenDelayedRef.current?P():E()},[d.isOpenDelayedRef,P,E]),onTriggerLeave:m.useCallback(()=>{j?A():(window.clearTimeout(x.current),x.current=0)},[A,j]),onOpen:E,onClose:A,disableHoverableContent:j,children:n})})};DD.displayName=Od;var iS="TooltipTrigger",LD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Af(iS,n),o=jN(iS,n),i=pv(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(_f,{asChild:!0,...i,children:a.jsx(Ge.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:Te(e.onPointerMove,g=>{g.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)})})});LD.displayName=iS;var SN="TooltipPortal",[CV,_V]=fv(SN,{forceMount:void 0}),FD=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,o=Af(SN,t);return a.jsx(CV,{scope:t,forceMount:n,children:a.jsx(Gn,{present:n||o.open,children:a.jsx(vl,{asChild:!0,container:s,children:r})})})};FD.displayName=SN;var Ec="TooltipContent",BD=m.forwardRef((e,t)=>{const n=_V(Ec,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,i=Af(Ec,e.__scopeTooltip);return a.jsx(Gn,{present:r||i.open,children:i.disableHoverableContent?a.jsx(zD,{side:s,...o,ref:t}):a.jsx(AV,{side:s,...o,ref:t})})}),AV=m.forwardRef((e,t)=>{const n=Af(Ec,e.__scopeTooltip),r=jN(Ec,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,g=m.useCallback(()=>{c(null),p(!1)},[p]),x=m.useCallback((j,b)=>{const y=j.currentTarget,S={x:j.clientX,y:j.clientY},C=OV(S,y.getBoundingClientRect()),N=RV(S,C),E=IV(b.getBoundingClientRect()),A=$V([...N,...E]);c(A),p(!0)},[p]);return m.useEffect(()=>()=>g(),[g]),m.useEffect(()=>{if(d&&h){const j=y=>x(y,h),b=y=>x(y,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",b)}}},[d,h,x,g]),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=!MV(S,i);C?g():N&&(g(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,i,f,g]),a.jsx(zD,{...e,ref:o})}),[EV,PV]=fv(Od,{isInside:!1}),kV=wV("TooltipContent"),zD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...c}=e,d=Af(Ec,n),f=pv(n),{onClose:h}=d;return m.useEffect(()=>(document.addEventListener(oS,h),()=>document.removeEventListener(oS,h)),[h]),m.useEffect(()=>{if(d.trigger){const p=g=>{g.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),a.jsx(ml,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:a.jsxs(uv,{"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(kV,{children:r}),a.jsx(EV,{scope:n,isInside:!0,children:a.jsx(t7,{id:d.contentId,role:"tooltip",children:s||r})})]})})});BD.displayName=Ec;var qD="TooltipArrow",TV=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=pv(n);return PV(qD,n).isInside?null:a.jsx(dv,{...s,...r,ref:t})});TV.displayName=qD;function OV(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 RV(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 IV(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 MV(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,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(s=!s)}return s}function $V(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),DV(t)}function DV(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 LV=$D,FV=DD,BV=LD,zV=FD,UD=BD;const ni=LV,ri=FV,ai=BV,lo=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(zV,{children:a.jsx(UD,{ref:r,sideOffset:t,className:Se("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})}));lo.displayName=UD.displayName;var hv=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(){}},qV={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},UV=class{#e=qV;#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 UV;function WV(e){setTimeout(e,0)}var mv=typeof window>"u"||"Deno"in globalThis;function Ha(){}function VV(e,t){return typeof e=="function"?e(t):e}function HV(e){return typeof e=="number"&&e>=0&&e!==1/0}function KV(e,t){return Math.max(e+(t||0)-Date.now(),0)}function cS(e,t){return typeof e=="function"?e(t):e}function GV(e,t){return typeof e=="function"?e(t):e}function lP(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(!Id(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 cP(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Rd(t.options.mutationKey)!==Rd(o))return!1}else if(!Id(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function NN(e,t){return(t?.queryKeyHashFn||Rd)(e)}function Rd(e){return JSON.stringify(e,(t,n)=>uS(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Id(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Id(e[n],t[n])):!1}var YV=Object.prototype.hasOwnProperty;function WD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=uP(e)&&uP(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],g=e[p],x=t[p];if(g===x){d[p]=g,(r?h<o:YV.call(e,p))&&f++;continue}if(g===null||x===null||typeof g!="object"||typeof x!="object"){d[p]=x;continue}const j=WD(g,x,n+1);d[p]=j,j===g&&f++}return o===c&&f===o?e:d}function uP(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function uS(e){if(!dP(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!dP(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function dP(e){return Object.prototype.toString.call(e)==="[object Object]"}function XV(e){return new Promise(t=>{lS.setTimeout(t,e)})}function QV(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?WD(e,t):t}function JV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ZV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var CN=Symbol();function VD(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 eH(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 tH=class extends hv{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!mv&&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"}},HD=new tH;function nH(){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 rH=WV;function aH(){let e=[],t=0,n=c=>{c()},r=c=>{c()},s=rH;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 _r=aH(),sH=class extends hv{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!mv&&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}},Fh=new sH;function oH(e){return Math.min(1e3*2**e,3e4)}function KD(e){return(e??"online")==="online"?Fh.isOnline():!0}var dS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function GD(e){let t=!1,n=0,r;const s=nH(),o=()=>s.status!=="pending",i=b=>{if(!o()){const y=new dS(b);g(y),e.onCancel?.(y)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>HD.isFocused()&&(e.networkMode==="always"||Fh.isOnline())&&e.canRun(),h=()=>KD(e.networkMode)&&e.canRun(),p=b=>{o()||(r?.(),s.resolve(b))},g=b=>{o()||(r?.(),s.reject(b))},x=()=>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??(mv?0:3),N=e.retryDelay??oH,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){g(S);return}n++,e.onFail?.(n,S),XV(E).then(()=>f()?void 0:x()).then(()=>{t?g(S):j()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r?.(),s),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?j():x().then(j),s)}}var YD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),HV(this.gcTime)&&(this.#e=lS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mv?1/0:300*1e3))}clearGcTimeout(){this.#e&&(lS.clearTimeout(this.#e),this.#e=void 0)}},iH=class extends YD{#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=pP(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=pP(this.options);t.data!==void 0&&(this.setState(fP(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=QV(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(Ha).catch(Ha):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>GV(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:!KV(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=VD(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=GD({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,...lH(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...fP(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),_r.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function lH(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:KD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fP(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pP(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 hP(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=>{eH(j,()=>t.signal,()=>h=!0)},g=VD(t.options,t.fetchOptions),x=async(j,b,y)=>{if(h)return Promise.reject();if(b==null&&j.pages.length)return Promise.resolve(j);const C=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:b,direction:y?"backward":"forward",meta:t.options.meta};return p(P),P})(),N=await g(C),{maxPages:E}=t.options,A=y?ZV:JV;return{pages:A(j.pages,N,E),pageParams:A(j.pageParams,b,E)}};if(s&&o.length){const j=s==="backward",b=j?cH:mP,y={pages:o,pageParams:i},S=b(r,y);c=await x(y,S,j)}else{const j=e??o.length;do{const b=d===0?i[0]??r.initialPageParam:mP(r,c);if(d>0&&b==null)break;c=await x(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 mP(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 cH(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var uH=class extends YD{#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||dH(),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=GD({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),_r.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function dH(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fH=class extends hv{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 uH({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=ah(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=ah(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=ah(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=ah(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){_r.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=>cP(t,n))}findAll(e={}){return this.getAll().filter(t=>cP(e,t))}notify(e){_r.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return _r.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ha))))}};function ah(e){return e.options.scope?.id}var pH=class extends hv{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 iH({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(){_r.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=>lP(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>lP(e,n)):t}notify(e){_r.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_r.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_r.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},hH=class{#e;#n;#t;#a;#r;#o;#i;#s;constructor(e={}){this.#e=e.queryCache||new pH,this.#n=e.mutationCache||new fH,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#i=HD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Fh.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=VV(t,o);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return _r.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;_r.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return _r.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=_r.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ha).catch(Ha)}invalidateQueries(e,t={}){return _r.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=_r.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(Ha)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Ha)}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(Ha).catch(Ha)}fetchInfiniteQuery(e){return e.behavior=hP(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ha).catch(Ha)}ensureInfiniteQueryData(e){return e.behavior=hP(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Fh.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(Rd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{Id(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Rd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Id(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()}},mH=m.createContext(void 0),vH=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(mH.Provider,{value:e,children:t}));function Md(){return Md=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},Md.apply(this,arguments)}var Go;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Go||(Go={}));const vP="popstate";function gH(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:Bh(s)}return yH(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 xH(){return Math.random().toString(36).substr(2,8)}function gP(e,t){return{usr:e.state,key:e.key,idx:t}}function fS(e,t,n,r){return n===void 0&&(n=null),Md({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?cu(t):t,{state:n,key:t&&t.key||r||xH()})}function Bh(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 cu(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 yH(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,c=Go.Pop,d=null,f=h();f==null&&(f=0,i.replaceState(Md({},i.state,{idx:f}),""));function h(){return(i.state||{idx:null}).idx}function p(){c=Go.Pop;let y=h(),S=y==null?null:y-f;f=y,d&&d({action:c,location:b.location,delta:S})}function g(y,S){c=Go.Push;let C=fS(b.location,y,S);f=h()+1;let N=gP(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 x(y,S){c=Go.Replace;let C=fS(b.location,y,S);f=h();let N=gP(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:Bh(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(vP,p),d=y,()=>{s.removeEventListener(vP,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:g,replace:x,go(y){return i.go(y)}};return b}var xP;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xP||(xP={}));function bH(e,t,n){return n===void 0&&(n="/"),wH(e,t,n)}function wH(e,t,n,r){let s=typeof t=="string"?cu(t):t,o=Pc(s.pathname||"/",n);if(o==null)return null;let i=XD(e);jH(i);let c=null;for(let d=0;c==null&&d<i.length;++d){let f=RH(o);c=TH(i[d],f)}return c}function XD(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=Qo([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+'".')),XD(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 QD(o.path))s(o,i,d)}),t}function QD(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=QD(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 jH(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:kH(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const SH=/^:[\w-]+$/,NH=3,CH=2,_H=1,AH=10,EH=-2,yP=e=>e==="*";function PH(e,t){let n=e.split("/"),r=n.length;return n.some(yP)&&(r+=EH),t&&(r+=CH),n.filter(s=>!yP(s)).reduce((s,o)=>s+(SH.test(o)?NH:o===""?_H:AH),r)}function kH(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=hn({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),g=d.route;if(!p)return null;Object.assign(s,p.params),i.push({params:s,pathname:Qo([o,p.pathname]),pathnameBase:LH(Qo([o,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(o=Qo([o,p.pathnameBase]))}return i}function hn(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=OH(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:g,isOptional:x}=h;if(g==="*"){let b=c[p]||"";i=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}const j=c[p];return x&&!j?f[g]=void 0:f[g]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:i,pattern:e}}function OH(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 RH(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 Pc(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 IH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,MH=e=>IH.test(e);function $H(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?cu(e):e,o;if(n)if(MH(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=bP(n.substring(1),"/"):o=bP(n,t)}else o=t;return{pathname:o,search:FH(r),hash:BH(s)}}function bP(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 DH(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function AN(e,t){let n=DH(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=cu(e):(s=Md({},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 g=i.split("/");for(;g[0]==="..";)g.shift(),p-=1;s.pathname=g.join("/")}c=p>=0?t[p]:"/"}let d=$H(s,c),f=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Qo=e=>e.join("/").replace(/\/\/+/g,"/"),LH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),FH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,BH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function zH(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const JD=["post","put","patch","delete"];new Set(JD);const qH=["get",...JD];new Set(qH);function $d(){return $d=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},$d.apply(this,arguments)}const vv=m.createContext(null),ZD=m.createContext(null),ho=m.createContext(null),gv=m.createContext(null),Os=m.createContext({outlet:null,matches:[],isDataRoute:!1}),e5=m.createContext(null);function UH(e,t){let{relative:n}=t===void 0?{}:t;uu()||$n(!1);let{basename:r,navigator:s}=m.useContext(ho),{hash:o,pathname:i,search:c}=xv(e,{relative:n}),d=i;return r!=="/"&&(d=i==="/"?r:Qo([r,i])),s.createHref({pathname:d,search:c,hash:o})}function uu(){return m.useContext(gv)!=null}function Rs(){return uu()||$n(!1),m.useContext(gv).location}function t5(e){m.useContext(ho).static||m.useLayoutEffect(e)}function Ia(){let{isDataRoute:e}=m.useContext(Os);return e?aK():WH()}function WH(){uu()||$n(!1);let e=m.useContext(vv),{basename:t,future:n,navigator:r}=m.useContext(ho),{matches:s}=m.useContext(Os),{pathname:o}=Rs(),i=JSON.stringify(AN(s,n.v7_relativeSplatPath)),c=m.useRef(!1);return t5(()=>{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:Qo([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,i,o,e])}const VH=m.createContext(null);function HH(e){let t=m.useContext(Os).outlet;return t&&m.createElement(VH.Provider,{value:e},t)}function xl(){let{matches:e}=m.useContext(Os),t=e[e.length-1];return t?t.params:{}}function xv(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(ho),{matches:s}=m.useContext(Os),{pathname:o}=Rs(),i=JSON.stringify(AN(s,r.v7_relativeSplatPath));return m.useMemo(()=>EN(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function KH(e,t){return GH(e,t)}function GH(e,t,n,r){uu()||$n(!1);let{navigator:s}=m.useContext(ho),{matches:o}=m.useContext(Os),i=o[o.length-1],c=i?i.params:{};i&&i.pathname;let d=i?i.pathnameBase:"/";i&&i.route;let f=Rs(),h;if(t){var p;let y=typeof t=="string"?cu(t):t;d==="/"||(p=y.pathname)!=null&&p.startsWith(d)||$n(!1),h=y}else h=f;let g=h.pathname||"/",x=g;if(d!=="/"){let y=d.replace(/^\//,"").split("/");x="/"+g.replace(/^\//,"").split("/").slice(y.length).join("/")}let j=bH(e,{pathname:x}),b=ZH(j&&j.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Qo([d,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?d:Qo([d,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,n,r);return t&&b?m.createElement(gv.Provider,{value:{location:$d({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Go.Pop}},b):b}function YH(){let e=rK(),t=zH(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 XH=m.createElement(YH,null);class QH 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(Os.Provider,{value:this.props.routeContext},m.createElement(e5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function JH(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(vv);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Os.Provider,{value:t},r)}function ZH(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:g,errors:x}=n,j=p.route.loader&&g[p.route.id]===void 0&&(!x||x[p.route.id]===void 0);if(p.route.lazy||j){d=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}return i.reduceRight((h,p,g)=>{let x,j=!1,b=null,y=null;n&&(x=c&&p.route.id?c[p.route.id]:void 0,b=p.route.errorElement||XH,d&&(f<0&&g===0?(sK("route-fallback"),j=!0,y=null):f===g&&(j=!0,y=p.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,g+1)),C=()=>{let N;return x?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(JH,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:N})};return n&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?m.createElement(QH,{location:n.location,revalidation:n.revalidation,component:b,error:x,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):C()},null)}var n5=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(n5||{}),r5=(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})(r5||{});function eK(e){let t=m.useContext(vv);return t||$n(!1),t}function tK(e){let t=m.useContext(ZD);return t||$n(!1),t}function nK(e){let t=m.useContext(Os);return t||$n(!1),t}function a5(e){let t=nK(),n=t.matches[t.matches.length-1];return n.route.id||$n(!1),n.route.id}function rK(){var e;let t=m.useContext(e5),n=tK(),r=a5();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function aK(){let{router:e}=eK(n5.UseNavigateStable),t=a5(r5.UseNavigateStable),n=m.useRef(!1);return t5(()=>{n.current=!0}),m.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,$d({fromRouteId:t},o)))},[e,t])}const wP={};function sK(e,t,n){wP[e]||(wP[e]=!0)}function oK(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function s5(e){let{to:t,replace:n,state:r,relative:s}=e;uu()||$n(!1);let{future:o,static:i}=m.useContext(ho),{matches:c}=m.useContext(Os),{pathname:d}=Rs(),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 jP(e){return HH(e.context)}function pn(e){$n(!1)}function iK(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Go.Pop,navigator:o,static:i=!1,future:c}=e;uu()&&$n(!1);let d=t.replace(/^\/*/,"/"),f=m.useMemo(()=>({basename:d,navigator:o,static:i,future:$d({v7_relativeSplatPath:!1},c)}),[d,c,o,i]);typeof r=="string"&&(r=cu(r));let{pathname:h="/",search:p="",hash:g="",state:x=null,key:j="default"}=r,b=m.useMemo(()=>{let y=Pc(h,d);return y==null?null:{location:{pathname:y,search:p,hash:g,state:x,key:j},navigationType:s}},[d,h,p,g,x,j,s]);return b==null?null:m.createElement(ho.Provider,{value:f},m.createElement(gv.Provider,{children:n,value:b}))}function lK(e){let{children:t,location:n}=e;return KH(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!==pn&&$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 zh(){return zh=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},zh.apply(this,arguments)}function o5(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 cK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function uK(e,t){return e.button===0&&(!t||t==="_self")&&!cK(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 dK(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 fK=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],pK=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],hK="6";try{window.__reactRouterVersion=hK}catch{}const mK=m.createContext({isTransitioning:!1}),vK="startTransition",SP=Zm[vK];function gK(e){let{basename:t,children:n,future:r,window:s}=e,o=m.useRef();o.current==null&&(o.current=gH({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&&SP?SP(()=>d(p)):d(p)},[d,f]);return m.useLayoutEffect(()=>i.listen(h),[i,h]),m.useEffect(()=>oK(r),[r]),m.createElement(iK,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:i,future:r})}const xK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",yK=/^(?:[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,g=o5(t,fK),{basename:x}=m.useContext(ho),j,b=!1;if(typeof f=="string"&&yK.test(f)&&(j=f,xK))try{let N=new URL(window.location.href),E=f.startsWith("//")?new URL(N.protocol+f):new URL(f),A=Pc(E.pathname,x);E.origin===N.origin&&A!=null?f=A+E.search+E.hash:b=!0}catch{}let y=UH(f,{relative:s}),S=jK(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",zh({},g,{href:j||y,onClick:b||o?r:C,ref:n,target:d}))}),bK=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=o5(t,pK),g=xv(d,{relative:p.relative}),x=Rs(),j=m.useContext(ZD),{navigator:b,basename:y}=m.useContext(ho),S=j!=null&&SK(g)&&f===!0,C=b.encodeLocation?b.encodeLocation(g).pathname:g.pathname,N=x.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=Pc(E,y)||E);const A=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let P=N===C||!i&&N.startsWith(C)&&N.charAt(A)==="/",T=E!=null&&(E===C||!i&&E.startsWith(C)&&E.charAt(C.length)==="/"),O={isActive:P,isPending:T,isTransitioning:S},$=P?r:void 0,z;typeof o=="function"?z=o(O):z=[o,P?"active":null,T?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let U=typeof c=="function"?c(O):c;return m.createElement(_t,zh({},p,{"aria-current":$,className:z,ref:n,style:U,to:d,viewTransition:f}),typeof h=="function"?h(O):h)});var mS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(mS||(mS={}));var NP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(NP||(NP={}));function wK(e){let t=m.useContext(vv);return t||$n(!1),t}function jK(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:i,viewTransition:c}=t===void 0?{}:t,d=Ia(),f=Rs(),h=xv(e,{relative:i});return m.useCallback(p=>{if(uK(p,n)){p.preventDefault();let g=r!==void 0?r:Bh(f)===Bh(h);d(e,{replace:g,state:s,preventScrollReset:o,relative:i,viewTransition:c})}},[f,d,h,r,s,n,e,o,i,c])}function mo(e){let t=m.useRef(hS(e)),n=m.useRef(!1),r=Rs(),s=m.useMemo(()=>dK(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 SK(e,t){t===void 0&&(t={});let n=m.useContext(mK);n==null&&$n(!1);let{basename:r}=wK(mS.useViewTransitionState),s=xv(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Pc(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Pc(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hn(s.pathname,i)!=null||hn(s.pathname,o)!=null}var NK=Symbol.for("react.lazy"),qh=Zm[" use ".trim().toString()];function CK(e){return typeof e=="object"&&e!==null&&"then"in e}function i5(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===NK&&"_payload"in e&&CK(e._payload)}function yv(e){const t=_K(e),n=m.forwardRef((r,s)=>{let{children:o,...i}=r;i5(o)&&typeof qh=="function"&&(o=qh(o._payload));const c=m.Children.toArray(o),d=c.find(EK);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 ci=yv("Slot");function _K(e){const t=m.forwardRef((n,r)=>{let{children:s,...o}=n;if(i5(s)&&typeof qh=="function"&&(s=qh(s._payload)),m.isValidElement(s)){const i=kK(s),c=PK(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Tr(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 AK=Symbol("radix.slottable");function EK(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AK}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 kK(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 PN=gl("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?ci:"button";return a.jsx(i,{className:Se(PN({variant:t,size:n,className:e})),ref:o,...s})});se.displayName="Button";const mt=m.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:Se("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}));mt.displayName="Input";var OK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],RK=OK.reduce((e,t)=>{const n=yv(`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}},{}),IK="Separator",CP="horizontal",MK=["horizontal","vertical"],l5=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=CP,...s}=e,o=$K(r)?r:CP,c=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return a.jsx(RK.div,{"data-orientation":o,...c,...s,ref:t})});l5.displayName=IK;function $K(e){return MK.includes(e)}var c5=l5;const u5=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(c5,{ref:s,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));u5.displayName=c5.displayName;var Cy="focusScope.autoFocusOnMount",_y="focusScope.autoFocusOnUnmount",_P={bubbles:!1,cancelable:!0},DK="FocusScope",Ef=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),g=wt(t,b=>d(b)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let b=function(N){if(x.paused||!c)return;const E=N.target;c.contains(E)?p.current=E:Ho(p.current,{select:!0})},y=function(N){if(x.paused||!c)return;const E=N.relatedTarget;E!==null&&(c.contains(E)||Ho(p.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const A of N)A.removedNodes.length>0&&Ho(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,x.paused]),m.useEffect(()=>{if(c){EP.add(x);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(Cy,_P);c.addEventListener(Cy,f),c.dispatchEvent(S),S.defaultPrevented||(LK(UK(d5(c)),{select:!0}),document.activeElement===b&&Ho(c))}return()=>{c.removeEventListener(Cy,f),setTimeout(()=>{const S=new CustomEvent(_y,_P);c.addEventListener(_y,h),c.dispatchEvent(S),S.defaultPrevented||Ho(b??document.body,{select:!0}),c.removeEventListener(_y,h),EP.remove(x)},0)}}},[c,f,h,x]);const j=m.useCallback(b=>{if(!n&&!r||x.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]=FK(C);N&&E?!b.shiftKey&&S===E?(b.preventDefault(),n&&Ho(N,{select:!0})):b.shiftKey&&S===N&&(b.preventDefault(),n&&Ho(E,{select:!0})):S===C&&b.preventDefault()}},[n,r,x.paused]);return a.jsx(Ge.div,{tabIndex:-1,...i,ref:g,onKeyDown:j})});Ef.displayName=DK;function LK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ho(r,{select:t}),document.activeElement!==n)return}function FK(e){const t=d5(e),n=AP(t,e),r=AP(t.reverse(),e);return[n,r]}function d5(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 AP(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 zK(e){return e instanceof HTMLInputElement&&"select"in e}function Ho(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&zK(e)&&t&&e.select()}}var EP=qK();function qK(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=PP(e,t),e.unshift(t)},remove(t){e=PP(e,t),e[0]?.resume()}}}function PP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function UK(e){return e.filter(t=>t.tagName!=="A")}var Ay=0;function bv(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kP()),document.body.insertAdjacentElement("beforeend",e[1]??kP()),Ay++,()=>{Ay===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ay--}},[])}function kP(){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 vs=function(){return vs=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},vs.apply(this,arguments)};function f5(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 WK(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 kh="right-scroll-bar-position",Th="width-before-scroll-bar",VK="with-scroll-bars-hidden",HK="--removed-body-scroll-bar-size";function Ey(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function KK(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 GK=typeof window<"u"?m.useLayoutEffect:m.useEffect,TP=new WeakMap;function YK(e,t){var n=KK(null,function(r){return e.forEach(function(s){return Ey(s,r)})});return GK(function(){var r=TP.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)})}TP.set(n,e)},[e]),n}function XK(e){return e}function QK(e,t){t===void 0&&(t=XK);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 JK(e){e===void 0&&(e={});var t=QK(null);return t.options=vs({async:!0,ssr:!1},e),t}var p5=function(e){var t=e.sideCar,n=f5(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,vs({},n))};p5.isSideCarExport=!0;function ZK(e,t){return e.useMedium(t),p5}var h5=JK(),Py=function(){},wv=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Py,onWheelCapture:Py,onTouchMoveCapture:Py}),s=r[0],o=r[1],i=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,g=e.sideCar,x=e.noRelative,j=e.noIsolation,b=e.inert,y=e.allowPinchZoom,S=e.as,C=S===void 0?"div":S,N=e.gapMode,E=f5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,P=YK([n,t]),T=vs(vs({},E),s);return m.createElement(m.Fragment,null,h&&m.createElement(A,{sideCar:h5,removeScrollBar:f,shards:p,noRelative:x,noIsolation:j,inert:b,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:N}),i?m.cloneElement(m.Children.only(c),vs(vs({},T),{ref:P})):m.createElement(C,vs({},T,{className:d,ref:P}),c))});wv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wv.classNames={fullWidth:Th,zeroRight:kh};var eG=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=eG();return t&&e.setAttribute("nonce",t),e}function nG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=tG())&&(nG(t,n),rG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},sG=function(){var e=aG();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},m5=function(){var e=sG(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},oG={left:0,top:0,right:0,gap:0},ky=function(e){return parseInt(e||"",10)||0},iG=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[ky(n),ky(r),ky(s)]},lG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return oG;var t=iG(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])}},cG=m5(),yc="data-scroll-locked",uG=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(VK,` {
11
- overflow: hidden `).concat(r,`;
12
- padding-right: `).concat(c,"px ").concat(r,`;
13
- }
14
- body[`).concat(yc,`] {
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(kh,` {
28
- right: `).concat(c,"px ").concat(r,`;
29
- }
30
-
31
- .`).concat(Th,` {
32
- margin-right: `).concat(c,"px ").concat(r,`;
33
- }
34
-
35
- .`).concat(kh," .").concat(kh,` {
36
- right: 0 `).concat(r,`;
37
- }
38
-
39
- .`).concat(Th," .").concat(Th,` {
40
- margin-right: 0 `).concat(r,`;
41
- }
42
-
43
- body[`).concat(yc,`] {
44
- `).concat(HK,": ").concat(c,`px;
45
- }
46
- `)},OP=function(){var e=parseInt(document.body.getAttribute(yc)||"0",10);return isFinite(e)?e:0},dG=function(){m.useEffect(function(){return document.body.setAttribute(yc,(OP()+1).toString()),function(){var e=OP()-1;e<=0?document.body.removeAttribute(yc):document.body.setAttribute(yc,e.toString())}},[])},fG=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;dG();var o=m.useMemo(function(){return lG(s)},[s]);return m.createElement(cG,{styles:uG(o,!t,s,n?"":"!important")})},vS=!1;if(typeof window<"u")try{var sh=Object.defineProperty({},"passive",{get:function(){return vS=!0,!0}});window.addEventListener("test",sh,sh),window.removeEventListener("test",sh,sh)}catch{vS=!1}var Ql=vS?{passive:!1}:!1,pG=function(e){return e.tagName==="TEXTAREA"},v5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pG(e)&&n[t]==="visible")},hG=function(e){return v5(e,"overflowY")},mG=function(e){return v5(e,"overflowX")},RP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=g5(e,r);if(s){var o=x5(e,r),i=o[1],c=o[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},vG=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},gG=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},g5=function(e,t){return e==="v"?hG(t):mG(t)},x5=function(e,t){return e==="v"?vG(t):gG(t)},xG=function(e,t){return e==="h"&&t==="rtl"?-1:1},yG=function(e,t,n,r,s){var o=xG(e,window.getComputedStyle(t).direction),i=o*r,c=n.target,d=t.contains(c),f=!1,h=i>0,p=0,g=0;do{if(!c)break;var x=x5(e,c),j=x[0],b=x[1],y=x[2],S=b-y-o*j;(j||S)&&g5(e,c)&&(p+=S,g+=j);var C=c.parentNode;c=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(g)<1)&&(f=!0),f},oh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},IP=function(e){return[e.deltaX,e.deltaY]},MP=function(e){return e&&"current"in e?e.current:e},bG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wG=function(e){return`
47
- .block-interactivity-`.concat(e,` {pointer-events: none;}
48
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
49
- `)},jG=0,Jl=[];function SG(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(jG++)[0],o=m.useState(m5)[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=WK([e.lockRef.current],(e.shards||[]).map(MP),!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=oh(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,P=b.target,T=Math.abs(N)>Math.abs(E)?"h":"v";if("touches"in b&&T==="h"&&P.type==="range")return!1;var O=window.getSelection(),$=O&&O.anchorNode,z=$?$===P||$.contains(P):!1;if(z)return!1;var U=RP(T,P);if(!U)return!0;if(U?A=T:(A=T==="v"?"h":"v",U=RP(T,P)),!U)return!1;if(!r.current&&"changedTouches"in b&&(N||E)&&(r.current=A),!A)return!0;var B=r.current||A;return yG(B,y,b,B==="h"?N:E)},[]),d=m.useCallback(function(b){var y=b;if(!(!Jl.length||Jl[Jl.length-1]!==o)){var S="deltaY"in y?IP(y):oh(y),C=t.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&bG(A.delta,S)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var N=(i.current.shards||[]).map(MP).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:NG(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=oh(b),r.current=void 0},[]),p=m.useCallback(function(b){f(b.type,IP(b),b.target,c(b,e.lockRef.current))},[]),g=m.useCallback(function(b){f(b.type,oh(b),b.target,c(b,e.lockRef.current))},[]);m.useEffect(function(){return Jl.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,Ql),document.addEventListener("touchmove",d,Ql),document.addEventListener("touchstart",h,Ql),function(){Jl=Jl.filter(function(b){return b!==o}),document.removeEventListener("wheel",d,Ql),document.removeEventListener("touchmove",d,Ql),document.removeEventListener("touchstart",h,Ql)}},[]);var x=e.removeScrollBar,j=e.inert;return m.createElement(m.Fragment,null,j?m.createElement(o,{styles:wG(s)}):null,x?m.createElement(fG,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function NG(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const CG=ZK(h5,SG);var Pf=m.forwardRef(function(e,t){return m.createElement(wv,vs({},e,{ref:t,sideCar:CG}))});Pf.classNames=wv.classNames;var _G=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zl=new WeakMap,ih=new WeakMap,lh={},Ty=0,y5=function(e){return e&&(e.host||y5(e.parentNode))},AG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=y5(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})},EG=function(e,t,n,r){var s=AG(t,Array.isArray(e)?e:[e]);lh[n]||(lh[n]=new WeakMap);var o=lh[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(g){if(c.has(g))h(g);else try{var x=g.getAttribute(r),j=x!==null&&x!=="false",b=(Zl.get(g)||0)+1,y=(o.get(g)||0)+1;Zl.set(g,b),o.set(g,y),i.push(g),b===1&&j&&ih.set(g,!0),y===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return h(t),c.clear(),Ty++,function(){i.forEach(function(p){var g=Zl.get(p)-1,x=o.get(p)-1;Zl.set(p,g),o.set(p,x),g||(ih.has(p)||p.removeAttribute(r),ih.delete(p)),x||p.removeAttribute(n)}),Ty--,Ty||(Zl=new WeakMap,Zl=new WeakMap,ih=new WeakMap,lh={})}},jv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=_G(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),EG(r,s,n,"aria-hidden")):function(){return null}};function PG(e){const t=kG(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(OG);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 kG(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=IG(s),c=RG(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Tr(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 OG(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TG}function RG(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 IG(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 Sv="Dialog",[b5,w5]=hr(Sv),[MG,ts]=b5(Sv),j5=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]=pa({prop:r,defaultProp:s??!1,onChange:o,caller:Sv});return a.jsx(MG,{scope:t,triggerRef:c,contentRef:d,contentId:tr(),titleId:tr(),descriptionId:tr(),open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),modal:i,children:n})};j5.displayName=Sv;var S5="DialogTrigger",N5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ts(S5,n),o=wt(t,s.triggerRef);return a.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ON(s.open),...r,ref:o,onClick:Te(e.onClick,s.onOpenToggle)})});N5.displayName=S5;var kN="DialogPortal",[$G,C5]=b5(kN,{forceMount:void 0}),_5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=ts(kN,t);return a.jsx($G,{scope:t,forceMount:n,children:m.Children.map(r,i=>a.jsx(Gn,{present:n||o.open,children:a.jsx(vl,{asChild:!0,container:s,children:i})}))})};_5.displayName=kN;var Uh="DialogOverlay",A5=m.forwardRef((e,t)=>{const n=C5(Uh,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ts(Uh,e.__scopeDialog);return o.modal?a.jsx(Gn,{present:r||o.open,children:a.jsx(LG,{...s,ref:t})}):null});A5.displayName=Uh;var DG=PG("DialogOverlay.RemoveScroll"),LG=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ts(Uh,n);return a.jsx(Pf,{as:DG,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Ge.div,{"data-state":ON(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Zi="DialogContent",E5=m.forwardRef((e,t)=>{const n=C5(Zi,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ts(Zi,e.__scopeDialog);return a.jsx(Gn,{present:r||o.open,children:o.modal?a.jsx(FG,{...s,ref:t}):a.jsx(BG,{...s,ref:t})})});E5.displayName=Zi;var FG=m.forwardRef((e,t)=>{const n=ts(Zi,e.__scopeDialog),r=m.useRef(null),s=wt(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return jv(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=ts(Zi,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=ts(Zi,n),d=m.useRef(null),f=wt(t,d);return bv(),a.jsxs(a.Fragment,{children:[a.jsx(Ef,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(ml,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":ON(c.open),...i,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(qG,{titleId:c.titleId}),a.jsx(WG,{contentRef:d,descriptionId:c.descriptionId})]})]})}),TN="DialogTitle",k5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ts(TN,n);return a.jsx(Ge.h2,{id:s.titleId,...r,ref:t})});k5.displayName=TN;var T5="DialogDescription",O5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ts(T5,n);return a.jsx(Ge.p,{id:s.descriptionId,...r,ref:t})});O5.displayName=T5;var R5="DialogClose",I5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ts(R5,n);return a.jsx(Ge.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});I5.displayName=R5;function ON(e){return e?"open":"closed"}var M5="DialogTitleWarning",[zG,$5]=NU(M5,{contentName:Zi,titleName:TN,docsSlug:"dialog"}),qG=({titleId:e})=>{const t=$5(M5),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},UG="DialogDescriptionWarning",WG=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$5(UG).contentName}}.`;return m.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Nv=j5,VG=N5,Cv=_5,du=A5,fu=E5,kf=k5,Tf=O5,_v=I5;const D5=Nv,HG=Cv,L5=m.forwardRef(({className:e,...t},n)=>a.jsx(du,{className:Se("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}));L5.displayName=du.displayName;const KG=gl("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(HG,{children:[a.jsx(L5,{}),a.jsxs(fu,{ref:s,className:Se(KG({side:e}),t),...r,children:[n,a.jsxs(_v,{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(_s,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));RN.displayName=fu.displayName;const F5=({className:e,...t})=>a.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});F5.displayName="SheetHeader";const B5=m.forwardRef(({className:e,...t},n)=>a.jsx(kf,{ref:n,className:Se("text-lg font-semibold text-foreground",e),...t}));B5.displayName=kf.displayName;const GG=m.forwardRef(({className:e,...t},n)=>a.jsx(Tf,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));GG.displayName=Tf.displayName;function $P({className:e,...t}){return a.jsx("div",{className:Se("animate-pulse rounded-md bg-muted",e),...t})}const YG="sidebar:state",XG=3600*24*7,QG="16rem",JG="18rem",ZG="3rem",eY="b",z5=m.createContext(null);function Of(){const e=m.useContext(z5);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const q5=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,g]=m.useState(e),x=t??p,j=m.useCallback(C=>{const N=typeof C=="function"?C(x):C;n?n(N):g(N),document.cookie=`${YG}=${N}; path=/; max-age=${XG}`},[n,x]),b=m.useCallback(()=>d?h(C=>!C):j(C=>!C),[d,j,h]);m.useEffect(()=>{const C=N=>{N.key===eY&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),b())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[b]);const y=x?"expanded":"collapsed",S=m.useMemo(()=>({state:y,open:x,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:b}),[y,x,j,d,f,h,b]);return a.jsx(z5.Provider,{value:S,children:a.jsx(ni,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":QG,"--sidebar-width-icon":ZG,...s},className:Se("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...i,children:o})})})});q5.displayName="SidebarProvider";const U5=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}=Of();return n==="none"?a.jsx("div",{className:Se("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:i,...o,children:s}):c?a.jsx(D5,{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":JG},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:Se("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:Se("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})})]})});U5.displayName="Sidebar";const W5=m.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:s}=Of();return a.jsxs(se,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Se("h-7 w-7",e),onClick:o=>{t?.(o),s()},...n,children:[a.jsx(I7,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});W5.displayName="SidebarTrigger";const tY=m.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=Of();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Se("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})});tY.displayName="SidebarRail";const nY=m.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:Se("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}));nY.displayName="SidebarInset";const rY=m.forwardRef(({className:e,...t},n)=>a.jsx(mt,{ref:n,"data-sidebar":"input",className:Se("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));rY.displayName="SidebarInput";const V5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:Se("flex flex-col gap-2 p-2",e),...t}));V5.displayName="SidebarHeader";const H5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:Se("flex flex-col gap-2 p-2",e),...t}));H5.displayName="SidebarFooter";const gS=m.forwardRef(({className:e,...t},n)=>a.jsx(u5,{ref:n,"data-sidebar":"separator",className:Se("mx-2 w-auto bg-sidebar-border",e),...t}));gS.displayName="SidebarSeparator";const K5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:Se("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));K5.displayName="SidebarContent";const G5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:Se("relative flex w-full min-w-0 flex-col p-2",e),...t}));G5.displayName="SidebarGroup";const Y5=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?ci:"div";return a.jsx(s,{ref:r,"data-sidebar":"group-label",className:Se("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})});Y5.displayName="SidebarGroupLabel";const aY=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?ci:"button";return a.jsx(s,{ref:r,"data-sidebar":"group-action",className:Se("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})});aY.displayName="SidebarGroupAction";const X5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:Se("w-full text-sm",e),...t}));X5.displayName="SidebarGroupContent";const Q5=m.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:Se("flex w-full min-w-0 flex-col gap-1",e),...t}));Q5.displayName="SidebarMenu";const J5=m.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Se("group/menu-item relative",e),...t}));J5.displayName="SidebarMenuItem";const sY=gl("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"}}),Z5=m.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:o,...i},c)=>{const d=e?ci:"button",{isMobile:f,state:h}=Of(),p=a.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Se(sY({variant:n,size:r}),o),...i});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(ri,{children:[a.jsx(ai,{asChild:!0,children:p}),a.jsx(lo,{side:"right",align:"center",hidden:h!=="collapsed"||f,...s})]})):p});Z5.displayName="SidebarMenuButton";const oY=m.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const o=t?ci:"button";return a.jsx(o,{ref:s,"data-sidebar":"menu-action",className:Se("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})});oY.displayName="SidebarMenuAction";const iY=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:Se("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}));iY.displayName="SidebarMenuBadge";const lY=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:Se("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&a.jsx($P,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),a.jsx($P,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});lY.displayName="SidebarMenuSkeleton";const cY=m.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:Se("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}));cY.displayName="SidebarMenuSub";const uY=m.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));uY.displayName="SidebarMenuSubItem";const dY=m.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},o)=>{const i=e?ci:"a";return a.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:Se("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})});dY.displayName="SidebarMenuSubButton";const e3=m.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...s},o)=>a.jsx(bK,{ref:o,to:r,className:({isActive:i,isPending:c})=>Se(e,i&&t,c&&n),...s}));e3.displayName="NavLink";function fY({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 pY=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:Z$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:J$},{title:"Analyze MCP",url:"/tool-analysis",icon:eD},{title:"OAuth Debugger",url:"/oauth-debugger",icon:D7}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:Q$},{title:"MCP servers",url:"/libraries/servers",icon:X$},{title:"Agents",url:"/libraries/agents",icon:kr}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:Zs},{title:"Evaluation Results",url:"/results",icon:Nc},{title:"Compare Evaluations",url:"/compare",icon:cN},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:tD},{title:"Custom Reports",url:"/markdown-reports",icon:cc}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:fN},{title:"MCPLab MCP server",url:"/settings/mcp",icon:Jj}]}];function hY(e={version:null}){const t=e.version??null,{state:n}=Of(),r=n==="collapsed",s=Rs(),o=m.useMemo(()=>pY,[]);return a.jsxs(U5,{collapsible:"icon",children:[a.jsx(V5,{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(fY,{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(K5,{children:o.map((i,c)=>a.jsxs("div",{children:[c>0&&!r&&a.jsx(gS,{className:"my-1.5"}),a.jsxs(G5,{className:r?"px-2":"px-3 py-2",children:[!r&&a.jsx(Y5,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:i.title}),a.jsx(X5,{children:a.jsx(Q5,{children:i.items.map(d=>a.jsx(J5,{children:a.jsx(Z5,{asChild:!0,isActive:d.url==="/"?s.pathname==="/":d.url==="/settings"?s.pathname==="/settings":s.pathname.startsWith(d.url),tooltip:d.title,children:a.jsxs(e3,{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(H5,{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(E7,{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 t3=m.forwardRef(({...e},t)=>a.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));t3.displayName="Breadcrumb";const n3=m.forwardRef(({className:e,...t},n)=>a.jsx("ol",{ref:n,className:Se("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));n3.displayName="BreadcrumbList";const r3=m.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,className:Se("inline-flex items-center gap-1.5",e),...t}));r3.displayName="BreadcrumbItem";const a3=m.forwardRef(({asChild:e,className:t,...n},r)=>{const s=e?ci:"a";return a.jsx(s,{ref:r,className:Se("transition-colors hover:text-foreground",t),...n})});a3.displayName="BreadcrumbLink";const s3=m.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Se("font-normal text-foreground",e),...t}));s3.displayName="BreadcrumbPage";const o3=({children:e,className:t,...n})=>a.jsx("li",{role:"presentation","aria-hidden":"true",className:Se("[&>svg]:size-3.5",t),...n,children:e??a.jsx(lN,{})});o3.displayName="BreadcrumbSeparator";function gs(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function ac(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 Ys(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 mY(e){const t=gs();for(const n of e)ac(t,n);return Ys(t)}function vY(e,t){return`${e}-${t+1}`}function gY(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 i3(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 sc(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 g=String(p.id||p.name||"").trim();if(!g)continue;const x=g;s.set(g,x);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="api_key"||p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",b={id:x,name:String(p.name||g),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.token??(p.auth.env?`\${${p.auth.env}}`:void 0):p.auth?.type==="api_key"?p.auth.value:void 0,apiKeyHeaderName:p.auth?.type==="api_key"?p.auth.header_name:void 0,oauthClientId:p.auth?.type==="oauth_authorization_code"?p.auth.client_id:void 0,oauthClientSecret:p.auth?.type==="oauth_authorization_code"?p.auth.client_secret:void 0,oauthRedirectUrl:p.auth?.type==="oauth_authorization_code"?p.auth.redirect_url:void 0,oauthScope:p.auth?.type==="oauth_authorization_code"||p.auth?.type==="oauth_client_credentials"?p.auth.scope:void 0,oauthMode:p.auth?.type==="oauth_authorization_code"?p.auth.mode:void 0,oauthAuthorizationUrl:p.auth?.type==="oauth_authorization_code"?p.auth.authorization_url:void 0,oauthTokenEndpoint:p.auth?.type==="oauth_authorization_code"?p.auth.token_url:void 0,oauthTokenUrl:p.auth?.type==="oauth_client_credentials"?p.auth.token_url:void 0,oauthClientIdEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_id_env:void 0,oauthClientSecretEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_secret_env:void 0,oauthAudience:p.auth?.type==="oauth_client_credentials"?p.auth.audience:void 0};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 g=String(p.id||p.name||"").trim();if(!g)continue;const x=g,j=p.provider==="azure_openai"?"azure":p.provider,b={id:x,name:String(p.name||g),provider:j,model:p.model,temperature:p.temperature??0,maxTokens:p.max_tokens??2048,maxTurns:p.max_turns,systemPrompt:p.system};c.push(b),d.push({kind:"inline",agent:b})}const f=[],h=[];return e.config.scenarios.forEach((p,g)=>{if("ref"in p){const b=String(p.ref||"").trim();if(!b)return;h.push({kind:"referenced",ref:b});return}const x=[];for(const b of p.eval?.tool_constraints?.required_tools??[])x.push({type:"required_tool",value:b});for(const b of p.eval?.tool_constraints?.forbidden_tools??[])x.push({type:"forbidden_tool",value:b});for(const b of p.eval?.response_assertions??[])x.push(gY(b));const j={id:p.id||vY("scn",g),name:p.name||p.id||`Scenario ${g+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)];if("id"in y&&y.id){const S=String(y.id);if(!s.has(S)){s.set(S,S);const C=y.auth,N=C?.type==="bearer"?"bearer":C?.type==="api_key"||C?.type==="oauth_client_credentials"?"api-key":C?.type==="oauth_authorization_code"?"oauth2":"none";o.push({id:S,name:String(y.name||S),transport:"streamable-http",url:String(y.url||""),authType:N,authValue:C?.type==="bearer"?String(C.token||"")||(C.env?`\${${C.env}}`:void 0):C?.type==="api_key"?String(C.value||""):void 0,apiKeyHeaderName:C?.type==="api_key"?String(C.header_name||""):void 0,oauthClientId:C?.type==="oauth_authorization_code"&&String(C.client_id||"")||void 0,oauthClientSecret:C?.type==="oauth_authorization_code"&&String(C.client_secret||"")||void 0,oauthRedirectUrl:C?.type==="oauth_authorization_code"&&String(C.redirect_url||"")||void 0,oauthScope:(C?.type==="oauth_authorization_code"||C?.type==="oauth_client_credentials")&&String(C.scope||"")||void 0,oauthMode:C?.type==="oauth_authorization_code"?C.mode:void 0,oauthAuthorizationUrl:C?.type==="oauth_authorization_code"&&String(C.authorization_url||"")||void 0,oauthTokenEndpoint:C?.type==="oauth_authorization_code"&&String(C.token_url||"")||void 0,oauthTokenUrl:C?.type==="oauth_client_credentials"?String(C.token_url||""):void 0,oauthClientIdEnv:C?.type==="oauth_client_credentials"?String(C.client_id_env||""):void 0,oauthClientSecretEnv:C?.type==="oauth_client_credentials"?String(C.client_secret_env||""):void 0,oauthAudience:C?.type==="oauth_client_credentials"&&String(C.audience||"")||void 0}),i.push({kind:"inline",server:o[o.length-1]})}return[S]}return[]}):[]})(),prompt:p.prompt,snapshotEval:p.snapshot_eval?{enabled:p.snapshot_eval.enabled,baselineSnapshotId:p.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:p.snapshot_eval.baseline_source_run_id,lastUpdatedAt:p.snapshot_eval.last_updated_at}:void 0,evalRules:x,extractRules:(p.extract??[]).map(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 xY(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=sc(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function DP(e){const t=new Map,n=x=>{const j=x.id,b=x.authValue?.trim()??"",y=x.apiKeyHeaderName?.trim()??"",S=x.authType==="bearer"?(()=>{if(!b)throw new Error(`Server '${j}' is missing bearer token value`);return{type:"bearer",token:b}})():x.authType==="api-key"&&!x.oauthTokenUrl?{type:"api_key",...y?{header_name:y}:{},value:(()=>{if(!b)throw new Error(`Server '${j}' is missing API key value`);return b})()}:x.authType==="api-key"?{type:"oauth_client_credentials",token_url:x.oauthTokenUrl||"",client_id_env:x.oauthClientIdEnv||"",client_secret_env:x.oauthClientSecretEnv||"",...x.oauthScope?{scope:x.oauthScope}:{},...x.oauthAudience?{audience:x.oauthAudience}:{}}:x.authType==="oauth2"?{type:"oauth_authorization_code",...x.oauthMode==="dcr"?{mode:"dcr"}:{},...x.oauthMode!=="dcr"&&x.oauthClientId?{client_id:x.oauthClientId}:{},...x.oauthClientSecret?{client_secret:x.oauthClientSecret}:{},...x.oauthRedirectUrl?{redirect_url:x.oauthRedirectUrl}:{},...x.oauthScope?{scope:x.oauthScope}:{},...x.oauthAuthorizationUrl?{authorization_url:x.oauthAuthorizationUrl}:{},...x.oauthTokenEndpoint?{token_url:x.oauthTokenEndpoint}:{}}:void 0;return{id:j,...x.name&&x.name!==j?{name:x.name}:{},transport:"http",url:x.url||"http://localhost:3000/mcp",...S!==void 0?{auth:S}:{}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(x=>({kind:"inline",server:x}))],s=new Set,o=new Map,i=r.flatMap(x=>{if(x.kind==="referenced"){const b=String(x.ref||"").trim();return!b||s.has(b)?[]:(s.add(b),t.set(b,b),[{ref:b}])}const j=n(x.server);return t.set(x.server.id,j.id),o.set(j.id,j),[j]}),c=x=>{const j=x.id;return{id:j,...x.name&&x.name!==j?{name:x.name}:{},provider:x.provider==="azure"?"azure_openai":x.provider==="anthropic"?"anthropic":"openai",model:x.model,temperature:x.temperature,max_tokens:x.maxTokens,max_turns:x.maxTurns,system:x.systemPrompt}},d=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(x=>({kind:"inline",agent:x}))],f=new Set,h=d.flatMap(x=>{if(x.kind==="referenced"){const j=String(x.ref||"").trim();return!j||f.has(j)?[]:(f.add(j),[{ref:j}])}return[c(x.agent)]}),p=x=>{const j=x.evalRules.filter(S=>S.type==="required_tool").map(S=>S.value).filter(S=>typeof S=="string"&&S.length>0),b=x.evalRules.filter(S=>S.type==="forbidden_tool").map(S=>S.value).filter(S=>typeof S=="string"&&S.length>0),y=x.evalRules.map(S=>i3(S)).filter(S=>!!S);return{id:x.id,name:x.name||void 0,mcp_servers:x.serverIds.length>0?x.serverIds.map(S=>{const C=t.get(S)??S;return o.get(C)??{ref:C}}):void 0,prompt:x.prompt,...x.snapshotEval?{snapshot_eval:{enabled:x.snapshotEval.enabled,baseline_snapshot_id:x.snapshotEval.baselineSnapshotId,baseline_source_run_id:x.snapshotEval.baselineSourceRunId,last_updated_at:x.snapshotEval.lastUpdatedAt}}:{},eval:{tool_constraints:{required_tools:j,forbidden_tools:b},response_assertions:y},extract:x.extractRules.map(S=>({name:S.name,from:"final_text",regex:S.pattern}))}},g=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(x=>x.kind==="referenced"?{ref:x.ref}:p(x.scenario)):[...e.scenarios.map(x=>p(x))];return{name:e.configName?.trim()||void 0,servers:i,agents:h,scenarios:g,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0,snapshot_eval:e.snapshotEval?{enabled:e.snapshotEval.enabled,mode:e.snapshotEval.mode,baseline_snapshot_id:e.snapshotEval.baselineSnapshotId,baseline_source_run_id:e.snapshotEval.baselineSourceRunId,last_updated_at:e.snapshotEval.lastUpdatedAt}:void 0}}function yY(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=>i3(s)).filter(s=>!!s)},extract:r.extractRules.map(s=>({name:s.name,from:"final_text",regex:s.pattern}))}))}}function bY(e,t){if(e)return`${e}::${t??""}`}function ch(e){return e.type==="text"}function l3(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 c3(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(ch);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 g of d.content)g.type==="tool_result"&&(g.tool_use_id?h.set(g.tool_use_id,g):p.push(g));for(const g of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:LP(g.input??{}),toolName:g.name,timestamp:i.ts,estimatedTokens:g.estimated_tokens?{inputTokens:g.estimated_tokens.input,outputTokens:g.estimated_tokens.output,totalTokens:g.estimated_tokens.total}:void 0,estimatedTokenMethod:g.estimated_tokens?.method});const x=h.get(g.id);if(!x)continue;const j=x.content.filter(ch).map(b=>b.text).join(`
54
- `);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:j,toolName:x.name,ok:!x.is_error,durationMs:x.duration_ms,timestamp:x.ts_end??d.ts,estimatedTokens:x.estimated_tokens?{inputTokens:x.estimated_tokens.input,outputTokens:x.estimated_tokens.output,totalTokens:x.estimated_tokens.total}:void 0,estimatedTokenMethod:x.estimated_tokens?.method}),h.delete(g.id)}for(const g of[...h.values(),...p]){const x=g.content.filter(ch).map(j=>j.text).join(`
55
- `);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:x,toolName:g.name,ok:!g.is_error,durationMs:g.duration_ms,timestamp:g.ts_end??d.ts,estimatedTokens:g.estimated_tokens?{inputTokens:g.estimated_tokens.input,outputTokens:g.estimated_tokens.output,totalTokens:g.estimated_tokens.total}:void 0,estimatedTokenMethod:g.estimated_tokens?.method})}o+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:LP(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(ch).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 LP(e){try{return JSON.stringify(e)}catch{return String(e)}}function FP(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 Oy(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 u3(e){const t=gs(),n=gs(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(const o of e.messages??[]){if(o.role!=="assistant")continue;FP(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 g=p.estimated_tokens;n.input+=g.input,n.hasInput=!0,n.output+=g.output,n.hasOutput=!0,n.total+=g.total,n.hasTotal=!0;const x=r.get(p.name)??gs();x.input+=g.input,x.hasInput=!0,x.output+=g.output,x.hasOutput=!0,x.total+=g.total,x.hasTotal=!0,r.set(p.name,x)}continue}FP(n,o.usage);const d=Oy(o.usage?.input_tokens,i.length),f=Oy(o.usage?.output_tokens,i.length),h=Oy(o.usage?.total_tokens,i.length);for(let p=0;p<i.length;p+=1){const g=i[p].name,x=r.get(g)??gs(),j=d[p],b=f[p],y=h[p];typeof j=="number"&&(x.input+=j,x.hasInput=!0),typeof b=="number"&&(x.output+=b,x.hasOutput=!0),typeof y=="number"&&(x.total+=y,x.hasTotal=!0),r.set(g,x)}}const s={};for(const[o,i]of Array.from(r.entries()).sort((c,d)=>c[0].localeCompare(d[0]))){const c=Ys(i);c&&(s[o]=c)}return{assistant:Ys(t),tool:Ys(n),perTool:s}}function BP(e,t=[]){const n=new Map;for(const i of t){const c=bY(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=u3(C);return{runIndex:y.run_index,passed:y.pass,toolCalls:l3(y,C),assistantTokenUsage:N.assistant,toolTokenUsage:N.tool,toolTokenUsageByTool:N.perTool,finalAnswer:y.final_text,conversation:c3(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=gs(),p=gs(),g=new Map;for(const y of f){ac(h,y.assistantTokenUsage),ac(p,y.toolTokenUsage);for(const[S,C]of Object.entries(y.toolTokenUsageByTool??{})){const N=g.get(S)??gs();ac(N,C),g.set(S,N)}}const x={};for(const[y,S]of Array.from(g.entries()).sort((C,N)=>C[0].localeCompare(N[0]))){const C=Ys(S);C&&(x[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:Ys(h),toolTokenUsage:Ys(p),toolTokenUsageByTool:x}}),s=gs(),o=gs();for(const i of r)ac(s,i.assistantTokenUsage),ac(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:Ys(s),toolTokenUsage:Ys(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 wY(e,t){const n=u3(t??void 0);return{runIndex:e.run_index,passed:e.pass,toolCalls:l3(e,t??void 0),assistantTokenUsage:n.assistant,toolTokenUsage:n.tool,toolTokenUsageByTool:n.perTool,finalAnswer:e.final_text,conversation:c3(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 jY(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const Wi=jY();class IN extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function lt(e,t){const n=await fetch(`${Wi}${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 SY(e,t){const n=await fetch(`${Wi}${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 zP(e,t){const n=new EventSource(`${Wi}${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(`${Wi}${r}`,{method:"GET",cache:"no-store",headers:{accept:"application/json"}}).then(d=>{(d.status===404||d.status===410)&&i()}).catch(()=>{})}},()=>i()}const Qe={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)=>zP(`/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)=>zP(`/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(`${Wi}/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(`${Wi}/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`):SY(`/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(`${Wi}/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 NY(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 CY(e){return e||`config-${Date.now()}`}const _Y={async health(){return Qe.health()},async listConfigs(){return(await Qe.listConfigs()).map(sc)},async createConfig(e){const t=await Qe.createConfig(NY(e),DP(e));return sc(t)},async updateConfig(e){const t=await Qe.updateConfig(e.id,DP(e),CY(e.name));return sc(t)},async deleteConfig(e){await Qe.deleteConfig(e)},async listResults(){const t=(await Qe.listRuns()).map(async n=>{const[{results:r},s]=await Promise.all([Qe.getRun(n.runId),Qe.getRunTrace(n.runId)]);return BP(r,s.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([Qe.getRun(e),Qe.getRunTrace(e)]);return BP(t,n.records)}catch{return}},async deleteResult(e){await Qe.deleteRun(e)},async updateRunNote(e,t){await Qe.updateRunNote(e,t)},async listMarkdownReports(){return Qe.listMarkdownReports()},async getMarkdownReport(e){return Qe.getMarkdownReport(e)},async deleteMarkdownReport(e){await Qe.deleteMarkdownReport(e)},async startRun(e){return Qe.startRun(e)},async runScenarioPreview(e){const t=await Qe.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:wY(n,t.scenario.traceRecord)}},async stopRun(e){await Qe.stopRun(e)},async getRunQueue(){return Qe.getRunQueue()},async removeQueuedRun(e){await Qe.removeQueuedRun(e)},async resumeQueue(){return Qe.resumeQueue()},subscribeRunJob(e,t){return Qe.subscribeRunJob(e,t)},async listSnapshots(){return Qe.listSnapshots()},async createSnapshotFromRun(e,t){return Qe.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await Qe.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return Qe.compareSnapshot(e,t)},async applyResultAssistantReport(e){return Qe.applyResultAssistantReport(e)},async createResultAssistantSession(e){return Qe.createResultAssistantSession(e)},async getResultAssistantSession(e){return Qe.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return Qe.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return Qe.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return Qe.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await Qe.closeResultAssistantSession(e)},subscribeResultAssistantSessionEvents(e,t){return Qe.subscribeResultAssistantSessionEvents(e,t)},async generateSnapshotEvalBaseline(e,t,n){const r=await Qe.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:sc(r.config)}},async updateSnapshotPolicy(e,t){const n=await Qe.updateSnapshotPolicy(e,t);return sc(n)},async getLibraries(){const e=await Qe.getLibraries();return xY(e)},async saveLibraries(e){await Qe.saveLibraries(yY(e))},async listProviderModels(e){return Qe.listProviderModels(e)},async getWorkspaceSettings(){return Qe.getSettings()},async updateWorkspaceSettings(e){return Qe.updateSettings(e)},async createScenarioAssistantSession(e){return Qe.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return Qe.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return Qe.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return Qe.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return Qe.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return Qe.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await Qe.closeScenarioAssistantSession(e)},subscribeScenarioAssistantSessionEvents(e,t){return Qe.subscribeScenarioAssistantSessionEvents(e,t)},async discoverToolsForAnalysis(e){return Qe.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return Qe.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return Qe.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return Qe.getToolAnalysisResult(e)},async stopToolAnalysis(e){return Qe.stopToolAnalysis(e)},async listToolAnalysisResults(){return Qe.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return Qe.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await Qe.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return Qe.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return Qe.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return Qe.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return Qe.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return Qe.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return Qe.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return Qe.exportOAuthDebuggerSession(e,t)},async createOAuthRuntimeSession(e){return Qe.createOAuthRuntimeSession(e)},async getOAuthRuntimeSession(e){return Qe.getOAuthRuntimeSession(e)},async getOAuthRuntimeSessionToken(e){return Qe.getOAuthRuntimeSessionToken(e)},async submitOAuthRuntimeCallback(e,t){return Qe.submitOAuthRuntimeCallback(e,t)},async cancelOAuthRuntimeSession(e){return Qe.cancelOAuthRuntimeSession(e)},async ensureOAuthServers(e){return Qe.ensureOAuthServers(e)}},d3=m.createContext(null);function AY({children:e}){const t="workspace",[n,r]=m.useState("checking"),[s,o]=m.useState(null);m.useEffect(()=>{r("checking"),Qe.health().then(c=>{r("connected"),o(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),o(null)})},[t]);const i=m.useMemo(()=>_Y,[]);return a.jsx(d3.Provider,{value:{mode:t,connection:n,version:s,source:i},children:e})}function Dn(){const e=m.useContext(d3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const EY=(e,t)=>{if(e==="/")return[{label:"Dashboard"}];const n=[{label:"Dashboard",to:"/"}];if(hn("/mcp-evaluations/:id",e))return n.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),n;if(hn("/mcp-evaluations",e))return n.push({label:"MCP Evaluations"}),n;if(hn("/settings/mcp",e))return n.push({label:"Settings",to:"/settings"},{label:"MCP Connection"}),n;if(hn("/settings",e))return n.push({label:"Settings"}),n;if(hn("/tool-analysis",e))return n.push({label:"Analyze MCP Tools"}),n;if(hn("/tool-analysis-results/:id",e)){const r=hn("/tool-analysis-results/:id",e);return n.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:r?.params.id??"Report"}),n}if(hn("/tool-analysis-results",e))return n.push({label:"Tool Analysis Results"}),n;if(hn("/markdown-reports/view",e))return n.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),n;if(hn("/markdown-reports",e))return n.push({label:"Markdown Reports"}),n;if(hn("/oauth-debugger",e))return n.push({label:"OAuth Debugger"}),n;if(hn("/results/:id",e))return n.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),n;if(hn("/results",e))return n.push({label:"Evaluation Results"}),n;if(hn("/run",e))return n.push({label:"Run Evaluation"}),n;if(hn("/libraries/servers/:serverId",e)){const r=hn("/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(hn("/libraries/servers",e))return n.push({label:"Libraries",to:"/libraries/servers"},{label:"MCP servers"}),n;if(hn("/libraries/agents/:agentName",e)){const r=hn("/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(hn("/libraries/agents",e))return n.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),n;if(hn("/libraries/test-cases/:testCaseId",e)){const r=hn("/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(hn("/libraries/test-cases",e))return n.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),n;if(hn("/compare/results",e))return n.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),n;if(hn("/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=Rs(),t=new URLSearchParams(e.search).get("embed")==="1",n=EY(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(jP,{})}):a.jsx(q5,{children:a.jsxs("div",{className:"flex min-h-screen w-full",children:[a.jsx(hY,{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(W5,{}),a.jsx(t3,{children:a.jsx(n3,{children:n.map((o,i)=>{const c=i===n.length-1;return a.jsxs(m.Fragment,{children:[a.jsx(r3,{children:o.to&&!c?a.jsx(a3,{asChild:!0,children:a.jsx(_t,{to:o.to,children:o.label})}):a.jsx(s3,{children:o.label})}),!c&&a.jsx(o3,{})]},`${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(jP,{})})]})]})})}const f3=m.createContext(null);function kY({children:e}){const{source:t}=Dn(),[n,r]=m.useState([]),[s,o]=m.useState(!0),i=m.useCallback(async()=>{o(!0);try{const g=await t.listConfigs();r(g)}finally{o(!1)}},[t]);m.useEffect(()=>{i()},[i]);const c=m.useCallback(g=>n.find(x=>x.id===g),[n]),d=m.useCallback(async g=>{const x=await t.createConfig(g);return r(j=>[...j,x]),x},[t]),f=m.useCallback(async(g,x)=>{const j=await t.updateConfig({...x,id:g});return r(b=>b.map(y=>y.id===g?j:y)),j},[t]),h=m.useCallback(async g=>{await t.deleteConfig(g),r(x=>x.filter(j=>j.id!==g))},[t]),p=m.useCallback(async g=>{const x=n.find(y=>y.id===g);if(!x)throw new Error("Config not found");const j={...structuredClone(x),id:`cfg-${Date.now()}`,name:`${x.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},b=await t.createConfig(j);return r(y=>[...y,b]),b},[n,t]);return a.jsx(f3.Provider,{value:{configs:n,loading:s,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:i},children:e})}function Rf(){const e=m.useContext(f3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const p3=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(p3.Provider,{value:d,children:e})}function ns(){const e=m.useContext(p3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const ze=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ze.displayName="Card";const At=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Se("flex flex-col space-y-1.5 p-6",e),...t}));At.displayName="CardHeader";const Et=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:Se("text-2xl font-semibold leading-none tracking-tight",e),...t}));Et.displayName="CardTitle";const qr=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));qr.displayName="CardDescription";const qe=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Se("p-6 pt-0",e),...t}));qe.displayName="CardContent";const OY=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Se("flex items-center p-6 pt-0",e),...t}));OY.displayName="CardFooter";const Ur=m.forwardRef(({className:e,containerClassName:t,...n},r)=>a.jsx("div",{className:Se("relative w-full overflow-auto",t),children:a.jsx("table",{ref:r,className:Se("w-full caption-bottom text-sm",e),...n})}));Ur.displayName="Table";const Wr=m.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:Se("[&_tr]:border-b",e),...t}));Wr.displayName="TableHeader";const Vr=m.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:Se("[&_tr:last-child]:border-0",e),...t}));Vr.displayName="TableBody";const RY=m.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:Se("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));RY.displayName="TableFooter";const Kt=m.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:Se("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Kt.displayName="TableRow";const at=m.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:Se("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));at.displayName="TableHead";const Be=m.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:Se("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Be.displayName="TableCell";const IY=m.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:Se("mt-4 text-sm text-muted-foreground",e),...t}));IY.displayName="TableCaption";function ms({title:e,value:t,subtitle:n,icon:r,trend:s}){return a.jsx(ze,{children:a.jsx(qe,{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 MY=gl("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?ci:"div";return a.jsx(o,{ref:s,className:Se(MY({variant:t}),e),...r})});We.displayName="Badge";function Xs({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,qP;function Yr(){if(qP)return Ry;qP=1;var e=Array.isArray;return Ry=e,Ry}var Iy,UP;function h3(){if(UP)return Iy;UP=1;var e=typeof Jp=="object"&&Jp&&Jp.Object===Object&&Jp;return Iy=e,Iy}var My,WP;function Is(){if(WP)return My;WP=1;var e=h3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return My=n,My}var $y,VP;function If(){if(VP)return $y;VP=1;var e=Is(),t=e.Symbol;return $y=t,$y}var Dy,HP;function $Y(){if(HP)return Dy;HP=1;var e=If(),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,KP;function DY(){if(KP)return Ly;KP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Ly=n,Ly}var Fy,GP;function vo(){if(GP)return Fy;GP=1;var e=If(),t=$Y(),n=DY(),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 By,YP;function go(){if(YP)return By;YP=1;function e(t){return t!=null&&typeof t=="object"}return By=e,By}var zy,XP;function pu(){if(XP)return zy;XP=1;var e=vo(),t=go(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return zy=r,zy}var qy,QP;function MN(){if(QP)return qy;QP=1;var e=Yr(),t=pu(),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,JP;function ui(){if(JP)return Uy;JP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Uy=e,Uy}var Wy,ZP;function $N(){if(ZP)return Wy;ZP=1;var e=vo(),t=ui(),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,ek;function LY(){if(ek)return Vy;ek=1;var e=Is(),t=e["__core-js_shared__"];return Vy=t,Vy}var Hy,tk;function FY(){if(tk)return Hy;tk=1;var e=LY(),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,nk;function m3(){if(nk)return Ky;nk=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,rk;function BY(){if(rk)return Gy;rk=1;var e=$N(),t=FY(),n=ui(),r=m3(),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(g){if(!n(g)||t(g))return!1;var x=e(g)?h:o;return x.test(r(g))}return Gy=p,Gy}var Yy,ak;function zY(){if(ak)return Yy;ak=1;function e(t,n){return t?.[n]}return Yy=e,Yy}var Xy,sk;function yl(){if(sk)return Xy;sk=1;var e=BY(),t=zY();function n(r,s){var o=t(r,s);return e(o)?o:void 0}return Xy=n,Xy}var Qy,ok;function Av(){if(ok)return Qy;ok=1;var e=yl(),t=e(Object,"create");return Qy=t,Qy}var Jy,ik;function qY(){if(ik)return Jy;ik=1;var e=Av();function t(){this.__data__=e?e(null):{},this.size=0}return Jy=t,Jy}var Zy,lk;function UY(){if(lk)return Zy;lk=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,ck;function WY(){if(ck)return eb;ck=1;var e=Av(),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,uk;function VY(){if(uk)return tb;uk=1;var e=Av(),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,dk;function HY(){if(dk)return nb;dk=1;var e=Av(),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,fk;function KY(){if(fk)return rb;fk=1;var e=qY(),t=UY(),n=WY(),r=VY(),s=HY();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,pk;function GY(){if(pk)return ab;pk=1;function e(){this.__data__=[],this.size=0}return ab=e,ab}var sb,hk;function DN(){if(hk)return sb;hk=1;function e(t,n){return t===n||t!==t&&n!==n}return sb=e,sb}var ob,mk;function Ev(){if(mk)return ob;mk=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,vk;function YY(){if(vk)return ib;vk=1;var e=Ev(),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,gk;function XY(){if(gk)return lb;gk=1;var e=Ev();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,xk;function QY(){if(xk)return cb;xk=1;var e=Ev();function t(n){return e(this.__data__,n)>-1}return cb=t,cb}var ub,yk;function JY(){if(yk)return ub;yk=1;var e=Ev();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,bk;function Pv(){if(bk)return db;bk=1;var e=GY(),t=YY(),n=XY(),r=QY(),s=JY();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,wk;function LN(){if(wk)return fb;wk=1;var e=yl(),t=Is(),n=e(t,"Map");return fb=n,fb}var pb,jk;function ZY(){if(jk)return pb;jk=1;var e=KY(),t=Pv(),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,Sk;function eX(){if(Sk)return hb;Sk=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,Nk;function kv(){if(Nk)return mb;Nk=1;var e=eX();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,Ck;function tX(){if(Ck)return vb;Ck=1;var e=kv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return vb=t,vb}var gb,_k;function nX(){if(_k)return gb;_k=1;var e=kv();function t(n){return e(this,n).get(n)}return gb=t,gb}var xb,Ak;function rX(){if(Ak)return xb;Ak=1;var e=kv();function t(n){return e(this,n).has(n)}return xb=t,xb}var yb,Ek;function aX(){if(Ek)return yb;Ek=1;var e=kv();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,Pk;function FN(){if(Pk)return bb;Pk=1;var e=ZY(),t=tX(),n=nX(),r=rX(),s=aX();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,kk;function v3(){if(kk)return wb;kk=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,Tk;function sX(){if(Tk)return jb;Tk=1;var e=v3(),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,Ok;function oX(){if(Ok)return Sb;Ok=1;var e=sX(),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,Rk;function BN(){if(Rk)return Nb;Rk=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,Ik;function iX(){if(Ik)return Cb;Ik=1;var e=If(),t=BN(),n=Yr(),r=pu(),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,Mk;function g3(){if(Mk)return _b;Mk=1;var e=iX();function t(n){return n==null?"":e(n)}return _b=t,_b}var Ab,$k;function x3(){if($k)return Ab;$k=1;var e=Yr(),t=MN(),n=oX(),r=g3();function s(o,i){return e(o)?o:t(o,i)?[o]:n(r(o))}return Ab=s,Ab}var Eb,Dk;function Tv(){if(Dk)return Eb;Dk=1;var e=pu();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 Pb,Lk;function zN(){if(Lk)return Pb;Lk=1;var e=x3(),t=Tv();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 Pb=n,Pb}var kb,Fk;function y3(){if(Fk)return kb;Fk=1;var e=zN();function t(n,r,s){var o=n==null?void 0:e(n,r);return o===void 0?s:o}return kb=t,kb}var lX=y3();const da=dn(lX);var Tb,Bk;function cX(){if(Bk)return Tb;Bk=1;function e(t){return t==null}return Tb=e,Tb}var uX=cX();const It=dn(uX);var Ob,zk;function dX(){if(zk)return Ob;zk=1;var e=vo(),t=Yr(),n=go(),r="[object String]";function s(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return Ob=s,Ob}var fX=dX();const el=dn(fX);var pX=$N();const Rt=dn(pX);var hX=ui();const hu=dn(hX);var Rb={exports:{}},ln={};var qk;function mX(){if(qk)return ln;qk=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"),g=Symbol.for("react.lazy"),x=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 g:case p:case o:return y;default:return S}}case t:return S}}}return ln.ContextConsumer=i,ln.ContextProvider=o,ln.Element=e,ln.ForwardRef=d,ln.Fragment=n,ln.Lazy=g,ln.Memo=p,ln.Portal=t,ln.Profiler=s,ln.StrictMode=r,ln.Suspense=f,ln.SuspenseList=h,ln.isAsyncMode=function(){return!1},ln.isConcurrentMode=function(){return!1},ln.isContextConsumer=function(y){return b(y)===i},ln.isContextProvider=function(y){return b(y)===o},ln.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},ln.isForwardRef=function(y){return b(y)===d},ln.isFragment=function(y){return b(y)===n},ln.isLazy=function(y){return b(y)===g},ln.isMemo=function(y){return b(y)===p},ln.isPortal=function(y){return b(y)===t},ln.isProfiler=function(y){return b(y)===s},ln.isStrictMode=function(y){return b(y)===r},ln.isSuspense=function(y){return b(y)===f},ln.isSuspenseList=function(y){return b(y)===h},ln.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===s||y===r||y===f||y===h||y===x||typeof y=="object"&&y!==null&&(y.$$typeof===g||y.$$typeof===p||y.$$typeof===o||y.$$typeof===i||y.$$typeof===d||y.$$typeof===j||y.getModuleId!==void 0)},ln.typeOf=b,ln}var Uk;function vX(){return Uk||(Uk=1,Rb.exports=mX()),Rb.exports}var gX=vX(),Ib,Wk;function b3(){if(Wk)return Ib;Wk=1;var e=vo(),t=go(),n="[object Number]";function r(s){return typeof s=="number"||t(s)&&e(s)==n}return Ib=r,Ib}var Mb,Vk;function xX(){if(Vk)return Mb;Vk=1;var e=b3();function t(n){return e(n)&&n!=+n}return Mb=t,Mb}var yX=xX();const Mf=dn(yX);var bX=b3();const wX=dn(bX);var Ar=function(t){return t===0?0:t>0?1:-1},Bi=function(t){return el(t)&&t.indexOf("%")===t.length-1},Ve=function(t){return wX(t)&&!Mf(t)},jX=function(t){return It(t)},er=function(t){return Ve(t)||el(t)},SX=0,mu=function(t){var n=++SX;return"".concat(t||"").concat(n)},Er=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(!Ve(t)&&!el(t))return r;var o;if(Bi(t)){var i=t.indexOf("%");o=n*parseFloat(t.slice(0,i))/100}else o=+t;return Mf(o)&&(o=r),s&&o>n&&(o=n),o},oc=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},NX=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},ia=function(t,n){return Ve(t)&&Ve(n)?function(r){return t+r*(n-t)}:function(){return n}};function Wh(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):da(r,t))===n})}var CX=function(t,n){return Ve(t)&&Ve(n)?t-n:el(t)&&el(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function bc(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 _X=["viewBox","children"],AX=["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"],Hk=["points","pathLength"],$b={svg:_X,polygon:Hk,polyline:Hk},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"],Vh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(m.isValidElement(t)&&(r=t.props),!hu(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},EX=function(t,n,r){return function(s){return t(n,r,s),null}},tl=function(t,n,r){if(!hu(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]=EX(i,n,r))}),s},PX=["children"],kX=["children"];function Kk(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 Gk={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"},eo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Yk=null,Db=null,UN=function e(t){if(t===Yk&&Array.isArray(Db))return Db;var n=[];return m.Children.forEach(t,function(r){It(r)||(gX.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Db=n,Yk=t,n};function fa(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return eo(s)}):r=[eo(t)],UN(e).forEach(function(s){var o=da(s,"type.displayName")||da(s,"type.name");r.indexOf(o)!==-1&&n.push(s)}),n}function sa(e,t){var n=fa(e,t);return n&&n[0]}var Xk=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!Ve(r)||r<=0||!Ve(s)||s<=0)},OX=["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"],RX=function(t){return t&&t.type&&el(t.type)&&OX.indexOf(t.type)>=0},IX=function(t){return t&&yS(t)==="object"&&"clipDot"in t},MX=function(t,n,r,s){var o,i=(o=$b?.[s])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!Rt(t)&&(s&&i.includes(n)||AX.includes(n))||r&&qN.includes(n)},jt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(m.isValidElement(t)&&(s=t.props),!hu(s))return null;var o={};return Object.keys(s).forEach(function(i){var c;MX((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 Qk(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(!Qk(o,i))return!1}return!0},Qk=function(t,n){if(It(t)&&It(n))return!0;if(!It(t)&&!It(n)){var r=t.props||{},s=r.children,o=Kk(r,PX),i=n.props||{},c=i.children,d=Kk(i,kX);return s&&c?bc(o,d)&&bS(s,c):!s&&!c?bc(o,d):!1}return!1},Jk=function(t,n){var r=[],s={};return UN(t).forEach(function(o,i){if(RX(o))r.push(o);else if(o){var c=eo(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},$X=function(t){var n=t&&t.type;return n&&Gk[n]?Gk[n]:null},DX=function(t,n){return UN(n).indexOf(t)},LX=["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 FX(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=FX(e,LX),h=s||{width:n,height:r,x:0,y:0},p=Mt("recharts-surface",o);return G.createElement("svg",wS({},jt(f,!0,"svg"),{className:p,width:n,height:r,style:i,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),G.createElement("title",null,c),G.createElement("desc",null,d),t)}var zX=["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 qX(e,t){if(e==null)return{};var n=UX(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 UX(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 nn=G.forwardRef(function(e,t){var n=e.children,r=e.className,s=qX(e,zX),o=Mt("recharts-layer",r);return G.createElement("g",SS({className:o},jt(s,!0),{ref:t}),n)}),to=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,Zk;function WX(){if(Zk)return Lb;Zk=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,eT;function VX(){if(eT)return Fb;eT=1;var e=WX();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 Bb,tT;function w3(){if(tT)return Bb;tT=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 Bb=d,Bb}var zb,nT;function HX(){if(nT)return zb;nT=1;function e(t){return t.split("")}return zb=e,zb}var qb,rT;function KX(){if(rT)return qb;rT=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}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",j=f+"?",b="["+o+"]?",y="(?:"+x+"(?:"+[h,p,g].join("|")+")"+b+j+")*",S=b+j+y,C="(?:"+[h+c+"?",c,p,g,i].join("|")+")",N=RegExp(d+"(?="+d+")|"+C+S,"g");function E(A){return A.match(N)||[]}return qb=E,qb}var Ub,aT;function GX(){if(aT)return Ub;aT=1;var e=HX(),t=w3(),n=KX();function r(s){return t(s)?n(s):e(s)}return Ub=r,Ub}var Wb,sT;function YX(){if(sT)return Wb;sT=1;var e=VX(),t=w3(),n=GX(),r=g3();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,oT;function XX(){if(oT)return Vb;oT=1;var e=YX(),t=e("toUpperCase");return Vb=t,Vb}var QX=XX();const Ov=dn(QX);function wn(e){return function(){return e}}const j3=Math.cos,Hh=Math.sin,rs=Math.sqrt,Kh=Math.PI,Rv=2*Kh,NS=Math.PI,CS=2*NS,Di=1e-6,JX=CS-Di;function S3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ZX(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return S3;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 eQ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?S3:ZX(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,g=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Di)if(!(Math.abs(p*d-f*h)>Di)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-i,j=s-c,b=d*d+f*f,y=x*x+j*j,S=Math.sqrt(b),C=Math.sqrt(g),N=o*Math.tan((NS-Math.acos((b+g-y)/(2*S*C)))/2),E=N/C,A=N/S;Math.abs(E-1)>Di&&this._append`L${t+E*h},${n+E*p}`,this._append`A${o},${o},0,0,${+(p*x>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,g=i?s-o:o-s;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>Di||Math.abs(this._y1-h)>Di)&&this._append`L${f},${h}`,r&&(g<0&&(g=g%CS+CS),g>JX?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:g>Di&&this._append`A${r},${r},0,${+(g>=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 eQ(t)}function VN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function N3(e){this._context=e}N3.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 Iv(e){return new N3(e)}function C3(e){return e[0]}function _3(e){return e[1]}function A3(e,t){var n=wn(!0),r=null,s=Iv,o=null,i=WN(c);e=typeof e=="function"?e:e===void 0?C3:wn(e),t=typeof t=="function"?t:t===void 0?_3:wn(t);function c(d){var f,h=(d=VN(d)).length,p,g=!1,x;for(r==null&&(o=s(x=i())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===g&&((g=!g)?o.lineStart():o.lineEnd()),g&&o.point(+e(p,f,d),+t(p,f,d));if(x)return o=null,x+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:wn(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:wn(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:wn(!!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 uh(e,t,n){var r=null,s=wn(!0),o=null,i=Iv,c=null,d=WN(f);e=typeof e=="function"?e:e===void 0?C3:wn(+e),t=typeof t=="function"?t:wn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?_3:wn(+n);function f(p){var g,x,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())),g=0;g<=b;++g){if(!(g<b&&s(y=p[g],g,p))===S)if(S=!S)x=g,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=g-1;j>=x;--j)c.point(N[j],E[j]);c.lineEnd(),c.areaEnd()}S&&(N[g]=+e(y,g,p),E[g]=+t(y,g,p),c.point(r?+r(y,g,p):N[g],n?+n(y,g,p):E[g]))}if(C)return c=null,C+""||null}function h(){return A3().defined(s).curve(i).context(o)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:wn(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:wn(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:wn(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:wn(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:wn(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:wn(+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:wn(!!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 E3{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 tQ(e){return new E3(e,!0)}function nQ(e){return new E3(e,!1)}const HN={draw(e,t){const n=rs(t/Kh);e.moveTo(n,0),e.arc(0,0,n,0,Rv)}},rQ={draw(e,t){const n=rs(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=rs(1/3),aQ=P3*2,sQ={draw(e,t){const n=rs(t/aQ),r=n*P3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},oQ={draw(e,t){const n=rs(t),r=-n/2;e.rect(r,r,n,n)}},iQ=.8908130915292852,k3=Hh(Kh/10)/Hh(7*Kh/10),lQ=Hh(Rv/10)*k3,cQ=-j3(Rv/10)*k3,uQ={draw(e,t){const n=rs(t*iQ),r=lQ*n,s=cQ*n;e.moveTo(0,-n),e.lineTo(r,s);for(let o=1;o<5;++o){const i=Rv*o/5,c=j3(i),d=Hh(i);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*s,d*r+c*s)}e.closePath()}},Hb=rs(3),dQ={draw(e,t){const n=-rs(t/(Hb*3));e.moveTo(0,n*2),e.lineTo(-Hb*n,-n),e.lineTo(Hb*n,-n),e.closePath()}},Sa=-.5,Na=rs(3)/2,_S=1/rs(12),fQ=(_S/2+1)*3,pQ={draw(e,t){const n=rs(t/fQ),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 hQ(e,t){let n=null,r=WN(s);e=typeof e=="function"?e:wn(e||HN),t=typeof t=="function"?t:wn(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:wn(o),s):e},s.size=function(o){return arguments.length?(t=typeof o=="function"?o:wn(+o),s):t},s.context=function(o){return arguments.length?(n=o??null,s):n},s}function Gh(){}function Yh(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:Yh(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:Yh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mQ(e){return new T3(e)}function O3(e){this._context=e}O3.prototype={areaStart:Gh,areaEnd:Gh,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:Yh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function vQ(e){return new O3(e)}function R3(e){this._context=e}R3.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:Yh(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:Gh,areaEnd:Gh,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 xQ(e){return new I3(e)}function iT(e){return e<0?-1:1}function lT(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(iT(o)+iT(i))*Math.min(Math.abs(o),Math.abs(i),.5*Math.abs(c))||0}function cT(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 Xh(e){this._context=e}Xh.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,cT(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,cT(this,n=lT(this,e,t)),n);break;default:Kb(this,this._t0,n=lT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function M3(e){this._context=new $3(e)}(M3.prototype=Object.create(Xh.prototype)).point=function(e,t){Xh.prototype.point.call(this,t,e)};function $3(e){this._context=e}$3.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 yQ(e){return new Xh(e)}function bQ(e){return new M3(e)}function D3(e){this._context=e}D3.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=uT(e),s=uT(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 uT(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 wQ(e){return new D3(e)}function Mv(e,t){this._context=e,this._t=t}Mv.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 jQ(e){return new Mv(e,.5)}function SQ(e){return new Mv(e,0)}function NQ(e){return new Mv(e,1)}function kc(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 CQ(e,t){return e[t]}function _Q(e){const t=[];return t.key=e,t}function AQ(){var e=wn([]),t=AS,n=kc,r=CQ;function s(o){var i=Array.from(e.apply(this,arguments),_Q),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:wn(Array.from(o)),s):e},s.value=function(o){return arguments.length?(r=typeof o=="function"?o:wn(+o),s):r},s.order=function(o){return arguments.length?(t=o==null?AS:typeof o=="function"?o:wn(Array.from(o)),s):t},s.offset=function(o){return arguments.length?(n=o??kc,s):n},s}function EQ(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}kc(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}kc(e,t)}}function kQ(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,g=h[r-1][1]||0,x=(p-g)/2,j=0;j<c;++j){var b=e[t[j]],y=b[r][1]||0,S=b[r-1][1]||0;x+=y-S}d+=p,f+=x*p}s[r-1][1]+=s[r-1][0]=n,d&&(n-=f/d)}s[r-1][1]+=s[r-1][0]=n,kc(e,t)}}function Dd(e){"@babel/helpers - typeof";return Dd=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},Dd(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 dT(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 fT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dT(Object(n),!0).forEach(function(r){OQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OQ(e,t,n){return t=RQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RQ(e){var t=IQ(e,"string");return Dd(t)=="symbol"?t:t+""}function IQ(e,t){if(Dd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MQ(e,t){if(e==null)return{};var n=$Q(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 $Q(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 L3={symbolCircle:HN,symbolCross:rQ,symbolDiamond:sQ,symbolSquare:oQ,symbolStar:uQ,symbolTriangle:dQ,symbolWye:pQ},DQ=Math.PI/180,LQ=function(t){var n="symbol".concat(Ov(t));return L3[n]||HN},FQ=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*DQ;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){L3["symbol".concat(Ov(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=MQ(t,TQ),f=fT(fT({},d),{},{type:r,size:o,sizeType:c}),h=function(){var y=LQ(r),S=hQ().type(y).size(FQ(o,c,r));return S()},p=f.className,g=f.cx,x=f.cy,j=jt(f,!0);return g===+g&&x===+x&&o===+o?G.createElement("path",ES({},j,{className:Mt("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(x,")"),d:h()})):null};KN.registerSymbol=BQ;function Tc(e){"@babel/helpers - typeof";return Tc=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},Tc(e)}function PS(){return PS=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},PS.apply(this,arguments)}function pT(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 zQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pT(Object(n),!0).forEach(function(r){Ld(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UQ(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 WQ(e,t,n){return t&&UQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function VQ(e,t,n){return t=Qh(t),HQ(e,F3()?Reflect.construct(t,n||[],Qh(e).constructor):t.apply(e,n))}function HQ(e,t){if(t&&(Tc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KQ(e)}function KQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F3=function(){return!!e})()}function Qh(e){return Qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qh(e)}function GQ(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&&kS(e,t)}function kS(e,t){return kS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},kS(e,t)}function Ld(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=YQ(e,"string");return Tc(t)=="symbol"?t:t+""}function YQ(e,t){if(Tc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tc(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 qQ(this,t),VQ(this,t,arguments)}return GQ(t,e),WQ(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 G.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 G.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 G.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(G.isValidElement(r.legendIcon)){var f=zQ({},r);return delete f.legendIcon,G.cloneElement(r.legendIcon,f)}return G.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},g={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(x,j){var b=x.formatter||d,y=Mt(Ld(Ld({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",x.inactive));if(x.type==="none")return null;var S=Rt(x.value)?null:x.value;to(!Rt(x.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var C=x.inactive?f:x.color;return G.createElement("li",PS({className:y,style:p,key:"legend-item-".concat(j)},tl(r.props,x,j)),G.createElement(jS,{width:i,height:i,viewBox:h,style:g},r.renderIcon(x)),G.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},b?b(S,x,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 G.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(m.PureComponent);Ld(GN,"displayName","Legend");Ld(GN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Gb,hT;function XQ(){if(hT)return Gb;hT=1;var e=Pv();function t(){this.__data__=new e,this.size=0}return Gb=t,Gb}var Yb,mT;function QQ(){if(mT)return Yb;mT=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Yb=e,Yb}var Xb,vT;function JQ(){if(vT)return Xb;vT=1;function e(t){return this.__data__.get(t)}return Xb=e,Xb}var Qb,gT;function ZQ(){if(gT)return Qb;gT=1;function e(t){return this.__data__.has(t)}return Qb=e,Qb}var Jb,xT;function eJ(){if(xT)return Jb;xT=1;var e=Pv(),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,yT;function z3(){if(yT)return Zb;yT=1;var e=Pv(),t=XQ(),n=QQ(),r=JQ(),s=ZQ(),o=eJ();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,bT;function tJ(){if(bT)return e0;bT=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return e0=t,e0}var t0,wT;function nJ(){if(wT)return t0;wT=1;function e(t){return this.__data__.has(t)}return t0=e,t0}var n0,jT;function q3(){if(jT)return n0;jT=1;var e=FN(),t=tJ(),n=nJ();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,ST;function U3(){if(ST)return r0;ST=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,NT;function W3(){if(NT)return a0;NT=1;function e(t,n){return t.has(n)}return a0=e,a0}var s0,CT;function V3(){if(CT)return s0;CT=1;var e=q3(),t=U3(),n=W3(),r=1,s=2;function o(i,c,d,f,h,p){var g=d&r,x=i.length,j=c.length;if(x!=j&&!(g&&j>x))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<x;){var E=i[S],A=c[S];if(f)var P=g?f(A,E,S,c,i,p):f(E,A,S,i,c,p);if(P!==void 0){if(P)continue;C=!1;break}if(N){if(!t(c,function(T,O){if(!n(N,O)&&(E===T||h(E,T,d,f,p)))return N.push(O)})){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,_T;function rJ(){if(_T)return o0;_T=1;var e=Is(),t=e.Uint8Array;return o0=t,o0}var i0,AT;function aJ(){if(AT)return i0;AT=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,ET;function YN(){if(ET)return l0;ET=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,PT;function sJ(){if(PT)return c0;PT=1;var e=If(),t=rJ(),n=DN(),r=V3(),s=aJ(),o=YN(),i=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",g="[object Number]",x="[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(P,T,O,$,z,U,B){switch(O){case C:if(P.byteLength!=T.byteLength||P.byteOffset!=T.byteOffset)return!1;P=P.buffer,T=T.buffer;case S:return!(P.byteLength!=T.byteLength||!U(new t(P),new t(T)));case d:case f:case g:return n(+P,+T);case h:return P.name==T.name&&P.message==T.message;case x:case b:return P==T+"";case p:var V=s;case j:var q=$&i;if(V||(V=o),P.size!=T.size&&!q)return!1;var I=B.get(P);if(I)return I==T;$|=c,B.set(P,T);var W=r(V(P),V(T),$,z,U,B);return B.delete(P),W;case y:if(E)return E.call(P)==E.call(T)}return!1}return c0=A,c0}var u0,kT;function H3(){if(kT)return u0;kT=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,TT;function oJ(){if(TT)return d0;TT=1;var e=H3(),t=Yr();function n(r,s,o){var i=s(r);return t(r)?i:e(i,o(r))}return d0=n,d0}var f0,OT;function iJ(){if(OT)return f0;OT=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,RT;function lJ(){if(RT)return p0;RT=1;function e(){return[]}return p0=e,p0}var h0,IT;function cJ(){if(IT)return h0;IT=1;var e=iJ(),t=lJ(),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,MT;function uJ(){if(MT)return m0;MT=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,$T;function dJ(){if($T)return v0;$T=1;var e=vo(),t=go(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return v0=r,v0}var g0,DT;function XN(){if(DT)return g0;DT=1;var e=dJ(),t=go(),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 xd={exports:{}},x0,LT;function fJ(){if(LT)return x0;LT=1;function e(){return!1}return x0=e,x0}xd.exports;var FT;function K3(){return FT||(FT=1,(function(e,t){var n=Is(),r=fJ(),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})(xd,xd.exports)),xd.exports}var y0,BT;function QN(){if(BT)return y0;BT=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,zT;function JN(){if(zT)return b0;zT=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return b0=t,b0}var w0,qT;function pJ(){if(qT)return w0;qT=1;var e=vo(),t=JN(),n=go(),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]",g="[object RegExp]",x="[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]",P="[object Int32Array]",T="[object Uint8Array]",O="[object Uint8ClampedArray]",$="[object Uint16Array]",z="[object Uint32Array]",U={};U[C]=U[N]=U[E]=U[A]=U[P]=U[T]=U[O]=U[$]=U[z]=!0,U[r]=U[s]=U[y]=U[o]=U[S]=U[i]=U[c]=U[d]=U[f]=U[h]=U[p]=U[g]=U[x]=U[j]=U[b]=!1;function B(V){return n(V)&&t(V.length)&&!!U[e(V)]}return w0=B,w0}var j0,UT;function G3(){if(UT)return j0;UT=1;function e(t){return function(n){return t(n)}}return j0=e,j0}var yd={exports:{}};yd.exports;var WT;function hJ(){return WT||(WT=1,(function(e,t){var n=h3(),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})(yd,yd.exports)),yd.exports}var S0,VT;function Y3(){if(VT)return S0;VT=1;var e=pJ(),t=G3(),n=hJ(),r=n&&n.isTypedArray,s=r?t(r):e;return S0=s,S0}var N0,HT;function mJ(){if(HT)return N0;HT=1;var e=uJ(),t=XN(),n=Yr(),r=K3(),s=QN(),o=Y3(),i=Object.prototype,c=i.hasOwnProperty;function d(f,h){var p=n(f),g=!p&&t(f),x=!p&&!g&&r(f),j=!p&&!g&&!x&&o(f),b=p||g||x||j,y=b?e(f.length,String):[],S=y.length;for(var C in f)(h||c.call(f,C))&&!(b&&(C=="length"||x&&(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,KT;function vJ(){if(KT)return C0;KT=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,GT;function X3(){if(GT)return _0;GT=1;function e(t,n){return function(r){return t(n(r))}}return _0=e,_0}var A0,YT;function gJ(){if(YT)return A0;YT=1;var e=X3(),t=e(Object.keys,Object);return A0=t,A0}var E0,XT;function xJ(){if(XT)return E0;XT=1;var e=vJ(),t=gJ(),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 P0,QT;function $f(){if(QT)return P0;QT=1;var e=$N(),t=JN();function n(r){return r!=null&&t(r.length)&&!e(r)}return P0=n,P0}var k0,JT;function $v(){if(JT)return k0;JT=1;var e=mJ(),t=xJ(),n=$f();function r(s){return n(s)?e(s):t(s)}return k0=r,k0}var T0,ZT;function yJ(){if(ZT)return T0;ZT=1;var e=oJ(),t=cJ(),n=$v();function r(s){return e(s,n,t)}return T0=r,T0}var O0,eO;function bJ(){if(eO)return O0;eO=1;var e=yJ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(o,i,c,d,f,h){var p=c&t,g=e(o),x=g.length,j=e(i),b=j.length;if(x!=b&&!p)return!1;for(var y=x;y--;){var S=g[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<x;){S=g[y];var P=o[S],T=i[S];if(d)var O=p?d(T,P,S,i,o,h):d(P,T,S,o,i,h);if(!(O===void 0?P===T||f(P,T,c,d,h):O)){E=!1;break}A||(A=S=="constructor")}if(E&&!A){var $=o.constructor,z=i.constructor;$!=z&&"constructor"in o&&"constructor"in i&&!(typeof $=="function"&&$ instanceof $&&typeof z=="function"&&z instanceof z)&&(E=!1)}return h.delete(o),h.delete(i),E}return O0=s,O0}var R0,tO;function wJ(){if(tO)return R0;tO=1;var e=yl(),t=Is(),n=e(t,"DataView");return R0=n,R0}var I0,nO;function jJ(){if(nO)return I0;nO=1;var e=yl(),t=Is(),n=e(t,"Promise");return I0=n,I0}var M0,rO;function Q3(){if(rO)return M0;rO=1;var e=yl(),t=Is(),n=e(t,"Set");return M0=n,M0}var $0,aO;function SJ(){if(aO)return $0;aO=1;var e=yl(),t=Is(),n=e(t,"WeakMap");return $0=n,$0}var D0,sO;function NJ(){if(sO)return D0;sO=1;var e=wJ(),t=LN(),n=jJ(),r=Q3(),s=SJ(),o=vo(),i=m3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",g="[object DataView]",x=i(e),j=i(t),b=i(n),y=i(r),S=i(s),C=o;return(e&&C(new e(new ArrayBuffer(1)))!=g||t&&C(new t)!=c||n&&C(n.resolve())!=f||r&&C(new r)!=h||s&&C(new s)!=p)&&(C=function(N){var E=o(N),A=E==d?N.constructor:void 0,P=A?i(A):"";if(P)switch(P){case x:return g;case j:return c;case b:return f;case y:return h;case S:return p}return E}),D0=C,D0}var L0,oO;function CJ(){if(oO)return L0;oO=1;var e=z3(),t=V3(),n=sJ(),r=bJ(),s=NJ(),o=Yr(),i=K3(),c=Y3(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",g=Object.prototype,x=g.hasOwnProperty;function j(b,y,S,C,N,E){var A=o(b),P=o(y),T=A?h:s(b),O=P?h:s(y);T=T==f?p:T,O=O==f?p:O;var $=T==p,z=O==p,U=T==O;if(U&&i(b)){if(!i(y))return!1;A=!0,$=!1}if(U&&!$)return E||(E=new e),A||c(b)?t(b,y,S,C,N,E):n(b,y,T,S,C,N,E);if(!(S&d)){var B=$&&x.call(b,"__wrapped__"),V=z&&x.call(y,"__wrapped__");if(B||V){var q=B?b.value():b,I=V?y.value():y;return E||(E=new e),N(q,I,S,C,E)}}return U?(E||(E=new e),r(b,y,S,C,N,E)):!1}return L0=j,L0}var F0,iO;function ZN(){if(iO)return F0;iO=1;var e=CJ(),t=go();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 B0,lO;function _J(){if(lO)return B0;lO=1;var e=z3(),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 g=c[f];if(p&&g[2]?g[1]!==o[g[0]]:!(g[0]in o))return!1}for(;++f<h;){g=c[f];var x=g[0],j=o[x],b=g[1];if(p&&g[2]){if(j===void 0&&!(x in o))return!1}else{var y=new e;if(d)var S=d(j,b,x,o,i,y);if(!(S===void 0?t(b,j,n|r,d,y):S))return!1}}return!0}return B0=s,B0}var z0,cO;function J3(){if(cO)return z0;cO=1;var e=ui();function t(n){return n===n&&!e(n)}return z0=t,z0}var q0,uO;function AJ(){if(uO)return q0;uO=1;var e=J3(),t=$v();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,dO;function Z3(){if(dO)return U0;dO=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,fO;function EJ(){if(fO)return W0;fO=1;var e=_J(),t=AJ(),n=Z3();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,pO;function PJ(){if(pO)return V0;pO=1;function e(t,n){return t!=null&&n in Object(t)}return V0=e,V0}var H0,hO;function kJ(){if(hO)return H0;hO=1;var e=x3(),t=XN(),n=Yr(),r=QN(),s=JN(),o=Tv();function i(c,d,f){d=e(d,c);for(var h=-1,p=d.length,g=!1;++h<p;){var x=o(d[h]);if(!(g=c!=null&&f(c,x)))break;c=c[x]}return g||++h!=p?g:(p=c==null?0:c.length,!!p&&s(p)&&r(x,p)&&(n(c)||t(c)))}return H0=i,H0}var K0,mO;function TJ(){if(mO)return K0;mO=1;var e=PJ(),t=kJ();function n(r,s){return r!=null&&t(r,s,e)}return K0=n,K0}var G0,vO;function OJ(){if(vO)return G0;vO=1;var e=ZN(),t=y3(),n=TJ(),r=MN(),s=J3(),o=Z3(),i=Tv(),c=1,d=2;function f(h,p){return r(h)&&s(p)?o(i(h),p):function(g){var x=t(g,h);return x===void 0&&x===p?n(g,h):e(p,x,c|d)}}return G0=f,G0}var Y0,gO;function vu(){if(gO)return Y0;gO=1;function e(t){return t}return Y0=e,Y0}var X0,xO;function RJ(){if(xO)return X0;xO=1;function e(t){return function(n){return n?.[t]}}return X0=e,X0}var Q0,yO;function IJ(){if(yO)return Q0;yO=1;var e=zN();function t(n){return function(r){return e(r,n)}}return Q0=t,Q0}var J0,bO;function MJ(){if(bO)return J0;bO=1;var e=RJ(),t=IJ(),n=MN(),r=Tv();function s(o){return n(o)?e(r(o)):t(o)}return J0=s,J0}var Z0,wO;function Ms(){if(wO)return Z0;wO=1;var e=EJ(),t=OJ(),n=vu(),r=Yr(),s=MJ();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,jO;function eL(){if(jO)return ew;jO=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,SO;function $J(){if(SO)return tw;SO=1;function e(t){return t!==t}return tw=e,tw}var nw,NO;function DJ(){if(NO)return nw;NO=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,CO;function LJ(){if(CO)return rw;CO=1;var e=eL(),t=$J(),n=DJ();function r(s,o,i){return o===o?n(s,o,i):e(s,t,i)}return rw=r,rw}var aw,_O;function FJ(){if(_O)return aw;_O=1;var e=LJ();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return aw=t,aw}var sw,AO;function BJ(){if(AO)return sw;AO=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,EO;function zJ(){if(EO)return ow;EO=1;function e(){}return ow=e,ow}var iw,PO;function qJ(){if(PO)return iw;PO=1;var e=Q3(),t=zJ(),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,kO;function UJ(){if(kO)return lw;kO=1;var e=q3(),t=FJ(),n=BJ(),r=W3(),s=qJ(),o=YN(),i=200;function c(d,f,h){var p=-1,g=t,x=d.length,j=!0,b=[],y=b;if(h)j=!1,g=n;else if(x>=i){var S=f?null:s(d);if(S)return o(S);j=!1,g=r,y=new e}else y=f?[]:b;e:for(;++p<x;){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 g(y,N,h)||(y!==b&&y.push(N),b.push(C))}return b}return lw=c,lw}var cw,TO;function WJ(){if(TO)return cw;TO=1;var e=Ms(),t=UJ();function n(r,s){return r&&r.length?t(r,e(s,2)):[]}return cw=n,cw}var VJ=WJ();const OO=dn(VJ);function tL(e,t,n){return t===!0?OO(e,n):Rt(t)?OO(e,t):e}function Oc(e){"@babel/helpers - typeof";return Oc=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},Oc(e)}var HJ=["ref"];function RO(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 Ks(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RO(Object(n),!0).forEach(function(r){Dv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IO(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,rL(r.key),r)}}function GJ(e,t,n){return t&&IO(e.prototype,t),n&&IO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function YJ(e,t,n){return t=Jh(t),XJ(e,nL()?Reflect.construct(t,n||[],Jh(e).constructor):t.apply(e,n))}function XJ(e,t){if(t&&(Oc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QJ(e)}function QJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nL=function(){return!!e})()}function Jh(e){return Jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jh(e)}function JJ(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&&TS(e,t)}function TS(e,t){return TS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},TS(e,t)}function Dv(e,t,n){return t=rL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rL(e){var t=ZJ(e,"string");return Oc(t)=="symbol"?t:t+""}function ZJ(e,t){if(Oc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Oc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function eZ(e,t){if(e==null)return{};var n=tZ(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 tZ(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 nZ(e){return e.value}function rZ(e,t){if(G.isValidElement(e))return G.cloneElement(e,t);if(typeof e=="function")return G.createElement(e,t);t.ref;var n=eZ(t,HJ);return G.createElement(GN,n)}var MO=1,Vi=(function(e){function t(){var n;KJ(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=YJ(this,t,[].concat(s)),Dv(n,"lastBoundingBox",{width:-1,height:-1}),n}return JJ(t,e),GJ(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)>MO||Math.abs(s.height-this.lastBoundingBox.height)>MO)&&(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?Ks({},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,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(i==="center"&&o==="vertical"){var x=this.getBBoxSnapshot();p={left:((f||0)-x.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();g={top:((h||0)-j.height)/2}}else g=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Ks(Ks({},p),g)}},{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=Ks(Ks({position:"absolute",width:i||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return G.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(x){r.wrapperNode=x}},rZ(o,Ks(Ks({},this.props),{},{payload:tL(h,f,nZ)})))}}],[{key:"getWithHeight",value:function(r,s){var o=Ks(Ks({},this.defaultProps),r.props),i=o.layout;return i==="vertical"&&Ve(r.props.height)?{height:r.props.height}:i==="horizontal"?{width:r.props.width||s}:null}}])})(m.PureComponent);Dv(Vi,"displayName","Legend");Dv(Vi,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var uw,$O;function aZ(){if($O)return uw;$O=1;var e=If(),t=XN(),n=Yr(),r=e?e.isConcatSpreadable:void 0;function s(o){return n(o)||t(o)||!!(r&&o&&o[r])}return uw=s,uw}var dw,DO;function aL(){if(DO)return dw;DO=1;var e=H3(),t=aZ();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,LO;function sZ(){if(LO)return fw;LO=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,FO;function oZ(){if(FO)return pw;FO=1;var e=sZ(),t=e();return pw=t,pw}var hw,BO;function sL(){if(BO)return hw;BO=1;var e=oZ(),t=$v();function n(r,s){return r&&e(r,s,t)}return hw=n,hw}var mw,zO;function iZ(){if(zO)return mw;zO=1;var e=$f();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,qO;function eC(){if(qO)return vw;qO=1;var e=sL(),t=iZ(),n=t(e);return vw=n,vw}var gw,UO;function oL(){if(UO)return gw;UO=1;var e=eC(),t=$f();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,WO;function lZ(){if(WO)return xw;WO=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,VO;function cZ(){if(VO)return yw;VO=1;var e=pu();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,HO;function uZ(){if(HO)return bw;HO=1;var e=cZ();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,KO;function dZ(){if(KO)return ww;KO=1;var e=BN(),t=zN(),n=Ms(),r=oL(),s=lZ(),o=G3(),i=uZ(),c=vu(),d=Yr();function f(h,p,g){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 x=-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:++x,value:b}});return s(j,function(b,y){return i(b,y,g)})}return ww=f,ww}var jw,GO;function fZ(){if(GO)return jw;GO=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,YO;function pZ(){if(YO)return Sw;YO=1;var e=fZ(),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,XO;function hZ(){if(XO)return Nw;XO=1;function e(t){return function(){return t}}return Nw=e,Nw}var Cw,QO;function iL(){if(QO)return Cw;QO=1;var e=yl(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Cw=t,Cw}var _w,JO;function mZ(){if(JO)return _w;JO=1;var e=hZ(),t=iL(),n=vu(),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,ZO;function vZ(){if(ZO)return Aw;ZO=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,eR;function gZ(){if(eR)return Ew;eR=1;var e=mZ(),t=vZ(),n=t(e);return Ew=n,Ew}var Pw,tR;function xZ(){if(tR)return Pw;tR=1;var e=vu(),t=pZ(),n=gZ();function r(s,o){return n(t(s,o,e),s+"")}return Pw=r,Pw}var kw,nR;function Lv(){if(nR)return kw;nR=1;var e=DN(),t=$f(),n=QN(),r=ui();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 kw=s,kw}var Tw,rR;function yZ(){if(rR)return Tw;rR=1;var e=aL(),t=dZ(),n=xZ(),r=Lv(),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 Tw=s,Tw}var bZ=yZ();const tC=dn(bZ);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)}function OS(){return OS=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},OS.apply(this,arguments)}function wZ(e,t){return CZ(e)||NZ(e,t)||SZ(e,t)||jZ()}function jZ(){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 SZ(e,t){if(e){if(typeof e=="string")return aR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aR(e,t)}}function aR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NZ(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 CZ(e){if(Array.isArray(e))return e}function sR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ow(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sR(Object(n),!0).forEach(function(r){_Z(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Z(e,t,n){return t=AZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AZ(e){var t=EZ(e,"string");return Fd(t)=="symbol"?t:t+""}function EZ(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 PZ(e){return Array.isArray(e)&&er(e[0])&&er(e[1])?e.join(" ~ "):e}var kZ=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,g=t.itemSorter,x=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 B={padding:0,margin:0},V=(g?tC(h,g):h).map(function(q,I){if(q.type==="none")return null;var W=Ow({display:"block",paddingTop:4,paddingBottom:4,color:q.color||"#000"},c),X=q.formatter||p||PZ,K=q.value,F=q.name,J=K,D=F;if(X&&J!=null&&D!=null){var R=X(K,F,q,I,h);if(Array.isArray(R)){var ne=wZ(R,2);J=ne[0],D=ne[1]}else J=R}return G.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:W},er(D)?G.createElement("span",{className:"recharts-tooltip-item-name"},D):null,er(D)?G.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,G.createElement("span",{className:"recharts-tooltip-item-value"},J),G.createElement("span",{className:"recharts-tooltip-item-unit"},q.unit||""))});return G.createElement("ul",{className:"recharts-tooltip-item-list",style:B},V)}return null},E=Ow({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),A=Ow({margin:0},f),P=!It(b),T=P?b:"",O=Mt("recharts-default-tooltip",x),$=Mt("recharts-tooltip-label",j);P&&y&&h!==void 0&&h!==null&&(T=y(b,h));var z=C?{role:"status","aria-live":"assertive"}:{};return G.createElement("div",OS({className:O,style:E},z),G.createElement("p",{className:$,style:A},G.isValidElement(T)?T:"".concat(T)),N())};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 dh(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=OZ(e,"string");return Bd(t)=="symbol"?t:t+""}function OZ(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)}var id="recharts-tooltip-wrapper",RZ={visibility:"hidden"};function IZ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Mt(id,dh(dh(dh(dh({},"".concat(id,"-right"),Ve(n)&&t&&Ve(t.x)&&n>=t.x),"".concat(id,"-left"),Ve(n)&&t&&Ve(t.x)&&n<t.x),"".concat(id,"-bottom"),Ve(r)&&t&&Ve(t.y)&&r>=t.y),"".concat(id,"-top"),Ve(r)&&t&&Ve(t.y)&&r<t.y))}function oR(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&&Ve(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 g=h,x=d[r];return g<x?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 MZ(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 $Z(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=oR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:o,tooltipDimension:i.width,viewBox:d,viewBoxDimension:d.width}),p=oR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:o,tooltipDimension:i.height,viewBox:d,viewBoxDimension:d.height}),f=MZ({translateX:h,translateY:p,useTranslate3d:c})):f=RZ,{cssProperties:f,cssClasses:IZ({translateX:h,translateY:p,coordinate:n})}}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 iR(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 lR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iR(Object(n),!0).forEach(function(r){IS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LZ(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,cL(r.key),r)}}function FZ(e,t,n){return t&&LZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function BZ(e,t,n){return t=Zh(t),zZ(e,lL()?Reflect.construct(t,n||[],Zh(e).constructor):t.apply(e,n))}function zZ(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 qZ(e)}function qZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lL=function(){return!!e})()}function Zh(e){return Zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zh(e)}function UZ(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=cL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cL(e){var t=WZ(e,"string");return Rc(t)=="symbol"?t:t+""}function WZ(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 cR=1,VZ=(function(e){function t(){var n;DZ(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 UZ(t,e),FZ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>cR||Math.abs(r.height-this.state.lastBoundingBox.height)>cR)&&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,g=s.isAnimationActive,x=s.offset,j=s.position,b=s.reverseDirection,y=s.useTranslate3d,S=s.viewBox,C=s.wrapperStyle,N=$Z({allowEscapeViewBox:i,coordinate:h,offsetTopLeft:x,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:S}),E=N.cssClasses,A=N.cssProperties,P=lR(lR({transition:g&&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 G.createElement("div",{tabIndex:-1,className:E,style:P,ref:function(O){r.wrapperNode=O}},f)}}])})(m.PureComponent),HZ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},bl={isSsr:HZ()};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)}function uR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function dR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uR(Object(n),!0).forEach(function(r){nC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GZ(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,dL(r.key),r)}}function YZ(e,t,n){return t&&GZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function XZ(e,t,n){return t=em(t),QZ(e,uL()?Reflect.construct(t,n||[],em(e).constructor):t.apply(e,n))}function QZ(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 JZ(e)}function JZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uL=function(){return!!e})()}function em(e){return em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},em(e)}function ZZ(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=dL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dL(e){var t=eee(e,"string");return Ic(t)=="symbol"?t:t+""}function eee(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 tee(e){return e.dataKey}function nee(e,t){return G.isValidElement(e)?G.cloneElement(e,t):typeof e=="function"?G.createElement(e,t):G.createElement(kZ,t)}var Br=(function(e){function t(){return KZ(this,t),XZ(this,t,arguments)}return ZZ(t,e),YZ(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,g=s.isAnimationActive,x=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=tL(j.filter(function(T){return T.value!=null&&(T.hide!==!0||r.props.includeHidden)}),b,tee));var P=A.length>0;return G.createElement(VZ,{allowEscapeViewBox:i,animationDuration:c,animationEasing:d,isAnimationActive:g,active:o,coordinate:h,hasPayload:P,offset:x,position:y,reverseDirection:S,useTranslate3d:C,viewBox:N,wrapperStyle:E},nee(f,dR(dR({},this.props),{},{payload:A})))}}])})(m.PureComponent);nC(Br,"displayName","Tooltip");nC(Br,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!bl.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,fR;function ree(){if(fR)return Rw;fR=1;var e=Is(),t=function(){return e.Date.now()};return Rw=t,Rw}var Iw,pR;function aee(){if(pR)return Iw;pR=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,hR;function see(){if(hR)return Mw;hR=1;var e=aee(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Mw=n,Mw}var $w,mR;function fL(){if(mR)return $w;mR=1;var e=see(),t=ui(),n=pu(),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,vR;function oee(){if(vR)return Dw;vR=1;var e=ui(),t=ree(),n=fL(),r="Expected a function",s=Math.max,o=Math.min;function i(c,d,f){var h,p,g,x,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,g=C?s(n(f.maxWait)||0,d):g,N="trailing"in f?!!f.trailing:N);function E(V){var q=h,I=p;return h=p=void 0,y=V,x=c.apply(I,q),x}function A(V){return y=V,j=setTimeout(O,d),S?E(V):x}function P(V){var q=V-b,I=V-y,W=d-q;return C?o(W,g-I):W}function T(V){var q=V-b,I=V-y;return b===void 0||q>=d||q<0||C&&I>=g}function O(){var V=t();if(T(V))return $(V);j=setTimeout(O,P(V))}function $(V){return j=void 0,N&&h?E(V):(h=p=void 0,x)}function z(){j!==void 0&&clearTimeout(j),y=0,h=b=p=j=void 0}function U(){return j===void 0?x:$(t())}function B(){var V=t(),q=T(V);if(h=arguments,p=this,b=V,q){if(j===void 0)return A(b);if(C)return clearTimeout(j),j=setTimeout(O,d),E(b)}return j===void 0&&(j=setTimeout(O,d)),x}return B.cancel=z,B.flush=U,B}return Dw=i,Dw}var Lw,gR;function iee(){if(gR)return Lw;gR=1;var e=oee(),t=ui(),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 lee=iee();const pL=dn(lee);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 xR(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 fh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xR(Object(n),!0).forEach(function(r){cee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cee(e,t,n){return t=uee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uee(e){var t=dee(e,"string");return zd(t)=="symbol"?t:t+""}function dee(e,t){if(zd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fee(e,t){return vee(e)||mee(e,t)||hee(e,t)||pee()}function pee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
61
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hee(e,t){if(e){if(typeof e=="string")return yR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yR(e,t)}}function yR(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 mee(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 vee(e){if(Array.isArray(e))return e}var tm=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,g=e.maxHeight,x=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),P=m.useRef();P.current=C,m.useImperativeHandle(t,function(){return Object.defineProperty(A.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),A.current},configurable:!0})});var T=m.useState({containerWidth:s.width,containerHeight:s.height}),O=fee(T,2),$=O[0],z=O[1],U=m.useCallback(function(V,q){z(function(I){var W=Math.round(V),X=Math.round(q);return I.containerWidth===W&&I.containerHeight===X?I:{containerWidth:W,containerHeight:X}})},[]);m.useEffect(function(){var V=function(F){var J,D=F[0].contentRect,R=D.width,ne=D.height;U(R,ne),(J=P.current)===null||J===void 0||J.call(P,R,ne)};b>0&&(V=pL(V,b,{trailing:!0,leading:!1}));var q=new ResizeObserver(V),I=A.current.getBoundingClientRect(),W=I.width,X=I.height;return U(W,X),q.observe(A.current),function(){q.disconnect()}},[U,b]);var B=m.useMemo(function(){var V=$.containerWidth,q=$.containerHeight;if(V<0||q<0)return null;to(Bi(i)||Bi(d),`The width(%s) and height(%s) are both fixed numbers,
62
- maybe you don't need to use a ResponsiveContainer.`,i,d),to(!n||n>0,"The aspect(%s) must be greater than zero.",n);var I=Bi(i)?V:i,W=Bi(d)?q:d;n&&n>0&&(I?W=I/n:W&&(I=W*n),g&&W>g&&(W=g)),to(I>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.`,I,W,i,d,h,p,n);var X=!Array.isArray(x)&&eo(x.type).endsWith("Chart");return G.Children.map(x,function(K){return G.isValidElement(K)?m.cloneElement(K,fh({width:I,height:W},X?{style:fh({height:"100%",width:"100%",maxHeight:W,maxWidth:I},K.props.style)}:{})):K})},[n,x,d,g,p,h,$,i]);return G.createElement("div",{id:y?"".concat(y):void 0,className:Mt("recharts-responsive-container",S),style:fh(fh({},E),{},{width:i,height:d,minWidth:h,minHeight:p,maxHeight:g}),ref:A},B)}),Fv=function(t){return null};Fv.displayName="Cell";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 bR(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?bR(Object(n),!0).forEach(function(r){gee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gee(e,t,n){return t=xee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xee(e){var t=yee(e,"string");return qd(t)=="symbol"?t:t+""}function yee(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 ec={widthCache:{},cacheCount:0},bee=2e3,wee={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},wR="recharts_measurement_span";function jee(e){var t=$S({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Nd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||bl.isSsr)return{width:0,height:0};var r=jee(n),s=JSON.stringify({text:t,copyStyle:r});if(ec.widthCache[s])return ec.widthCache[s];try{var o=document.getElementById(wR);o||(o=document.createElement("span"),o.setAttribute("id",wR),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var i=$S($S({},wee),r);Object.assign(o.style,i),o.textContent="".concat(t);var c=o.getBoundingClientRect(),d={width:c.width,height:c.height};return ec.widthCache[s]=d,++ec.cacheCount>bee&&(ec.cacheCount=0,ec.widthCache={}),d}catch{return{width:0,height:0}}},See=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};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 nm(e,t){return Aee(e)||_ee(e,t)||Cee(e,t)||Nee()}function Nee(){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 Cee(e,t){if(e){if(typeof e=="string")return jR(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 jR(e,t)}}function jR(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 _ee(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 Aee(e){if(Array.isArray(e))return e}function Eee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kee(r.key),r)}}function Pee(e,t,n){return t&&SR(e.prototype,t),n&&SR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kee(e){var t=Tee(e,"string");return Ud(t)=="symbol"?t:t+""}function Tee(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 String(e)}var NR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,CR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Oee=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Ree=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,hL={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Iee=Object.keys(hL),uc="NaN";function Mee(e,t){return e*hL[t]}var ph=(function(){function e(t,n){Eee(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!Oee.test(n)&&(this.num=NaN,this.unit=""),Iee.includes(n)&&(this.num=Mee(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=Ree.exec(n))!==null&&r!==void 0?r:[],o=nm(s,3),i=o[1],c=o[2];return new e(parseFloat(i),c??"")}}])})();function mL(e){if(e.includes(uc))return uc;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=NR.exec(t))!==null&&n!==void 0?n:[],s=nm(r,4),o=s[1],i=s[2],c=s[3],d=ph.parse(o??""),f=ph.parse(c??""),h=i==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return uc;t=t.replace(NR,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,g=(p=CR.exec(t))!==null&&p!==void 0?p:[],x=nm(g,4),j=x[1],b=x[2],y=x[3],S=ph.parse(j??""),C=ph.parse(y??""),N=b==="+"?S.add(C):S.subtract(C);if(N.isNaN())return uc;t=t.replace(CR,N.toString())}return t}var _R=/\(([^()]*)\)/;function $ee(e){for(var t=e;t.includes("(");){var n=_R.exec(t),r=nm(n,2),s=r[1];t=t.replace(_R,mL(s))}return t}function Dee(e){var t=e.replace(/\s+/g,"");return t=$ee(t),t=mL(t),t}function Lee(e){try{return Dee(e)}catch{return uc}}function Fw(e){var t=Lee(e.slice(5,-1));return t===uc?"":t}var Fee=["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 AR(e,t){if(e==null)return{};var n=zee(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 zee(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 ER(e,t){return Vee(e)||Wee(e,t)||Uee(e,t)||qee()}function qee(){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 Uee(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 Wee(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 Vee(e){if(Array.isArray(e))return e}var vL=/[ \f\n\r\t\v\u2028\u2029]+/,gL=function(t){var n=t.children,r=t.breakAll,s=t.style;try{var o=[];It(n)||(r?o=n.toString().split(""):o=n.toString().split(vL));var i=o.map(function(d){return{word:d,width:Nd(d,s).width}}),c=r?0:Nd(" ",s).width;return{wordsWithComputedWidth:i,spaceWidth:c}}catch{return null}},Hee=function(t,n,r,s,o){var i=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=Ve(i),p=c,g=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return I.reduce(function(W,X){var K=X.word,F=X.width,J=W[W.length-1];if(J&&(s==null||o||J.width+F+r<Number(s)))J.words.push(K),J.width+=F+r;else{var D={words:[K],width:F};W.push(D)}return W},[])},x=g(n),j=function(I){return I.reduce(function(W,X){return W.width>X.width?W:X})};if(!h)return x;for(var b="…",y=function(I){var W=p.slice(0,I),X=gL({breakAll:f,style:d,children:W+b}).wordsWithComputedWidth,K=g(X),F=K.length>i||j(K).width>Number(s);return[F,K]},S=0,C=p.length-1,N=0,E;S<=C&&N<=p.length-1;){var A=Math.floor((S+C)/2),P=A-1,T=y(P),O=ER(T,2),$=O[0],z=O[1],U=y(A),B=ER(U,1),V=B[0];if(!$&&!V&&(S=A+1),$&&V&&(C=A-1),!$&&V){E=z;break}N++}return E||x},kR=function(t){var n=It(t)?[]:t.toString().split(vL);return[{words:n}]},Kee=function(t){var n=t.width,r=t.scaleToFit,s=t.children,o=t.style,i=t.breakAll,c=t.maxLines;if((n||r)&&!bl.isSsr){var d,f,h=gL({breakAll:i,children:s,style:o});if(h){var p=h.wordsWithComputedWidth,g=h.spaceWidth;d=p,f=g}else return kR(s);return Hee({breakAll:i,children:s,maxLines:c,style:o},d,f,n,r)}return kR(s)},TR="#808080",nl=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,g=t.textAnchor,x=g===void 0?"start":g,j=t.verticalAnchor,b=j===void 0?"end":j,y=t.fill,S=y===void 0?TR:y,C=AR(t,Fee),N=m.useMemo(function(){return Kee({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,P=C.angle,T=C.className,O=C.breakAll,$=AR(C,Bee);if(!er(r)||!er(o))return null;var z=r+(Ve(E)?E:0),U=o+(Ve(A)?A:0),B;switch(b){case"start":B=Fw("calc(".concat(f,")"));break;case"middle":B=Fw("calc(".concat((N.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:B=Fw("calc(".concat(N.length-1," * -").concat(c,")"));break}var V=[];if(p){var q=N[0].width,I=C.width;V.push("scale(".concat((Ve(I)?I/q:1)/q,")"))}return P&&V.push("rotate(".concat(P,", ").concat(z,", ").concat(U,")")),V.length&&($.transform=V.join(" ")),G.createElement("text",DS({},jt($,!0),{x:z,y:U,className:Mt("recharts-text",T),textAnchor:x,fill:S.includes("url")?TR:S}),N.map(function(W,X){var K=W.words.join(O?"":" ");return G.createElement("tspan",{x:z,dy:X===0?B:c,key:"".concat(K,"-").concat(X)},K)}))};function Jo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Gee(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=Jo,n=(c,d)=>Jo(e(c),d),r=(c,d)=>e(c)-d):(t=e===Jo||e===Gee?e:Yee,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 Yee(){return 0}function xL(e){return e===null?NaN:+e}function*Xee(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Qee=rC(Jo),Df=Qee.right;rC(xL).center;class OR extends Map{constructor(t,n=ete){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(RR(this,t))}has(t){return super.has(RR(this,t))}set(t,n){return super.set(Jee(this,t),n)}delete(t){return super.delete(Zee(this,t))}}function RR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Jee({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Zee({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ete(e){return e!==null&&typeof e=="object"?e.valueOf():e}function tte(e=Jo){if(e===Jo)return yL;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 yL(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const nte=Math.sqrt(50),rte=Math.sqrt(10),ate=Math.sqrt(2);function rm(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>=nte?10:o>=rte?5:o>=ate?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?rm(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?rm(t,e,n):rm(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,rm(e,t,n)[2]}function BS(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 IR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}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 bL(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?yL:tte(s);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,h=Math.log(d),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),x=Math.max(n,Math.floor(t-f*p/d+g)),j=Math.min(r,Math.floor(t+(d-f)*p/d+g));bL(e,t,x,j,s)}const o=e[t];let i=n,c=r;for(ld(e,n,t),s(e[r],o)>0&&ld(e,n,r);i<c;){for(ld(e,i,c),++i,--c;s(e[i],o)<0;)++i;for(;s(e[c],o)>0;)--c}s(e[n],o)===0?ld(e,n,c):(++c,ld(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function ld(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function ste(e,t,n){if(e=Float64Array.from(Xee(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return MR(e);if(t>=1)return IR(e);var r,s=(r-1)*t,o=Math.floor(s),i=IR(bL(e,o).subarray(0,o+1)),c=MR(e.subarray(o+1));return i+(c-i)*(s-o)}}function ote(e,t,n=xL){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 ite(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 xo(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 zS=Symbol("implicit");function aC(){var e=new OR,t=[],n=[],r=zS;function s(o){let i=e.get(o);if(i===void 0){if(r!==zS)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 OR;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 Wd(){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 g=t().length,x=s<r,j=x?s:r,b=x?r:s;o=(b-j)/Math.max(1,g-d+f*2),c&&(o=Math.floor(o)),j+=(b-j-o*(g-d))*h,i=o*(1-d),c&&(j=Math.round(j),i=Math.round(i));var y=ite(g).map(function(S){return j+o*S});return n(x?y.reverse():y)}return e.domain=function(g){return arguments.length?(t(g),p()):t()},e.range=function(g){return arguments.length?([r,s]=g,r=+r,s=+s,p()):[r,s]},e.rangeRound=function(g){return[r,s]=g,r=+r,s=+s,c=!0,p()},e.bandwidth=function(){return i},e.step=function(){return o},e.round=function(g){return arguments.length?(c=!!g,p()):c},e.padding=function(g){return arguments.length?(d=Math.min(1,f=+g),p()):d},e.paddingInner=function(g){return arguments.length?(d=Math.min(1,g),p()):d},e.paddingOuter=function(g){return arguments.length?(f=+g,p()):f},e.align=function(g){return arguments.length?(h=Math.max(0,Math.min(1,g)),p()):h},e.copy=function(){return Wd(t(),[r,s]).round(c).paddingInner(d).paddingOuter(f).align(h)},Ma.apply(p(),arguments)}function wL(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return wL(t())},e}function Cd(){return wL(Wd.apply(null,arguments).paddingInner(1))}function sC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function jL(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Lf(){}var Vd=.7,am=1/Vd,wc="\\s*([+-]?\\d+)\\s*",Hd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",js="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lte=/^#([0-9a-f]{3,8})$/,cte=new RegExp(`^rgb\\(${wc},${wc},${wc}\\)$`),ute=new RegExp(`^rgb\\(${js},${js},${js}\\)$`),dte=new RegExp(`^rgba\\(${wc},${wc},${wc},${Hd}\\)$`),fte=new RegExp(`^rgba\\(${js},${js},${js},${Hd}\\)$`),pte=new RegExp(`^hsl\\(${Hd},${js},${js}\\)$`),hte=new RegExp(`^hsla\\(${Hd},${js},${js},${Hd}\\)$`),$R={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(Lf,Kd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:DR,formatHex:DR,formatHex8:mte,formatHsl:vte,formatRgb:LR,toString:LR});function DR(){return this.rgb().formatHex()}function mte(){return this.rgb().formatHex8()}function vte(){return SL(this).formatHsl()}function LR(){return this.rgb().formatRgb()}function Kd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=lte.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?FR(t):n===3?new Hr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?hh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?hh(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=cte.exec(e))?new Hr(t[1],t[2],t[3],1):(t=ute.exec(e))?new Hr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dte.exec(e))?hh(t[1],t[2],t[3],t[4]):(t=fte.exec(e))?hh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pte.exec(e))?qR(t[1],t[2]/100,t[3]/100,1):(t=hte.exec(e))?qR(t[1],t[2]/100,t[3]/100,t[4]):$R.hasOwnProperty(e)?FR($R[e]):e==="transparent"?new Hr(NaN,NaN,NaN,0):null}function FR(e){return new Hr(e>>16&255,e>>8&255,e&255,1)}function hh(e,t,n,r){return r<=0&&(e=t=n=NaN),new Hr(e,t,n,r)}function gte(e){return e instanceof Lf||(e=Kd(e)),e?(e=e.rgb(),new Hr(e.r,e.g,e.b,e.opacity)):new Hr}function qS(e,t,n,r){return arguments.length===1?gte(e):new Hr(e,t,n,r??1)}function Hr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}sC(Hr,qS,jL(Lf,{brighter(e){return e=e==null?am:Math.pow(am,e),new Hr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Vd:Math.pow(Vd,e),new Hr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Hr(Hi(this.r),Hi(this.g),Hi(this.b),sm(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:xte,formatRgb:zR,toString:zR}));function BR(){return`#${zi(this.r)}${zi(this.g)}${zi(this.b)}`}function xte(){return`#${zi(this.r)}${zi(this.g)}${zi(this.b)}${zi((isNaN(this.opacity)?1:this.opacity)*255)}`}function zR(){const e=sm(this.opacity);return`${e===1?"rgb(":"rgba("}${Hi(this.r)}, ${Hi(this.g)}, ${Hi(this.b)}${e===1?")":`, ${e})`}`}function sm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zi(e){return e=Hi(e),(e<16?"0":"")+e.toString(16)}function qR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ja(e,t,n,r)}function SL(e){if(e instanceof Ja)return new Ja(e.h,e.s,e.l,e.opacity);if(e instanceof Lf||(e=Kd(e)),!e)return new Ja;if(e instanceof Ja)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 Ja(i,c,d,e.opacity)}function yte(e,t,n,r){return arguments.length===1?SL(e):new Ja(e,t,n,r??1)}function Ja(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}sC(Ja,yte,jL(Lf,{brighter(e){return e=e==null?am:Math.pow(am,e),new Ja(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vd:Math.pow(Vd,e),new Ja(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 Hr(Bw(e>=240?e-240:e+120,s,r),Bw(e,s,r),Bw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Ja(UR(this.h),mh(this.s),mh(this.l),sm(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=sm(this.opacity);return`${e===1?"hsl(":"hsla("}${UR(this.h)}, ${mh(this.s)*100}%, ${mh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function UR(e){return e=(e||0)%360,e<0?e+360:e}function mh(e){return Math.max(0,Math.min(1,e||0))}function Bw(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 bte(e,t){return function(n){return e+n*t}}function wte(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 jte(e){return(e=+e)==1?NL:function(t,n){return n-t?wte(t,n,e):oC(isNaN(t)?n:t)}}function NL(e,t){var n=t-e;return n?bte(e,n):oC(isNaN(e)?t:e)}const WR=(function e(t){var n=jte(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=NL(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 Ste(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 Nte(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Cte(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]=gu(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 _te(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function om(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ate(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]=gu(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,zw=new RegExp(US.source,"g");function Ete(e){return function(){return e}}function Pte(e){return function(t){return e(t)+""}}function kte(e,t){var n=US.lastIndex=zw.lastIndex=0,r,s,o,i=-1,c=[],d=[];for(e=e+"",t=t+"";(r=US.exec(e))&&(s=zw.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:om(r,s)})),n=zw.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):Ete(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 gu(e,t){var n=typeof t,r;return t==null||n==="boolean"?oC(t):(n==="number"?om:n==="string"?(r=Kd(t))?(t=r,WR):kte:t instanceof Kd?WR:t instanceof Date?_te:Nte(t)?Ste:Array.isArray(t)?Cte:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Ate:om)(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=gu);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 Ote(e){return function(){return e}}function im(e){return+e}var VR=[0,1];function Pr(e){return e}function WS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Ote(isNaN(t)?NaN:.5)}function Rte(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Ite(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 Mte(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=Df(e,c,1,r)-1;return o[d](s[d](c))}}function Ff(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Bv(){var e=VR,t=VR,n=gu,r,s,o,i=Pr,c,d,f;function h(){var g=Math.min(e.length,t.length);return i!==Pr&&(i=Rte(e[0],e[g-1])),c=g>2?Mte:Ite,d=f=null,p}function p(g){return g==null||isNaN(g=+g)?o:(d||(d=c(e.map(r),t,n)))(r(i(g)))}return p.invert=function(g){return i(s((f||(f=c(t,e.map(r),om)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,im),h()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),h()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=iC,h()},p.clamp=function(g){return arguments.length?(i=g?!0:Pr,h()):i!==Pr},p.interpolate=function(g){return arguments.length?(n=g,h()):n},p.unknown=function(g){return arguments.length?(o=g,p):o},function(g,x){return r=g,s=x,h()}}function lC(){return Bv()(Pr,Pr)}function $te(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function lm(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 Mc(e){return e=lm(Math.abs(e)),e?e[1]:NaN}function Dte(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 Lte(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Fte=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Gd(e){if(!(t=Fte.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]})}Gd.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 cm;function zte(e,t){var n=lm(e,t);if(!n)return cm=void 0,e.toPrecision(t);var r=n[0],s=n[1],o=s-(cm=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")+lm(e,Math.max(0,t+o-1))[0]}function HR(e,t){var n=lm(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 KR={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$te,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)=>HR(e*100,t),r:HR,s:zte,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function GR(e){return e}var YR=Array.prototype.map,XR=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function qte(e){var t=e.grouping===void 0||e.thousands===void 0?GR:Dte(YR.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?GR:Lte(YR.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,g){p=Gd(p);var x=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,P=p.type;P==="n"?(N=!0,P="g"):KR[P]||(E===void 0&&(E=12),A=!0,P="g"),(S||x==="0"&&j==="=")&&(S=!0,x="0",j="=");var T=(g&&g.prefix!==void 0?g.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),O=(y==="$"?r:/[%p]/.test(P)?i:"")+(g&&g.suffix!==void 0?g.suffix:""),$=KR[P],z=/[defgprs%]/.test(P);E=E===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function U(B){var V=T,q=O,I,W,X;if(P==="c")q=$(B)+q,B="";else{B=+B;var K=B<0||1/B<0;if(B=isNaN(B)?d:$(Math.abs(B),E),A&&(B=Bte(B)),K&&+B==0&&b!=="+"&&(K=!1),V=(K?b==="("?b:c:b==="-"||b==="("?"":b)+V,q=(P==="s"&&!isNaN(B)&&cm!==void 0?XR[8+cm/3]:"")+q+(K&&b==="("?")":""),z){for(I=-1,W=B.length;++I<W;)if(X=B.charCodeAt(I),48>X||X>57){q=(X===46?s+B.slice(I+1):B.slice(I))+q,B=B.slice(0,I);break}}}N&&!S&&(B=t(B,1/0));var F=V.length+B.length+q.length,J=F<C?new Array(C-F+1).join(x):"";switch(N&&S&&(B=t(J+B,J.length?C-q.length:1/0),J=""),j){case"<":B=V+B+q+J;break;case"=":B=V+J+B+q;break;case"^":B=J.slice(0,F=J.length>>1)+V+B+q+J.slice(F);break;default:B=J+V+B+q;break}return o(B)}return U.toString=function(){return p+""},U}function h(p,g){var x=Math.max(-8,Math.min(8,Math.floor(Mc(g)/3)))*3,j=Math.pow(10,-x),b=f((p=Gd(p),p.type="f",p),{suffix:XR[8+x/3]});return function(y){return b(j*y)}}return{format:f,formatPrefix:h}}var vh,uC,CL;Ute({thousands:",",grouping:[3],currency:["$",""]});function Ute(e){return vh=qte(e),uC=vh.format,CL=vh.formatPrefix,vh}function Wte(e){return Math.max(0,-Mc(Math.abs(e)))}function Vte(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Mc(t)/3)))*3-Mc(Math.abs(e)))}function Hte(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Mc(t)-Mc(e))+1}function _L(e,t,n,r){var s=BS(e,t,n),o;switch(r=Gd(r??",f"),r.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Vte(s,i))&&(r.precision=o),CL(r,i)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Hte(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Wte(s))&&(r.precision=o-(r.type==="%")*2);break}}return uC(r)}function di(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 _L(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 um(){var e=lC();return e.copy=function(){return Ff(e,um())},Ma.apply(e,arguments),di(e)}function AL(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,im),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return AL(e).unknown(t)},e=arguments.length?Array.from(e,im):[0,1],di(n)}function EL(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 QR(e){return Math.log(e)}function JR(e){return Math.exp(e)}function Kte(e){return-Math.log(-e)}function Gte(e){return-Math.exp(-e)}function Yte(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Xte(e){return e===10?Yte:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Qte(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 ZR(e){return(t,n)=>-e(-t,n)}function dC(e){const t=e(QR,JR),n=t.domain;let r=10,s,o;function i(){return s=Qte(r),o=Xte(r),n()[0]<0?(s=ZR(s),o=ZR(o),e(Kte,Gte)):e(QR,JR),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 g=s(f),x=s(h),j,b;const y=c==null?10:+c;let S=[];if(!(r%1)&&x-g<y){if(g=Math.floor(g),x=Math.ceil(x),f>0){for(;g<=x;++g)for(j=1;j<r;++j)if(b=g<0?j/o(-g):j*o(g),!(b<f)){if(b>h)break;S.push(b)}}else for(;g<=x;++g)for(j=r-1;j>=1;--j)if(b=g>0?j/o(-g):j*o(g),!(b<f)){if(b>h)break;S.push(b)}S.length*2<y&&(S=LS(f,h,y))}else S=LS(g,x,Math.min(x-g,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=Gd(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(EL(n(),{floor:c=>o(Math.floor(s(c))),ceil:c=>o(Math.ceil(s(c)))})),t}function PL(){const e=dC(Bv()).domain([1,10]);return e.copy=()=>Ff(e,PL()).base(e.base()),Ma.apply(e,arguments),e}function e2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function t2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function fC(e){var t=1,n=e(e2(t),t2(t));return n.constant=function(r){return arguments.length?e(e2(t=+r),t2(t)):t},di(n)}function kL(){var e=fC(Bv());return e.copy=function(){return Ff(e,kL()).constant(e.constant())},Ma.apply(e,arguments)}function n2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Jte(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Zte(e){return e<0?-e*e:e*e}function pC(e){var t=e(Pr,Pr),n=1;function r(){return n===1?e(Pr,Pr):n===.5?e(Jte,Zte):e(n2(n),n2(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},di(t)}function hC(){var e=pC(Bv());return e.copy=function(){return Ff(e,hC()).exponent(e.exponent())},Ma.apply(e,arguments),e}function ene(){return hC.apply(null,arguments).exponent(.5)}function r2(e){return Math.sign(e)*e*e}function tne(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=tne(e(o));return isNaN(i)?r:n?Math.round(i):i}return s.invert=function(o){return e.invert(r2(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,im)).map(r2)),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),di(s)}function OL(){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]=ote(e,i/c);return o}function o(i){return i==null||isNaN(i=+i)?r:t[Df(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(Jo),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 OL().domain(e).range(t).unknown(r)},Ma.apply(o,arguments)}function RL(){var e=0,t=1,n=1,r=[.5],s=[0,1],o;function i(d){return d!=null&&d<=d?s[Df(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 RL().domain([e,t]).range(s).unknown(o)},Ma.apply(di(i),arguments)}function IL(){var e=[.5],t=[0,1],n,r=1;function s(o){return o!=null&&o<=o?t[Df(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 IL().domain(e).range(t).unknown(n)},Ma.apply(s,arguments)}const qw=new Date,Uw=new Date;function rr(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=>rr(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 dm=rr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);dm.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?rr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):dm);dm.range;const Qs=1e3,Pa=Qs*60,Js=Pa*60,co=Js*24,mC=co*7,a2=co*30,Ww=co*365,qi=rr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Qs)},(e,t)=>(t-e)/Qs,e=>e.getUTCSeconds());qi.range;const vC=rr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Qs)},(e,t)=>{e.setTime(+e+t*Pa)},(e,t)=>(t-e)/Pa,e=>e.getMinutes());vC.range;const gC=rr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Pa)},(e,t)=>(t-e)/Pa,e=>e.getUTCMinutes());gC.range;const xC=rr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Qs-e.getMinutes()*Pa)},(e,t)=>{e.setTime(+e+t*Js)},(e,t)=>(t-e)/Js,e=>e.getHours());xC.range;const yC=rr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Js)},(e,t)=>(t-e)/Js,e=>e.getUTCHours());yC.range;const Bf=rr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Pa)/co,e=>e.getDate()-1);Bf.range;const zv=rr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/co,e=>e.getUTCDate()-1);zv.range;const ML=rr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/co,e=>Math.floor(e/co));ML.range;function wl(e){return rr(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())*Pa)/mC)}const qv=wl(0),fm=wl(1),nne=wl(2),rne=wl(3),$c=wl(4),ane=wl(5),sne=wl(6);qv.range;fm.range;nne.range;rne.range;$c.range;ane.range;sne.range;function jl(e){return rr(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 Uv=jl(0),pm=jl(1),one=jl(2),ine=jl(3),Dc=jl(4),lne=jl(5),cne=jl(6);Uv.range;pm.range;one.range;ine.range;Dc.range;lne.range;cne.range;const bC=rr(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=rr(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 uo=rr(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());uo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:rr(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)});uo.range;const fo=rr(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());fo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:rr(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)});fo.range;function $L(e,t,n,r,s,o){const i=[[qi,1,Qs],[qi,5,5*Qs],[qi,15,15*Qs],[qi,30,30*Qs],[o,1,Pa],[o,5,5*Pa],[o,15,15*Pa],[o,30,30*Pa],[s,1,Js],[s,3,3*Js],[s,6,6*Js],[s,12,12*Js],[r,1,co],[r,2,2*co],[n,1,mC],[t,1,a2],[t,3,3*a2],[e,1,Ww]];function c(f,h,p){const g=h<f;g&&([f,h]=[h,f]);const x=p&&typeof p.range=="function"?p:d(f,h,p),j=x?x.range(f,+h+1):[];return g?j.reverse():j}function d(f,h,p){const g=Math.abs(h-f)/p,x=rC(([,,y])=>y).right(i,g);if(x===i.length)return e.every(BS(f/Ww,h/Ww,p));if(x===0)return dm.every(Math.max(BS(f,h,p),1));const[j,b]=i[g/i[x-1][2]<i[x][2]/g?x-1:x];return j.every(b)}return[c,d]}const[une,dne]=$L(fo,wC,Uv,ML,yC,gC),[fne,pne]=$L(uo,bC,qv,Bf,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 cd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function hne(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=ud(s),h=dd(s),p=ud(o),g=dd(o),x=ud(i),j=dd(i),b=ud(c),y=dd(c),S=ud(d),C=dd(d),N={a:X,A:K,b:F,B:J,c:null,d:u2,e:u2,f:Dne,g:Kne,G:Yne,H:Ine,I:Mne,j:$ne,L:DL,m:Lne,M:Fne,p:D,q:R,Q:p2,s:h2,S:Bne,u:zne,U:qne,V:Une,w:Wne,W:Vne,x:null,X:null,y:Hne,Y:Gne,Z:Xne,"%":f2},E={a:ne,A:te,b:de,B:he,c:null,d:d2,e:d2,f:ere,g:ure,G:fre,H:Qne,I:Jne,j:Zne,L:FL,m:tre,M:nre,p:H,q:ue,Q:p2,s:h2,S:rre,u:are,U:sre,V:ore,w:ire,W:lre,x:null,X:null,y:cre,Y:dre,Z:pre,"%":f2},A={a:z,A:U,b:B,B:V,c:q,d:l2,e:l2,f:kne,g:i2,G:o2,H:c2,I:c2,j:_ne,L:Pne,m:Cne,M:Ane,p:$,q:Nne,Q:One,s:Rne,S:Ene,u:yne,U:bne,V:wne,w:xne,W:jne,x:I,X:W,y:i2,Y:o2,Z:Sne,"%":Tne};N.x=P(n,N),N.X=P(r,N),N.c=P(t,N),E.x=P(n,E),E.X=P(r,E),E.c=P(t,E);function P(Q,Z){return function(fe){var ae=[],Oe=-1,we=0,Ye=Q.length,L,ie,pe;for(fe instanceof Date||(fe=new Date(+fe));++Oe<Ye;)Q.charCodeAt(Oe)===37&&(ae.push(Q.slice(we,Oe)),(ie=s2[L=Q.charAt(++Oe)])!=null?L=Q.charAt(++Oe):ie=L==="e"?" ":"0",(pe=Z[L])&&(L=pe(fe,ie)),ae.push(L),we=Oe+1);return ae.push(Q.slice(we,Oe)),ae.join("")}}function T(Q,Z){return function(fe){var ae=cd(1900,void 0,1),Oe=O(ae,Q,fe+="",0),we,Ye;if(Oe!=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?(we=Hw(cd(ae.y,0,1)),Ye=we.getUTCDay(),we=Ye>4||Ye===0?pm.ceil(we):pm(we),we=zv.offset(we,(ae.V-1)*7),ae.y=we.getUTCFullYear(),ae.m=we.getUTCMonth(),ae.d=we.getUTCDate()+(ae.w+6)%7):(we=Vw(cd(ae.y,0,1)),Ye=we.getDay(),we=Ye>4||Ye===0?fm.ceil(we):fm(we),we=Bf.offset(we,(ae.V-1)*7),ae.y=we.getFullYear(),ae.m=we.getMonth(),ae.d=we.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),Ye="Z"in ae?Hw(cd(ae.y,0,1)).getUTCDay():Vw(cd(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(Ye+5)%7:ae.w+ae.U*7-(Ye+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,Hw(ae)):Vw(ae)}}function O(Q,Z,fe,ae){for(var Oe=0,we=Z.length,Ye=fe.length,L,ie;Oe<we;){if(ae>=Ye)return-1;if(L=Z.charCodeAt(Oe++),L===37){if(L=Z.charAt(Oe++),ie=A[L in s2?Z.charAt(Oe++):L],!ie||(ae=ie(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 z(Q,Z,fe){var ae=x.exec(Z.slice(fe));return ae?(Q.w=j.get(ae[0].toLowerCase()),fe+ae[0].length):-1}function U(Q,Z,fe){var ae=p.exec(Z.slice(fe));return ae?(Q.w=g.get(ae[0].toLowerCase()),fe+ae[0].length):-1}function B(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 V(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 q(Q,Z,fe){return O(Q,t,Z,fe)}function I(Q,Z,fe){return O(Q,n,Z,fe)}function W(Q,Z,fe){return O(Q,r,Z,fe)}function X(Q){return i[Q.getDay()]}function K(Q){return o[Q.getDay()]}function F(Q){return d[Q.getMonth()]}function J(Q){return c[Q.getMonth()]}function D(Q){return s[+(Q.getHours()>=12)]}function R(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 H(Q){return s[+(Q.getUTCHours()>=12)]}function ue(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var Z=P(Q+="",N);return Z.toString=function(){return Q},Z},parse:function(Q){var Z=T(Q+="",!1);return Z.toString=function(){return Q},Z},utcFormat:function(Q){var Z=P(Q+="",E);return Z.toString=function(){return Q},Z},utcParse:function(Q){var Z=T(Q+="",!0);return Z.toString=function(){return Q},Z}}}var s2={"-":"",_:" ",0:"0"},cr=/^\s*\d+/,mne=/^%/,vne=/[\\^$*+?|[\]().{}]/g;function rn(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 gne(e){return e.replace(vne,"\\$&")}function ud(e){return new RegExp("^(?:"+e.map(gne).join("|")+")","i")}function dd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function xne(e,t,n){var r=cr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function yne(e,t,n){var r=cr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function bne(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function wne(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function jne(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function o2(e,t,n){var r=cr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function i2(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Sne(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 Nne(e,t,n){var r=cr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Cne(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function l2(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function _ne(e,t,n){var r=cr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function c2(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ane(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ene(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Pne(e,t,n){var r=cr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function kne(e,t,n){var r=cr.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=mne.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function One(e,t,n){var r=cr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Rne(e,t,n){var r=cr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function u2(e,t){return rn(e.getDate(),t,2)}function Ine(e,t){return rn(e.getHours(),t,2)}function Mne(e,t){return rn(e.getHours()%12||12,t,2)}function $ne(e,t){return rn(1+Bf.count(uo(e),e),t,3)}function DL(e,t){return rn(e.getMilliseconds(),t,3)}function Dne(e,t){return DL(e,t)+"000"}function Lne(e,t){return rn(e.getMonth()+1,t,2)}function Fne(e,t){return rn(e.getMinutes(),t,2)}function Bne(e,t){return rn(e.getSeconds(),t,2)}function zne(e){var t=e.getDay();return t===0?7:t}function qne(e,t){return rn(qv.count(uo(e)-1,e),t,2)}function LL(e){var t=e.getDay();return t>=4||t===0?$c(e):$c.ceil(e)}function Une(e,t){return e=LL(e),rn($c.count(uo(e),e)+(uo(e).getDay()===4),t,2)}function Wne(e){return e.getDay()}function Vne(e,t){return rn(fm.count(uo(e)-1,e),t,2)}function Hne(e,t){return rn(e.getFullYear()%100,t,2)}function Kne(e,t){return e=LL(e),rn(e.getFullYear()%100,t,2)}function Gne(e,t){return rn(e.getFullYear()%1e4,t,4)}function Yne(e,t){var n=e.getDay();return e=n>=4||n===0?$c(e):$c.ceil(e),rn(e.getFullYear()%1e4,t,4)}function Xne(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+rn(t/60|0,"0",2)+rn(t%60,"0",2)}function d2(e,t){return rn(e.getUTCDate(),t,2)}function Qne(e,t){return rn(e.getUTCHours(),t,2)}function Jne(e,t){return rn(e.getUTCHours()%12||12,t,2)}function Zne(e,t){return rn(1+zv.count(fo(e),e),t,3)}function FL(e,t){return rn(e.getUTCMilliseconds(),t,3)}function ere(e,t){return FL(e,t)+"000"}function tre(e,t){return rn(e.getUTCMonth()+1,t,2)}function nre(e,t){return rn(e.getUTCMinutes(),t,2)}function rre(e,t){return rn(e.getUTCSeconds(),t,2)}function are(e){var t=e.getUTCDay();return t===0?7:t}function sre(e,t){return rn(Uv.count(fo(e)-1,e),t,2)}function BL(e){var t=e.getUTCDay();return t>=4||t===0?Dc(e):Dc.ceil(e)}function ore(e,t){return e=BL(e),rn(Dc.count(fo(e),e)+(fo(e).getUTCDay()===4),t,2)}function ire(e){return e.getUTCDay()}function lre(e,t){return rn(pm.count(fo(e)-1,e),t,2)}function cre(e,t){return rn(e.getUTCFullYear()%100,t,2)}function ure(e,t){return e=BL(e),rn(e.getUTCFullYear()%100,t,2)}function dre(e,t){return rn(e.getUTCFullYear()%1e4,t,4)}function fre(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Dc(e):Dc.ceil(e),rn(e.getUTCFullYear()%1e4,t,4)}function pre(){return"+0000"}function f2(){return"%"}function p2(e){return+e}function h2(e){return Math.floor(+e/1e3)}var tc,zL,qL;hre({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 hre(e){return tc=hne(e),zL=tc.format,tc.parse,qL=tc.utcFormat,tc.utcParse,tc}function mre(e){return new Date(e)}function vre(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,g=h.domain,x=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(P){return(d(P)<P?x:c(P)<P?j:i(P)<P?b:o(P)<P?y:r(P)<P?s(P)<P?S:C:n(P)<P?N:E)(P)}return h.invert=function(P){return new Date(p(P))},h.domain=function(P){return arguments.length?g(Array.from(P,vre)):g().map(mre)},h.ticks=function(P){var T=g();return e(T[0],T[T.length-1],P??10)},h.tickFormat=function(P,T){return T==null?A:f(T)},h.nice=function(P){var T=g();return(!P||typeof P.range!="function")&&(P=t(T[0],T[T.length-1],P??10)),P?g(EL(T,P)):h},h.copy=function(){return Ff(h,jC(e,t,n,r,s,o,i,c,d,f))},h}function gre(){return Ma.apply(jC(fne,pne,uo,bC,qv,Bf,xC,vC,qi,zL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function xre(){return Ma.apply(jC(une,dne,fo,wC,Uv,zv,yC,gC,qi,qL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Wv(){var e=0,t=1,n,r,s,o,i=Pr,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(g){var x,j;return arguments.length?([x,j]=g,i=p(x,j),f):[i(0),i(1)]}}return f.range=h(gu),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 fi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function UL(){var e=di(Wv()(Pr));return e.copy=function(){return fi(e,UL())},xo.apply(e,arguments)}function WL(){var e=dC(Wv()).domain([1,10]);return e.copy=function(){return fi(e,WL()).base(e.base())},xo.apply(e,arguments)}function VL(){var e=fC(Wv());return e.copy=function(){return fi(e,VL()).constant(e.constant())},xo.apply(e,arguments)}function SC(){var e=pC(Wv());return e.copy=function(){return fi(e,SC()).exponent(e.exponent())},xo.apply(e,arguments)}function yre(){return SC.apply(null,arguments).exponent(.5)}function HL(){var e=[],t=Pr;function n(r){if(r!=null&&!isNaN(r=+r))return t((Df(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(Jo),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)=>ste(e,o/r))},n.copy=function(){return HL(t).domain(e)},xo.apply(n,arguments)}function Vv(){var e=0,t=.5,n=1,r=1,s,o,i,c,d,f=Pr,h,p=!1,g;function x(b){return isNaN(b=+b)?g:(b=.5+((b=+h(b))-o)*(r*b<r*o?c:d),f(p?Math.max(0,Math.min(1,b)):b))}x.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,x):[e,t,n]},x.clamp=function(b){return arguments.length?(p=!!b,x):p},x.interpolator=function(b){return arguments.length?(f=b,x):f};function j(b){return function(y){var S,C,N;return arguments.length?([S,C,N]=y,f=Tte(b,[S,C,N]),x):[f(0),f(.5),f(1)]}}return x.range=j(gu),x.rangeRound=j(iC),x.unknown=function(b){return arguments.length?(g=b,x):g},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,x}}function KL(){var e=di(Vv()(Pr));return e.copy=function(){return fi(e,KL())},xo.apply(e,arguments)}function GL(){var e=dC(Vv()).domain([.1,1,10]);return e.copy=function(){return fi(e,GL()).base(e.base())},xo.apply(e,arguments)}function YL(){var e=fC(Vv());return e.copy=function(){return fi(e,YL()).constant(e.constant())},xo.apply(e,arguments)}function NC(){var e=pC(Vv());return e.copy=function(){return fi(e,NC()).exponent(e.exponent())},xo.apply(e,arguments)}function bre(){return NC.apply(null,arguments).exponent(.5)}const m2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Wd,scaleDiverging:KL,scaleDivergingLog:GL,scaleDivergingPow:NC,scaleDivergingSqrt:bre,scaleDivergingSymlog:YL,scaleIdentity:AL,scaleImplicit:zS,scaleLinear:um,scaleLog:PL,scaleOrdinal:aC,scalePoint:Cd,scalePow:hC,scaleQuantile:OL,scaleQuantize:RL,scaleRadial:TL,scaleSequential:UL,scaleSequentialLog:WL,scaleSequentialPow:SC,scaleSequentialQuantile:HL,scaleSequentialSqrt:yre,scaleSequentialSymlog:VL,scaleSqrt:ene,scaleSymlog:kL,scaleThreshold:IL,scaleTime:gre,scaleUtc:xre,tickFormat:_L},Symbol.toStringTag,{value:"Module"}));var Kw,v2;function Hv(){if(v2)return Kw;v2=1;var e=pu();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,g2;function XL(){if(g2)return Gw;g2=1;function e(t,n){return t>n}return Gw=e,Gw}var Yw,x2;function wre(){if(x2)return Yw;x2=1;var e=Hv(),t=XL(),n=vu();function r(s){return s&&s.length?e(s,n,t):void 0}return Yw=r,Yw}var jre=wre();const Kv=dn(jre);var Xw,y2;function QL(){if(y2)return Xw;y2=1;function e(t,n){return t<n}return Xw=e,Xw}var Qw,b2;function Sre(){if(b2)return Qw;b2=1;var e=Hv(),t=QL(),n=vu();function r(s){return s&&s.length?e(s,n,t):void 0}return Qw=r,Qw}var Nre=Sre();const Gv=dn(Nre);var Jw,w2;function Cre(){if(w2)return Jw;w2=1;var e=BN(),t=Ms(),n=oL(),r=Yr();function s(o,i){var c=r(o)?e:n;return c(o,t(i,3))}return Jw=s,Jw}var Zw,j2;function _re(){if(j2)return Zw;j2=1;var e=aL(),t=Cre();function n(r,s){return e(t(r,s),1)}return Zw=n,Zw}var Are=_re();const Ere=dn(Are);var ej,S2;function Pre(){if(S2)return ej;S2=1;var e=ZN();function t(n,r){return e(n,r)}return ej=t,ej}var kre=Pre();const zf=dn(kre);var xu=1e9,Tre={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},_C,Rn=!0,Ra="[DecimalError] ",Ki=Ra+"Invalid argument: ",CC=Ra+"Exponent out of range: ",yu=Math.floor,Li=Math.pow,Ore=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,la,ir=1e7,kn=7,JL=9007199254740991,hm=yu(JL/kn),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)*kn;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 no(this,new this.constructor(e))};rt.dividedToIntegerBy=rt.idiv=function(e){var t=this,n=t.constructor;return xn(no(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(la))throw Error(Ra+"NaN");if(n.s<1)throw Error(Ra+(n.s?"NaN":"-Infinity"));return n.eq(la)?new r(0):(Rn=!1,t=no(Yd(n,o),Yd(e,o),o),Rn=!0,xn(t,s))};rt.minus=rt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?t4(t,e):ZL(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?(Rn=!1,t=no(n,e,0,1).times(e),Rn=!0,n.minus(t)):xn(new r(n),s)};rt.naturalExponential=rt.exp=function(){return e4(this)};rt.naturalLogarithm=rt.ln=function(){return Yd(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?ZL(t,e):t4(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(Ki+e);if(t=Kn(s)+1,r=s.d.length-1,n=r*kn+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),Rn=!1,s=Math.sqrt(+c),s==0||s==1/0?(t=ys(c.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=yu((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(no(c,o,i+2)).times(.5),ys(o.d).slice(0,i)===(t=ys(r.d)).slice(0,i)){if(t=t.slice(i-3,i+1),s==i&&t=="4999"){if(xn(o,n+1,0),o.times(o).eq(c)){r=o;break}}else if(t!="9999")break;i+=4}return Rn=!0,xn(r,n)};rt.times=rt.mul=function(e){var t,n,r,s,o,i,c,d,f,h=this,p=h.constructor,g=h.d,x=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,n=h.e+e.e,d=g.length,f=x.length,d<f&&(o=g,g=x,x=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]+x[r]*g[s-r-1]+t,o[s--]=c%ir|0,t=c/ir|0;o[s]=(o[s]+t)%ir|0}for(;!o[--i];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,Rn?xn(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:(Es(e,0,xu),t===void 0?t=r.rounding:Es(t,0,8),xn(n,e+Kn(n)+1,t))};rt.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=rl(r,!0):(Es(e,0,xu),t===void 0?t=s.rounding:Es(t,0,8),r=xn(new s(r),e+1,t),n=rl(r,!0,e+1)),n};rt.toFixed=function(e,t){var n,r,s=this,o=s.constructor;return e===void 0?rl(s):(Es(e,0,xu),t===void 0?t=o.rounding:Es(t,0,8),r=xn(new o(s),e+Kn(s)+1,t),n=rl(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 xn(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(la);if(c=new d(c),!c.s){if(e.s<1)throw Error(Ra+"Infinity");return c}if(c.eq(la))return c;if(r=d.precision,e.eq(la))return xn(c,r);if(t=e.e,n=e.d.length-1,i=t>=n,o=c.s,i){if((n=h<0?-h:h)<=JL){for(s=new d(la),t=Math.ceil(r/kn+4),Rn=!1;n%2&&(s=s.times(c),C2(s.d,t)),n=yu(n/2),n!==0;)c=c.times(c),C2(c.d,t);return Rn=!0,e.s<0?new d(la).div(s):xn(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,Rn=!1,s=e.times(Yd(c,r+f)),Rn=!0,s=e4(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=rl(s,n<=o.toExpNeg||n>=o.toExpPos)):(Es(e,1,xu),t===void 0?t=o.rounding:Es(t,0,8),s=xn(new o(s),e,t),n=Kn(s),r=rl(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):(Es(e,1,xu),t===void 0?t=r.rounding:Es(t,0,8)),xn(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 rl(e,t<=n.toExpNeg||t>=n.toExpPos)};function ZL(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)),Rn?xn(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/kn),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)/ir|0,d[o]%=ir;for(n&&(d.unshift(n),++s),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=s,Rn?xn(t,p):t}function Es(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Ki+e)}function ys(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=kn-r.length,n&&(o+=Ko(n)),o+=r;i=e[t],r=i+"",n=kn-r.length,n&&(o+=Ko(n))}else if(i===0)return"0";for(;i%10===0;)i/=10;return o+i}var no=(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%ir|0,i=o/ir|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*ir+r[o]-s[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,s,o,i){var c,d,f,h,p,g,x,j,b,y,S,C,N,E,A,P,T,O,$=r.constructor,z=r.s==s.s?1:-1,U=r.d,B=s.d;if(!r.s)return new $(r);if(!s.s)throw Error(Ra+"Division by zero");for(d=r.e-s.e,T=B.length,A=U.length,x=new $(z),j=x.d=[],f=0;B[f]==(U[f]||0);)++f;if(B[f]>(U[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/kn+2|0,f=0,T==1)for(h=0,B=B[0],C++;(f<A||h)&&C--;f++)N=h*ir+(U[f]||0),j[f]=N/B|0,h=N%B|0;else{for(h=ir/(B[0]+1)|0,h>1&&(B=e(B,h),U=e(U,h),T=B.length,A=U.length),E=T,b=U.slice(0,T),y=b.length;y<T;)b[y++]=0;O=B.slice(),O.unshift(0),P=B[0],B[1]>=ir/2&&++P;do h=0,c=t(B,b,T,y),c<0?(S=b[0],T!=y&&(S=S*ir+(b[1]||0)),h=S/P|0,h>1?(h>=ir&&(h=ir-1),p=e(B,h),g=p.length,y=b.length,c=t(p,b,g,y),c==1&&(h--,n(p,T<g?O:B,g))):(h==0&&(c=h=1),p=B.slice()),g=p.length,g<y&&p.unshift(0),n(b,p,y),c==-1&&(y=b.length,c=t(B,b,T,y),c<1&&(h++,n(b,T<y?O:B,y))),y=b.length):c===0&&(h++,b=[0]),j[f++]=h,c&&b[0]?b[y++]=U[E]||0:(b=[U[E]],y=1);while((E++<A||b[0]!==void 0)&&C--)}return j[0]||j.shift(),x.e=d,xn(x,i?o+Kn(x)+1:o)}})();function e4(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(la);for(Rn=!1,c=p,i=new h(.03125);e.abs().gte(.1);)e=e.times(i),f+=5;for(r=Math.log(Li(2,f))/Math.LN10*2+5|0,c+=r,n=s=o=new h(la),h.precision=c;;){if(s=xn(s.times(e),c),n=n.times(++d),i=o.plus(no(s,n,c)),ys(i.d).slice(0,c)===ys(o.d).slice(0,c)){for(;f--;)o=xn(o.times(o),c);return h.precision=p,t==null?(Rn=!0,xn(o,p)):o}o=i}}function Kn(e){for(var t=e.e*kn,n=e.d[0];n>=10;n/=10)t++;return t}function tj(e,t,n){if(t>e.LN10.sd())throw Rn=!0,n&&(e.precision=n),Error(Ra+"LN10 precision limit exceeded");return xn(new e(e.LN10),t)}function Ko(e){for(var t="";e--;)t+="0";return t}function Yd(e,t){var n,r,s,o,i,c,d,f,h,p=1,g=10,x=e,j=x.d,b=x.constructor,y=b.precision;if(x.s<1)throw Error(Ra+(x.s?"NaN":"-Infinity"));if(x.eq(la))return new b(0);if(t==null?(Rn=!1,f=y):f=t,x.eq(10))return t==null&&(Rn=!0),tj(b,f);if(f+=g,b.precision=f,n=ys(j),r=n.charAt(0),o=Kn(x),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=ys(x.d),r=n.charAt(0),p++;o=Kn(x),r>1?(x=new b("0."+n),o++):x=new b(r+"."+n.slice(1))}else return d=tj(b,f+2,y).times(o+""),x=Yd(new b(r+"."+n.slice(1)),f-g).plus(d),b.precision=y,t==null?(Rn=!0,xn(x,y)):x;for(c=i=x=no(x.minus(la),x.plus(la),f),h=xn(x.times(x),f),s=3;;){if(i=xn(i.times(h),f),d=c.plus(no(i,new b(s),f)),ys(d.d).slice(0,f)===ys(c.d).slice(0,f))return c=c.times(2),o!==0&&(c=c.plus(tj(b,f+2,y).times(o+""))),c=no(c,new b(p),f),b.precision=y,t==null?(Rn=!0,xn(c,y)):c;c=d,s+=2}}function N2(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=yu(n/kn),e.d=[],r=(n+1)%kn,n<0&&(r+=kn),r<s){for(r&&e.d.push(+t.slice(0,r)),s-=kn;r<s;)e.d.push(+t.slice(r,r+=kn));t=t.slice(r),r=kn-t.length}else r-=s;for(;r--;)t+="0";if(e.d.push(+t),Rn&&(e.e>hm||e.e<-hm))throw Error(CC+n)}else e.s=0,e.e=0,e.d=[0];return e}function xn(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+=kn,s=t,f=p[h=0];else{if(h=Math.ceil((r+1)/kn),o=p.length,h>=o)return e;for(f=o=p[h],i=1;o>=10;o/=10)i++;r%=kn,s=r-kn+i}if(n!==void 0&&(o=Li(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/Li(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]=Li(10,(kn-t%kn)%kn),e.e=yu(-t/kn)||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=Li(10,kn-r),p[h]=s>0?(f/Li(10,i-s)%Li(10,s)|0)*o:0),d)for(;;)if(h==0){(p[0]+=o)==ir&&(p[0]=1,++e.e);break}else{if(p[h]+=o,p[h]!=ir)break;p[h--]=0,o=1}for(r=p.length;p[--r]===0;)p.pop();if(Rn&&(e.e>hm||e.e<-hm))throw Error(CC+Kn(e));return e}function t4(e,t){var n,r,s,o,i,c,d,f,h,p,g=e.constructor,x=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),Rn?xn(t,x):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(x/kn),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]=ir-1;--d[o],d[s]+=ir}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,Rn?xn(t,x):t):new g(0)}function rl(e,t,n){var r,s=Kn(e),o=ys(e.d),i=o.length;return t?(n&&(r=n-i)>0?o=o.charAt(0)+"."+o.slice(1)+Ko(r):i>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(s<0?"e":"e+")+s):s<0?(o="0."+Ko(-s-1)+o,n&&(r=n-i)>0&&(o+=Ko(r))):s>=i?(o+=Ko(s+1-i),n&&(r=n-s-1)>0&&(o=o+"."+Ko(r))):((r=s+1)<i&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-i)>0&&(s+1===i&&(o+="."),o+=Ko(r))),e.s<0?"-"+o:o}function C2(e,t){if(e.length>t)return e.length=t,!0}function n4(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(Ki+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 N2(i,o.toString())}else if(typeof o!="string")throw Error(Ki+o);if(o.charCodeAt(0)===45?(o=o.slice(1),i.s=-1):i.s=1,Ore.test(o))N2(i,o);else throw Error(Ki+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=n4,s.config=s.set=Rre,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 Rre(e){if(!e||typeof e!="object")throw Error(Ra+"Object expected");var t,n,r,s=["precision",1,xu,"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(yu(r)===r&&r>=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(Ki+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ki+n+": "+r);return this}var _C=n4(Tre);la=new _C(1);const mn=_C;function Ire(e){return Lre(e)||Dre(e)||$re(e)||Mre()}function Mre(){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 $re(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 Dre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Lre(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 Fre=function(t){return t},r4={},a4=function(t){return t===r4},_2=function(t){return function n(){return arguments.length===0||arguments.length===1&&a4(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Bre=function e(t,n){return t===1?n:_2(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!==r4}).length;return i>=t?n.apply(void 0,s):e(t-i,_2(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 a4(p)?d.shift():p});return n.apply(void 0,Ire(h).concat(d))}))})},Yv=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},zre=Yv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),qre=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Fre;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("")},s4=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 Ure(e){var t;return e===0?t=1:t=Math.floor(new mn(e).abs().log(10).toNumber())+1,t}function Wre(e,t,n){for(var r=new mn(e),s=0,o=[];r.lt(t)&&s<1e5;)o.push(r.toNumber()),r=r.add(n),s++;return o}var Vre=Yv(function(e,t,n){var r=+e,s=+t;return r+n*(s-r)}),Hre=Yv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Kre=Yv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Xv={rangeStep:Wre,getDigitCount:Ure,interpolateNumber:Vre,uninterpolateNumber:Hre,uninterpolateTruncation:Kre};function GS(e){return Xre(e)||Yre(e)||o4(e)||Gre()}function Gre(){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 Yre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Xre(e){if(Array.isArray(e))return YS(e)}function Xd(e,t){return Zre(e)||Jre(e,t)||o4(e,t)||Qre()}function Qre(){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 o4(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 Jre(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 Zre(e){if(Array.isArray(e))return e}function i4(e){var t=Xd(e,2),n=t[0],r=t[1],s=n,o=r;return n>r&&(s=r,o=n),[s,o]}function l4(e,t,n){if(e.lte(0))return new mn(0);var r=Xv.getDigitCount(e.toNumber()),s=new mn(10).pow(r),o=e.div(s),i=r!==1?.05:.1,c=new mn(Math.ceil(o.div(i).toNumber())).add(n).mul(i),d=c.mul(s);return t?d:new mn(Math.ceil(d))}function eae(e,t,n){var r=1,s=new mn(e);if(!s.isint()&&n){var o=Math.abs(e);o<1?(r=new mn(10).pow(Xv.getDigitCount(e)-1),s=new mn(Math.floor(s.div(r).toNumber())).mul(r)):o>1&&(s=new mn(Math.floor(e)))}else e===0?s=new mn(Math.floor((t-1)/2)):n||(s=new mn(Math.floor(e)));var i=Math.floor((t-1)/2),c=qre(zre(function(d){return s.add(new mn(d-i).mul(r)).toNumber()}),HS);return c(0,t)}function c4(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 mn(0),tickMin:new mn(0),tickMax:new mn(0)};var o=l4(new mn(t).sub(e).div(n-1),r,s),i;e<=0&&t>=0?i=new mn(0):(i=new mn(e).add(t).div(2),i=i.sub(new mn(i).mod(o)));var c=Math.ceil(i.sub(e).div(o).toNumber()),d=Math.ceil(new mn(t).sub(i).div(o).toNumber()),f=c+d+1;return f>n?c4(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 mn(c).mul(o)),tickMax:i.add(new mn(d).mul(o))})}function tae(e){var t=Xd(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=i4([n,r]),d=Xd(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 eae(f,s,o);var g=c4(f,h,i,o),x=g.step,j=g.tickMin,b=g.tickMax,y=Xv.rangeStep(j,b.add(new mn(.1).mul(x)),x);return n>r?KS(y):y}function nae(e,t){var n=Xd(e,2),r=n[0],s=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=i4([r,s]),c=Xd(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=l4(new mn(f).sub(d).div(h-1),o,0),g=[].concat(GS(Xv.rangeStep(new mn(d),new mn(f).sub(new mn(.99).mul(p)),p)),[f]);return r>s?KS(g):g}var rae=s4(tae),aae=s4(nae),sae="Invariant failed";function al(e,t){throw new Error(sae)}var oae=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Lc(e){"@babel/helpers - typeof";return Lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lc(e)}function mm(){return mm=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},mm.apply(this,arguments)}function iae(e,t){return dae(e)||uae(e,t)||cae(e,t)||lae()}function lae(){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 cae(e,t){if(e){if(typeof e=="string")return A2(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 A2(e,t)}}function A2(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 uae(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 dae(e){if(Array.isArray(e))return e}function fae(e,t){if(e==null)return{};var n=pae(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 pae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function hae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mae(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 vae(e,t,n){return t&&mae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gae(e,t,n){return t=vm(t),xae(e,u4()?Reflect.construct(t,n||[],vm(e).constructor):t.apply(e,n))}function xae(e,t){if(t&&(Lc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yae(e)}function yae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(u4=function(){return!!e})()}function vm(e){return vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vm(e)}function bae(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 d4(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=wae(e,"string");return Lc(t)=="symbol"?t:t+""}function wae(e,t){if(Lc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var qf=(function(e){function t(){return hae(this,t),gae(this,t,arguments)}return bae(t,e),vae(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,g=fae(r,oae),x=jt(g,!1);this.props.direction==="x"&&h.type!=="number"&&al();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=[],P,T;if(Array.isArray(E)){var O=iae(E,2);P=O[0],T=O[1]}else P=T=E;if(o==="vertical"){var $=h.scale,z=C+s,U=z+i,B=z-i,V=$(N-P),q=$(N+T);A.push({x1:q,y1:U,x2:q,y2:B}),A.push({x1:V,y1:z,x2:q,y2:z}),A.push({x1:V,y1:U,x2:V,y2:B})}else if(o==="horizontal"){var I=p.scale,W=S+s,X=W-i,K=W+i,F=I(N-P),J=I(N+T);A.push({x1:X,y1:J,x2:K,y2:J}),A.push({x1:W,y1:F,x2:W,y2:J}),A.push({x1:X,y1:F,x2:K,y2:F})}return G.createElement(nn,mm({className:"recharts-errorBar",key:"bar-".concat(A.map(function(D){return"".concat(D.x1,"-").concat(D.x2,"-").concat(D.y1,"-").concat(D.y2)}))},x),A.map(function(D){return G.createElement("line",mm({},D,{key:"line-".concat(D.x1,"-").concat(D.x2,"-").concat(D.y1,"-").concat(D.y2)}))}))});return G.createElement(nn,{className:"recharts-errorBars"},j)}}])})(G.Component);d4(qf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});d4(qf,"displayName","ErrorBar");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 E2(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 Ti(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E2(Object(n),!0).forEach(function(r){jae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jae(e,t,n){return t=Sae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sae(e){var t=Nae(e,"string");return Qd(t)=="symbol"?t:t+""}function Nae(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 p4=function(t){var n=t.children,r=t.formattedGraphicalItems,s=t.legendWidth,o=t.legendContent,i=sa(n,Vi);if(!i)return null;var c=Vi.defaultProps,d=c!==void 0?Ti(Ti({},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 g=p.item,x=p.props,j=x.sectors||x.data||[];return h.concat(j.map(function(b){return{type:i.props.iconType||g.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):f=(r||[]).map(function(h){var p=h.item,g=p.type.defaultProps,x=g!==void 0?Ti(Ti({},g),p.props):{},j=x.dataKey,b=x.name,y=x.legendType,S=x.hide;return{inactive:S,dataKey:j,type:d.iconType||y||"square",color:AC(p),value:b||j,payload:x}}),Ti(Ti(Ti({},d),Vi.getWithHeight(i,s)),{},{payload:f,item:i})};function Jd(e){"@babel/helpers - typeof";return Jd=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},Jd(e)}function P2(e){return Eae(e)||Aae(e)||_ae(e)||Cae()}function Cae(){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 _ae(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 Aae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Eae(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 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 Fn(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){jc(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 jc(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=kae(e,"string");return Jd(t)=="symbol"?t:t+""}function kae(e,t){if(Jd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zn(e,t,n){return It(e)||It(t)?n:er(t)?da(e,t,n):Rt(t)?t(e):n}function _d(e,t,n,r){var s=Ere(e,function(c){return Zn(c,t)});if(n==="number"){var o=s.filter(function(c){return Ve(c)||parseFloat(c)});return o.length?[Gv(o),Kv(o)]:[1/0,-1/0]}var i=r?s.filter(function(c){return!It(c)}):s;return i.map(function(c){return er(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,g=f>=c-1?s[0].coordinate:s[f+1].coordinate,x=void 0;if(Ar(p-h)!==Ar(g-p)){var j=[];if(Ar(g-p)===Ar(d[1]-d[0])){x=g;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+h)/2),j[1]=Math.max(b,(b+h)/2)}else{x=h;var y=g+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,(x+p)/2),Math.max(p,(x+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,g),N=Math.max(h,g);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?Fn(Fn({},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},Oae=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),g=0,x=p.length;g<x;g++){var j=h[p[g]],b=j.items,y=j.cateAxisId,S=b.filter(function(T){return eo(T.type).indexOf("Bar")>=0});if(S&&S.length){var C=S[0].type.defaultProps,N=C!==void 0?Fn(Fn({},C),S[0].props):S[0].props,E=N.barSize,A=N[y];i[A]||(i[A]=[]);var P=It(E)?n:E;i[A].push({item:S[0],stackList:S.slice(1),barSize:It(P)?void 0:Er(P,r,0)})}}return i},Rae=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=Er(n,s,0,!0),h,p=[];if(i[0].barSize===+i[0].barSize){var g=!1,x=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&&x>0&&(g=!0,x*=.9,j=d*x);var b=(s-j)/2>>0,y={offset:b-f,size:0};h=i.reduce(function(E,A){var P={item:A.item,position:{offset:y.offset+y.size+f,size:g?x:A.barSize}},T=[].concat(P2(E),[P]);return y=T[T.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(O){T.push({item:O,position:y})}),T},p)}else{var S=Er(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,P){var T=[].concat(P2(E),[{item:A.item,position:{offset:S+(C+f)*P+(C-N)/2,size:N}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(O){T.push({item:O,position:T[T.length-1].position})}),T},p)}return h},Iae=function(t,n,r,s){var o=r.children,i=r.width,c=r.margin,d=i-(c.left||0)-(c.right||0),f=p4({children:o,legendWidth:d});if(f){var h=s||{},p=h.width,g=h.height,x=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&x!=="center"&&Ve(t[x]))return Fn(Fn({},t),{},jc({},x,t[x]+(p||0)));if((b==="horizontal"||b==="vertical"&&x==="center")&&j!=="middle"&&Ve(t[j]))return Fn(Fn({},t),{},jc({},j,t[j]+(g||0)))}return t},Mae=function(t,n,r){return It(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},h4=function(t,n,r,s,o){var i=n.props.children,c=fa(i,qf).filter(function(f){return Mae(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=Zn(h,r);if(It(p))return f;var g=Array.isArray(p)?[Gv(p),Kv(p)]:[p,p],x=d.reduce(function(j,b){var y=Zn(h,b,0),S=g[0]-Math.abs(Array.isArray(y)?y[0]:y),C=g[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(x[0],f[0]),Math.max(x[1],f[1])]},[1/0,-1/0])}return null},$ae=function(t,n,r,s,o){var i=n.map(function(c){return h4(t,c,r,o,s)}).filter(function(c){return!It(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},m4=function(t,n,r,s,o){var i=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&h4(t,d,f,s)||_d(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},[])},v4=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Ui=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?Ar(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var g=o?o.indexOf(p):p;return{coordinate:s(g)+f,value:p,offset:f}});return h.filter(function(p){return!Mf(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,g){return{coordinate:s(p)+f,value:p,index:g,offset:f}}):s.ticks&&!r?s.ticks(t.tickCount).map(function(p){return{coordinate:s(p)+f,value:p,offset:f}}):s.domain().map(function(p,g){return{coordinate:s(p)+f,value:o?o[p]:p,index:g,offset:f}})},nj=new WeakMap,gh=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},g4=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:Wd(),realScaleType:"band"}:i==="radial"&&c==="angleAxis"?{scale:um(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Cd(),realScaleType:"point"}:o==="category"?{scale:Wd(),realScaleType:"band"}:{scale:um(),realScaleType:"linear"};if(el(s)){var d="scale".concat(Ov(s));return{scale:(m2[d]||Cd)(),realScaleType:m2[d]?d:"point"}}return Rt(s)?{scale:s}:{scale:Cd(),realScaleType:"point"}},T2=1e-4,x4=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]])}},Dae=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},Lae=function(t,n){if(!n||n.length!==2||!Ve(n[0])||!Ve(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(!Ve(t[0])||t[0]<r)&&(o[0]=r),(!Ve(t[1])||t[1]>s)&&(o[1]=s),o[0]>s&&(o[0]=s),o[1]<r&&(o[1]=r),o},Fae=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=Mf(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=Mf(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)}},zae={sign:Fae,expand:EQ,none:kc,silhouette:PQ,wiggle:kQ,positive:Bae},qae=function(t,n,r){var s=n.map(function(c){return c.props.dataKey}),o=zae[r],i=AQ().keys(s).value(function(c,d){return+Zn(c,d,0)}).order(AS).offset(o);return i(t)},Uae=function(t,n,r,s,o,i){if(!t)return null;var c=i?n.reverse():n,d={},f=c.reduce(function(p,g){var x,j=(x=g.type)!==null&&x!==void 0&&x.defaultProps?Fn(Fn({},g.type.defaultProps),g.props):g.props,b=j.stackId,y=j.hide;if(y)return p;var S=j[r],C=p[S]||{hasStack:!1,stackGroups:{}};if(er(b)){var N=C.stackGroups[b]||{numericAxisId:r,cateAxisId:s,items:[]};N.items.push(g),C.hasStack=!0,C.stackGroups[b]=N}else C.stackGroups[mu("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[g]};return Fn(Fn({},p),{},jc({},S,C))},d),h={};return Object.keys(f).reduce(function(p,g){var x=f[g];if(x.hasStack){var j={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(b,y){var S=x.stackGroups[y];return Fn(Fn({},b),{},jc({},y,{numericAxisId:r,cateAxisId:s,items:S.items,stackedData:qae(t,S.items,o)}))},j)}return Fn(Fn({},p),{},jc({},g,x))},h)},y4=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=rae(f,o,c);return t.domain([Gv(h),Kv(h)]),{niceTicks:h}}if(o&&s==="number"){var p=t.domain(),g=aae(p,o,c);return{niceTicks:g}}return null};function O2(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&&!It(s[t.dataKey])){var c=Wh(n,"value",s[t.dataKey]);if(c)return c.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var d=Zn(s,It(i)?t.dataKey:i);return It(d)?null:t.scale(d)}var R2=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=Zn(i,n.dataKey,n.domain[c]);return It(d)?null:n.scale(d)-o/2+s},Wae=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]},Vae=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Fn(Fn({},t.type.defaultProps),t.props):t.props,o=s.stackId;if(er(o)){var i=n[o];if(i){var c=i.items.indexOf(t);return c>=0?i.stackedData[c]:null}}return null},Hae=function(t){return t.reduce(function(n,r){return[Gv(r.concat([n[0]]).filter(Ve)),Kv(r.concat([n[1]]).filter(Ve))]},[1/0,-1/0])},b4=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=Hae(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})},I2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,M2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,JS=function(t,n,r){if(Rt(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(Ve(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(I2.test(t[0])){var o=+I2.exec(t[0])[1];s[0]=n[0]-o}else Rt(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(Ve(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if(M2.test(t[1])){var i=+M2.exec(t[1])[1];s[1]=n[1]+i}else Rt(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},gm=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},$2=function(t,n,r){return!t||!t.length||zf(t,da(r,"type.defaultProps.domain"))?n:t},w4=function(t,n){var r=t.type.defaultProps?Fn(Fn({},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 Fn(Fn({},jt(t,!1)),{},{dataKey:s,unit:i,formatter:c,name:o||s,color:AC(t),value:Zn(n,s),type:d,payload:n,chartType:f,hide:h})};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 D2(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 Gs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D2(Object(n),!0).forEach(function(r){j4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j4(e,t,n){return t=Kae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kae(e){var t=Gae(e,"string");return Zd(t)=="symbol"?t:t+""}function Gae(e,t){if(Zd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yae(e,t){return Zae(e)||Jae(e,t)||Qae(e,t)||Xae()}function Xae(){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 Qae(e,t){if(e){if(typeof e=="string")return L2(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 L2(e,t)}}function L2(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 Jae(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 Zae(e){if(Array.isArray(e))return e}var xm=Math.PI/180,ese=function(t){return t*180/Math.PI},Nn=function(t,n,r,s){return{x:t+Math.cos(-xm*s)*r,y:n+Math.sin(-xm*s)*r}},S4=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},tse=function(t,n,r,s,o){var i=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=Er(t.cx,i,i/2),p=Er(t.cy,c,c/2),g=S4(i,c,r),x=Er(t.innerRadius,g,0),j=Er(t.outerRadius,g,g*.8),b=Object.keys(n);return b.reduce(function(y,S){var C=n[S],N=C.domain,E=C.reversed,A;if(It(C.range))s==="angleAxis"?A=[d,f]:s==="radiusAxis"&&(A=[x,j]),E&&(A=[A[1],A[0]]);else{A=C.range;var P=A,T=Yae(P,2);d=T[0],f=T[1]}var O=g4(C,o),$=O.realScaleType,z=O.scale;z.domain(N).range(A),x4(z);var U=y4(z,Gs(Gs({},C),{},{realScaleType:$})),B=Gs(Gs(Gs({},C),U),{},{range:A,radius:j,realScaleType:$,scale:z,cx:h,cy:p,innerRadius:x,outerRadius:j,startAngle:d,endAngle:f});return Gs(Gs({},y),{},j4({},S,B))},{})},nse=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))},rse=function(t,n){var r=t.x,s=t.y,o=n.cx,i=n.cy,c=nse({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:ese(f),angleInRadian:f}},ase=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}},sse=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},F2=function(t,n){var r=t.x,s=t.y,o=rse({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=ase(n),p=h.startAngle,g=h.endAngle,x=c,j;if(p<=g){for(;x>g;)x-=360;for(;x<p;)x+=360;j=x>=p&&x<=g}else{for(;x>p;)x-=360;for(;x<g;)x+=360;j=x>=g&&x<=p}return j?Gs(Gs({},n),{},{radius:i,angle:sse(x,n)}):null},N4=function(t){return!m.isValidElement(t)&&!Rt(t)&&typeof t!="boolean"?t.className:""};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)}var ose=["offset"];function ise(e){return dse(e)||use(e)||cse(e)||lse()}function lse(){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 cse(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 use(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dse(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 fse(e,t){if(e==null)return{};var n=pse(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 pse(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function 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 Jn(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){hse(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 hse(e,t,n){return t=mse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mse(e){var t=vse(e,"string");return ef(t)=="symbol"?t:t+""}function vse(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 tf(){return tf=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},tf.apply(this,arguments)}var gse=function(t){var n=t.value,r=t.formatter,s=It(t.children)?n:t.children;return Rt(r)?r(s):s},xse=function(t,n){var r=Ar(n-t),s=Math.min(Math.abs(n-t),360);return r*s},yse=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,g=d.outerRadius,x=d.startAngle,j=d.endAngle,b=d.clockWise,y=(p+g)/2,S=xse(x,j),C=S>=0?1:-1,N,E;s==="insideStart"?(N=x+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=Nn(f,h,y,N),P=Nn(f,h,y,N+(E?1:-1)*359),T="M".concat(A.x,",").concat(A.y,`
75
- A`).concat(y,",").concat(y,",0,1,").concat(E?0:1,`,
76
- `).concat(P.x,",").concat(P.y),O=It(t.id)?mu("recharts-radial-line-"):t.id;return G.createElement("text",tf({},r,{dominantBaseline:"central",className:Mt("recharts-radial-bar-label",c)}),G.createElement("defs",null,G.createElement("path",{id:O,d:T})),G.createElement("textPath",{xlinkHref:"#".concat(O)},n))},bse=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,g=(h+p)/2;if(s==="outside"){var x=Nn(i,c,f+r,g),j=x.x,b=x.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=Nn(i,c,y,g),C=S.x,N=S.y;return{x:C,y:N,textAnchor:"middle",verticalAnchor:"middle"}},wse=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,g=p*s,x=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:x};return Jn(Jn({},N),r?{height:Math.max(d-r.y,0),width:f}:{})}if(o==="bottom"){var E={x:c+f/2,y:d+h+g,textAnchor:"middle",verticalAnchor:j};return Jn(Jn({},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 Jn(Jn({},A),r?{width:Math.max(A.x-r.x,0),height:h}:{})}if(o==="right"){var P={x:c+f+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"};return Jn(Jn({},P),r?{width:Math.max(r.x+r.width-P.x,0),height:h}:{})}var T=r?{width:f,height:h}:{};return o==="insideLeft"?Jn({x:c+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"},T):o==="insideRight"?Jn({x:c+f-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},T):o==="insideTop"?Jn({x:c+f/2,y:d+g,textAnchor:"middle",verticalAnchor:j},T):o==="insideBottom"?Jn({x:c+f/2,y:d+h-g,textAnchor:"middle",verticalAnchor:x},T):o==="insideTopLeft"?Jn({x:c+y,y:d+g,textAnchor:C,verticalAnchor:j},T):o==="insideTopRight"?Jn({x:c+f-y,y:d+g,textAnchor:S,verticalAnchor:j},T):o==="insideBottomLeft"?Jn({x:c+y,y:d+h-g,textAnchor:C,verticalAnchor:x},T):o==="insideBottomRight"?Jn({x:c+f-y,y:d+h-g,textAnchor:S,verticalAnchor:x},T):hu(o)&&(Ve(o.x)||Bi(o.x))&&(Ve(o.y)||Bi(o.y))?Jn({x:c+Er(o.x,f),y:d+Er(o.y,h),textAnchor:"end",verticalAnchor:"end"},T):Jn({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},T)},jse=function(t){return"cx"in t&&Ve(t.cx)};function lr(e){var t=e.offset,n=t===void 0?5:t,r=fse(e,ose),s=Jn({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,g=s.textBreakAll;if(!o||It(c)&&It(d)&&!m.isValidElement(f)&&!Rt(f))return null;if(m.isValidElement(f))return m.cloneElement(f,s);var x;if(Rt(f)){if(x=m.createElement(f,s),m.isValidElement(x))return x}else x=gse(s);var j=jse(o),b=jt(s,!0);if(j&&(i==="insideStart"||i==="insideEnd"||i==="end"))return yse(s,x,b);var y=j?bse(s):wse(s);return G.createElement(nl,tf({className:Mt("recharts-label",p)},b,y,{breakAll:g}),x)}lr.displayName="Label";var C4=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,g=t.y,x=t.top,j=t.left,b=t.width,y=t.height,S=t.clockWise,C=t.labelViewBox;if(C)return C;if(Ve(b)&&Ve(y)){if(Ve(p)&&Ve(g))return{x:p,y:g,width:b,height:y};if(Ve(x)&&Ve(j))return{x,y:j,width:b,height:y}}return Ve(p)&&Ve(g)?{x:p,y:g,width:0,height:0}:Ve(n)&&Ve(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:{}},Sse=function(t,n){return t?t===!0?G.createElement(lr,{key:"label-implicit",viewBox:n}):er(t)?G.createElement(lr,{key:"label-implicit",viewBox:n,value:t}):m.isValidElement(t)?t.type===lr?m.cloneElement(t,{key:"label-implicit",viewBox:n}):G.createElement(lr,{key:"label-implicit",content:t,viewBox:n}):Rt(t)?G.createElement(lr,{key:"label-implicit",content:t,viewBox:n}):hu(t)?G.createElement(lr,tf({viewBox:n},t,{key:"label-implicit"})):null:null},Nse=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=C4(t),i=fa(s,lr).map(function(d,f){return m.cloneElement(d,{viewBox:n||o,key:"label-".concat(f)})});if(!r)return i;var c=Sse(t.label,n||o);return[c].concat(ise(i))};lr.parseViewBox=C4;lr.renderCallByParent=Nse;var rj,z2;function Cse(){if(z2)return rj;z2=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return rj=e,rj}var _se=Cse();const Ase=dn(_se);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 Ese=["valueAccessor"],Pse=["data","dataKey","clockWise","id","textBreakAll"];function kse(e){return Ise(e)||Rse(e)||Ose(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 Ose(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 Rse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ise(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 ym(){return ym=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},ym.apply(this,arguments)}function q2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function U2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q2(Object(n),!0).forEach(function(r){Mse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mse(e,t,n){return t=$se(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $se(e){var t=Dse(e,"string");return nf(t)=="symbol"?t:t+""}function Dse(e,t){if(nf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W2(e,t){if(e==null)return{};var n=Lse(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 Lse(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 Fse=function(t){return Array.isArray(t.value)?Ase(t.value):t.value};function ro(e){var t=e.valueAccessor,n=t===void 0?Fse:t,r=W2(e,Ese),s=r.data,o=r.dataKey,i=r.clockWise,c=r.id,d=r.textBreakAll,f=W2(r,Pse);return!s||!s.length?null:G.createElement(nn,{className:"recharts-label-list"},s.map(function(h,p){var g=It(o)?n(h,p):Zn(h&&h.payload,o),x=It(c)?{}:{id:"".concat(c,"-").concat(p)};return G.createElement(lr,ym({},jt(h,!0),f,x,{parentViewBox:h.parentViewBox,value:g,textBreakAll:d,viewBox:lr.parseViewBox(It(i)?h:U2(U2({},h),{},{clockWise:i})),key:"label-".concat(p),index:p}))}))}ro.displayName="LabelList";function Bse(e,t){return e?e===!0?G.createElement(ro,{key:"labelList-implicit",data:t}):G.isValidElement(e)||Rt(e)?G.createElement(ro,{key:"labelList-implicit",data:t,content:e}):hu(e)?G.createElement(ro,ym({data:t},e,{key:"labelList-implicit"})):null:null}function zse(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=fa(r,ro).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(kse(s))}ro.renderCallByParent=zse;function rf(e){"@babel/helpers - typeof";return rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rf(e)}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 V2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function H2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V2(Object(n),!0).forEach(function(r){qse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qse(e,t,n){return t=Use(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Use(e){var t=Wse(e,"string");return rf(t)=="symbol"?t:t+""}function Wse(e,t){if(rf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vse=function(t,n){var r=Ar(n-t),s=Math.min(Math.abs(n-t),359.999);return r*s},xh=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)/xm,g=f?o:o+i*p,x=Nn(n,r,h,g),j=Nn(n,r,s,g),b=f?o-i*p:o,y=Nn(n,r,h*Math.cos(p*xm),b);return{center:x,circleTangency:j,lineTangency:y,theta:p}},_4=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,o=t.outerRadius,i=t.startAngle,c=t.endAngle,d=Vse(i,c),f=i+d,h=Nn(n,r,o,i),p=Nn(n,r,o,f),g="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 x=Nn(n,r,s,i),j=Nn(n,r,s,f);g+="L ".concat(j.x,",").concat(j.y,`
82
- A `).concat(s,",").concat(s,`,0,
83
- `).concat(+(Math.abs(d)>180),",").concat(+(i<=f),`,
84
- `).concat(x.x,",").concat(x.y," Z")}else g+="L ".concat(n,",").concat(r," Z");return g},Hse=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=Ar(h-f),g=xh({cx:n,cy:r,radius:o,angle:f,sign:p,cornerRadius:i,cornerIsExternal:d}),x=g.circleTangency,j=g.lineTangency,b=g.theta,y=xh({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
- `):_4({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(x.x,",").concat(x.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 P=xh({cx:n,cy:r,radius:s,angle:f,sign:p,isExternal:!0,cornerRadius:i,cornerIsExternal:d}),T=P.circleTangency,O=P.lineTangency,$=P.theta,z=xh({cx:n,cy:r,radius:s,angle:h,sign:-p,isExternal:!0,cornerRadius:i,cornerIsExternal:d}),U=z.circleTangency,B=z.lineTangency,V=z.theta,q=d?Math.abs(f-h):Math.abs(f-h)-$-V;if(q<0&&i===0)return"".concat(A,"L").concat(n,",").concat(r,"Z");A+="L".concat(B.x,",").concat(B.y,`
92
- A`).concat(i,",").concat(i,",0,0,").concat(+(p<0),",").concat(U.x,",").concat(U.y,`
93
- A`).concat(s,",").concat(s,",0,").concat(+(q>180),",").concat(+(p>0),",").concat(T.x,",").concat(T.y,`
94
- A`).concat(i,",").concat(i,",0,0,").concat(+(p<0),",").concat(O.x,",").concat(O.y,"Z")}else A+="L".concat(n,",").concat(r,"Z");return A},Kse={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},A4=function(t){var n=H2(H2({},Kse),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,g=n.className;if(i<o||h===p)return null;var x=Mt("recharts-sector",g),j=i-o,b=Er(c,j,0,!0),y;return b>0&&Math.abs(h-p)<360?y=Hse({cx:r,cy:s,innerRadius:o,outerRadius:i,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):y=_4({cx:r,cy:s,innerRadius:o,outerRadius:i,startAngle:h,endAngle:p}),G.createElement("path",t1({},jt(n,!0),{className:x,d:y,role:"img"}))};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)}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 K2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function G2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K2(Object(n),!0).forEach(function(r){Gse(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 Gse(e,t,n){return t=Yse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yse(e){var t=Xse(e,"string");return af(t)=="symbol"?t:t+""}function Xse(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)}var Y2={curveBasisClosed:vQ,curveBasisOpen:gQ,curveBasis:mQ,curveBumpX:tQ,curveBumpY:nQ,curveLinearClosed:xQ,curveLinear:Iv,curveMonotoneX:yQ,curveMonotoneY:bQ,curveNatural:wQ,curveStep:jQ,curveStepAfter:NQ,curveStepBefore:SQ},yh=function(t){return t.x===+t.x&&t.y===+t.y},fd=function(t){return t.x},pd=function(t){return t.y},Qse=function(t,n){if(Rt(t))return t;var r="curve".concat(Ov(t));return(r==="curveMonotone"||r==="curveBump")&&n?Y2["".concat(r).concat(n==="vertical"?"Y":"X")]:Y2[r]||Iv},Jse=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=Qse(r,c),p=f?o.filter(function(b){return yh(b)}):o,g;if(Array.isArray(i)){var x=f?i.filter(function(b){return yh(b)}):i,j=p.map(function(b,y){return G2(G2({},b),{},{base:x[y]})});return c==="vertical"?g=uh().y(pd).x1(fd).x0(function(b){return b.base.x}):g=uh().x(fd).y1(pd).y0(function(b){return b.base.y}),g.defined(yh).curve(h),g(j)}return c==="vertical"&&Ve(i)?g=uh().y(pd).x1(fd).x0(i):Ve(i)?g=uh().x(fd).y1(pd).y0(i):g=A3().x(fd).y(pd),g.defined(yh).curve(h),g(p)},bm=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?Jse(t):s;return m.createElement("path",n1({},jt(t,!1),Vh(t),{className:Mt("recharts-curve",n),d:i,ref:o}))},aj={exports:{}},sj,X2;function Zse(){if(X2)return sj;X2=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return sj=e,sj}var oj,Q2;function eoe(){if(Q2)return oj;Q2=1;var e=Zse();function t(){}function n(){}return n.resetWarningCache=t,oj=function(){function r(i,c,d,f,h,p){if(p!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}r.isRequired=r;function s(){return r}var 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 J2;function toe(){return J2||(J2=1,aj.exports=eoe()()),aj.exports}var noe=toe();const cn=dn(noe),{getOwnPropertyNames:roe,getOwnPropertySymbols:aoe}=Object,{hasOwnProperty:soe}=Object.prototype;function ij(e,t){return function(r,s,o){return e(r,s,o)&&t(r,s,o)}}function bh(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 ooe(e){return e?.[Symbol.toStringTag]}function Z2(e){return roe(e).concat(aoe(e))}const ioe=Object.hasOwn||((e,t)=>soe.call(e,t));function Sl(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const loe="__v",coe="__o",uoe="_owner",{getOwnPropertyDescriptor:eI,keys:tI}=Object;function doe(e,t){return e.byteLength===t.byteLength&&wm(new Uint8Array(e),new Uint8Array(t))}function foe(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 poe(e,t){return e.byteLength===t.byteLength&&wm(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function hoe(e,t){return Sl(e.getTime(),t.getTime())}function moe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function voe(e,t){return e===t}function nI(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 g=i.value,x=c.value;if(n.equals(g[0],x[0],d,p,e,t,n)&&n.equals(g[1],x[1],g[0],x[0],e,t,n)){h=s[p]=!0;break}p++}if(!h)return!1;d++}return!0}const goe=Sl;function xoe(e,t,n){const r=tI(e);let s=r.length;if(tI(t).length!==s)return!1;for(;s-- >0;)if(!E4(e,t,n,r[s]))return!1;return!0}function hd(e,t,n){const r=Z2(e);let s=r.length;if(Z2(t).length!==s)return!1;let o,i,c;for(;s-- >0;)if(o=r[s],!E4(e,t,n,o)||(i=eI(e,o),c=eI(t,o),(i||c)&&(!i||!c||i.configurable!==c.configurable||i.enumerable!==c.enumerable||i.writable!==c.writable)))return!1;return!0}function yoe(e,t){return Sl(e.valueOf(),t.valueOf())}function boe(e,t){return e.source===t.source&&e.flags===t.flags}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.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 wm(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 woe(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 E4(e,t,n,r){return(r===uoe||r===coe||r===loe)&&(e.$$typeof||t.$$typeof)?!0:ioe(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const joe="[object ArrayBuffer]",Soe="[object Arguments]",Noe="[object Boolean]",Coe="[object DataView]",_oe="[object Date]",Aoe="[object Error]",Eoe="[object Map]",Poe="[object Number]",koe="[object Object]",Toe="[object RegExp]",Ooe="[object Set]",Roe="[object String]",Ioe={"[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},Moe="[object URL]",$oe=Object.prototype.toString;function Doe({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:g,areUrlsEqual:x,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=$oe.call(y);if(A===_oe)return r(y,S,C);if(A===Toe)return h(y,S,C);if(A===Eoe)return i(y,S,C);if(A===Ooe)return p(y,S,C);if(A===koe)return typeof y.then!="function"&&typeof S.then!="function"&&d(y,S,C);if(A===Moe)return x(y,S,C);if(A===Aoe)return s(y,S,C);if(A===Soe)return d(y,S,C);if(Ioe[A])return g(y,S,C);if(A===joe)return e(y,S,C);if(A===Coe)return n(y,S,C);if(A===Noe||A===Poe||A===Roe)return f(y,S,C);if(j){let P=j[A];if(!P){const T=ooe(y);T&&(P=j[T])}if(P)return P(y,S,C)}return!1}}function Loe({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:doe,areArraysEqual:n?hd:foe,areDataViewsEqual:poe,areDatesEqual:hoe,areErrorsEqual:moe,areFunctionsEqual:voe,areMapsEqual:n?ij(nI,hd):nI,areNumbersEqual:goe,areObjectsEqual:n?hd:xoe,arePrimitiveWrappersEqual:yoe,areRegExpsEqual:boe,areSetsEqual:n?ij(rI,hd):rI,areTypedArraysEqual:n?ij(wm,hd):wm,areUrlsEqual:woe,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const s=bh(r.areArraysEqual),o=bh(r.areMapsEqual),i=bh(r.areObjectsEqual),c=bh(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:c})}return r}function Foe(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 zoe=pi();pi({strict:!0});pi({circular:!0});pi({circular:!0,strict:!0});pi({createInternalComparator:()=>Sl});pi({strict:!0,createInternalComparator:()=>Sl});pi({circular:!0,createInternalComparator:()=>Sl});pi({circular:!0,createInternalComparator:()=>Sl,strict:!0});function pi(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:s=!1}=e,o=Loe(e),i=Doe(o),c=n?n(i):Foe(i);return Boe({circular:t,comparator:i,createState:r,equals:c,strict:s})}function qoe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function aI(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):qoe(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 Uoe(e){return Koe(e)||Hoe(e)||Voe(e)||Woe()}function Woe(){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 Voe(e,t){if(e){if(typeof e=="string")return sI(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 sI(e,t)}}function sI(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 Hoe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Koe(e){if(Array.isArray(e))return e}function Goe(){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=Uoe(i),d=c[0],f=c.slice(1);if(typeof d=="number"){aI(s.bind(null,f),d);return}s(d),aI(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 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 oI(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?oI(Object(n),!0).forEach(function(r){P4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P4(e,t,n){return t=Yoe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yoe(e){var t=Xoe(e,"string");return sf(t)==="symbol"?t:String(t)}function Xoe(e,t){if(sf(e)!=="object"||e===null)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 Qoe=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,s){return r.filter(function(o){return s.includes(o)})})},Joe=function(t){return t},Zoe=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Ad=function(t,n){return Object.keys(n).reduce(function(r,s){return iI(iI({},r),{},P4({},s,t(s,n[s])))},{})},lI=function(t,n,r){return t.map(function(s){return"".concat(Zoe(s)," ").concat(n,"ms ").concat(r)}).join(",")};function eie(e,t){return rie(e)||nie(e,t)||k4(e,t)||tie()}function tie(){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 nie(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 rie(e){if(Array.isArray(e))return e}function aie(e){return iie(e)||oie(e)||k4(e)||sie()}function sie(){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 k4(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 oie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iie(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 jm=1e-4,T4=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},O4=function(t,n){return t.map(function(r,s){return r*Math.pow(n,s)}).reduce(function(r,s){return r+s})},cI=function(t,n){return function(r){var s=T4(t,n);return O4(s,r)}},lie=function(t,n){return function(r){var s=T4(t,n),o=[].concat(aie(s.map(function(i,c){return i*c}).slice(1)),[0]);return O4(o,r)}},uI=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=eie(f,4);s=h[0],o=h[1],i=h[2],c=h[3]}}}var p=cI(s,i),g=cI(o,c),x=lie(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,P=x(N);if(Math.abs(A-C)<jm||P<jm)return g(N);N=j(N-A/P)}return g(N)};return b.isStepper=!1,b},cie=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,g){var x=-(h-p)*r,j=g*o,b=g+(x-j)*c/1e3,y=g*c/1e3+h;return Math.abs(y-p)<jm&&Math.abs(b)<jm?[p,0]:[y,b]};return d.isStepper=!0,d.dt=c,d},uie=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 uI(s);case"spring":return cie();default:if(s.split("(")[0]==="cubic-bezier")return uI(s)}return typeof s=="function"?s:null};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 dI(e){return pie(e)||fie(e)||R4(e)||die()}function die(){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 fie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pie(e){if(Array.isArray(e))return o1(e)}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 pr(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){s1(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 s1(e,t,n){return t=hie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hie(e){var t=mie(e,"string");return of(t)==="symbol"?t:String(t)}function mie(e,t){if(of(e)!=="object"||e===null)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)}function vie(e,t){return yie(e)||xie(e,t)||R4(e,t)||gie()}function gie(){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 R4(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 xie(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 yie(e){if(Array.isArray(e))return e}var Sm=function(t,n,r){return t+(n-t)*r},i1=function(t){var n=t.from,r=t.to;return n!==r},bie=function e(t,n,r){var s=Ad(function(o,i){if(i1(i)){var c=t(i.from,i.to,i.velocity),d=vie(c,2),f=d[0],h=d[1];return pr(pr({},i),{},{from:f,velocity:h})}return i},n);return r<1?Ad(function(o,i){return i1(i)?pr(pr({},i),{},{velocity:Sm(i.velocity,s[o].velocity,r),from:Sm(i.from,s[o].from,r)}):i},n):e(t,s,r-1)};const wie=(function(e,t,n,r,s){var o=Qoe(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},g=function(){return Ad(function(S,C){return C.from},c)},x=function(){return!Object.values(c).filter(i1).length},j=function(S){f||(f=S);var C=S-f,N=C/n.dt;c=bie(n,c,N),s(pr(pr(pr({},e),t),g())),f=S,x()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var C=(S-h)/r,N=Ad(function(A,P){return Sm.apply(void 0,dI(P).concat([n(C)]))},i);if(s(pr(pr(pr({},e),t),N)),C<1)d=requestAnimationFrame(p);else{var E=Ad(function(A,P){return Sm.apply(void 0,dI(P).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 Fc(e){"@babel/helpers - typeof";return Fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fc(e)}var jie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Sie(e,t){if(e==null)return{};var n=Nie(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 Nie(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 Eie(e)||Aie(e)||_ie(e)||Cie()}function Cie(){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 _ie(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 Aie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Eie(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 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 Wa(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){bd(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 bd(e,t,n){return t=I4(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 kie(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,I4(r.key),r)}}function Tie(e,t,n){return t&&kie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function I4(e){var t=Oie(e,"string");return Fc(t)==="symbol"?t:String(t)}function Oie(e,t){if(Fc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rie(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 Iie(e){var t=Mie();return function(){var r=Nm(e),s;if(t){var o=Nm(this).constructor;s=Reflect.construct(r,arguments,o)}else s=r.apply(this,arguments);return u1(this,s)}}function u1(e,t){if(t&&(Fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return 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 Mie(){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 Nm(e){return Nm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nm(e)}var Ps=(function(e){Rie(n,e);var t=Iie(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,g=i.children,x=i.duration;if(o.handleStyleChange=o.handleStyleChange.bind(d1(o)),o.changeStyle=o.changeStyle.bind(d1(o)),!c||x<=0)return o.state={style:{}},typeof g=="function"&&(o.state={style:h}),u1(o);if(p&&p.length)o.state={style:p[0].style};else if(f){if(typeof g=="function")return o.state={style:f},u1(o);o.state={style:d?bd({},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,g=this.state.style;if(c){if(!i){var x={style:d?bd({},d,h):h};this.state&&g&&(d&&g[d]!==h||!d&&g!==h)&&this.setState(x);return}if(!(zoe(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&&g){var y={style:d?bd({},d,b):b};(d&&g[d]!==b||!d&&g!==b)&&this.setState(y)}this.runAnimation(Wa(Wa({},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,g=s.onAnimationStart,x=wie(i,c,uie(f),d,this.changeStyle),j=function(){o.stopJSAnimation=x()};this.manager.start([g,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,g=p===void 0?0:p,x=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,P=y.properties,T=y.onAnimationEnd,O=S>0?i[S-1]:y,$=P||Object.keys(A);if(typeof E=="function"||E==="spring")return[].concat(lj(b),[o.runJSAnimation.bind(o,{from:O.style,to:A,duration:C,easing:E}),C]);var z=lI($,C,E),U=Wa(Wa(Wa({},O.style),A),{},{transition:z});return[].concat(lj(b),[U,C,T]).filter(Joe)};return this.manager.start([d].concat(lj(i.reduce(x,[h,Math.max(g,c)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=Goe());var o=s.begin,i=s.duration,c=s.attributeName,d=s.to,f=s.easing,h=s.onAnimationStart,p=s.onAnimationEnd,g=s.steps,x=s.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof x=="function"||f==="spring"){this.runJSAnimation(s);return}if(g.length>1){this.runStepAnimation(s);return}var b=c?bd({},c,d):d,y=lI(Object.keys(b),i,f);j.start([h,o,Wa(Wa({},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=Sie(s,jie),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(x){var j=x.props,b=j.style,y=b===void 0?{}:b,S=j.className,C=m.cloneElement(x,Wa(Wa({},d),{},{style:Wa(Wa({},y),h),className:S}));return C};return f===1?p(m.Children.only(o)):G.createElement("div",null,m.Children.map(o,function(g){return p(g)}))}}]),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:cn.oneOfType([cn.object,cn.string]),to:cn.oneOfType([cn.object,cn.string]),attributeName:cn.string,duration:cn.number,begin:cn.number,easing:cn.oneOfType([cn.string,cn.func]),steps:cn.arrayOf(cn.shape({duration:cn.number.isRequired,style:cn.object.isRequired,easing:cn.oneOfType([cn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),cn.func]),properties:cn.arrayOf("string"),onAnimationEnd:cn.func})),children:cn.oneOfType([cn.node,cn.func]),isActive:cn.bool,canBegin:cn.bool,onAnimationEnd:cn.func,shouldReAnimate:cn.bool,onAnimationStart:cn.func,onAnimationReStart:cn.func};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 Cm(){return Cm=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},Cm.apply(this,arguments)}function $ie(e,t){return Bie(e)||Fie(e,t)||Lie(e,t)||Die()}function Die(){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 Lie(e,t){if(e){if(typeof e=="string")return hI(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 hI(e,t)}}function hI(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 Fie(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 mI(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 vI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mI(Object(n),!0).forEach(function(r){zie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zie(e,t,n){return t=qie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qie(e){var t=Uie(e,"string");return lf(t)=="symbol"?t:t+""}function Uie(e,t){if(lf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gI=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],g=0,x=4;g<x;g++)p[g]=o[g]>i?i:o[g];h="M".concat(t,",").concat(n+c*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),h+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`,
102
- `).concat(t+r,",").concat(n+c*p[1])),h+="L ".concat(t+r,",").concat(n+s-c*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(f,`,
103
- `).concat(t+r-d*p[2],",").concat(n+s)),h+="L ".concat(t+d*p[3],",").concat(n+s),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`,
104
- `).concat(t,",").concat(n+s-c*p[3])),h+="Z"}else if(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},Wie=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),g=Math.max(i,i+d);return r>=f&&r<=h&&s>=p&&s<=g}return!1},Vie={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=vI(vI({},Vie),t),r=m.useRef(),s=m.useState(-1),o=$ie(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,g=n.radius,x=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=Mt("recharts-rectangle",x);return C?G.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,P=E.height,T=E.x,O=E.y;return G.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},G.createElement("path",Cm({},jt(n,!0),{className:N,d:gI(T,O,A,P,g),ref:r})))}):G.createElement("path",Cm({},jt(n,!0),{className:N,d:gI(d,f,h,p,g)}))},Hie=["points","className","baseLinePoints","connectNulls"];function dc(){return dc=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},dc.apply(this,arguments)}function Kie(e,t){if(e==null)return{};var n=Gie(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 Gie(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 xI(e){return Jie(e)||Qie(e)||Xie(e)||Yie()}function Yie(){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 Xie(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 Qie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jie(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 yI=function(t){return t&&t.x===+t.x&&t.y===+t.y},Zie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){yI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),yI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Ed=function(t,n){var r=Zie(t);n&&(r=[r.reduce(function(o,i){return[].concat(xI(o),xI(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},ele=function(t,n,r){var s=Ed(t,r);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(Ed(n.reverse(),r).slice(1))},tle=function(t){var n=t.points,r=t.className,s=t.baseLinePoints,o=t.connectNulls,i=Kie(t,Hie);if(!n||!n.length)return null;var c=Mt("recharts-polygon",r);if(s&&s.length){var d=i.stroke&&i.stroke!=="none",f=ele(n,s,o);return G.createElement("g",{className:c},G.createElement("path",dc({},jt(i,!0),{fill:f.slice(-1)==="Z"?i.fill:"none",stroke:"none",d:f})),d?G.createElement("path",dc({},jt(i,!0),{fill:"none",d:Ed(n,o)})):null,d?G.createElement("path",dc({},jt(i,!0),{fill:"none",d:Ed(s,o)})):null)}var h=Ed(n,o);return G.createElement("path",dc({},jt(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 Qv=function(t){var n=t.cx,r=t.cy,s=t.r,o=t.className,i=Mt("recharts-dot",o);return n===+n&&r===+r&&s===+s?m.createElement("circle",p1({},jt(t,!1),Vh(t),{className:i,cx:n,cy:r,r: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)}var nle=["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 bI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function rle(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bI(Object(n),!0).forEach(function(r){ale(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ale(e,t,n){return t=sle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sle(e){var t=ole(e,"string");return cf(t)=="symbol"?t:t+""}function ole(e,t){if(cf(e)!="object"||!e)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 ile(e,t){if(e==null)return{};var n=lle(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 lle(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 cle=function(t,n,r,s,o,i){return"M".concat(t,",").concat(o,"v").concat(s,"M").concat(i,",").concat(n,"h").concat(r)},ule=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,g=t.height,x=g===void 0?0:g,j=t.className,b=ile(t,nle),y=rle({x:r,y:o,top:c,left:f,width:p,height:x},b);return!Ve(r)||!Ve(o)||!Ve(p)||!Ve(x)||!Ve(c)||!Ve(f)?null:G.createElement("path",h1({},jt(y,!0),{className:Mt("recharts-cross",j),d:cle(r,o,p,x,c,f)}))},cj,wI;function dle(){if(wI)return cj;wI=1;var e=Hv(),t=XL(),n=Ms();function r(s,o){return s&&s.length?e(s,n(o,2),t):void 0}return cj=r,cj}var fle=dle();const ple=dn(fle);var uj,jI;function hle(){if(jI)return uj;jI=1;var e=Hv(),t=Ms(),n=QL();function r(s,o){return s&&s.length?e(s,t(o,2),n):void 0}return uj=r,uj}var mle=hle();const vle=dn(mle);var gle=["cx","cy","angle","ticks","axisLine"],xle=["ticks","tick","angle","tickFormatter","stroke"];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)}function Pd(){return Pd=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},Pd.apply(this,arguments)}function SI(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 Oi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SI(Object(n),!0).forEach(function(r){Jv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NI(e,t){if(e==null)return{};var n=yle(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 yle(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 ble(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CI(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,$4(r.key),r)}}function wle(e,t,n){return t&&CI(e.prototype,t),n&&CI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jle(e,t,n){return t=_m(t),Sle(e,M4()?Reflect.construct(t,n||[],_m(e).constructor):t.apply(e,n))}function Sle(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 Nle(e)}function Nle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(M4=function(){return!!e})()}function _m(e){return _m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_m(e)}function Cle(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 Jv(e,t,n){return t=$4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $4(e){var t=_le(e,"string");return Bc(t)=="symbol"?t:t+""}function _le(e,t){if(Bc(e)!="object"||!e)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)}var Zv=(function(e){function t(){return ble(this,t),jle(this,t,arguments)}return Cle(t,e),wle(t,[{key:"getTickValueCoord",value:function(r){var s=r.coordinate,o=this.props,i=o.angle,c=o.cx,d=o.cy;return Nn(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=ple(c,function(h){return h.coordinate||0}),f=vle(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=NI(r,gle),h=c.reduce(function(j,b){return[Math.min(j[0],b.coordinate),Math.max(j[1],b.coordinate)]},[1/0,-1/0]),p=Nn(s,o,h[0],i),g=Nn(s,o,h[1],i),x=Oi(Oi(Oi({},jt(f,!1)),{},{fill:"none"},jt(d,!1)),{},{x1:p.x,y1:p.y,x2:g.x,y2:g.y});return G.createElement("line",Pd({className:"recharts-polar-radius-axis-line"},x))}},{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=NI(s,xle),p=this.getTickTextAnchor(),g=jt(h,!1),x=jt(i,!1),j=o.map(function(b,y){var S=r.getTickValueCoord(b),C=Oi(Oi(Oi(Oi({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},g),{},{stroke:"none",fill:f},x),{},{index:y},S),{},{payload:b});return G.createElement(nn,Pd({className:Mt("recharts-polar-radius-axis-tick",N4(i)),key:"tick-".concat(b.coordinate)},tl(r.props,b,y)),t.renderTickItem(i,C,d?d(b.value,y):b.value))});return G.createElement(nn,{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:G.createElement(nn,{className:Mt("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),i&&this.renderTicks(),lr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,s,o){var i;return G.isValidElement(r)?i=G.cloneElement(r,s):Rt(r)?i=r(s):i=G.createElement(nl,Pd({},s,{className:"recharts-polar-radius-axis-tick-value"}),o),i}}])})(m.PureComponent);Jv(Zv,"displayName","PolarRadiusAxis");Jv(Zv,"axisType","radiusAxis");Jv(Zv,"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 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 Fi(){return Fi=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},Fi.apply(this,arguments)}function _I(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 Ri(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_I(Object(n),!0).forEach(function(r){eg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ale(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AI(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,L4(r.key),r)}}function Ele(e,t,n){return t&&AI(e.prototype,t),n&&AI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ple(e,t,n){return t=Am(t),kle(e,D4()?Reflect.construct(t,n||[],Am(e).constructor):t.apply(e,n))}function kle(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 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 D4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(D4=function(){return!!e})()}function Am(e){return Am=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Am(e)}function Ole(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 eg(e,t,n){return t=L4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L4(e){var t=Rle(e,"string");return zc(t)=="symbol"?t:t+""}function Rle(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(t==="string"?String:Number)(e)}var Ile=Math.PI/180,EI=1e-5,tg=(function(e){function t(){return Ale(this,t),Ple(this,t,arguments)}return Ole(t,e),Ele(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=Nn(o,i,c,r.coordinate),g=Nn(o,i,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:g.x,y2:g.y}}},{key:"getTickTextAnchor",value:function(r){var s=this.props.orientation,o=Math.cos(-r.coordinate*Ile),i;return o>EI?i=s==="outer"?"start":"end":o<-EI?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=Ri(Ri({},jt(this.props,!1)),{},{fill:"none"},jt(c,!1));if(d==="circle")return G.createElement(Qv,Fi({className:"recharts-polar-angle-axis-line"},f,{cx:s,cy:o,r:i}));var h=this.props.ticks,p=h.map(function(g){return Nn(s,o,i,g.coordinate)});return G.createElement(tle,Fi({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=jt(this.props,!1),p=jt(i,!1),g=Ri(Ri({},h),{},{fill:"none"},jt(c,!1)),x=o.map(function(j,b){var y=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),C=Ri(Ri(Ri({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:y.x2,y:y.y2});return G.createElement(nn,Fi({className:Mt("recharts-polar-angle-axis-tick",N4(i)),key:"tick-".concat(j.coordinate)},tl(r.props,j,b)),c&&G.createElement("line",Fi({className:"recharts-polar-angle-axis-tick-line"},g,y)),i&&t.renderTickItem(i,C,d?d(j.value,b):j.value))});return G.createElement(nn,{className:"recharts-polar-angle-axis-ticks"},x)}},{key:"render",value:function(){var r=this.props,s=r.ticks,o=r.radius,i=r.axisLine;return o<=0||!s||!s.length?null:G.createElement(nn,{className:Mt("recharts-polar-angle-axis",this.props.className)},i&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,s,o){var i;return G.isValidElement(r)?i=G.cloneElement(r,s):Rt(r)?i=r(s):i=G.createElement(nl,Fi({},s,{className:"recharts-polar-angle-axis-tick-value"}),o),i}}])})(m.PureComponent);eg(tg,"displayName","PolarAngleAxis");eg(tg,"axisType","angleAxis");eg(tg,"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 Mle(){if(PI)return dj;PI=1;var e=X3(),t=e(Object.getPrototypeOf,Object);return dj=t,dj}var fj,kI;function $le(){if(kI)return fj;kI=1;var e=vo(),t=Mle(),n=go(),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 g=c.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&i.call(g)==d}return fj=f,fj}var Dle=$le();const Lle=dn(Dle);var pj,TI;function Fle(){if(TI)return pj;TI=1;var e=vo(),t=go(),n="[object Boolean]";function r(s){return s===!0||s===!1||t(s)&&e(s)==n}return pj=r,pj}var Ble=Fle();const zle=dn(Ble);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 Em(){return Em=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},Em.apply(this,arguments)}function qle(e,t){return Hle(e)||Vle(e,t)||Wle(e,t)||Ule()}function Ule(){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 Wle(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 Vle(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 Hle(e){if(Array.isArray(e))return e}function RI(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?RI(Object(n),!0).forEach(function(r){Kle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kle(e,t,n){return t=Gle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gle(e){var t=Yle(e,"string");return uf(t)=="symbol"?t:t+""}function Yle(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 MI=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},Xle={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Qle=function(t){var n=II(II({},Xle),t),r=m.useRef(),s=m.useState(-1),o=qle(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,g=n.height,x=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||g!==+g||h===0&&p===0||g===0)return null;var C=Mt("recharts-trapezoid",x);return S?G.createElement(Ps,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:g,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:g,x:d,y:f},duration:b,animationEasing:j,isActive:S},function(N){var E=N.upperWidth,A=N.lowerWidth,P=N.height,T=N.x,O=N.y;return G.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},G.createElement("path",Em({},jt(n,!0),{className:C,d:MI(T,O,E,A,P),ref:r})))}):G.createElement("g",null,G.createElement("path",Em({},jt(n,!0),{className:C,d:MI(d,f,h,p,g)})))},Jle=["option","shapeType","propTransformer","activeClassName","isActive"];function df(e){"@babel/helpers - typeof";return df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},df(e)}function Zle(e,t){if(e==null)return{};var n=ece(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 ece(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 $I(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 Pm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$I(Object(n),!0).forEach(function(r){tce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tce(e,t,n){return t=nce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nce(e){var t=rce(e,"string");return df(t)=="symbol"?t:t+""}function rce(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 ace(e,t){return Pm(Pm({},t),e)}function sce(e,t){return e==="symbols"}function DI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return G.createElement(EC,n);case"trapezoid":return G.createElement(Qle,n);case"sector":return G.createElement(A4,n);case"symbols":if(sce(t))return G.createElement(KN,n);break;default:return null}}function oce(e){return m.isValidElement(e)?e.props:e}function F4(e){var t=e.option,n=e.shapeType,r=e.propTransformer,s=r===void 0?ace:r,o=e.activeClassName,i=o===void 0?"recharts-active-shape":o,c=e.isActive,d=Zle(e,Jle),f;if(m.isValidElement(t))f=m.cloneElement(t,Pm(Pm({},d),oce(t)));else if(Rt(t))f=t(d);else if(Lle(t)&&!zle(t)){var h=s(t,d);f=G.createElement(DI,{shapeType:n,elementProps:h})}else{var p=d;f=G.createElement(DI,{shapeType:n,elementProps:p})}return c?G.createElement(nn,{className:i},f):f}function ng(e,t){return t!=null&&"trapezoids"in e.props}function rg(e,t){return t!=null&&"sectors"in e.props}function ff(e,t){return t!=null&&"points"in e.props}function ice(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 lce(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function cce(e,t){var n=e.x===t.x,r=e.y===t.y,s=e.z===t.z;return n&&r&&s}function uce(e,t){var n;return ng(e,t)?n=ice:rg(e,t)?n=lce:ff(e,t)&&(n=cce),n}function dce(e,t){var n;return ng(e,t)?n="trapezoids":rg(e,t)?n="sectors":ff(e,t)&&(n="points"),n}function fce(e,t){if(ng(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(rg(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 ff(e,t)?t.payload:{}}function pce(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,s=dce(n,t),o=fce(n,t),i=r.filter(function(d,f){var h=zf(o,d),p=n.props[s].filter(function(j){var b=uce(n,t);return b(j,t)}),g=n.props[s].indexOf(p[p.length-1]),x=f===g;return h&&x}),c=r.indexOf(i[i.length-1]);return c}var Oh;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 fc(){return fc=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},fc.apply(this,arguments)}function LI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LI(Object(n),!0).forEach(function(r){Aa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FI(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,z4(r.key),r)}}function mce(e,t,n){return t&&FI(e.prototype,t),n&&FI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vce(e,t,n){return t=km(t),gce(e,B4()?Reflect.construct(t,n||[],km(e).constructor):t.apply(e,n))}function gce(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 xce(e)}function xce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(B4=function(){return!!e})()}function km(e){return km=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},km(e)}function yce(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=z4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z4(e){var t=bce(e,"string");return qc(t)=="symbol"?t:t+""}function bce(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 yo=(function(e){function t(n){var r;return hce(this,t),r=vce(this,t,[n]),Aa(r,"pieRef",null),Aa(r,"sectorRefs",[]),Aa(r,"id",mu("recharts-pie-")),Aa(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Rt(s)&&s()}),Aa(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Rt(s)&&s()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return yce(t,e),mce(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=jt(this.props,!1),p=jt(i,!1),g=jt(c,!1),x=i&&i.offsetRadius||20,j=r.map(function(b,y){var S=(b.startAngle+b.endAngle)/2,C=Nn(b.cx,b.cy,b.outerRadius+x,S),N=bn(bn(bn(bn({},h),b),{},{stroke:"none"},p),{},{index:y,textAnchor:t.getTextAnchor(C.x,b.cx)},C),E=bn(bn(bn(bn({},h),b),{},{fill:"none",stroke:b.fill},g),{},{index:y,points:[Nn(b.cx,b.cy,b.outerRadius,S),C]}),A=d;return It(d)&&It(f)?A="value":It(d)&&(A=f),G.createElement(nn,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(y)},c&&t.renderLabelLineItem(c,E,"line"),t.renderLabelItem(i,N,Zn(b,A)))});return G.createElement(nn,{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),g=d&&s.hasActiveIndex()?d:null,x=p?i:g,j=bn(bn({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return G.createElement(nn,fc({ref:function(y){y&&!s.sectorRefs.includes(y)&&s.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},tl(s.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),G.createElement(F4,fc({option:x,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,g=p.prevSectors,x=p.prevIsAnimationActive;return G.createElement(Ps,{begin:c,duration:d,isActive:i,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(x),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=g&&g[E],P=E>0?da(N,"paddingAngle",0):0;if(A){var T=ia(A.endAngle-A.startAngle,N.endAngle-N.startAngle),O=bn(bn({},N),{},{startAngle:C+P,endAngle:C+T(b)+P});y.push(O),C=O.endAngle}else{var $=N.endAngle,z=N.startAngle,U=ia(0,$-z),B=U(b),V=bn(bn({},N),{},{startAngle:C+P,endAngle:C+B+P});y.push(V),C=V.endAngle}}),G.createElement(nn,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||!zf(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,g=s.outerRadius,x=s.isAnimationActive,j=this.state.isAnimationFinished;if(o||!i||!i.length||!Ve(f)||!Ve(h)||!Ve(p)||!Ve(g))return null;var b=Mt("recharts-pie",c);return G.createElement(nn,{tabIndex:this.props.rootTabIndex,className:b,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(i),lr.renderCallByParent(this.props,null,!1),(!x||j)&&ro.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(G.isValidElement(r))return G.cloneElement(r,s);if(Rt(r))return r(s);var i=Mt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return G.createElement(bm,fc({},s,{key:o,type:"linear",className:i}))}},{key:"renderLabelItem",value:function(r,s,o){if(G.isValidElement(r))return G.cloneElement(r,s);var i=o;if(Rt(r)&&(i=r(s),G.isValidElement(i)))return i;var c=Mt("recharts-pie-label-text",typeof r!="boolean"&&!Rt(r)?r.className:"");return G.createElement(nl,fc({},s,{alignmentBaseline:"middle",className:c}),i)}}])})(m.PureComponent);Oh=yo;Aa(yo,"displayName","Pie");Aa(yo,"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:!bl.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Aa(yo,"parseDeltaAngle",function(e,t){var n=Ar(t-e),r=Math.min(Math.abs(t-e),360);return n*r});Aa(yo,"getRealPieData",function(e){var t=e.data,n=e.children,r=jt(e,!1),s=fa(n,Fv);return t&&t.length?t.map(function(o,i){return bn(bn(bn({payload:o},r),o),s&&s[i]&&s[i].props)}):s&&s.length?s.map(function(o){return bn(bn({},r),o.props)}):[]});Aa(yo,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,s=t.width,o=t.height,i=S4(s,o),c=r+Er(e.cx,s,s/2),d=n+Er(e.cy,o,o/2),f=Er(e.innerRadius,i,0),h=Er(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(yo,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?bn(bn({},t.type.defaultProps),t.props):t.props,s=Oh.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,g=r.tooltipType,x=Math.abs(r.minAngle),j=Oh.parseCoordinateOfPie(r,n),b=Oh.parseDeltaAngle(i,c),y=Math.abs(b),S=f;It(f)&&It(p)?(to(!1,`Use "dataKey" to specify the value of pie,
114
- the props "valueKey" will be deprecated in 1.1.0`),S="value"):It(f)&&(to(!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(O){return Zn(O,S,0)!==0}).length,N=(y>=360?C:C-1)*d,E=y-C*x-N,A=s.reduce(function(O,$){var z=Zn($,S,0);return O+(Ve(z)?z:0)},0),P;if(A>0){var T;P=s.map(function(O,$){var z=Zn(O,S,0),U=Zn(O,h,$),B=(Ve(z)?z:0)/A,V;$?V=T.endAngle+Ar(b)*d*(z!==0?1:0):V=i;var q=V+Ar(b)*((z!==0?x:0)+B*E),I=(V+q)/2,W=(j.innerRadius+j.outerRadius)/2,X=[{name:U,value:z,payload:O,dataKey:S,type:g}],K=Nn(j.cx,j.cy,W,I);return T=bn(bn(bn({percent:B,cornerRadius:o,name:U,tooltipPayload:X,midAngle:I,middleRadius:W,tooltipPosition:K},O),j),{},{value:Zn(O,S),startAngle:V,endAngle:q,payload:O,paddingAngle:Ar(b)*d}),T})}return bn(bn({},j),{},{sectors:P,data:s})});var hj,BI;function wce(){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,zI;function q4(){if(zI)return mj;zI=1;var e=fL(),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,qI;function jce(){if(qI)return vj;qI=1;var e=wce(),t=Lv(),n=q4();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,UI;function Sce(){if(UI)return gj;UI=1;var e=jce(),t=e();return gj=t,gj}var Nce=Sce();const Tm=dn(Nce);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 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 VI(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){U4(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 U4(e,t,n){return t=Cce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cce(e){var t=_ce(e,"string");return pf(t)=="symbol"?t:t+""}function _ce(e,t){if(pf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ace=["Webkit","Moz","O","ms"],Ece=function(t,n){var r=t.replace(/(\w)/,function(o){return o.toUpperCase()}),s=Ace.reduce(function(o,i){return VI(VI({},o),{},U4({},i+r,n))},{});return s[t]=n,s};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 Om(){return Om=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},Om.apply(this,arguments)}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 xj(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){aa(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 Pce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,V4(r.key),r)}}function kce(e,t,n){return t&&KI(e.prototype,t),n&&KI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tce(e,t,n){return t=Rm(t),Oce(e,W4()?Reflect.construct(t,n||[],Rm(e).constructor):t.apply(e,n))}function Oce(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 Rce(e)}function Rce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(W4=function(){return!!e})()}function Rm(e){return Rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Rm(e)}function Ice(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 aa(e,t,n){return t=V4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V4(e){var t=Mce(e,"string");return Uc(t)=="symbol"?t:t+""}function Mce(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 String(e)}var $ce=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=Cd().domain(Tm(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}},GI=function(t){return t.changedTouches&&!!t.changedTouches.length},Wc=(function(e){function t(n){var r;return Pce(this,t),r=Tce(this,t,[n]),aa(r,"handleDrag",function(s){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(s):r.state.isSlideMoving&&r.handleSlideDrag(s)}),aa(r,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&r.handleDrag(s.changedTouches[0])}),aa(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()}),aa(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),aa(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),aa(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),aa(r,"handleSlideDragStart",function(s){var o=GI(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 Ice(t,e),kce(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=r.startX,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),g=Math.max(s,o),x=t.getIndexInRange(i,p),j=t.getIndexInRange(i,g);return{startIndex:x-x%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=Zn(o[r],c,r);return Rt(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,g=d.startIndex,x=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!==g||y.endIndex!==x)&&j&&j(y),this.setState({startX:i+b,endX:c+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var o=GI(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,g=h.width,x=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+g-x-f):C<0&&(C=Math.max(C,p-f)),S[i]=f+C;var N=this.getIndex(S),E=N.startIndex,A=N.endIndex,P=function(){var O=y.length-1;return i==="startX"&&(c>d?E%b===0:A%b===0)||c<d&&A===O||i==="endX"&&(c>d?A%b===0:E%b===0)||c>d&&A===O};this.setState(aa(aa({},i,f+C),"brushMoveStartX",r.pageX),function(){j&&P()&&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 g=p+r;if(!(g===-1||g>=c.length)){var x=c[g];s==="startX"&&x>=f||s==="endX"&&x<=d||this.setState(aa({},s,x),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 G.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?G.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,g=d.traveller,x=d.ariaLabel,j=d.data,b=d.startIndex,y=d.endIndex,S=Math.max(r,this.props.x),C=xj(xj({},jt(this.props,!1)),{},{x:S,y:f,width:h,height:p}),N=x||"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 G.createElement(nn,{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(g,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 G.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,g=h.endX,x=5,j={pointerEvents:"none",fill:f};return G.createElement(nn,{className:"recharts-brush-texts"},G.createElement(nl,Om({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,g)-x,y:i+c/2},j),this.getTextOfTick(s)),G.createElement(nl,Om({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,g)+d+x,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,g=this.state,x=g.startX,j=g.endX,b=g.isTextActive,y=g.isSlideMoving,S=g.isTravellerMoving,C=g.isTravellerFocused;if(!s||!s.length||!Ve(c)||!Ve(d)||!Ve(f)||!Ve(h)||f<=0||h<=0)return null;var N=Mt("recharts-brush",o),E=G.Children.count(i)===1,A=Ece("userSelect","none");return G.createElement(nn,{className:N,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(x,j),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(j,"endX"),(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 G.createElement(G.Fragment,null,G.createElement("rect",{x:s,y:o,width:i,height:c,fill:d,stroke:"none"}),G.createElement("line",{x1:s+1,y1:f,x2:s+i-1,y2:f,fill:"none",stroke:"#fff"}),G.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 G.isValidElement(r)?o=G.cloneElement(r,s):Rt(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?$ce({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 g=s.scale.domain().map(function(x){return s.scale(x)});return{prevData:o,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:i,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:g}}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);aa(Wc,"displayName","Brush");aa(Wc,"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,YI;function Dce(){if(YI)return yj;YI=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,XI;function Lce(){if(XI)return bj;XI=1;var e=U3(),t=Ms(),n=Dce(),r=Yr(),s=Lv();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 Fce=Lce();const Bce=dn(Fce);var Ss=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},wj,QI;function zce(){if(QI)return wj;QI=1;var e=iL();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,JI;function qce(){if(JI)return jj;JI=1;var e=zce(),t=sL(),n=Ms();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 Uce=qce();const Wce=dn(Uce);var Sj,ZI;function Vce(){if(ZI)return Sj;ZI=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,eM;function Hce(){if(eM)return Nj;eM=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,tM;function Kce(){if(tM)return Cj;tM=1;var e=Vce(),t=Hce(),n=Ms(),r=Yr(),s=Lv();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 Gce=Kce();const Yce=dn(Gce);var Xce=["x","y"];function hf(e){"@babel/helpers - typeof";return hf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hf(e)}function 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 nM(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 md(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nM(Object(n),!0).forEach(function(r){Qce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qce(e,t,n){return t=Jce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jce(e){var t=Zce(e,"string");return hf(t)=="symbol"?t:t+""}function Zce(e,t){if(hf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eue(e,t){if(e==null)return{};var n=tue(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 tue(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 nue(e,t){var n=e.x,r=e.y,s=eue(e,Xce),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),g=parseInt(p,10);return md(md(md(md(md({},t),s),i?{x:i}:{}),d?{y:d}:{}),{},{height:h,width:g,name:t.name,radius:t.radius})}function rM(e){return G.createElement(F4,y1({shapeType:"rectangle",propTransformer:nue,activeClassName:"recharts-active-bar"},e))}var rue=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=Ve(r)||jX(r);return o?t(r,s):(o||al(),n)}},aue=["value","background"],H4;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 sue(e,t){if(e==null)return{};var n=oue(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 oue(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 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 aM(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?aM(Object(n),!0).forEach(function(r){Yo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iue(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,G4(r.key),r)}}function lue(e,t,n){return t&&sM(e.prototype,t),n&&sM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cue(e,t,n){return t=Mm(t),uue(e,K4()?Reflect.construct(t,n||[],Mm(e).constructor):t.apply(e,n))}function uue(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 due(e)}function due(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K4=function(){return!!e})()}function Mm(e){return Mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mm(e)}function fue(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 Yo(e,t,n){return t=G4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G4(e){var t=pue(e,"string");return Vc(t)=="symbol"?t:t+""}function pue(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 Nl=(function(e){function t(){var n;iue(this,t);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=cue(this,t,[].concat(s)),Yo(n,"state",{isAnimationFinished:!1}),Yo(n,"id",mu("recharts-bar-")),Yo(n,"handleAnimationEnd",function(){var i=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),i&&i()}),Yo(n,"handleAnimationStart",function(){var i=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),i&&i()}),n}return fue(t,e),lue(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=jt(this.props,!1);return r&&r.map(function(p,g){var x=g===d,j=x?f:i,b=Hn(Hn(Hn({},h),p),{},{isActive:x,option:j,index:g,dataKey:c,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return G.createElement(nn,Im({className:"recharts-bar-rectangle"},tl(s.props,p,g),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(g)}),G.createElement(rM,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,g=this.state.prevData;return G.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(x){var j=x.t,b=o.map(function(y,S){var C=g&&g[S];if(C){var N=ia(C.x,y.x),E=ia(C.y,y.y),A=ia(C.width,y.width),P=ia(C.height,y.height);return Hn(Hn({},y),{},{x:N(j),y:E(j),width:A(j),height:P(j)})}if(i==="horizontal"){var T=ia(0,y.height),O=T(j);return Hn(Hn({},y),{},{y:y.y+y.height-O,height:O})}var $=ia(0,y.width),z=$(j);return Hn(Hn({},y),{},{width:z})});return G.createElement(nn,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||!zf(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=jt(this.props.background,!1);return o.map(function(f,h){f.value;var p=f.background,g=sue(f,aue);if(!p)return null;var x=Hn(Hn(Hn(Hn(Hn({},g),{},{fill:"#eee"},p),d),tl(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:i,index:h,className:"recharts-bar-background-rectangle"});return G.createElement(rM,Im({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},x))})}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,i=o.data,c=o.xAxis,d=o.yAxis,f=o.layout,h=o.children,p=fa(h,qf);if(!p)return null;var g=f==="vertical"?i[0].height/2:i[0].width/2,x=function(y,S){var C=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:C,errorVal:Zn(y,S)}},j={clipPath:r?"url(#clipPath-".concat(s,")"):null};return G.createElement(nn,j,p.map(function(b){return G.cloneElement(b,{key:"error-bar-".concat(s,"-").concat(b.props.dataKey),data:i,xAxis:c,yAxis:d,layout:f,offset:g,dataPointFormatter:x})}))}},{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,g=r.height,x=r.isAnimationActive,j=r.background,b=r.id;if(s||!o||!o.length)return null;var y=this.state.isAnimationFinished,S=Mt("recharts-bar",i),C=c&&c.allowDataOverflow,N=d&&d.allowDataOverflow,E=C||N,A=It(b)?this.id:b;return G.createElement(nn,{className:S},C||N?G.createElement("defs",null,G.createElement("clipPath",{id:"clipPath-".concat(A)},G.createElement("rect",{x:C?f:f-p/2,y:N?h:h-g/2,width:C?p:p*2,height:N?g:g*2}))):null,G.createElement(nn,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(A,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,A),(!x||y)&&ro.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);H4=Nl;Yo(Nl,"displayName","Bar");Yo(Nl,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!bl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Yo(Nl,"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,g=e.offset,x=Dae(r,n);if(!x)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,P=Wae({numericAxis:E}),T=fa(C,Fv),O=p.map(function($,z){var U,B,V,q,I,W;f?U=Lae(f[h+z],A):(U=Zn($,S),Array.isArray(U)||(U=[P,U]));var X=rue(N,H4.defaultProps.minPointSize)(U[1],z);if(j==="horizontal"){var K,F=[i.scale(U[0]),i.scale(U[1])],J=F[0],D=F[1];B=R2({axis:o,ticks:c,bandSize:s,offset:x.offset,entry:$,index:z}),V=(K=D??J)!==null&&K!==void 0?K:void 0,q=x.size;var R=J-D;if(I=Number.isNaN(R)?0:R,W={x:B,y:i.y,width:q,height:i.height},Math.abs(X)>0&&Math.abs(I)<Math.abs(X)){var ne=Ar(I||X)*(Math.abs(X)-Math.abs(I));V-=ne,I+=ne}}else{var te=[o.scale(U[0]),o.scale(U[1])],de=te[0],he=te[1];if(B=de,V=R2({axis:i,ticks:d,bandSize:s,offset:x.offset,entry:$,index:z}),q=he-de,I=x.size,W={x:o.x,y:V,width:o.width,height:I},Math.abs(X)>0&&Math.abs(q)<Math.abs(X)){var H=Ar(q||X)*(Math.abs(X)-Math.abs(q));q+=H}}return Hn(Hn(Hn({},$),{},{x:B,y:V,width:q,height:I,value:f?U:U[1],payload:$,background:W},T&&T[z]&&T[z].props),{},{tooltipPayload:[w4(n,$)],tooltipPosition:{x:B+q/2,y:V+I/2}})});return Hn({data:O,layout:j},g)});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 hue(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 mue(e,t,n){return t&&oM(e.prototype,t),n&&oM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iM(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 Ka(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iM(Object(n),!0).forEach(function(r){ag(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ag(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=vue(e,"string");return mf(t)=="symbol"?t:t+""}function vue(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 X4=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},g=!!sa(f,Nl);return h.reduce(function(x,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,P="".concat(y).concat(E?"Mirror":""),T,O,$,z,U;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var B=S[1]-S[0],V=1/0,q=b.categoricalDomain.sort(CX);if(q.forEach(function(te,de){de>0&&(V=Math.min((te||0)-(q[de-1]||0),V))}),Number.isFinite(V)){var I=V/B,W=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(T=I*W/2),b.padding==="no-gap"){var X=Er(t.barCategoryGap,I*W),K=I*W/2;T=K-X-(K-X)/W*X}}}s==="xAxis"?O=[r.left+(N.left||0)+(T||0),r.left+r.width-(N.right||0)-(T||0)]:s==="yAxis"?O=d==="horizontal"?[r.top+r.height-(N.bottom||0),r.top+(N.top||0)]:[r.top+(N.top||0)+(T||0),r.top+r.height-(N.bottom||0)-(T||0)]:O=b.range,A&&(O=[O[1],O[0]]);var F=g4(b,o,g),J=F.scale,D=F.realScaleType;J.domain(S).range(O),x4(J);var R=y4(J,Ka(Ka({},b),{},{realScaleType:D}));s==="xAxis"?(U=y==="top"&&!E||y==="bottom"&&E,$=r.left,z=p[P]-U*b.height):s==="yAxis"&&(U=y==="left"&&!E||y==="right"&&E,$=p[P]-U*b.width,z=r.top);var ne=Ka(Ka(Ka({},b),R),{},{realScaleType:D,x:$,y:z,scale:J,width:s==="xAxis"?r.width:b.width,height:s==="yAxis"?r.height:b.height});return ne.bandSize=gm(ne,R),!b.hide&&s==="xAxis"?p[P]+=(U?-1:1)*ne.height:b.hide||(p[P]+=(U?-1:1)*ne.width),Ka(Ka({},x),{},ag({},j,ne))},{})},Q4=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)}},gue=function(t){var n=t.x1,r=t.y1,s=t.x2,o=t.y2;return Q4({x:n,y:r},{x:s,y:o})},J4=(function(){function e(t){hue(this,e),this.scale=t}return mue(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)}}])})();ag(J4,"EPS",1e-4);var PC=function(t){var n=Object.keys(t).reduce(function(r,s){return Ka(Ka({},r),{},ag({},s,J4.create(t[s])))},{});return Ka(Ka({},n),{},{apply:function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=o.bandAware,c=o.position;return Wce(s,function(d,f){return n[f].apply(d,{bandAware:i,position:c})})},isInRange:function(s){return Yce(s,function(o,i){return n[i].isInRange(o)})}})};function xue(e){return(e%180+180)%180}var yue=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=xue(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,lM;function bue(){if(lM)return _j;lM=1;var e=Ms(),t=$f(),n=$v();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,cM;function wue(){if(cM)return Aj;cM=1;var e=q4();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return Aj=t,Aj}var Ej,uM;function jue(){if(uM)return Ej;uM=1;var e=eL(),t=Ms(),n=wue(),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 Pj,dM;function Sue(){if(dM)return Pj;dM=1;var e=bue(),t=jue(),n=e(t);return Pj=n,Pj}Sue();var Nue=v3();const Cue=dn(Nue);var _ue=Cue(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("")}),Z4=m.createContext(void 0),eF=m.createContext(void 0),tF=m.createContext(void 0),Aue=m.createContext({}),nF=m.createContext(void 0),rF=m.createContext(0),aF=m.createContext(0),fM=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=_ue(o);return G.createElement(Z4.Provider,{value:r},G.createElement(eF.Provider,{value:s},G.createElement(Aue.Provider,{value:o},G.createElement(tF.Provider,{value:h},G.createElement(nF.Provider,{value:i},G.createElement(rF.Provider,{value:f},G.createElement(aF.Provider,{value:d},c)))))))},Eue=function(){return m.useContext(nF)},sF=function(t){var n=m.useContext(Z4);n==null&&al();var r=n[t];return r==null&&al(),r},oF=function(t){var n=m.useContext(eF);n==null&&al();var r=n[t];return r==null&&al(),r},Pue=function(){var t=m.useContext(tF);return t},iF=function(){return m.useContext(aF)},lF=function(){return m.useContext(rF)};function Hc(e){"@babel/helpers - typeof";return Hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hc(e)}function kue(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,uF(r.key),r)}}function Oue(e,t,n){return t&&Tue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rue(e,t,n){return t=$m(t),Iue(e,cF()?Reflect.construct(t,n||[],$m(e).constructor):t.apply(e,n))}function Iue(e,t){if(t&&(Hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mue(e)}function Mue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cF=function(){return!!e})()}function $m(e){return $m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$m(e)}function $ue(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 pM(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 hM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pM(Object(n),!0).forEach(function(r){kC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kC(e,t,n){return t=uF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uF(e){var t=Due(e,"string");return Hc(t)=="symbol"?t:t+""}function Due(e,t){if(Hc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Lue(e,t){return que(e)||zue(e,t)||Bue(e,t)||Fue()}function Fue(){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 mM(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 mM(e,t)}}function mM(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 zue(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 que(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 Uue=function(t,n){var r;return G.isValidElement(t)?r=G.cloneElement(t,n):Rt(t)?r=t(n):r=G.createElement("line",j1({},n,{className:"recharts-reference-line-line"})),r},Wue=function(t,n,r,s,o,i,c,d,f){var h=o.x,p=o.y,g=o.width,x=o.height;if(r){var j=f.y,b=t.y.apply(j,{position:i});if(Ss(f,"discard")&&!t.y.isInRange(b))return null;var y=[{x:h+g,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(Ss(f,"discard")&&!t.x.isInRange(C))return null;var N=[{x:C,y:p+x},{x:C,y:p}];return c==="top"?N.reverse():N}if(s){var E=f.segment,A=E.map(function(P){return t.apply(P,{position:i})});return Ss(f,"discard")&&Bce(A,function(P){return!t.isInRange(P)})?null:A}return null};function Vue(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=Eue(),h=sF(s),p=oF(o),g=Pue();if(!f||!g)return null;to(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var x=PC({x:h.scale,y:p.scale}),j=er(t),b=er(n),y=r&&r.length===2,S=Wue(x,j,b,y,g,e.position,h.orientation,p.orientation,e);if(!S)return null;var C=Lue(S,2),N=C[0],E=N.x,A=N.y,P=C[1],T=P.x,O=P.y,$=Ss(e,"hidden")?"url(#".concat(f,")"):void 0,z=hM(hM({clipPath:$},jt(e,!0)),{},{x1:E,y1:A,x2:T,y2:O});return G.createElement(nn,{className:Mt("recharts-reference-line",c)},Uue(i,z),lr.renderCallByParent(e,gue({x1:E,y1:A,x2:T,y2:O})))}var TC=(function(e){function t(){return kue(this,t),Rue(this,t,arguments)}return $ue(t,e),Oue(t,[{key:"render",value:function(){return G.createElement(Vue,this.props)}}])})(G.Component);kC(TC,"displayName","ReferenceLine");kC(TC,"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 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 vM(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 gM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vM(Object(n),!0).forEach(function(r){sg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kue(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,fF(r.key),r)}}function Gue(e,t,n){return t&&Kue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yue(e,t,n){return t=Dm(t),Xue(e,dF()?Reflect.construct(t,n||[],Dm(e).constructor):t.apply(e,n))}function Xue(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 Que(e)}function Que(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dF=function(){return!!e})()}function Dm(e){return Dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Dm(e)}function Jue(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 sg(e,t,n){return t=fF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fF(e){var t=Zue(e,"string");return Kc(t)=="symbol"?t:t+""}function Zue(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 ede=function(t){var n=t.x,r=t.y,s=t.xAxis,o=t.yAxis,i=PC({x:s.scale,y:o.scale}),c=i.apply({x:n,y:r},{bandAware:!0});return Ss(t,"discard")&&!i.isInRange(c)?null:c},og=(function(e){function t(){return Hue(this,t),Yue(this,t,arguments)}return Jue(t,e),Gue(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=er(s),h=er(o);if(to(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=ede(this.props);if(!p)return null;var g=p.x,x=p.y,j=this.props,b=j.shape,y=j.className,S=Ss(this.props,"hidden")?"url(#".concat(d,")"):void 0,C=gM(gM({clipPath:S},jt(this.props,!0)),{},{cx:g,cy:x});return G.createElement(nn,{className:Mt("recharts-reference-dot",y)},t.renderDot(b,C),lr.renderCallByParent(this.props,{x:g-i,y:x-i,width:2*i,height:2*i}))}}])})(G.Component);sg(og,"displayName","ReferenceDot");sg(og,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});sg(og,"renderDot",function(e,t){var n;return G.isValidElement(e)?n=G.cloneElement(e,t):Rt(e)?n=e(t):n=G.createElement(Qv,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 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 xM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function yM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xM(Object(n),!0).forEach(function(r){ig(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nde(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,hF(r.key),r)}}function rde(e,t,n){return t&&nde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ade(e,t,n){return t=Lm(t),sde(e,pF()?Reflect.construct(t,n||[],Lm(e).constructor):t.apply(e,n))}function sde(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 ode(e)}function ode(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pF=function(){return!!e})()}function Lm(e){return Lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lm(e)}function ide(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 ig(e,t,n){return t=hF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hF(e){var t=lde(e,"string");return Gc(t)=="symbol"?t:t+""}function lde(e,t){if(Gc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var cde=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 g=PC({x:h.scale,y:p.scale}),x={x:t?g.x.apply(i,{position:"start"}):g.x.rangeMin,y:r?g.y.apply(d,{position:"start"}):g.y.rangeMin},j={x:n?g.x.apply(c,{position:"end"}):g.x.rangeMax,y:s?g.y.apply(f,{position:"end"}):g.y.rangeMax};return Ss(o,"discard")&&(!g.isInRange(x)||!g.isInRange(j))?null:Q4(x,j)},lg=(function(e){function t(){return tde(this,t),ade(this,t,arguments)}return ide(t,e),rde(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;to(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=er(s),g=er(o),x=er(i),j=er(c),b=this.props.shape;if(!p&&!g&&!x&&!j&&!b)return null;var y=cde(p,g,x,j,this.props);if(!y&&!b)return null;var S=Ss(this.props,"hidden")?"url(#".concat(h,")"):void 0;return G.createElement(nn,{className:Mt("recharts-reference-area",d)},t.renderRect(b,yM(yM({clipPath:S},jt(this.props,!0)),y)),lr.renderCallByParent(this.props,y))}}])})(G.Component);ig(lg,"displayName","ReferenceArea");ig(lg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});ig(lg,"renderRect",function(e,t){var n;return G.isValidElement(e)?n=G.cloneElement(e,t):Rt(e)?n=e(t):n=G.createElement(EC,C1({},t,{className:"recharts-reference-area-rect"})),n});function mF(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 ude(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return yue(r,n)}function dde(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 Fm(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 fde(e,t){return mF(e,t+1)}function pde(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:mF(r,f)};var b=d,y,S=function(){return y===void 0&&(y=n(j,b)),y},C=j.coordinate,N=d===0||Fm(e,C,S,h,c);N||(d=0,h=i,f+=1),N&&(h=C+e*(S()/2+s),d+=f)},g;f<=o.length;)if(g=p(),g)return g.v;return[]}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 bM(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 wr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bM(Object(n),!0).forEach(function(r){hde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hde(e,t,n){return t=mde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mde(e){var t=vde(e,"string");return vf(t)=="symbol"?t:t+""}function vde(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 gde(e,t,n,r,s){for(var o=(r||[]).slice(),i=o.length,c=t.start,d=t.end,f=function(g){var x=o[g],j,b=function(){return j===void 0&&(j=n(x,g)),j};if(g===i-1){var y=e*(x.coordinate+e*b()/2-d);o[g]=x=wr(wr({},x),{},{tickCoord:y>0?x.coordinate-y*e:x.coordinate})}else o[g]=x=wr(wr({},x),{},{tickCoord:x.coordinate});var S=Fm(e,x.tickCoord,b,c,d);S&&(d=x.tickCoord-e*(b()/2+s),o[g]=wr(wr({},x),{},{isShow:!0}))},h=i-1;h>=0;h--)f(h);return o}function xde(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),g=e*(h.coordinate+e*p/2-f);i[c-1]=h=wr(wr({},h),{},{tickCoord:g>0?h.coordinate-g*e:h.coordinate});var x=Fm(e,h.tickCoord,function(){return p},d,f);x&&(f=h.tickCoord-e*(p/2+s),i[c-1]=wr(wr({},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 P=e*(N.coordinate-e*A()/2-d);i[C]=N=wr(wr({},N),{},{tickCoord:P<0?N.coordinate-P*e:N.coordinate})}else i[C]=N=wr(wr({},N),{},{tickCoord:N.coordinate});var T=Fm(e,N.tickCoord,A,d,f);T&&(d=N.tickCoord+e*(A()/2+s),i[C]=wr(wr({},N),{},{isShow:!0}))},y=0;y<j;y++)b(y);return i}function yde(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(Ve(d)||bl.isSsr)return fde(s,typeof d=="number"&&Ve(d)?d:0);var g=[],x=c==="top"||c==="bottom"?"width":"height",j=h&&x==="width"?Nd(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(N,E){var A=Rt(f)?f(N.value,E):N.value;return x==="width"?ude(Nd(A,{fontSize:t,letterSpacing:n}),j,p):Nd(A,{fontSize:t,letterSpacing:n})[x]},y=s.length>=2?Ar(s[1].coordinate-s[0].coordinate):1,S=dde(o,y,x);return d==="equidistantPreserveStart"?pde(y,S,b,s,i):(d==="preserveStart"||d==="preserveStartEnd"?g=xde(y,S,b,s,i,d==="preserveStartEnd"):g=gde(y,S,b,s,i),g.filter(function(C){return C.isShow}))}var bde=["viewBox"],wde=["viewBox"],jde=["ticks"];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 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 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 Qn(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){OC(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 kj(e,t){if(e==null)return{};var n=Sde(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 Sde(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 Nde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jM(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,gF(r.key),r)}}function Cde(e,t,n){return t&&jM(e.prototype,t),n&&jM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _de(e,t,n){return t=Bm(t),Ade(e,vF()?Reflect.construct(t,n||[],Bm(e).constructor):t.apply(e,n))}function Ade(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 Ede(e)}function Ede(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vF=function(){return!!e})()}function Bm(e){return Bm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bm(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 OC(e,t,n){return t=gF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gF(e){var t=kde(e,"string");return Yc(t)=="symbol"?t:t+""}function kde(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 cg=(function(e){function t(n){var r;return Nde(this,t),r=_de(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Pde(t,e),Cde(t,[{key:"shouldComponentUpdate",value:function(r,s){var o=r.viewBox,i=kj(r,bde),c=this.props,d=c.viewBox,f=kj(c,wde);return!bc(o,d)||!bc(i,f)||!bc(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,g=s.tickMargin,x,j,b,y,S,C,N=p?-1:1,E=r.tickSize||h,A=Ve(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":x=j=r.coordinate,y=i+ +!p*d,b=y-N*E,C=b-N*g,S=A;break;case"left":b=y=r.coordinate,j=o+ +!p*c,x=j-N*E,S=x-N*g,C=A;break;case"right":b=y=r.coordinate,j=o+ +p*c,x=j+N*E,S=x+N*g,C=A;break;default:x=j=r.coordinate,y=i+ +p*d,b=y+N*E,C=b+N*g,S=A;break}return{line:{x1:x,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=Qn(Qn(Qn({},jt(this.props,!1)),jt(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var g=+(d==="top"&&!f||d==="bottom"&&f);p=Qn(Qn({},p),{},{x1:s,y1:o+g*c,x2:s+i,y2:o+g*c})}else{var x=+(d==="left"&&!f||d==="right"&&f);p=Qn(Qn({},p),{},{x1:s+x*i,y1:o,x2:s+x*i,y2:o+c})}return G.createElement("line",pc({},p,{className:Mt("recharts-cartesian-axis-line",da(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,g=c.unit,x=yde(Qn(Qn({},this.props),{},{ticks:r}),s,o),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),y=jt(this.props,!1),S=jt(h,!1),C=Qn(Qn({},y),{},{fill:"none"},jt(d,!1)),N=x.map(function(E,A){var P=i.getTickLineCoord(E),T=P.line,O=P.tick,$=Qn(Qn(Qn(Qn({textAnchor:j,verticalAnchor:b},y),{},{stroke:"none",fill:f},S),O),{},{index:A,payload:E,visibleTicksCount:x.length,tickFormatter:p});return G.createElement(nn,pc({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},tl(i.props,E,A)),d&&G.createElement("line",pc({},C,T,{className:Mt("recharts-cartesian-axis-tick-line",da(d,"className"))})),h&&t.renderTickItem(h,$,"".concat(Rt(p)?p(E.value,A):E.value).concat(g||"")))});return G.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,g=p.ticks,x=kj(p,jde),j=g;return Rt(d)&&(j=g&&g.length>0?d(this.props):d(x)),i<=0||c<=0||!j||!j.length?null:G.createElement(nn,{className:Mt("recharts-cartesian-axis",f),ref:function(y){r.layerReference=y}},o&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),lr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,o){var i,c=Mt(s.className,"recharts-cartesian-axis-tick-value");return G.isValidElement(r)?i=G.cloneElement(r,Qn(Qn({},s),{},{className:c})):Rt(r)?i=r(Qn(Qn({},s),{},{className:c})):i=G.createElement(nl,pc({},s,{className:"recharts-cartesian-axis-tick-value"}),o),i}}])})(m.Component);OC(cg,"displayName","CartesianAxis");OC(cg,"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"],Ode=["key"];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 SM(e,t){if(e==null)return{};var n=Rde(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 Rde(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 kd(){return kd=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},kd.apply(this,arguments)}function NM(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 na(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NM(Object(n),!0).forEach(function(r){Ga(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nc(e){return Dde(e)||$de(e)||Mde(e)||Ide()}function Ide(){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 Mde(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 $de(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Dde(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 Lde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CM(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,yF(r.key),r)}}function Fde(e,t,n){return t&&CM(e.prototype,t),n&&CM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bde(e,t,n){return t=zm(t),zde(e,xF()?Reflect.construct(t,n||[],zm(e).constructor):t.apply(e,n))}function zde(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 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 xF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xF=function(){return!!e})()}function zm(e){return zm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zm(e)}function Ude(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 Ga(e,t,n){return t=yF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yF(e){var t=Wde(e,"string");return Xc(t)=="symbol"?t:t+""}function Wde(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 sl=(function(e){function t(){var n;Lde(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)),Ga(n,"state",{isAnimationFinished:!0,totalLength:0}),Ga(n,"generateSimpleStrokeDasharray",function(i,c){return"".concat(c,"px ").concat(i-c,"px")}),Ga(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,g=c-i,x=[],j=0,b=0;j<d.length;b+=d[j],++j)if(b+d[j]>p){x=[].concat(nc(d.slice(0,j)),[p-b]);break}var y=x.length%2===0?[0,g]:[g];return[].concat(nc(t.repeat(d,h)),nc(x),y).map(function(S){return"".concat(S,"px")}).join(", ")}),Ga(n,"id",mu("recharts-line-")),Ga(n,"pathRef",function(i){n.mainCurve=i}),Ga(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Ga(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Ude(t,e),Fde(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=fa(h,qf);if(!p)return null;var g=function(b,y){return{x:b.x,y:b.y,value:b.value,errorVal:Zn(b.payload,y)}},x={clipPath:r?"url(#clipPath-".concat(s,")"):null};return G.createElement(nn,x,p.map(function(j){return G.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:i,xAxis:c,yAxis:d,layout:f,dataPointFormatter:g})}))}},{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=jt(this.props,!1),g=jt(d,!0),x=f.map(function(b,y){var S=na(na(na({key:"dot-".concat(y),r:3},p),g),{},{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 G.createElement(nn,kd({className:"recharts-line-dots",key:"dots"},j),x)}},{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=SM(c,Tde),g=na(na(na({},jt(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 G.createElement(bm,kd({},g,{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,g=i.animationEasing,x=i.animationId,j=i.animateNewValues,b=i.width,y=i.height,S=this.state,C=S.prevPoints,N=S.totalLength;return G.createElement(Ps,{begin:h,duration:p,isActive:f,easing:g,from:{t:0},to:{t:1},key:"line-".concat(x),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var A=E.t;if(C){var P=C.length/c.length,T=c.map(function(B,V){var q=Math.floor(V*P);if(C[q]){var I=C[q],W=ia(I.x,B.x),X=ia(I.y,B.y);return na(na({},B),{},{x:W(A),y:X(A)})}if(j){var K=ia(b*2,B.x),F=ia(y/2,B.y);return na(na({},B),{},{x:K(A),y:F(A)})}return na(na({},B),{},{x:B.x,y:B.y})});return o.renderCurveStatically(T,r,s)}var O=ia(0,N),$=O(A),z;if(d){var U="".concat(d).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});z=o.getStrokeDasharray($,N,U)}else z=o.generateSimpleStrokeDasharray(N,$);return o.renderCurveStatically(c,r,s,{strokeDasharray:z})})}},{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||!zf(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,g=s.left,x=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=Mt("recharts-line",d),E=f&&f.allowDataOverflow,A=h&&h.allowDataOverflow,P=E||A,T=It(y)?this.id:y,O=(r=jt(i,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},$=O.r,z=$===void 0?3:$,U=O.strokeWidth,B=U===void 0?2:U,V=IX(i)?i:{},q=V.clipDot,I=q===void 0?!0:q,W=z*2+B;return G.createElement(nn,{className:N},E||A?G.createElement("defs",null,G.createElement("clipPath",{id:"clipPath-".concat(T)},G.createElement("rect",{x:E?g:g-x/2,y:A?p:p-j/2,width:E?x:x*2,height:A?j:j*2})),!I&&G.createElement("clipPath",{id:"clipPath-dots-".concat(T)},G.createElement("rect",{x:g-W/2,y:p-W/2,width:x+W,height:j+W}))):null,!C&&this.renderCurve(P,T),this.renderErrorBar(P,T),(C||i)&&this.renderDots(P,I,T),(!b||S)&&ro.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(nc(r),[0]):r,i=[],c=0;c<s;++c)i=[].concat(nc(i),nc(o));return i}},{key:"renderDotItem",value:function(r,s){var o;if(G.isValidElement(r))o=G.cloneElement(r,s);else if(Rt(r))o=r(s);else{var i=s.key,c=SM(s,Ode),d=Mt("recharts-line-dot",typeof r!="boolean"?r.className:"");o=G.createElement(Qv,kd({key:i},c,{className:d}))}return o}}])})(m.PureComponent);Ga(sl,"displayName","Line");Ga(sl,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!bl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Ga(sl,"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(g,x){var j=Zn(g,i);return h==="horizontal"?{x:O2({axis:n,ticks:s,bandSize:c,entry:g,index:x}),y:It(j)?null:r.scale(j),value:j,payload:g}:{x:It(j)?null:n.scale(j),y:O2({axis:r,ticks:o,bandSize:c,entry:g,index:x}),value:j,payload:g}});return na({points:p,layout:h},f)});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 Vde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hde(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,jF(r.key),r)}}function Kde(e,t,n){return t&&Hde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gde(e,t,n){return t=qm(t),Yde(e,bF()?Reflect.construct(t,n||[],qm(e).constructor):t.apply(e,n))}function Yde(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 Xde(e)}function Xde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bF=function(){return!!e})()}function qm(e){return qm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qm(e)}function Qde(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 wF(e,t,n){return t=jF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jF(e){var t=Jde(e,"string");return Qc(t)=="symbol"?t:t+""}function Jde(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)}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 Zde(e){var t=e.xAxisId,n=iF(),r=lF(),s=sF(t);return s==null?null:m.createElement(cg,T1({},s,{className:Mt("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(i){return Ui(i,!0)}}))}var si=(function(e){function t(){return Vde(this,t),Gde(this,t,arguments)}return Qde(t,e),Kde(t,[{key:"render",value:function(){return m.createElement(Zde,this.props)}}])})(m.Component);wF(si,"displayName","XAxis");wF(si,"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 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 efe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tfe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CF(r.key),r)}}function nfe(e,t,n){return t&&tfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rfe(e,t,n){return t=Um(t),afe(e,SF()?Reflect.construct(t,n||[],Um(e).constructor):t.apply(e,n))}function afe(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 sfe(e)}function sfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SF=function(){return!!e})()}function Um(e){return Um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Um(e)}function ofe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O1(e,t)}function O1(e,t){return O1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},O1(e,t)}function NF(e,t,n){return t=CF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CF(e){var t=ife(e,"string");return Jc(t)=="symbol"?t:t+""}function ife(e,t){if(Jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function 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 lfe=function(t){var n=t.yAxisId,r=iF(),s=lF(),o=oF(n);return o==null?null:m.createElement(cg,R1({},o,{className:Mt("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:s},ticksGenerator:function(c){return Ui(c,!0)}}))},oi=(function(e){function t(){return efe(this,t),rfe(this,t,arguments)}return ofe(t,e),nfe(t,[{key:"render",value:function(){return m.createElement(lfe,this.props)}}])})(m.Component);NF(oi,"displayName","YAxis");NF(oi,"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 _M(e){return ffe(e)||dfe(e)||ufe(e)||cfe()}function cfe(){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 ufe(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 dfe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ffe(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=fa(t,TC),c=fa(t,og),d=[].concat(_M(i),_M(c)),f=fa(t,lg),h="".concat(s,"Id"),p=s[0],g=n;if(d.length&&(g=d.reduce(function(b,y){if(y.props[h]===r&&Ss(y.props,"extendDomain")&&Ve(y.props[p])){var S=y.props[p];return[Math.min(b[0],S),Math.max(b[1],S)]}return b},g)),f.length){var x="".concat(p,"1"),j="".concat(p,"2");g=f.reduce(function(b,y){if(y.props[h]===r&&Ss(y.props,"extendDomain")&&Ve(y.props[x])&&Ve(y.props[j])){var S=y.props[x],C=y.props[j];return[Math.min(b[0],S,C),Math.max(b[1],S,C)]}return b},g)}return o&&o.length&&(g=o.reduce(function(b,y){return Ve(y)?[Math.min(b[0],y),Math.max(b[1],y)]:b},g)),g},Tj={exports:{}},AM;function pfe(){return AM||(AM=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,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var x=new s(h,p||d,g),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],x]:d._events[j].push(x):(d._events[j]=x,d._eventsCount++),d}function 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 g=0,x=p.length,j=new Array(x);g<x;g++)j[g]=p[g].fn;return j},c.prototype.listenerCount=function(f){var h=n?n+f:f,p=this._events[h];return p?p.fn?1:p.length:0},c.prototype.emit=function(f,h,p,g,x,j){var 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,g),!0;case 5:return y.fn.call(y.context,h,p,g,x),!0;case 6:return y.fn.call(y.context,h,p,g,x,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,g);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,g){var x=n?n+f:f;if(!this._events[x])return this;if(!h)return i(this,x),this;var j=this._events[x];if(j.fn)j.fn===h&&(!g||j.once)&&(!p||j.context===p)&&i(this,x);else{for(var b=0,y=[],S=j.length;b<S;b++)(j[b].fn!==h||g&&!j[b].once||p&&j[b].context!==p)&&y.push(j[b]);y.length?this._events[x]=y.length===1?y[0]:y:i(this,x)}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})(Tj)),Tj.exports}var hfe=pfe();const mfe=dn(hfe);var Oj=new mfe,Rj="recharts.syncMouseEvents";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 vfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gfe(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 xfe(e,t,n){return t&&gfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ij(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=yfe(e,"string");return gf(t)=="symbol"?t:t+""}function yfe(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 String(e)}var bfe=(function(){function e(){vfe(this,e),Ij(this,"activeIndex",0),Ij(this,"coordinateList",[]),Ij(this,"layout","horizontal")}return xfe(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,g=n.mouseHandlerCallback,x=g===void 0?null:g;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=x??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var s=this.container.getBoundingClientRect(),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,g=i+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:g})}}}])})();function wfe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],s=e?.[1];if(r&&s&&Ve(r)&&Ve(s))return!0}return!1}function jfe(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 AF(e){var t=e.cx,n=e.cy,r=e.radius,s=e.startAngle,o=e.endAngle,i=Nn(t,n,r,s),c=Nn(t,n,r,o);return{points:[i,c],cx:t,cy:n,radius:r,startAngle:s,endAngle:o}}function Sfe(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,g=Nn(c,d,f,p),x=Nn(c,d,h,p);r=g.x,s=g.y,o=x.x,i=x.y}else return AF(t);return[{x:r,y:s},{x:o,y:i}]}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 EM(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 wh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EM(Object(n),!0).forEach(function(r){Nfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nfe(e,t,n){return t=Cfe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cfe(e){var t=_fe(e,"string");return xf(t)=="symbol"?t:t+""}function _fe(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 Afe(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,g=e.chartName,x=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!x||!o||!i||g!=="ScatterChart"&&s!=="axis")return null;var j,b=bm;if(g==="ScatterChart")j=i,b=ule;else if(g==="BarChart")j=jfe(p,i,d,h),b=EC;else if(p==="radial"){var y=AF(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=A4}else j={points:Sfe(p,i,d)},b=bm;var P=wh(wh(wh(wh({stroke:"#ccc",pointerEvents:"none"},d),j),jt(x,!1)),{},{payload:c,payloadIndex:f,className:Mt("recharts-tooltip-cursor",x.className)});return m.isValidElement(x)?m.cloneElement(x,P):m.createElement(b,P)}var Efe=["item"],Pfe=["children","className","width","height","style","compact","title","desc"];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 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 PM(e,t){return Ofe(e)||Tfe(e,t)||PF(e,t)||kfe()}function kfe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
119
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function 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 Ofe(e){if(Array.isArray(e))return e}function kM(e,t){if(e==null)return{};var n=Rfe(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 Rfe(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 Ife(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mfe(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,kF(r.key),r)}}function $fe(e,t,n){return t&&Mfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dfe(e,t,n){return t=Wm(t),Lfe(e,EF()?Reflect.construct(t,n||[],Wm(e).constructor):t.apply(e,n))}function Lfe(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 Ffe(e)}function Ffe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function EF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(EF=function(){return!!e})()}function Wm(e){return Wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wm(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 eu(e){return Ufe(e)||qfe(e)||PF(e)||zfe()}function zfe(){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 qfe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ufe(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 je(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){Nt(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 Nt(e,t,n){return t=kF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kF(e){var t=Wfe(e,"string");return Zc(t)=="symbol"?t:t+""}function Wfe(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(t==="string"?String:Number)(e)}var Vfe={xAxis:["bottom","top"],yAxis:["left","right"]},Hfe={width:"100%",height:"100%"},TF={x:0,y:0};function jh(e){return e}var Kfe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Gfe=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 je(je(je({},s),Nn(s.cx,s.cy,c,i)),{},{angle:i,radius:c})}var d=o.coordinate,f=s.angle;return je(je(je({},s),Nn(s.cx,s.cy,d,f)),{},{angle:f,radius:d})}return TF},ug=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(eu(c),eu(f)):c},[]);return i.length>0?i:t&&t.length&&Ve(s)&&Ve(o)?t.slice(s,o+1):[]};function OF(e){return e==="number"?[0,"auto"]:void 0}var L1=function(t,n,r,s){var o=t.graphicalItems,i=t.tooltipAxis,c=ug(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 g;if(i.dataKey&&!i.allowDuplicatedCategory){var x=p===void 0?c:p;g=Wh(x,i.dataKey,s)}else g=p&&p[r]||c[r];return g?[].concat(eu(d),[w4(f,g)]):d},[])},OM=function(t,n,r,s){var o=s||{x:t.chartX,y:t.chartY},i=Kfe(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,g=L1(t,n,h,p),x=Gfe(r,c,h,o);return{activeTooltipIndex:h,activeLabel:p,activePayload:g,activeCoordinate:x}}return null},Yfe=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,g=t.stackOffset,x=v4(h,o);return r.reduce(function(j,b){var y,S=b.type.defaultProps!==void 0?je(je({},b.type.defaultProps),b.props):b.props,C=S.type,N=S.dataKey,E=S.allowDataOverflow,A=S.allowDuplicatedCategory,P=S.scale,T=S.ticks,O=S.includeHidden,$=S[i];if(j[$])return j;var z=ug(t.data,{graphicalItems:s.filter(function(R){var ne,te=i in R.props?R.props[i]:(ne=R.type.defaultProps)===null||ne===void 0?void 0:ne[i];return te===$}),dataStartIndex:d,dataEndIndex:f}),U=z.length,B,V,q;wfe(S.domain,E,C)&&(B=JS(S.domain,null,E),x&&(C==="number"||P!=="auto")&&(q=_d(z,N,"category")));var I=OF(C);if(!B||B.length===0){var W,X=(W=S.domain)!==null&&W!==void 0?W:I;if(N){if(B=_d(z,N,C),C==="category"&&x){var K=NX(B);A&&K?(V=B,B=Tm(0,U)):A||(B=$2(X,B,b).reduce(function(R,ne){return R.indexOf(ne)>=0?R:[].concat(eu(R),[ne])},[]))}else if(C==="category")A?B=B.filter(function(R){return R!==""&&!It(R)}):B=$2(X,B,b).reduce(function(R,ne){return R.indexOf(ne)>=0||ne===""||It(ne)?R:[].concat(eu(R),[ne])},[]);else if(C==="number"){var F=$ae(z,s.filter(function(R){var ne,te,de=i in R.props?R.props[i]:(ne=R.type.defaultProps)===null||ne===void 0?void 0:ne[i],he="hide"in R.props?R.props.hide:(te=R.type.defaultProps)===null||te===void 0?void 0:te.hide;return de===$&&(O||!he)}),N,o,h);F&&(B=F)}x&&(C==="number"||P!=="auto")&&(q=_d(z,N,"category"))}else x?B=Tm(0,U):c&&c[$]&&c[$].hasStack&&C==="number"?B=g==="expand"?[0,1]:b4(c[$].stackGroups,d,f):B=m4(z,s.filter(function(R){var ne=i in R.props?R.props[i]:R.type.defaultProps[i],te="hide"in R.props?R.props.hide:R.type.defaultProps.hide;return ne===$&&(O||!te)}),C,h,!0);if(C==="number")B=M1(p,B,$,o,T),X&&(B=JS(X,B,E));else if(C==="category"&&X){var J=X,D=B.every(function(R){return J.indexOf(R)>=0});D&&(B=J)}}return je(je({},j),{},Nt({},$,je(je({},S),{},{axisType:o,domain:B,categoricalDomain:q,duplicateDomain:V,originalDomain:(y=S.domain)!==null&&y!==void 0?y:I,isCategorical:x,layout:h})))},{})},Xfe=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,g=ug(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),x=g.length,j=v4(h,o),b=-1;return r.reduce(function(y,S){var C=S.type.defaultProps!==void 0?je(je({},S.type.defaultProps),S.props):S.props,N=C[i],E=OF("number");if(!y[N]){b++;var A;return j?A=Tm(0,x):c&&c[N]&&c[N].hasStack?(A=b4(c[N].stackGroups,d,f),A=M1(p,A,N,o)):(A=JS(E,m4(g,r.filter(function(P){var T,O,$=i in P.props?P.props[i]:(T=P.type.defaultProps)===null||T===void 0?void 0:T[i],z="hide"in P.props?P.props.hide:(O=P.type.defaultProps)===null||O===void 0?void 0:O.hide;return $===N&&!z}),"number",h),s.defaultProps.allowDataOverflow),A=M1(p,A,N,o)),je(je({},y),{},Nt({},N,je(je({axisType:o},s.defaultProps),{},{hide:!0,orientation:da(Vfe,"".concat(o,".").concat(b%2),null),domain:A,originalDomain:E,isCategorical:j,layout:h})))}return y},{})},Qfe=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"),g=fa(h,o),x={};return g&&g.length?x=Yfe(t,{axes:g,graphicalItems:i,axisType:s,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):i&&i.length&&(x=Xfe(t,{Axis:o,graphicalItems:i,axisType:s,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),x},Jfe=function(t){var n=oc(t),r=Ui(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:tC(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:gm(n,r)}},RM=function(t){var n=t.children,r=t.defaultShowTooltip,s=sa(n,Wc),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}},Zfe=function(t){return!t||!t.length?!1:t.some(function(n){var r=eo(n&&n.type);return r&&r.indexOf("Bar")>=0})},IM=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"}},epe=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,g=r.margin||{},x=sa(p,Wc),j=sa(p,Vi),b=Object.keys(d).reduce(function(A,P){var T=d[P],O=T.orientation;return!T.mirror&&!T.hide?je(je({},A),{},Nt({},O,A[O]+T.width)):A},{left:g.left||0,right:g.right||0}),y=Object.keys(i).reduce(function(A,P){var T=i[P],O=T.orientation;return!T.mirror&&!T.hide?je(je({},A),{},Nt({},O,da(A,"".concat(O))+T.height)):A},{top:g.top||0,bottom:g.bottom||0}),S=je(je({},y),b),C=S.bottom;x&&(S.bottom+=x.props.height||Wc.defaultProps.height),j&&n&&(S=Iae(S,s,r,n));var N=f-S.left-S.right,E=h-S.top-S.bottom;return je(je({brushBottom:C},S),{},{width:Math.max(N,0),height:Math.max(E,0)})},tpe=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,g=function(S,C){var N=C.graphicalItems,E=C.stackGroups,A=C.offset,P=C.updateId,T=C.dataStartIndex,O=C.dataEndIndex,$=S.barSize,z=S.layout,U=S.barGap,B=S.barCategoryGap,V=S.maxBarSize,q=IM(z),I=q.numericAxisName,W=q.cateAxisName,X=Zfe(N),K=[];return N.forEach(function(F,J){var D=ug(S.data,{graphicalItems:[F],dataStartIndex:T,dataEndIndex:O}),R=F.type.defaultProps!==void 0?je(je({},F.type.defaultProps),F.props):F.props,ne=R.dataKey,te=R.maxBarSize,de=R["".concat(I,"Id")],he=R["".concat(W,"Id")],H={},ue=d.reduce(function(pt,vt){var gt=C["".concat(vt.axisType,"Map")],Bt=R["".concat(vt.axisType,"Id")];gt&&gt[Bt]||vt.axisType==="zAxis"||al();var Lt=gt[Bt];return je(je({},pt),{},Nt(Nt({},vt.axisType,Lt),"".concat(vt.axisType,"Ticks"),Ui(Lt)))},H),Q=ue[W],Z=ue["".concat(W,"Ticks")],fe=E&&E[de]&&E[de].hasStack&&Vae(F,E[de].stackGroups),ae=eo(F.type).indexOf("Bar")>=0,Oe=gm(Q,Z),we=[],Ye=X&&Oae({barSize:$,stackGroups:E,totalSize:tpe(ue,W)});if(ae){var L,ie,pe=It(te)?V:te,Ee=(L=(ie=gm(Q,Z,!0))!==null&&ie!==void 0?ie:pe)!==null&&L!==void 0?L:0;we=Rae({barGap:U,barCategoryGap:B,bandSize:Ee!==Oe?Ee:Oe,sizeList:Ye[he],maxBarSize:pe}),Ee!==Oe&&(we=we.map(function(pt){return je(je({},pt),{},{position:je(je({},pt.position),{},{offset:pt.position.offset-Ee/2})})}))}var Xe=F&&F.type&&F.type.getComposedData;Xe&&K.push({props:je(je({},Xe(je(je({},ue),{},{displayedData:D,props:S,dataKey:ne,item:F,bandSize:Oe,barPosition:we,offset:A,stackedData:fe,layout:z,dataStartIndex:T,dataEndIndex:O}))),{},Nt(Nt(Nt({key:F.key||"item-".concat(J)},I,ue[I]),W,ue[W]),"animationId",P)),childIndex:DX(F,S.children),item:F})}),K},x=function(S,C){var N=S.props,E=S.dataStartIndex,A=S.dataEndIndex,P=S.updateId;if(!Xk({props:N}))return null;var T=N.children,O=N.layout,$=N.stackOffset,z=N.data,U=N.reverseStackOrder,B=IM(O),V=B.numericAxisName,q=B.cateAxisName,I=fa(T,r),W=Uae(z,I,"".concat(V,"Id"),"".concat(q,"Id"),$,U),X=d.reduce(function(R,ne){var te="".concat(ne.axisType,"Map");return je(je({},R),{},Nt({},te,Qfe(N,je(je({},ne),{},{graphicalItems:I,stackGroups:ne.axisType===V&&W,dataStartIndex:E,dataEndIndex:A}))))},{}),K=epe(je(je({},X),{},{props:N,graphicalItems:I}),C?.legendBBox);Object.keys(X).forEach(function(R){X[R]=h(N,X[R],K,R.replace("Map",""),n)});var F=X["".concat(q,"Map")],J=Jfe(F),D=g(N,je(je({},X),{},{dataStartIndex:E,dataEndIndex:A,updateId:P,graphicalItems:I,stackGroups:W,offset:K}));return je(je({formattedGraphicalItems:D,graphicalItems:I,offset:K,stackGroups:W},J),X)},j=(function(y){function S(C){var N,E,A;return Ife(this,S),A=Dfe(this,S,[C]),Nt(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Nt(A,"accessibilityManager",new bfe),Nt(A,"handleLegendBBoxUpdate",function(P){if(P){var T=A.state,O=T.dataStartIndex,$=T.dataEndIndex,z=T.updateId;A.setState(je({legendBBox:P},x({props:A.props,dataStartIndex:O,dataEndIndex:$,updateId:z},je(je({},A.state),{},{legendBBox:P}))))}}),Nt(A,"handleReceiveSyncEvent",function(P,T,O){if(A.props.syncId===P){if(O===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(T)}}),Nt(A,"handleBrushChange",function(P){var T=P.startIndex,O=P.endIndex;if(T!==A.state.dataStartIndex||O!==A.state.dataEndIndex){var $=A.state.updateId;A.setState(function(){return je({dataStartIndex:T,dataEndIndex:O},x({props:A.props,dataStartIndex:T,dataEndIndex:O,updateId:$},A.state))}),A.triggerSyncEvent({dataStartIndex:T,dataEndIndex:O})}}),Nt(A,"handleMouseEnter",function(P){var T=A.getMouseInfo(P);if(T){var O=je(je({},T),{},{isTooltipActive:!0});A.setState(O),A.triggerSyncEvent(O);var $=A.props.onMouseEnter;Rt($)&&$(O,P)}}),Nt(A,"triggeredAfterMouseMove",function(P){var T=A.getMouseInfo(P),O=T?je(je({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(O),A.triggerSyncEvent(O);var $=A.props.onMouseMove;Rt($)&&$(O,P)}),Nt(A,"handleItemMouseEnter",function(P){A.setState(function(){return{isTooltipActive:!0,activeItem:P,activePayload:P.tooltipPayload,activeCoordinate:P.tooltipPosition||{x:P.cx,y:P.cy}}})}),Nt(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),Nt(A,"handleMouseMove",function(P){P.persist(),A.throttleTriggeredAfterMouseMove(P)}),Nt(A,"handleMouseLeave",function(P){A.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};A.setState(T),A.triggerSyncEvent(T);var O=A.props.onMouseLeave;Rt(O)&&O(T,P)}),Nt(A,"handleOuterEvent",function(P){var T=$X(P),O=da(A.props,"".concat(T));if(T&&Rt(O)){var $,z;/.*touch.*/i.test(T)?z=A.getMouseInfo(P.changedTouches[0]):z=A.getMouseInfo(P),O(($=z)!==null&&$!==void 0?$:{},P)}}),Nt(A,"handleClick",function(P){var T=A.getMouseInfo(P);if(T){var O=je(je({},T),{},{isTooltipActive:!0});A.setState(O),A.triggerSyncEvent(O);var $=A.props.onClick;Rt($)&&$(O,P)}}),Nt(A,"handleMouseDown",function(P){var T=A.props.onMouseDown;if(Rt(T)){var O=A.getMouseInfo(P);T(O,P)}}),Nt(A,"handleMouseUp",function(P){var T=A.props.onMouseUp;if(Rt(T)){var O=A.getMouseInfo(P);T(O,P)}}),Nt(A,"handleTouchMove",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(P.changedTouches[0])}),Nt(A,"handleTouchStart",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&A.handleMouseDown(P.changedTouches[0])}),Nt(A,"handleTouchEnd",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&A.handleMouseUp(P.changedTouches[0])}),Nt(A,"handleDoubleClick",function(P){var T=A.props.onDoubleClick;if(Rt(T)){var O=A.getMouseInfo(P);T(O,P)}}),Nt(A,"handleContextMenu",function(P){var T=A.props.onContextMenu;if(Rt(T)){var O=A.getMouseInfo(P);T(O,P)}}),Nt(A,"triggerSyncEvent",function(P){A.props.syncId!==void 0&&Oj.emit(Rj,A.props.syncId,P,A.eventEmitterSymbol)}),Nt(A,"applySyncEvent",function(P){var T=A.props,O=T.layout,$=T.syncMethod,z=A.state.updateId,U=P.dataStartIndex,B=P.dataEndIndex;if(P.dataStartIndex!==void 0||P.dataEndIndex!==void 0)A.setState(je({dataStartIndex:U,dataEndIndex:B},x({props:A.props,dataStartIndex:U,dataEndIndex:B,updateId:z},A.state)));else if(P.activeTooltipIndex!==void 0){var V=P.chartX,q=P.chartY,I=P.activeTooltipIndex,W=A.state,X=W.offset,K=W.tooltipTicks;if(!X)return;if(typeof $=="function")I=$(K,P);else if($==="value"){I=-1;for(var F=0;F<K.length;F++)if(K[F].value===P.activeLabel){I=F;break}}var J=je(je({},X),{},{x:X.left,y:X.top}),D=Math.min(V,J.x+J.width),R=Math.min(q,J.y+J.height),ne=K[I]&&K[I].value,te=L1(A.state,A.props.data,I),de=K[I]?{x:O==="horizontal"?K[I].coordinate:D,y:O==="horizontal"?R:K[I].coordinate}:TF;A.setState(je(je({},P),{},{activeLabel:ne,activeCoordinate:de,activePayload:te,activeTooltipIndex:I}))}else A.setState(P)}),Nt(A,"renderCursor",function(P){var T,O=A.state,$=O.isTooltipActive,z=O.activeCoordinate,U=O.activePayload,B=O.offset,V=O.activeTooltipIndex,q=O.tooltipAxisBandSize,I=A.getTooltipEventType(),W=(T=P.props.active)!==null&&T!==void 0?T:$,X=A.props.layout,K=P.key||"_recharts-cursor";return G.createElement(Afe,{key:K,activeCoordinate:z,activePayload:U,activeTooltipIndex:V,chartName:n,element:P,isActive:W,layout:X,offset:B,tooltipAxisBandSize:q,tooltipEventType:I})}),Nt(A,"renderPolarAxis",function(P,T,O){var $=da(P,"type.axisType"),z=da(A.state,"".concat($,"Map")),U=P.type.defaultProps,B=U!==void 0?je(je({},U),P.props):P.props,V=z&&z[B["".concat($,"Id")]];return m.cloneElement(P,je(je({},V),{},{className:Mt($,V.className),key:P.key||"".concat(T,"-").concat(O),ticks:Ui(V,!0)}))}),Nt(A,"renderPolarGrid",function(P){var T=P.props,O=T.radialLines,$=T.polarAngles,z=T.polarRadius,U=A.state,B=U.radiusAxisMap,V=U.angleAxisMap,q=oc(B),I=oc(V),W=I.cx,X=I.cy,K=I.innerRadius,F=I.outerRadius;return m.cloneElement(P,{polarAngles:Array.isArray($)?$:Ui(I,!0).map(function(J){return J.coordinate}),polarRadius:Array.isArray(z)?z:Ui(q,!0).map(function(J){return J.coordinate}),cx:W,cy:X,innerRadius:K,outerRadius:F,key:P.key||"polar-grid",radialLines:O})}),Nt(A,"renderLegend",function(){var P=A.state.formattedGraphicalItems,T=A.props,O=T.children,$=T.width,z=T.height,U=A.props.margin||{},B=$-(U.left||0)-(U.right||0),V=p4({children:O,formattedGraphicalItems:P,legendWidth:B,legendContent:f});if(!V)return null;var q=V.item,I=kM(V,Efe);return m.cloneElement(q,je(je({},I),{},{chartWidth:$,chartHeight:z,margin:U,onBBoxUpdate:A.handleLegendBBoxUpdate}))}),Nt(A,"renderTooltip",function(){var P,T=A.props,O=T.children,$=T.accessibilityLayer,z=sa(O,Br);if(!z)return null;var U=A.state,B=U.isTooltipActive,V=U.activeCoordinate,q=U.activePayload,I=U.activeLabel,W=U.offset,X=(P=z.props.active)!==null&&P!==void 0?P:B;return m.cloneElement(z,{viewBox:je(je({},W),{},{x:W.left,y:W.top}),active:X,label:I,payload:X?q:[],coordinate:V,accessibilityLayer:$})}),Nt(A,"renderBrush",function(P){var T=A.props,O=T.margin,$=T.data,z=A.state,U=z.offset,B=z.dataStartIndex,V=z.dataEndIndex,q=z.updateId;return m.cloneElement(P,{key:P.key||"_recharts-brush",onChange:gh(A.handleBrushChange,P.props.onChange),data:$,x:Ve(P.props.x)?P.props.x:U.left,y:Ve(P.props.y)?P.props.y:U.top+U.height+U.brushBottom-(O.bottom||0),width:Ve(P.props.width)?P.props.width:U.width,startIndex:B,endIndex:V,updateId:"brush-".concat(q)})}),Nt(A,"renderReferenceElement",function(P,T,O){if(!P)return null;var $=A,z=$.clipPathId,U=A.state,B=U.xAxisMap,V=U.yAxisMap,q=U.offset,I=P.type.defaultProps||{},W=P.props,X=W.xAxisId,K=X===void 0?I.xAxisId:X,F=W.yAxisId,J=F===void 0?I.yAxisId:F;return m.cloneElement(P,{key:P.key||"".concat(T,"-").concat(O),xAxis:B[K],yAxis:V[J],viewBox:{x:q.left,y:q.top,width:q.width,height:q.height},clipPathId:z})}),Nt(A,"renderActivePoints",function(P){var T=P.item,O=P.activePoint,$=P.basePoint,z=P.childIndex,U=P.isRange,B=[],V=T.props.key,q=T.item.type.defaultProps!==void 0?je(je({},T.item.type.defaultProps),T.item.props):T.item.props,I=q.activeDot,W=q.dataKey,X=je(je({index:z,dataKey:W,cx:O.x,cy:O.y,r:4,fill:AC(T.item),strokeWidth:2,stroke:"#fff",payload:O.payload,value:O.value},jt(I,!1)),Vh(I));return B.push(S.renderActiveDot(I,X,"".concat(V,"-activePoint-").concat(z))),$?B.push(S.renderActiveDot(I,je(je({},X),{},{cx:$.x,cy:$.y}),"".concat(V,"-basePoint-").concat(z))):U&&B.push(null),B}),Nt(A,"renderGraphicChild",function(P,T,O){var $=A.filterFormatItem(P,T,O);if(!$)return null;var z=A.getTooltipEventType(),U=A.state,B=U.isTooltipActive,V=U.tooltipAxis,q=U.activeTooltipIndex,I=U.activeLabel,W=A.props.children,X=sa(W,Br),K=$.props,F=K.points,J=K.isRange,D=K.baseLine,R=$.item.type.defaultProps!==void 0?je(je({},$.item.type.defaultProps),$.item.props):$.item.props,ne=R.activeDot,te=R.hide,de=R.activeBar,he=R.activeShape,H=!!(!te&&B&&X&&(ne||de||he)),ue={};z!=="axis"&&X&&X.props.trigger==="click"?ue={onClick:gh(A.handleItemMouseEnter,P.props.onClick)}:z!=="axis"&&(ue={onMouseLeave:gh(A.handleItemMouseLeave,P.props.onMouseLeave),onMouseEnter:gh(A.handleItemMouseEnter,P.props.onMouseEnter)});var Q=m.cloneElement(P,je(je({},$.props),ue));function Z(vt){return typeof V.dataKey=="function"?V.dataKey(vt.payload):null}if(H)if(q>=0){var fe,ae;if(V.dataKey&&!V.allowDuplicatedCategory){var Oe=typeof V.dataKey=="function"?Z:"payload.".concat(V.dataKey.toString());fe=Wh(F,Oe,I),ae=J&&D&&Wh(D,Oe,I)}else fe=F?.[q],ae=J&&D&&D[q];if(he||de){var we=P.props.activeIndex!==void 0?P.props.activeIndex:q;return[m.cloneElement(P,je(je(je({},$.props),ue),{},{activeIndex:we})),null,null]}if(!It(fe))return[Q].concat(eu(A.renderActivePoints({item:$,activePoint:fe,basePoint:ae,childIndex:q,isRange:J})))}else{var Ye,L=(Ye=A.getItemByXY(A.state.activeCoordinate))!==null&&Ye!==void 0?Ye:{graphicalItem:Q},ie=L.graphicalItem,pe=ie.item,Ee=pe===void 0?P:pe,Xe=ie.childIndex,pt=je(je(je({},$.props),ue),{},{activeIndex:Xe});return[m.cloneElement(Ee,pt),null,null]}return J?[Q,null,null]:[Q,null]}),Nt(A,"renderCustomized",function(P,T,O){return m.cloneElement(P,je(je({key:"recharts-customized-".concat(O)},A.props),A.state))}),Nt(A,"renderMap",{CartesianGrid:{handler:jh,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:jh},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:jh},YAxis:{handler:jh},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:mu("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=pL(A.triggeredAfterMouseMove,(E=C.throttleDelay)!==null&&E!==void 0?E:1e3/60),A.state={},A}return Bfe(S,y),$fe(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,P=N.height,T=N.layout,O=sa(E,Br);if(O){var $=O.props.defaultIndex;if(!(typeof $!="number"||$<0||$>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[$]&&this.state.tooltipTicks[$].value,U=L1(this.state,A,$,z),B=this.state.tooltipTicks[$].coordinate,V=(this.state.offset.top+P)/2,q=T==="horizontal",I=q?{x:B,y:V}:{y:B,x:V},W=this.state.formattedGraphicalItems.find(function(K){var F=K.item;return F.type.name==="Scatter"});W&&(I=je(je({},I),W.props.points[$].tooltipPosition),U=W.props.points[$].tooltipPayload);var X={activeTooltipIndex:$,isTooltipActive:!0,activeLabel:z,activePayload:U,activeCoordinate:I};this.setState(X),this.renderCursor(O),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,P;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0}})}return null}},{key:"componentDidUpdate",value:function(N){bS([sa(N.children,Br)],[sa(this.props.children,Br)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var N=sa(this.props.children,Br);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(),P=See(A),T={chartX:Math.round(N.pageX-P.left),chartY:Math.round(N.pageY-P.top)},O=A.width/E.offsetWidth||1,$=this.inRange(T.chartX,T.chartY,O);if(!$)return null;var z=this.state,U=z.xAxisMap,B=z.yAxisMap,V=this.getTooltipEventType(),q=OM(this.state,this.props.data,this.props.layout,$);if(V!=="axis"&&U&&B){var I=oc(U).scale,W=oc(B).scale,X=I&&I.invert?I.invert(T.chartX):null,K=W&&W.invert?W.invert(T.chartY):null;return je(je({},T),{},{xValue:X,yValue:K},q)}return q?je(je({},T),q):null}},{key:"inRange",value:function(N,E){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,P=this.props.layout,T=N/A,O=E/A;if(P==="horizontal"||P==="vertical"){var $=this.state.offset,z=T>=$.left&&T<=$.left+$.width&&O>=$.top&&O<=$.top+$.height;return z?{x:T,y:O}:null}var U=this.state,B=U.angleAxisMap,V=U.radiusAxisMap;if(B&&V){var q=oc(B);return F2({x:T,y:O},q)}return null}},{key:"parseEventsOfWrapper",value:function(){var N=this.props.children,E=this.getTooltipEventType(),A=sa(N,Br),P={};A&&E==="axis"&&(A.props.trigger==="click"?P={onClick:this.handleClick}:P={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=Vh(this.props,this.handleOuterEvent);return je(je({},T),P)}},{key:"addListener",value:function(){Oj.on(Rj,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Oj.removeListener(Rj,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(N,E,A){for(var P=this.state.formattedGraphicalItems,T=0,O=P.length;T<O;T++){var $=P[T];if($.item===N||$.props.key===N.key||E===eo($.item.type)&&A===$.childIndex)return $}return null}},{key:"renderClipPath",value:function(){var N=this.clipPathId,E=this.state.offset,A=E.left,P=E.top,T=E.height,O=E.width;return G.createElement("defs",null,G.createElement("clipPath",{id:N},G.createElement("rect",{x:A,y:P,height:T,width:O})))}},{key:"getXScales",value:function(){var N=this.state.xAxisMap;return N?Object.entries(N).reduce(function(E,A){var P=PM(A,2),T=P[0],O=P[1];return je(je({},E),{},Nt({},T,O.scale))},{}):null}},{key:"getYScales",value:function(){var N=this.state.yAxisMap;return N?Object.entries(N).reduce(function(E,A){var P=PM(A,2),T=P[0],O=P[1];return je(je({},E),{},Nt({},T,O.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,P=E.activeItem;if(A&&A.length)for(var T=0,O=A.length;T<O;T++){var $=A[T],z=$.props,U=$.item,B=U.type.defaultProps!==void 0?je(je({},U.type.defaultProps),U.props):U.props,V=eo(U.type);if(V==="Bar"){var q=(z.data||[]).find(function(K){return Wie(N,K)});if(q)return{graphicalItem:$,payload:q}}else if(V==="RadialBar"){var I=(z.data||[]).find(function(K){return F2(N,K)});if(I)return{graphicalItem:$,payload:I}}else if(ng($,P)||rg($,P)||ff($,P)){var W=pce({graphicalItem:$,activeTooltipItem:P,itemData:B.data}),X=B.activeIndex===void 0?W:B.activeIndex;return{graphicalItem:je(je({},$),{},{childIndex:X}),payload:ff($,P)?B.data[W]:$.props.data[W]}}}return null}},{key:"render",value:function(){var N=this;if(!Xk(this))return null;var E=this.props,A=E.children,P=E.className,T=E.width,O=E.height,$=E.style,z=E.compact,U=E.title,B=E.desc,V=kM(E,Pfe),q=jt(V,!1);if(z)return G.createElement(fM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},G.createElement(jS,hc({},q,{width:T,height:O,title:U,desc:B}),this.renderClipPath(),Jk(A,this.renderMap)));if(this.props.accessibilityLayer){var I,W;q.tabIndex=(I=this.props.tabIndex)!==null&&I!==void 0?I:0,q.role=(W=this.props.role)!==null&&W!==void 0?W:"application",q.onKeyDown=function(K){N.accessibilityManager.keyboardEvent(K)},q.onFocus=function(){N.accessibilityManager.focus()}}var X=this.parseEventsOfWrapper();return G.createElement(fM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},G.createElement("div",hc({className:Mt("recharts-wrapper",P),style:je({position:"relative",cursor:"default",width:T,height:O},$)},X,{ref:function(F){N.container=F}}),G.createElement(jS,hc({},q,{width:T,height:O,title:U,desc:B,style:Hfe}),this.renderClipPath(),Jk(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(m.Component);Nt(j,"displayName",n),Nt(j,"defaultProps",je({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),Nt(j,"getDerivedStateFromProps",function(y,S){var C=y.dataKey,N=y.data,E=y.children,A=y.width,P=y.height,T=y.layout,O=y.stackOffset,$=y.margin,z=S.dataStartIndex,U=S.dataEndIndex;if(S.updateId===void 0){var B=RM(y);return je(je(je({},B),{},{updateId:0},x(je(je({props:y},B),{},{updateId:0}),S)),{},{prevDataKey:C,prevData:N,prevWidth:A,prevHeight:P,prevLayout:T,prevStackOffset:O,prevMargin:$,prevChildren:E})}if(C!==S.prevDataKey||N!==S.prevData||A!==S.prevWidth||P!==S.prevHeight||T!==S.prevLayout||O!==S.prevStackOffset||!bc($,S.prevMargin)){var V=RM(y),q={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},I=je(je({},OM(S,N,T)),{},{updateId:S.updateId+1}),W=je(je(je({},V),q),I);return je(je(je({},W),x(je({props:y},W),S)),{},{prevDataKey:C,prevData:N,prevWidth:A,prevHeight:P,prevLayout:T,prevStackOffset:O,prevMargin:$,prevChildren:E})}if(!bS(E,S.prevChildren)){var X,K,F,J,D=sa(E,Wc),R=D&&(X=(K=D.props)===null||K===void 0?void 0:K.startIndex)!==null&&X!==void 0?X:z,ne=D&&(F=(J=D.props)===null||J===void 0?void 0:J.endIndex)!==null&&F!==void 0?F:U,te=R!==z||ne!==U,de=!It(N),he=de&&!te?S.updateId:S.updateId+1;return je(je({updateId:he},x(je(je({props:y},S),{},{updateId:he,dataStartIndex:R,dataEndIndex:ne}),S)),{},{prevChildren:E,dataStartIndex:R,dataEndIndex:ne})}return null}),Nt(j,"renderActiveDot",function(y,S,C){var N;return m.isValidElement(y)?N=m.cloneElement(y,S):Rt(y)?N=y(S):N=G.createElement(Qv,S),G.createElement(nn,{className:"recharts-active-dot",key:C},N)});var b=m.forwardRef(function(S,C){return G.createElement(j,hc({},S,{ref:C}))});return b.displayName=j.displayName,b},F1=RC({chartName:"LineChart",GraphicalChild:sl,axisComponents:[{axisType:"xAxis",AxisComp:si},{axisType:"yAxis",AxisComp:oi}],formatAxisMap:X4}),npe=RC({chartName:"BarChart",GraphicalChild:Nl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:si},{axisType:"yAxis",AxisComp:oi}],formatAxisMap:X4}),rpe=RC({chartName:"PieChart",GraphicalChild:yo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:tg},{axisType:"radiusAxis",AxisComp:Zv}],formatAxisMap:tse,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const ape=()=>{const{configs:e}=Rf(),{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,g=h===0?0:Math.round(n.reduce((y,S)=>y+S.avgLatency,0)/h),x=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=[...x].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(O=>O.scenarioId).filter(Boolean))),C=Array.from(new Set(y.scenarios.map(O=>O.agentName).filter(Boolean))),N=Array.from(new Set(y.scenarios.map(O=>O.model).filter(O=>!!O))),E=S.slice(0,2).join(", "),A=S.length>2?` +${S.length-2}`:"",P=N.slice(0,2).join(", "),T=N.length>2?` +${N.length-2}`:"";return{scenarioCount:S.length,agentCount:C.length,scenarioPreview:E?`${E}${A}`:"n/a",modelSummary:P?`${P}${T}`:""}};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(Z$,{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(Zs,{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(Nc,{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(ms,{title:"MCP Evaluations",value:f,icon:Qj,subtitle:`${f} active`}),a.jsx(ms,{title:"Total Runs",value:h,icon:G$,subtitle:"Last 30 days"}),a.jsx(ms,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:Nc,subtitle:"+5% from last week",trend:"up"}),a.jsx(ms,{title:"Avg Latency",value:`${g}ms`,icon:nD,subtitle:"-120ms from last week",trend:"up"})]}),a.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Pass Rate Trend"})}),a.jsx(qe,{children:a.jsx(tm,{width:"100%",height:200,children:a.jsxs(F1,{data:j,children:[a.jsx(si,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(oi,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:y=>`${y}%`}),a.jsx(Br,{formatter:y=>[`${y}%`,"Pass Rate"]}),a.jsx(sl,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Recent Tool Latency (ms)"})}),a.jsx(qe,{children:a.jsx(tm,{width:"100%",height:200,children:a.jsxs(F1,{data:j,children:[a.jsx(si,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(oi,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(Br,{formatter:y=>[`${y}ms`,"Latency"]}),a.jsx(sl,{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(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Recent Runs"})}),a.jsx(qe,{className:"p-0",children:a.jsxs(Ur,{children:[a.jsx(Wr,{children:a.jsxs(Kt,{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(bs,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}):a.jsx(mc,{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(bs,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}):a.jsx(mc,{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(bs,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}):a.jsx(mc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),a.jsx(Vr,{children:x.map(y=>a.jsxs(Kt,{className:"cursor-pointer",children:[a.jsx(Be,{children:a.jsx(_t,{to:`/results/${y.id}`,className:"font-mono text-xs text-primary hover:underline",children:y.id})}),a.jsx(Be,{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(Be,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(po,{className:"h-3 w-3"}),new Date(y.timestamp).toLocaleString()]})}),a.jsx(Be,{children:a.jsx(Xs,{rate:y.overallPassRate})}),a.jsx(Be,{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:Se("relative",r),children:[a.jsx(mt,{value:e,onChange:i=>t(i.target.value),placeholder:n,className:Se("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(_s,{className:"h-4 w-4"})})]})}var spe=m.createContext(void 0);function bu(e){const t=m.useContext(spe);return e||t||"ltr"}var Mj="rovingFocusGroup.onEntryFocus",ope={bubbles:!1,cancelable:!0},Uf="RovingFocusGroup",[B1,RF,ipe]=Sf(Uf),[lpe,dg]=hr(Uf,[ipe]),[cpe,upe]=lpe(Uf),IF=m.forwardRef((e,t)=>a.jsx(B1.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(B1.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(dpe,{...e,ref:t})})}));IF.displayName=Uf;var dpe=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,g=m.useRef(null),x=wt(t,g),j=bu(o),[b,y]=pa({prop:i,defaultProp:c??null,onChange:d,caller:Uf}),[S,C]=m.useState(!1),N=Wn(f),E=RF(n),A=m.useRef(!1),[P,T]=m.useState(0);return m.useEffect(()=>{const O=g.current;if(O)return O.addEventListener(Mj,N),()=>O.removeEventListener(Mj,N)},[N]),a.jsx(cpe,{scope:n,orientation:r,dir:j,loop:s,currentTabStopId:b,onItemFocus:m.useCallback(O=>y(O),[y]),onItemShiftTab:m.useCallback(()=>C(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(O=>O+1),[]),onFocusableItemRemove:m.useCallback(()=>T(O=>O-1),[]),children:a.jsx(Ge.div,{tabIndex:S||P===0?-1:0,"data-orientation":r,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{A.current=!0}),onFocus:Te(e.onFocus,O=>{const $=!A.current;if(O.target===O.currentTarget&&$&&!S){const z=new CustomEvent(Mj,ope);if(O.currentTarget.dispatchEvent(z),!z.defaultPrevented){const U=E().filter(W=>W.focusable),B=U.find(W=>W.active),V=U.find(W=>W.id===b),I=[B,V,...U].filter(Boolean).map(W=>W.ref.current);DF(I,h)}}A.current=!1}),onBlur:Te(e.onBlur,()=>C(!1))})})}),MF="RovingFocusGroupItem",$F=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:i,...c}=e,d=tr(),f=o||d,h=upe(MF,n),p=h.currentTabStopId===f,g=RF(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:b}=h;return m.useEffect(()=>{if(r)return x(),()=>j()},[r,x,j]),a.jsx(B1.ItemSlot,{scope:n,id:f,focusable:r,active:s,children:a.jsx(Ge.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=hpe(y,h.orientation,h.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let N=g().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?mpe(N,E+1):N.slice(E+1)}setTimeout(()=>DF(N))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:b!=null}):i})})});$F.displayName=MF;var fpe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ppe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function hpe(e,t,n){const r=ppe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return fpe[r]}function DF(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function mpe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var LF=IF,FF=$F;function vpe(e){const t=gpe(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(ype);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 gpe(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=wpe(s),c=bpe(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Tr(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 xpe=Symbol("radix.slottable");function ype(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xpe}function bpe(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 wpe(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 z1=["Enter"," "],jpe=["ArrowDown","PageUp","Home"],BF=["ArrowUp","PageDown","End"],Spe=[...jpe,...BF],Npe={ltr:[...z1,"ArrowRight"],rtl:[...z1,"ArrowLeft"]},Cpe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Wf="Menu",[yf,_pe,Ape]=Sf(Wf),[Cl,zF]=hr(Wf,[Ape,li,dg]),fg=li(),qF=dg(),[Epe,_l]=Cl(Wf),[Ppe,Vf]=Cl(Wf),UF=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:i=!0}=e,c=fg(t),[d,f]=m.useState(null),h=m.useRef(!1),p=Wn(o),g=bu(s);return m.useEffect(()=>{const x=()=>{h.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>h.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),a.jsx(cv,{...c,children:a.jsx(Epe,{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:g,modal:i,children:r})})})};UF.displayName=Wf;var kpe="MenuAnchor",MC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=fg(n);return a.jsx(_f,{...s,...r,ref:t})});MC.displayName=kpe;var $C="MenuPortal",[Tpe,WF]=Cl($C,{forceMount:void 0}),VF=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=_l($C,t);return a.jsx(Tpe,{scope:t,forceMount:n,children:a.jsx(Gn,{present:n||o.open,children:a.jsx(vl,{asChild:!0,container:s,children:r})})})};VF.displayName=$C;var ka="MenuContent",[Ope,DC]=Cl(ka),HF=m.forwardRef((e,t)=>{const n=WF(ka,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=_l(ka,e.__scopeMenu),i=Vf(ka,e.__scopeMenu);return a.jsx(yf.Provider,{scope:e.__scopeMenu,children:a.jsx(Gn,{present:r||o.open,children:a.jsx(yf.Slot,{scope:e.__scopeMenu,children:i.modal?a.jsx(Rpe,{...s,ref:t}):a.jsx(Ipe,{...s,ref:t})})})})}),Rpe=m.forwardRef((e,t)=>{const n=_l(ka,e.__scopeMenu),r=m.useRef(null),s=wt(t,r);return m.useEffect(()=>{const o=r.current;if(o)return jv(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)})}),Ipe=m.forwardRef((e,t)=>{const n=_l(ka,e.__scopeMenu);return a.jsx(LC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Mpe=vpe("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:g,onDismiss:x,disableOutsideScroll:j,...b}=e,y=_l(ka,n),S=Vf(ka,n),C=fg(n),N=qF(n),E=_pe(n),[A,P]=m.useState(null),T=m.useRef(null),O=wt(t,T,y.onContentChange),$=m.useRef(0),z=m.useRef(""),U=m.useRef(0),B=m.useRef(null),V=m.useRef("right"),q=m.useRef(0),I=j?Pf:m.Fragment,W=j?{as:Mpe,allowPinchZoom:!0}:void 0,X=F=>{const J=z.current+F,D=E().filter(H=>!H.disabled),R=document.activeElement,ne=D.find(H=>H.ref.current===R)?.textValue,te=D.map(H=>H.textValue),de=Kpe(te,J,ne),he=D.find(H=>H.textValue===de)?.ref.current;(function H(ue){z.current=ue,window.clearTimeout($.current),ue!==""&&($.current=window.setTimeout(()=>H(""),1e3))})(J),he&&setTimeout(()=>he.focus())};m.useEffect(()=>()=>window.clearTimeout($.current),[]),bv();const K=m.useCallback(F=>V.current===B.current?.side&&Ype(F,B.current?.area),[]);return a.jsx(Ope,{scope:n,searchRef:z,onItemEnter:m.useCallback(F=>{K(F)&&F.preventDefault()},[K]),onItemLeave:m.useCallback(F=>{K(F)||(T.current?.focus(),P(null))},[K]),onTriggerLeave:m.useCallback(F=>{K(F)&&F.preventDefault()},[K]),pointerGraceTimerRef:U,onPointerGraceIntentChange:m.useCallback(F=>{B.current=F},[]),children:a.jsx(I,{...W,children:a.jsx(Ef,{asChild:!0,trapped:s,onMountAutoFocus:Te(o,F=>{F.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:a.jsx(ml,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:x,children:a.jsx(LF,{asChild:!0,...N,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:P,onEntryFocus:Te(d,F=>{S.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(uv,{role:"menu","aria-orientation":"vertical","data-state":lB(y.open),"data-radix-menu-content":"",dir:S.dir,...C,...b,ref:O,style:{outline:"none",...b.style},onKeyDown:Te(b.onKeyDown,F=>{const D=F.target.closest("[data-radix-menu-content]")===F.currentTarget,R=F.ctrlKey||F.altKey||F.metaKey,ne=F.key.length===1;D&&(F.key==="Tab"&&F.preventDefault(),!R&&ne&&X(F.key));const te=T.current;if(F.target!==te||!Spe.includes(F.key))return;F.preventDefault();const he=E().filter(H=>!H.disabled).map(H=>H.ref.current);BF.includes(F.key)&&he.reverse(),Vpe(he)}),onBlur:Te(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout($.current),z.current="")}),onPointerMove:Te(e.onPointerMove,bf(F=>{const J=F.target,D=q.current!==F.clientX;if(F.currentTarget.contains(J)&&D){const R=F.clientX>q.current?"right":"left";V.current=R,q.current=F.clientX}}))})})})})})})});HF.displayName=ka;var $pe="MenuGroup",FC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Ge.div,{role:"group",...r,ref:t})});FC.displayName=$pe;var Dpe="MenuLabel",KF=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Ge.div,{...r,ref:t})});KF.displayName=Dpe;var Vm="MenuItem",MM="menu.itemSelect",pg=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=m.useRef(null),i=Vf(Vm,e.__scopeMenu),c=DC(Vm,e.__scopeMenu),d=wt(t,o),f=m.useRef(!1),h=()=>{const p=o.current;if(!n&&p){const g=new CustomEvent(MM,{bubbles:!0,cancelable:!0});p.addEventListener(MM,x=>r?.(x),{once:!0}),aN(p,g),g.defaultPrevented?f.current=!1:i.onClose()}};return a.jsx(GF,{...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 g=c.searchRef.current!=="";n||g&&p.key===" "||z1.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});pg.displayName=Vm;var GF=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,i=DC(Vm,n),c=qF(n),d=m.useRef(null),f=wt(t,d),[h,p]=m.useState(!1),[g,x]=m.useState("");return m.useEffect(()=>{const j=d.current;j&&x((j.textContent??"").trim())},[o.children]),a.jsx(yf.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:a.jsx(FF,{asChild:!0,...c,focusable:!r,children:a.jsx(Ge.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,bf(j=>{r?i.onItemLeave(j):(i.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,bf(j=>i.onItemLeave(j))),onFocus:Te(e.onFocus,()=>p(!0)),onBlur:Te(e.onBlur,()=>p(!1))})})})}),Lpe="MenuCheckboxItem",YF=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return a.jsx(eB,{scope:e.__scopeMenu,checked:n,children:a.jsx(pg,{role:"menuitemcheckbox","aria-checked":Hm(n)?"mixed":n,...s,ref:t,"data-state":zC(n),onSelect:Te(s.onSelect,()=>r?.(Hm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});YF.displayName=Lpe;var XF="MenuRadioGroup",[Fpe,Bpe]=Cl(XF,{value:void 0,onValueChange:()=>{}}),QF=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=Wn(r);return a.jsx(Fpe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:a.jsx(FC,{...s,ref:t})})});QF.displayName=XF;var JF="MenuRadioItem",ZF=m.forwardRef((e,t)=>{const{value:n,...r}=e,s=Bpe(JF,e.__scopeMenu),o=n===s.value;return a.jsx(eB,{scope:e.__scopeMenu,checked:o,children:a.jsx(pg,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":zC(o),onSelect:Te(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ZF.displayName=JF;var BC="MenuItemIndicator",[eB,zpe]=Cl(BC,{checked:!1}),tB=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=zpe(BC,n);return a.jsx(Gn,{present:r||Hm(o.checked)||o.checked===!0,children:a.jsx(Ge.span,{...s,ref:t,"data-state":zC(o.checked)})})});tB.displayName=BC;var qpe="MenuSeparator",nB=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Ge.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});nB.displayName=qpe;var Upe="MenuArrow",rB=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=fg(n);return a.jsx(dv,{...s,...r,ref:t})});rB.displayName=Upe;var Wpe="MenuSub",[Zxe,aB]=Cl(Wpe),wd="MenuSubTrigger",sB=m.forwardRef((e,t)=>{const n=_l(wd,e.__scopeMenu),r=Vf(wd,e.__scopeMenu),s=aB(wd,e.__scopeMenu),o=DC(wd,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(GF,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":lB(n.open),...e,ref:Tr(t,s.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,bf(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,bf(p=>{h();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,j=x==="right",b=j?-5:5,y=g[j?"left":"right"],S=g[j?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:y,y:g.bottom}],side:x}),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 g=o.searchRef.current!=="";e.disabled||g&&p.key===" "||Npe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});sB.displayName=wd;var oB="MenuSubContent",iB=m.forwardRef((e,t)=>{const n=WF(ka,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=_l(ka,e.__scopeMenu),i=Vf(ka,e.__scopeMenu),c=aB(oB,e.__scopeMenu),d=m.useRef(null),f=wt(t,d);return a.jsx(yf.Provider,{scope:e.__scopeMenu,children:a.jsx(Gn,{present:r||o.open,children:a.jsx(yf.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),g=Cpe[i.dir].includes(h.key);p&&g&&(o.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});iB.displayName=oB;function lB(e){return e?"open":"closed"}function Hm(e){return e==="indeterminate"}function zC(e){return Hm(e)?"indeterminate":e?"checked":"unchecked"}function Vpe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Hpe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Kpe(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=Hpe(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 Gpe(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,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(s=!s)}return s}function Ype(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Gpe(n,t)}function bf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Xpe=UF,Qpe=MC,Jpe=VF,Zpe=HF,ehe=FC,the=KF,nhe=pg,rhe=YF,ahe=QF,she=ZF,ohe=tB,ihe=nB,lhe=rB,che=sB,uhe=iB,hg="DropdownMenu",[dhe]=hr(hg,[zF]),Or=zF(),[fhe,cB]=dhe(hg),uB=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]=pa({prop:s,defaultProp:o??!1,onChange:i,caller:hg});return a.jsx(fhe,{scope:t,triggerId:tr(),triggerRef:f,contentId:tr(),open:h,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(g=>!g),[p]),modal:c,children:a.jsx(Xpe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};uB.displayName=hg;var dB="DropdownMenuTrigger",fB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=cB(dB,n),i=Or(n);return a.jsx(Qpe,{asChild:!0,...i,children:a.jsx(Ge.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:Tr(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())})})})});fB.displayName=dB;var phe="DropdownMenuPortal",pB=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Or(t);return a.jsx(Jpe,{...r,...n})};pB.displayName=phe;var hB="DropdownMenuContent",mB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cB(hB,n),o=Or(n),i=m.useRef(!1);return a.jsx(Zpe,{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)"}})});mB.displayName=hB;var hhe="DropdownMenuGroup",mhe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(ehe,{...s,...r,ref:t})});mhe.displayName=hhe;var vhe="DropdownMenuLabel",vB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(the,{...s,...r,ref:t})});vB.displayName=vhe;var ghe="DropdownMenuItem",gB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(nhe,{...s,...r,ref:t})});gB.displayName=ghe;var xhe="DropdownMenuCheckboxItem",xB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(rhe,{...s,...r,ref:t})});xB.displayName=xhe;var yhe="DropdownMenuRadioGroup",bhe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(ahe,{...s,...r,ref:t})});bhe.displayName=yhe;var whe="DropdownMenuRadioItem",yB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(she,{...s,...r,ref:t})});yB.displayName=whe;var jhe="DropdownMenuItemIndicator",bB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(ohe,{...s,...r,ref:t})});bB.displayName=jhe;var She="DropdownMenuSeparator",wB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(ihe,{...s,...r,ref:t})});wB.displayName=She;var Nhe="DropdownMenuArrow",Che=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(lhe,{...s,...r,ref:t})});Che.displayName=Nhe;var _he="DropdownMenuSubTrigger",jB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(che,{...s,...r,ref:t})});jB.displayName=_he;var Ahe="DropdownMenuSubContent",SB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(uhe,{...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)"}})});SB.displayName=Ahe;var Ehe=uB,Phe=fB,khe=pB,NB=mB,CB=vB,_B=gB,AB=xB,EB=yB,PB=bB,kB=wB,TB=jB,OB=SB;const Hf=Ehe,Kf=Phe,The=m.forwardRef(({className:e,inset:t,children:n,...r},s)=>a.jsxs(TB,{ref:s,className:Se("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=TB.displayName;const Ohe=m.forwardRef(({className:e,...t},n)=>a.jsx(OB,{ref:n,className:Se("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}));Ohe.displayName=OB.displayName;const wu=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(khe,{children:a.jsx(NB,{ref:r,sideOffset:t,className:Se("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})}));wu.displayName=NB.displayName;const Kr=m.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(_B,{ref:r,className:Se("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}));Kr.displayName=_B.displayName;const Rhe=m.forwardRef(({className:e,children:t,checked:n,...r},s)=>a.jsxs(AB,{ref:s,className:Se("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(PB,{children:a.jsx(Cc,{className:"h-4 w-4"})})}),t]}));Rhe.displayName=AB.displayName;const Ihe=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(EB,{ref:r,className:Se("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(PB,{children:a.jsx(N7,{className:"h-2 w-2 fill-current"})})}),t]}));Ihe.displayName=EB.displayName;const RB=m.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(CB,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));RB.displayName=CB.displayName;const IB=m.forwardRef(({className:e,...t},n)=>a.jsx(kB,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));IB.displayName=kB.displayName;function wf(e,[t,n]){return Math.min(n,Math.max(t,e))}function Mhe(e){const t=$he(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(Lhe);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 $he(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=Bhe(s),c=Fhe(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Tr(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 Dhe=Symbol("radix.slottable");function Lhe(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Dhe}function Fhe(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 mg(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 zhe=[" ","Enter","ArrowUp","ArrowDown"],qhe=[" ","Enter"],ol="Select",[vg,gg,Uhe]=Sf(ol),[ju]=hr(ol,[Uhe,li]),xg=li(),[Whe,hi]=ju(ol),[Vhe,Hhe]=ju(ol),MB=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:g,required:x,form:j}=e,b=xg(t),[y,S]=m.useState(null),[C,N]=m.useState(null),[E,A]=m.useState(!1),P=bu(f),[T,O]=pa({prop:r,defaultProp:s??!1,onChange:o,caller:ol}),[$,z]=pa({prop:i,defaultProp:c,onChange:d,caller:ol}),U=m.useRef(null),B=y?j||!!y.closest("form"):!0,[V,q]=m.useState(new Set),I=Array.from(V).map(W=>W.props.value).join(";");return a.jsx(cv,{...b,children:a.jsxs(Whe,{required:x,scope:t,trigger:y,onTriggerChange:S,valueNode:C,onValueNodeChange:N,valueNodeHasChildren:E,onValueNodeHasChildrenChange:A,contentId:tr(),value:$,onValueChange:z,open:T,onOpenChange:O,dir:P,triggerPointerDownPosRef:U,disabled:g,children:[a.jsx(vg.Provider,{scope:t,children:a.jsx(Vhe,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(W=>{q(X=>new Set(X).add(W))},[]),onNativeOptionRemove:m.useCallback(W=>{q(X=>{const K=new Set(X);return K.delete(W),K})},[]),children:n})}),B?a.jsxs(sz,{"aria-hidden":!0,required:x,tabIndex:-1,name:h,autoComplete:p,value:$,onChange:W=>z(W.target.value),disabled:g,form:j,children:[$===void 0?a.jsx("option",{value:""}):null,Array.from(V)]},I):null]})})};MB.displayName=ol;var $B="SelectTrigger",DB=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=xg(n),i=hi($B,n),c=i.disabled||r,d=wt(t,i.onTriggerChange),f=gg(n),h=m.useRef("touch"),[p,g,x]=iz(b=>{const y=f().filter(N=>!N.disabled),S=y.find(N=>N.value===i.value),C=lz(y,b,S);C!==void 0&&i.onValueChange(C.value)}),j=b=>{c||(i.onOpenChange(!0),x()),b&&(i.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return a.jsx(_f,{asChild:!0,...o,children:a.jsx(Ge.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":oz(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&&g(b.key),!(y&&b.key===" ")&&zhe.includes(b.key)&&(j(),b.preventDefault())})})})});DB.displayName=$B;var LB="SelectValue",FB=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:i="",...c}=e,d=hi(LB,n),{onValueNodeHasChildrenChange:f}=d,h=o!==void 0,p=wt(t,d.onValueNodeChange);return nr(()=>{f(h)},[f,h]),a.jsx(Ge.span,{...c,ref:p,style:{pointerEvents:"none"},children:oz(d.value)?a.jsx(a.Fragment,{children:i}):o})});FB.displayName=LB;var Khe="SelectIcon",BB=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(Ge.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});BB.displayName=Khe;var Ghe="SelectPortal",zB=e=>a.jsx(vl,{asChild:!0,...e});zB.displayName=Ghe;var il="SelectContent",qB=m.forwardRef((e,t)=>{const n=hi(il,e.__scopeSelect),[r,s]=m.useState();if(nr(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?su.createPortal(a.jsx(UB,{scope:e.__scopeSelect,children:a.jsx(vg.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),o):null}return a.jsx(WB,{...e,ref:t})});qB.displayName=il;var Va=10,[UB,mi]=ju(il),Yhe="SelectContentImpl",Xhe=Mhe("SelectContent.RemoveScroll"),WB=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:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:y,...S}=e,C=hi(il,n),[N,E]=m.useState(null),[A,P]=m.useState(null),T=wt(t,H=>E(H)),[O,$]=m.useState(null),[z,U]=m.useState(null),B=gg(n),[V,q]=m.useState(!1),I=m.useRef(!1);m.useEffect(()=>{if(N)return jv(N)},[N]),bv();const W=m.useCallback(H=>{const[ue,...Q]=B().map(ae=>ae.ref.current),[Z]=Q.slice(-1),fe=document.activeElement;for(const ae of H)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},[B,A]),X=m.useCallback(()=>W([O,N]),[W,O,N]);m.useEffect(()=>{V&&X()},[V,X]);const{onOpenChange:K,triggerPointerDownPosRef:F}=C;m.useEffect(()=>{if(N){let H={x:0,y:0};const ue=Z=>{H={x:Math.abs(Math.round(Z.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(F.current?.y??0))}},Q=Z=>{H.x<=10&&H.y<=10?Z.preventDefault():N.contains(Z.target)||K(!1),document.removeEventListener("pointermove",ue),F.current=null};return F.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,K,F]),m.useEffect(()=>{const H=()=>K(!1);return window.addEventListener("blur",H),window.addEventListener("resize",H),()=>{window.removeEventListener("blur",H),window.removeEventListener("resize",H)}},[K]);const[J,D]=iz(H=>{const ue=B().filter(fe=>!fe.disabled),Q=ue.find(fe=>fe.ref.current===document.activeElement),Z=lz(ue,H,Q);Z&&setTimeout(()=>Z.ref.current.focus())}),R=m.useCallback((H,ue,Q)=>{const Z=!I.current&&!Q;(C.value!==void 0&&C.value===ue||Z)&&($(H),Z&&(I.current=!0))},[C.value]),ne=m.useCallback(()=>N?.focus(),[N]),te=m.useCallback((H,ue,Q)=>{const Z=!I.current&&!Q;(C.value!==void 0&&C.value===ue||Z)&&U(H)},[C.value]),de=r==="popper"?q1:VB,he=de===q1?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:y}:{};return a.jsx(UB,{scope:n,content:N,viewport:A,onViewportChange:P,itemRefCallback:R,selectedItem:O,onItemLeave:ne,itemTextRefCallback:te,focusSelectedItem:X,selectedItemText:z,position:r,isPositioned:V,searchRef:J,children:a.jsx(Pf,{as:Xhe,allowPinchZoom:!0,children:a.jsx(Ef,{asChild:!0,trapped:C.open,onMountAutoFocus:H=>{H.preventDefault()},onUnmountAutoFocus:Te(s,H=>{C.trigger?.focus({preventScroll:!0}),H.preventDefault()}),children:a.jsx(ml,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:H=>H.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:a.jsx(de,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:H=>H.preventDefault(),...S,...he,onPlaced:()=>q(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Te(S.onKeyDown,H=>{const ue=H.ctrlKey||H.altKey||H.metaKey;if(H.key==="Tab"&&H.preventDefault(),!ue&&H.key.length===1&&D(H.key),["ArrowUp","ArrowDown","Home","End"].includes(H.key)){let Z=B().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(H.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(H.key)){const fe=H.target,ae=Z.indexOf(fe);Z=Z.slice(ae+1)}setTimeout(()=>W(Z)),H.preventDefault()}})})})})})})});WB.displayName=Yhe;var Qhe="SelectItemAlignedPosition",VB=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=hi(il,n),i=mi(il,n),[c,d]=m.useState(null),[f,h]=m.useState(null),p=wt(t,T=>h(T)),g=gg(n),x=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 T=o.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),z=S.getBoundingClientRect();if(o.dir!=="rtl"){const fe=z.left-O.left,ae=$.left-fe,Oe=T.left-ae,we=T.width+Oe,Ye=Math.max(we,O.width),L=window.innerWidth-Va,ie=wf(ae,[Va,Math.max(Va,L-Ye)]);c.style.minWidth=we+"px",c.style.left=ie+"px"}else{const fe=O.right-z.right,ae=window.innerWidth-$.right-fe,Oe=window.innerWidth-T.right-ae,we=T.width+Oe,Ye=Math.max(we,O.width),L=window.innerWidth-Va,ie=wf(ae,[Va,Math.max(Va,L-Ye)]);c.style.minWidth=we+"px",c.style.right=ie+"px"}const U=g(),B=window.innerHeight-Va*2,V=b.scrollHeight,q=window.getComputedStyle(f),I=parseInt(q.borderTopWidth,10),W=parseInt(q.paddingTop,10),X=parseInt(q.borderBottomWidth,10),K=parseInt(q.paddingBottom,10),F=I+W+V+K+X,J=Math.min(y.offsetHeight*5,F),D=window.getComputedStyle(b),R=parseInt(D.paddingTop,10),ne=parseInt(D.paddingBottom,10),te=T.top+T.height/2-Va,de=B-te,he=y.offsetHeight/2,H=y.offsetTop+he,ue=I+W+H,Q=F-ue;if(ue<=te){const fe=U.length>0&&y===U[U.length-1].ref.current;c.style.bottom="0px";const ae=f.clientHeight-b.offsetTop-b.offsetHeight,Oe=Math.max(de,he+(fe?ne:0)+ae+X),we=ue+Oe;c.style.height=we+"px"}else{const fe=U.length>0&&y===U[0].ref.current;c.style.top="0px";const Oe=Math.max(te,I+b.offsetTop+(fe?R:0)+he)+Q;c.style.height=Oe+"px",b.scrollTop=ue-te+b.offsetTop}c.style.margin=`${Va}px 0`,c.style.minHeight=J+"px",c.style.maxHeight=B+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[g,o.trigger,o.valueNode,c,f,b,y,S,o.dir,r]);nr(()=>N(),[N]);const[E,A]=m.useState();nr(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const P=m.useCallback(T=>{T&&j.current===!0&&(N(),C?.(),j.current=!1)},[N,C]);return a.jsx(Zhe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:x,onScrollButtonChange:P,children:a.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:a.jsx(Ge.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});VB.displayName=Qhe;var Jhe="SelectPopperPosition",q1=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Va,...o}=e,i=xg(n);return a.jsx(uv,{...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=Jhe;var[Zhe,qC]=ju(il,{}),U1="SelectViewport",HB=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=mi(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(vg.Slot,{scope:n,children:a.jsx(Ge.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:g}=i;if(g?.current&&p){const x=Math.abs(d.current-h.scrollTop);if(x>0){const j=window.innerHeight-Va*2,b=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),S=Math.max(b,y);if(S<j){const C=S+x,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})})})]})});HB.displayName=U1;var KB="SelectGroup",[eme,tme]=ju(KB),nme=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=tr();return a.jsx(eme,{scope:n,id:s,children:a.jsx(Ge.div,{role:"group","aria-labelledby":s,...r,ref:t})})});nme.displayName=KB;var GB="SelectLabel",YB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=tme(GB,n);return a.jsx(Ge.div,{id:s.id,...r,ref:t})});YB.displayName=GB;var Km="SelectItem",[rme,XB]=ju(Km),QB=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...i}=e,c=hi(Km,n),d=mi(Km,n),f=c.value===r,[h,p]=m.useState(o??""),[g,x]=m.useState(!1),j=wt(t,C=>d.itemRefCallback?.(C,r,s)),b=tr(),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(rme,{scope:n,value:r,disabled:s,textId:b,isSelected:f,onItemTextChange:m.useCallback(C=>{p(N=>N||(C?.textContent??"").trim())},[]),children:a.jsx(vg.ItemSlot,{scope:n,value:r,disabled:s,textValue:h,children:a.jsx(Ge.div,{role:"option","aria-labelledby":b,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:j,onFocus:Te(i.onFocus,()=>x(!0)),onBlur:Te(i.onBlur,()=>x(!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===" "||(qhe.includes(C.key)&&S(),C.key===" "&&C.preventDefault())})})})})});QB.displayName=Km;var jd="SelectItemText",JB=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,i=hi(jd,n),c=mi(jd,n),d=XB(jd,n),f=Hhe(jd,n),[h,p]=m.useState(null),g=wt(t,S=>p(S),d.onItemTextChange,S=>c.itemTextRefCallback?.(S,d.value,d.disabled)),x=h?.textContent,j=m.useMemo(()=>a.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=f;return nr(()=>(b(j),()=>y(j)),[b,y,j]),a.jsxs(a.Fragment,{children:[a.jsx(Ge.span,{id:d.textId,...o,ref:g}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?su.createPortal(o.children,i.valueNode):null]})});JB.displayName=jd;var ZB="SelectItemIndicator",ez=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return XB(ZB,n).isSelected?a.jsx(Ge.span,{"aria-hidden":!0,...r,ref:t}):null});ez.displayName=ZB;var W1="SelectScrollUpButton",tz=m.forwardRef((e,t)=>{const n=mi(W1,e.__scopeSelect),r=qC(W1,e.__scopeSelect),[s,o]=m.useState(!1),i=wt(t,r.onScrollButtonChange);return nr(()=>{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(rz,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});tz.displayName=W1;var V1="SelectScrollDownButton",nz=m.forwardRef((e,t)=>{const n=mi(V1,e.__scopeSelect),r=qC(V1,e.__scopeSelect),[s,o]=m.useState(!1),i=wt(t,r.onScrollButtonChange);return nr(()=>{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(rz,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});nz.displayName=V1;var rz=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=mi("SelectScrollButton",n),i=m.useRef(null),c=gg(n),d=m.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return m.useEffect(()=>()=>d(),[d]),nr(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),a.jsx(Ge.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()})})}),ame="SelectSeparator",az=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(Ge.div,{"aria-hidden":!0,...r,ref:t})});az.displayName=ame;var H1="SelectArrow",sme=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=xg(n),o=hi(H1,n),i=mi(H1,n);return o.open&&i.position==="popper"?a.jsx(dv,{...s,...r,ref:t}):null});sme.displayName=H1;var ome="SelectBubbleInput",sz=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=m.useRef(null),o=wt(r,s),i=mg(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(Ge.select,{...n,style:{..._$,...n.style},ref:o,defaultValue:t})});sz.displayName=ome;function oz(e){return e===""||e===void 0}function iz(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 lz(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=ime(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 ime(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var lme=MB,cz=DB,cme=FB,ume=BB,dme=zB,uz=qB,fme=HB,dz=YB,fz=QB,pme=JB,hme=ez,pz=tz,hz=nz,mz=az;const jn=lme,Sn=cme,vn=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(cz,{ref:r,className:Se("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(ume,{asChild:!0,children:a.jsx(Yt,{className:"h-4 w-4 opacity-50"})})]}));vn.displayName=cz.displayName;const vz=m.forwardRef(({className:e,...t},n)=>a.jsx(pz,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(bs,{className:"h-4 w-4"})}));vz.displayName=pz.displayName;const gz=m.forwardRef(({className:e,...t},n)=>a.jsx(hz,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Yt,{className:"h-4 w-4"})}));gz.displayName=hz.displayName;const gn=m.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>a.jsx(dme,{children:a.jsxs(uz,{ref:s,className:Se("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(vz,{}),a.jsx(fme,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(gz,{})]})}));gn.displayName=uz.displayName;const mme=m.forwardRef(({className:e,...t},n)=>a.jsx(dz,{ref:n,className:Se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));mme.displayName=dz.displayName;const tt=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(fz,{ref:r,className:Se("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(hme,{children:a.jsx(Cc,{className:"h-4 w-4"})})}),a.jsx(pme,{children:t})]}));tt.displayName=fz.displayName;const vme=m.forwardRef(({className:e,...t},n)=>a.jsx(mz,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));vme.displayName=mz.displayName;const Vo=e=>e.configName?.trim()||e.name,gme="(root)",xz="__ROOT__",$M="mcplab.configurations.collapsedSuites",$j=e=>e.suitePath&&e.suitePath.trim().length>0?e.suitePath.trim():null,Ii=e=>e??gme,Dj=e=>e===null?xz:`suite:${e}`,xme=e=>e===xz?null:e.startsWith("suite:")?e.slice(6):null,yme=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},bme=e=>yme([e]),wme=e=>{const t=bme(e);return t?{href:`/results?scenario=${encodeURIComponent(t)}`,tooltipLabel:`Open results filtered by scenario ${t}`}:{href:"/results",tooltipLabel:"Open results"}},DM=["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 jme(e){if(e===null)return"bg-slate-400";const t=e.split("").reduce((n,r)=>(n+r.charCodeAt(0))%DM.length,0);return DM[t]??"bg-slate-400"}const Sme=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:s}=Rf(),{source:o}=Dn(),i=Ia(),[c,d]=m.useState("name"),[f,h]=m.useState("asc"),[p,g]=m.useState(""),[x,j]=m.useState("all"),[b,y]=m.useState(()=>{try{const D=window.localStorage.getItem($M);if(!D)return new Set;const R=JSON.parse(D);return Array.isArray(R)?new Set(R.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,P]=m.useState(new Set),T=p.trim().toLowerCase(),O=D=>{if(c===D){h(R=>R==="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,R)=>{await t(D),Ae({title:"Deleted",description:`"${R}" has been removed.`})},z=async D=>{const R=await n(D);Ae({title:"Cloned",description:`Created "${Vo(R)}".`}),i(`/mcp-evaluations/${R.id}`)},U=D=>D.agentEntries?.length??D.agents?.length??0,B=D=>D.scenarioEntries?.length??D.scenarios?.length??0,V=m.useMemo(()=>{const D=new Set;for(const R of e)D.add($j(R));return Array.from(D).sort((R,ne)=>Ii(R).localeCompare(Ii(ne)))},[e]),q=m.useMemo(()=>e.filter(D=>{const R=$j(D),ne=x==="all"?void 0:xme(x),te=Ii(R);return ne!==void 0&&R!==ne?!1:T.length===0?!0:[Vo(D),D.id,D.description??"",D.loadError??"",te,D.relativePath??""].join(" ").toLowerCase().includes(T)}),[e,T,x]),I=m.useMemo(()=>[...q].sort((R,ne)=>{let te=0;return c==="name"&&(te=Vo(R).localeCompare(Vo(ne))),c==="scenarios"&&(te=B(R)-B(ne)),c==="agents"&&(te=U(R)-U(ne)),c==="updatedAt"&&(te=new Date(R.updatedAt).getTime()-new Date(ne.updatedAt).getTime()),f==="asc"?te:-te}),[q,c,f]),W=D=>c!==D?a.jsx(mc,{className:"h-3.5 w-3.5 text-muted-foreground"}):f==="asc"?a.jsx(bs,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}),X=D=>{y(R=>{const ne=new Set(R);return ne.has(D)?ne.delete(D):ne.add(D),ne})},K=async(D,R,ne)=>{if(!N.has(D)){E(te=>new Set(te).add(D));try{await o.startRun({configPath:R,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($M,JSON.stringify(Array.from(b)))}catch(D){console.warn("Failed to persist collapsed suites to localStorage (quota/private mode?)",D)}},[b]);const F=async(D,R,ne)=>{if(!A.has(D)){P(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 "${R}" 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,H=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:H===0?"Suite queued":"Suite queued with errors",description:H===0?`Queued ${he} evaluation${he===1?"":"s"} for suite "${R}".`:`Queued ${he}/${te.length} evaluations for suite "${R}" (${H} failed${Q?`: ${Q}`:""}).`,variant:H===0?"default":"destructive"})}catch(te){Ae({title:"Could not queue suite",description:te instanceof Error?te.message:String(te),variant:"destructive"})}finally{P(te=>{const de=new Set(te);return de.delete(D),de})}}},J=m.useMemo(()=>{const D=new Map;for(const R of I){const ne=$j(R),te=D.get(ne);te?te.push(R):D.set(ne,[R])}return Array.from(D.entries()).sort((R,ne)=>Ii(R[0]).localeCompare(Ii(ne[0])))},[I]);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(J$,{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:g,placeholder:"Search evaluations..."}),a.jsxs(jn,{value:x,onValueChange:j,children:[a.jsx(vn,{className:"h-9 w-[200px]",children:a.jsx(Sn,{placeholder:"All suites"})}),a.jsxs(gn,{children:[a.jsx(tt,{value:"all",children:"All suites"}),V.map(D=>a.jsx(tt,{value:Dj(D),children:Ii(D)},Dj(D)))]})]}),a.jsxs(se,{variant:"outline",size:"sm",onClick:()=>{s()},children:[a.jsx(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(se,{variant:"outline",size:"sm",children:[a.jsx(L7,{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(so,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),a.jsx(ze,{children:a.jsx(qe,{className:"p-0",children:a.jsxs(Ur,{children:[a.jsx(Wr,{children:a.jsxs(Kt,{children:[a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>O("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:()=>O("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:()=>O("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:()=>O("updatedAt"),children:["Last Updated",W("updatedAt")]})}),a.jsx(at,{className:"w-[220px] text-right"})]})}),a.jsxs(Vr,{children:[J.map(([D,R])=>{const ne=Ii(D),te=Dj(D),de=b.has(te),he=A.has(te);return a.jsxs(m.Fragment,{children:[a.jsx(Kt,{className:"bg-muted/40 hover:bg-muted/40",children:a.jsx(Be,{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 ${jme(D)}`,"aria-hidden":"true"}),D===null?a.jsx(P7,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}):a.jsx(A7,{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:["(",R.length,")"]})]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:he,onClick:()=>{F(te,ne,R)},children:[a.jsx(Zs,{className:"mr-1 h-3.5 w-3.5"}),he?"Queueing...":"Run Suite"]})]})})},`suite-${te}`),!de&&R.map(H=>{const ue=wme(H);return a.jsxs(Kt,{children:[a.jsx(Be,{children:a.jsxs("div",{children:[a.jsx(_t,{to:`/mcp-evaluations/${H.id}`,className:"font-medium text-sm hover:text-primary",children:Vo(H)}),H.loadError&&a.jsxs(We,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[a.jsx(Eh,{className:"mr-1 h-3 w-3"}),"Broken"]}),H.relativePath&&a.jsx("div",{className:"mt-0.5",children:a.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:H.relativePath})}),H.loadError&&a.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:H.loadError})]})}),a.jsx(Be,{className:"text-right font-mono text-sm",children:B(H)}),a.jsx(Be,{className:"text-right font-mono text-sm",children:U(H)}),a.jsx(Be,{className:"text-right text-xs text-muted-foreground",children:a.jsxs("div",{className:"inline-flex items-center gap-1",children:[a.jsx(po,{className:"h-3 w-3"}),new Date(H.updatedAt).toLocaleDateString()]})}),a.jsx(Be,{className:"w-[220px] whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsxs(Hf,{children:[a.jsx(Kf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(nv,{className:"h-4 w-4"})})}),a.jsxs(wu,{align:"end",children:[a.jsxs(Kr,{onClick:()=>i(`/mcp-evaluations/${H.id}`),children:[a.jsx(rv,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),a.jsxs(Kr,{onClick:()=>{z(H.id)},children:[a.jsx(Cs,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),a.jsxs(Kr,{className:"text-destructive",onClick:()=>{$(H.id,Vo(H))},children:[a.jsx(Oa,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]}),a.jsx(ni,{children:a.jsxs(ri,{children:[a.jsx(ai,{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(Nc,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"sr-only",children:ue.tooltipLabel})]})})}),a.jsx(lo,{children:ue.tooltipLabel})]})}),a.jsx(ni,{children:a.jsxs(ri,{children:[a.jsx(ai,{asChild:!0,children:a.jsx(se,{size:"sm",variant:"outline",className:`h-8 px-2 text-xs ${S.has(H.id)?"border-green-600 bg-green-600 text-white hover:bg-green-700 hover:text-white":""}`,disabled:N.has(H.id)||!H.sourcePath,onClick:()=>H.sourcePath&&void K(H.id,H.sourcePath,Vo(H)),"aria-label":`Queue ${Vo(H)}`,children:S.has(H.id)?"Queued":N.has(H.id)?"Queueing...":a.jsxs(a.Fragment,{children:[a.jsx(O7,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"sr-only",children:"Queue evaluation"})]})})}),a.jsx(lo,{children:"Queue evaluation run"})]})}),a.jsx(se,{size:"sm",variant:"outline",asChild:!0,children:a.jsxs(_t,{to:`/run?configId=${encodeURIComponent(H.id)}`,children:[a.jsx(Zs,{className:"h-3.5 w-3.5"}),"Run"]})})]})})]},H.id)})]},`suite-group-${te}`)}),!r&&e.length===0&&a.jsx(Kt,{children:a.jsx(Be,{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&&I.length===0&&a.jsx(Kt,{children:a.jsx(Be,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations match this filter."})}),r&&a.jsx(Kt,{children:a.jsx(Be,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Nme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cme=Nme.reduce((e,t)=>{const n=yv(`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}},{}),_me="Label",yz=m.forwardRef((e,t)=>a.jsx(Cme.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));yz.displayName=_me;var bz=yz;const Ame=gl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),$e=m.forwardRef(({className:e,...t},n)=>a.jsx(bz,{ref:n,className:Se(Ame(),e),...t}));$e.displayName=bz.displayName;const ks=m.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:Se("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}));ks.displayName="Textarea";var yg="Switch",[Eme]=hr(yg),[Pme,kme]=Eme(yg),wz=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,[g,x]=m.useState(null),j=wt(t,N=>x(N)),b=m.useRef(!1),y=g?h||!!g.closest("form"):!0,[S,C]=pa({prop:s,defaultProp:o??!1,onChange:f,caller:yg});return a.jsxs(Pme,{scope:n,checked:S,disabled:c,children:[a.jsx(Ge.button,{type:"button",role:"switch","aria-checked":S,"aria-required":i,"data-state":Cz(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(Nz,{control:g,bubbles:!b.current,name:r,value:d,checked:S,required:i,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});wz.displayName=yg;var jz="SwitchThumb",Sz=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=kme(jz,n);return a.jsx(Ge.span,{"data-state":Cz(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});Sz.displayName=jz;var Tme="SwitchBubbleInput",Nz=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const i=m.useRef(null),c=wt(i,o),d=mg(n),f=lv(t);return m.useEffect(()=>{const h=i.current;if(!h)return;const p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&x){const j=new Event("click",{bubbles:r});x.call(h,n),h.dispatchEvent(j)}},[d,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Nz.displayName=Tme;function Cz(e){return e?"checked":"unchecked"}var _z=wz,Ome=Sz;const Gm=m.forwardRef(({className:e,...t},n)=>a.jsx(_z,{className:Se("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(Ome,{className:Se("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")})}));Gm.displayName=_z.displayName;var bg="Tabs",[Rme]=hr(bg,[dg]),Az=dg(),[Ime,UC]=Rme(bg),Ez=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=bu(c),[p,g]=pa({prop:r,onChange:s,defaultProp:o??"",caller:bg});return a.jsx(Ime,{scope:n,baseId:tr(),value:p,onValueChange:g,orientation:i,dir:h,activationMode:d,children:a.jsx(Ge.div,{dir:h,"data-orientation":i,...f,ref:t})})});Ez.displayName=bg;var Pz="TabsList",kz=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=UC(Pz,n),i=Az(n);return a.jsx(LF,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:a.jsx(Ge.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});kz.displayName=Pz;var Tz="TabsTrigger",Oz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,i=UC(Tz,n),c=Az(n),d=Mz(i.baseId,r),f=$z(i.baseId,r),h=r===i.value;return a.jsx(FF,{asChild:!0,...c,focusable:!s,active:h,children:a.jsx(Ge.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)})})})});Oz.displayName=Tz;var Rz="TabsContent",Iz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...i}=e,c=UC(Rz,n),d=Mz(c.baseId,r),f=$z(c.baseId,r),h=r===c.value,p=m.useRef(h);return m.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),a.jsx(Gn,{present:s||h,children:({present:g})=>a.jsx(Ge.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&o})})});Iz.displayName=Rz;function Mz(e,t){return`${e}-trigger-${t}`}function $z(e,t){return`${e}-content-${t}`}var Mme=Ez,Dz=kz,Lz=Oz,Fz=Iz;const wg=Mme,Gf=m.forwardRef(({className:e,...t},n)=>a.jsx(Dz,{ref:n,className:Se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Gf.displayName=Dz.displayName;const Ns=m.forwardRef(({className:e,...t},n)=>a.jsx(Lz,{ref:n,className:Se("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}));Ns.displayName=Lz.displayName;const jf=m.forwardRef(({className:e,...t},n)=>a.jsx(Fz,{ref:n,className:Se("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));jf.displayName=Fz.displayName;const $me={openai:"OpenAI",anthropic:"Anthropic",azure:"Azure OpenAI",azure_openai:"Azure OpenAI",google:"Google"};function Ym(e){return $me[e]??e}const LM={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 Bz({provider:e}){return a.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${LM[e]??LM.custom}`,children:Ym(e)})}var jg="Collapsible",[Dme]=hr(jg),[Lme,WC]=Dme(jg),zz=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:i,...c}=e,[d,f]=pa({prop:r,defaultProp:s??!1,onChange:i,caller:jg});return a.jsx(Lme,{scope:n,disabled:o,contentId:tr(),open:d,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),children:a.jsx(Ge.div,{"data-state":HC(d),"data-disabled":o?"":void 0,...c,ref:t})})});zz.displayName=jg;var qz="CollapsibleTrigger",Uz=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=WC(qz,n);return a.jsx(Ge.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)})});Uz.displayName=qz;var VC="CollapsibleContent",Wz=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(Fme,{...r,ref:t,present:o})})});Wz.displayName=VC;var Fme=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),g=p.current,x=m.useRef(0),j=x.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)},[]),nr(()=>{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,x.current=N.width,y.current||(C.style.transitionDuration=S.current.transitionDuration,C.style.animationName=S.current.animationName),d(r)}},[i.open,r]),a.jsx(Ge.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":g?`${g}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=zz;const Ya=Bme,_a=Uz,Xa=Wz;function Ta({text:e,variant:t="assistant",className:n}){const r=zme(e);return a.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs",n),children:r.map((s,o)=>a.jsx(m.Fragment,{children:qme(s,o,t)},`md-${o}`))})}function zme(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 g=c.replace(/^```/,"").trim()||void 0;r+=1;const x=[];for(;r<t.length&&!o(t[r]);)x.push(t[r]),r+=1;r<t.length&&o(t[r])&&(r+=1),n.push({type:"code",lang:g,code:x.join(`
123
- `)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const g=[];for(;r<t.length&&t[r].trim().startsWith(">");)g.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:g.join(`
124
- `)});continue}const d=c.match(/^(#{1,4})\s+(.+)$/);if(d){n.push({type:"heading",level:d[1].length,text:d[2].trim()}),r+=1;continue}if(FM(t,r)){const g=BM(t[r]);r+=2;const x=[];for(;r<t.length&&t[r].includes("|")&&!s(t[r]);)x.push(BM(t[r])),r+=1;n.push({type:"table",headers:g,rows:x});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const g=!!f,x=[];for(;r<t.length;){const j=t[r].trim();if(g?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){x.push(j.replace(g?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}s(t[r])&&(r+=1);break}n.push({type:"list",ordered:g,items:x});continue}const p=[i];for(r+=1;r<t.length;){const g=t[r],x=g.trim();if(s(g)||o(g)||/^---+$/.test(x)||/^#{1,4}\s+/.test(x)||x.startsWith(">")||FM(t,r)||/^\d+\.\s+/.test(x)||/^[-*+]\s+/.test(x))break;p.push(g),r+=1}n.push({type:"paragraph",text:p.join(`
125
- `)})}return n}function FM(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 qme(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:rc(e.text,`${t}-h`)})}if(e.type==="paragraph")return a.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:rc(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:rc(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:Se("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((s,o)=>a.jsx("li",{className:"leading-relaxed",children:rc(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:rc(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:rc(o,`${t}-tdc-${s}-${i}`)},`${t}-td-${s}-${i}`))},`${t}-row-${s}`))})]})}):null}function rc(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 Vz({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:Se("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(Qa,{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:Se("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(Ta,{text:e.text,variant:"assistant"})})]});const o=s==="user",i=o?_c:kr;return a.jsxs("div",{className:Se(`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(Ta,{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(_c,{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:Se("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(Qa,{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(Ta,{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 Hz(){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(jr,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]})}function Ume({snippets:e,snippetsLabel:t,onSnippetSelect:n,disabled:r=!1,contentClassName:s="w-[360px]"}){return a.jsxs(Hf,{children:[a.jsx(Kf,{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(so,{className:"h-3 w-3"}),"Snippets",a.jsx(Yt,{className:"h-3 w-3"})]})}),a.jsxs(wu,{align:"start",className:s,children:[a.jsx(RB,{children:t}),a.jsx(IB,{}),e.map(o=>a.jsx(Kr,{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 Kz({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(ks,{ref:f,value:e,onChange:g=>t(g.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:g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),p||n())}}),a.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[a.jsx(Ume,{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(jr,{className:"h-4 w-4 animate-spin"}):a.jsx($7,{className:"h-4 w-4"})})]})]})}const Wme=Nv,Vme=Cv,Gz=m.forwardRef(({className:e,...t},n)=>a.jsx(du,{ref:n,className:Se("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}));Gz.displayName=du.displayName;const Yz=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Vme,{children:[a.jsx(Gz,{}),a.jsxs(fu,{ref:r,className:Se("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(_v,{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(_s,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Yz.displayName=fu.displayName;const Xz=({className:e,...t})=>a.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Xz.displayName="DialogHeader";const Qz=m.forwardRef(({className:e,...t},n)=>a.jsx(kf,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",e),...t}));Qz.displayName=kf.displayName;const Jz=m.forwardRef(({className:e,...t},n)=>a.jsx(Tf,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Jz.displayName=Tf.displayName;function Hme(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var KC="ScrollArea",[Zz]=hr(KC),[Kme,$a]=Zz(KC),e8=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,g]=m.useState(null),[x,j]=m.useState(null),[b,y]=m.useState(null),[S,C]=m.useState(0),[N,E]=m.useState(0),[A,P]=m.useState(!1),[T,O]=m.useState(!1),$=wt(t,U=>d(U)),z=bu(s);return a.jsx(Kme,{scope:n,type:r,dir:z,scrollHideDelay:o,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:g,scrollbarX:x,onScrollbarXChange:j,scrollbarXEnabled:A,onScrollbarXEnabledChange:P,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:T,onScrollbarYEnabledChange:O,onCornerWidthChange:C,onCornerHeightChange:E,children:a.jsx(Ge.div,{dir:z,...i,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});e8.displayName=KC;var t8="ScrollAreaViewport",n8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,i=$a(t8,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(Ge.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})})]})});n8.displayName=t8;var $s="ScrollAreaScrollbar",GC=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=$a($s,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(Gme,{...r,ref:t,forceMount:n}):s.type==="scroll"?a.jsx(Yme,{...r,ref:t,forceMount:n}):s.type==="auto"?a.jsx(r8,{...r,ref:t,forceMount:n}):s.type==="always"?a.jsx(YC,{...r,ref:t}):null});GC.displayName=$s;var Gme=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=$a($s,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(r8,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Yme=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=$a($s,e.__scopeScrollArea),o=e.orientation==="horizontal",i=Ng(()=>d("SCROLL_END"),100),[c,d]=Hme("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 g=()=>{const x=f[h];p!==x&&(d("SCROLL"),i()),p=x};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[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"))})})}),r8=m.forwardRef((e,t)=>{const n=$a($s,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,i]=m.useState(!1),c=e.orientation==="horizontal",d=Ng(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;i(c?f:h)}},10);return tu(n.viewport,d),tu(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($s,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=l8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:g=>i.current=g};function p(g,x){return tve(g,i.current,c,x)}return n==="horizontal"?a.jsx(Xme,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const g=s.viewport.scrollLeft,x=zM(g,c,s.dir);o.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=p(g,s.dir))}}):n==="vertical"?a.jsx(Qme,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const g=s.viewport.scrollTop,x=zM(g,c);o.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=p(g))}}):null}),Xme=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=$a($s,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(s8,{"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":Sg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(o.viewport){const g=o.viewport.scrollLeft+h.deltaX;e.onWheelScroll(g),u8(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Qm(i.paddingLeft),paddingEnd:Qm(i.paddingRight)}})}})}),Qme=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=$a($s,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(s8,{"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":Sg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(o.viewport){const g=o.viewport.scrollTop+h.deltaY;e.onWheelScroll(g),u8(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Qm(i.paddingTop),paddingEnd:Qm(i.paddingBottom)}})}})}),[Jme,a8]=Zz($s),s8=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,...g}=e,x=$a($s,n),[j,b]=m.useState(null),y=wt(t,$=>b($)),S=m.useRef(null),C=m.useRef(""),N=x.viewport,E=r.content-r.viewport,A=Wn(h),P=Wn(d),T=Ng(p,10);function O($){if(S.current){const z=$.clientX-S.current.left,U=$.clientY-S.current.top;f({x:z,y:U})}}return m.useEffect(()=>{const $=z=>{const U=z.target;j?.contains(U)&&A(z,E)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[N,j,E,A]),m.useEffect(P,[r,P]),tu(j,T),tu(x.content,T),a.jsx(Jme,{scope:n,scrollbar:j,hasThumb:s,onThumbChange:Wn(o),onThumbPointerUp:Wn(i),onThumbPositionChange:P,onThumbPointerDown:Wn(c),children:a.jsx(Ge.div,{...g,ref:y,style:{position:"absolute",...g.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",x.viewport&&(x.viewport.style.scrollBehavior="auto"),O($))}),onPointerMove:Te(e.onPointerMove,O),onPointerUp:Te(e.onPointerUp,$=>{const z=$.target;z.hasPointerCapture($.pointerId)&&z.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=C.current,x.viewport&&(x.viewport.style.scrollBehavior=""),S.current=null})})})}),Xm="ScrollAreaThumb",o8=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=a8(Xm,e.__scopeScrollArea);return a.jsx(Gn,{present:n||s.hasThumb,children:a.jsx(Zme,{ref:t,...r})})}),Zme=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=$a(Xm,n),i=a8(Xm,n),{onThumbPositionChange:c}=i,d=wt(t,p=>i.onThumbChange(p)),f=m.useRef(void 0),h=Ng(()=>{f.current&&(f.current(),f.current=void 0)},100);return m.useEffect(()=>{const p=o.viewport;if(p){const g=()=>{if(h(),!f.current){const x=nve(p,c);f.current=x,c()}};return c(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[o.viewport,h,c]),a.jsx(Ge.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 x=p.target.getBoundingClientRect(),j=p.clientX-x.left,b=p.clientY-x.top;i.onThumbPointerDown({x:j,y:b})}),onPointerUp:Te(e.onPointerUp,i.onThumbPointerUp)})});o8.displayName=Xm;var XC="ScrollAreaCorner",i8=m.forwardRef((e,t)=>{const n=$a(XC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(eve,{...e,ref:t}):null});i8.displayName=XC;var eve=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 tu(s.scrollbarX,()=>{const h=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(h),d(h)}),tu(s.scrollbarY,()=>{const h=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(h),i(h)}),f?a.jsx(Ge.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 Qm(e){return e?parseInt(e,10):0}function l8(e,t){const n=e/t;return isNaN(n)?0:n}function Sg(e){const t=l8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function tve(e,t,n,r="ltr"){const s=Sg(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 c8([d,f],p)(e)}function zM(e,t,n="ltr"){const r=Sg(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=wf(e,d);return c8([0,i],[0,c])(f)}function c8(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 u8(e,t){return e>0&&e<t}var nve=(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 Ng(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 tu(e,t){const n=Wn(t);nr(()=>{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 d8=e8,rve=n8,ave=i8;const QC=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(d8,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[a.jsx(rve,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(f8,{}),a.jsx(ave,{})]}));QC.displayName=d8.displayName;const f8=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>a.jsx(GC,{ref:r,orientation:t,className:Se("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(o8,{className:"relative flex-1 rounded-full bg-border"})}));f8.displayName=GC.displayName;async function sve(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 ove=250;async function ao(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 g of h.servers){const x=`${g.status}:${g.debugState??""}:${g.runtimeSessionId??""}`;f.get(g.serverName)!==x&&(f.set(g.serverName,x),s?.({serverName:g.serverName,status:g.status,debugState:g.debugState,tokenExpiresAt:g.tokenExpiresAt,tokenExpiresInSeconds:g.tokenExpiresInSeconds,message:g.message}))}const p=h.servers.filter(g=>g.status==="auth_required");if(p.length===0&&h.allReady)return;for(const g of p){const x=g.runtimeSessionId;if(!x)throw new Error(g.message||`OAuth login required for '${g.serverName}'.`);d.has(x)||(d.add(x),r?.(g.serverName));const j=(()=>{let 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(g.authorizeLaunchUrl||g.authorizationUrl||""),await sve({sessionId:x,source:n,serverName:g.serverName,onLaunchUrl:j,timeoutMs:Math.max(1e4,c-Date.now())})}await new Promise(g=>{window.setTimeout(g,ove)})}throw new Error("OAuth login timed out before all required servers were authorized.")}const ive=[{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 lve({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(),[g,x]=m.useState(null),[j,b]=m.useState(null),[y,S]=m.useState(""),[C,N]=m.useState(!1),[E,A]=m.useState(new Set),P=m.useRef(null),T=m.useRef(null),O=m.useRef(null),[$,z]=m.useState(!1),U=m.useRef(!1),B=d||o[0]?.id||"";m.useEffect(()=>{if(!e||!B||g)return;let H=!1;return N(!0),(async()=>{const Q=Array.from(new Set(s.serverIds.filter(fe=>i.find(Oe=>Oe.id===fe)?.authType==="oauth2")));await ao({serverNames:Q,source:p});const Z=await p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:s.id,selectedAssistantAgentName:B,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}))}});H||(x(Z.sessionId),q(Z.session))})().catch(Q=>{H||Ae({title:"Could not start Scenario Assistant",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}).finally(()=>{H||N(!1)}),()=>{H=!0}},[e,p,g,n,r,s,c,o,i,B]);const V=()=>{x(null),b(null),S(""),A(new Set),O.current=null},q=m.useCallback(H=>{b(ue=>ue&&ue.messages.length>H.messages.length?ue:H)},[]),I=H=>{V(),p.closeScenarioAssistantSession(H).catch(()=>{})};m.useEffect(()=>{e||g&&(U.current||$||I(g))},[e,g,p,$]),m.useEffect(()=>()=>{g&&p.closeScenarioAssistantSession(g).catch(()=>{})},[g,p]),m.useEffect(()=>{if(!e)return;$&&z(!1),U.current&&(U.current=!1);const H=window.setTimeout(()=>{P.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(H)},[e,C,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),m.useEffect(()=>{const H=T.current;if(!H)return;H.style.height="0px";const ue=Math.min(H.scrollHeight,160);H.style.height=`${Math.max(40,ue)}px`},[y,e]);const W=o.length>0&&s.serverIds.length>0&&!!B,X=async H=>{if(!g)return;const ue=H.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(g,ue);q(fe.session)}catch(fe){b(ae=>ae&&{...ae,messages:ae.messages.filter(Oe=>Oe.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)}},K=H=>{S(H),requestAnimationFrame(()=>T.current?.focus())};m.useEffect(()=>{if(!e||!g||!j||!W||C)return;const H=String(f??"").trim();H&&O.current!==H&&(O.current=H,X(H))},[e,g,j,W,C,f]),m.useEffect(()=>{if(!(!e||!g||!j))return p.subscribeScenarioAssistantSessionEvents(g,H=>{q(H.payload.session)})},[e,g,p,q]);const F=async H=>{if(g){N(!0);try{const ue=await p.approveScenarioAssistantToolCall(g,H);q(ue.session)}catch(ue){Ae({title:"Tool call failed",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{N(!1)}}},J=async H=>{if(g){N(!0);try{const ue=await p.denyScenarioAssistantToolCall(g,H);q(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(g){N(!0);try{const H=await p.approveAllScenarioAssistantToolCalls(g);q(H.session)}catch(H){Ae({title:"Could not approve all tool calls",description:H instanceof Error?H.message:String(H),variant:"destructive"})}finally{N(!1)}}},R=(H,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}}),H){const fe=`${H}:${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 H=document.activeElement;H instanceof HTMLElement&&H.blur()},te=H=>{H||(ne(),z(!1),U.current=!1),t(H)},de=()=>{ne(),U.current=!0,z(!0),t(!1)},he=()=>{ne(),U.current=!1,z(!1),g&&I(g)};return a.jsxs(a.Fragment,{children:[!e&&g&&a.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 rounded-md border bg-background px-3 py-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm font-medium",children:"Scenario Assistant (session active)"}),a.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:["Resume conversation for ",a.jsx("span",{className:"font-mono",children:s.id}),j?` · ${j.messages.length} messages`:""]})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsxs(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(_s,{className:"h-4 w-4"})})]})]}),a.jsx(Wme,{open:e,onOpenChange:te,children:a.jsxs(Yz,{className:"max-w-6xl h-[85vh] flex flex-col",children:[g&&a.jsxs("button",{type:"button",className:"absolute right-12 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:de,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[a.jsx(R7,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Minimize"})]}),a.jsx(Xz,{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(Qz,{className:"flex items-center gap-2",children:[a.jsx(zr,{className:"h-4 w-4"}),"Scenario Assistant"]}),a.jsx(Jz,{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($e,{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(Qa,{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((H,ue)=>a.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:H},`${H}-${ue}`)),j?.messages.map(H=>a.jsxs(m.Fragment,{children:[(()=>{const ue=H.pendingToolCallIds??(H.pendingToolCallId?[H.pendingToolCallId]:[]),Q=ue.map(we=>(j?.pendingToolCalls??[]).find(Ye=>Ye.id===we)).filter(we=>!!we),Z=ue.map(we=>j.pendingToolCalls.find(Ye=>Ye.id===we)??j.pendingToolCalls.find(Ye=>Ye.id===we)).filter(Boolean);if(!(H.role==="assistant"&&ue.length>0))return a.jsx("div",{className:"space-y-2",children:a.jsx(cve,{message:H})});const ae=Q.length,Oe=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:[Oe," 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((we,Ye)=>a.jsx(K1,{call:we,loading:C,description:Ye===0?H.text:void 0,onApprove:L=>{F(L)},onDeny:L=>{J(L)}},we.id))]})]})})(),H.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"]}),H.suggestions.prompt&&a.jsx(Sh,{title:"Prompt",rationale:H.suggestions.prompt.rationale,preview:H.suggestions.prompt.replacement,applied:E.has(`${H.id}:prompt`),onApply:()=>R(H.id,H.suggestions,"prompt")}),H.suggestions.evalRules&&a.jsx(Sh,{title:"Checks",rationale:H.suggestions.evalRules.rationale,preview:JSON.stringify(H.suggestions.evalRules.replacement,null,2),applied:E.has(`${H.id}:evalRules`),onApply:()=>R(H.id,H.suggestions,"evalRules")}),H.suggestions.extractRules&&a.jsx(Sh,{title:"Value Capture Rules",rationale:H.suggestions.extractRules.rationale,preview:JSON.stringify(H.suggestions.extractRules.replacement,null,2),applied:E.has(`${H.id}:extractRules`),onApply:()=>R(H.id,H.suggestions,"extractRules")}),H.suggestions.snapshotEval&&a.jsx(Sh,{title:"Snapshot Settings",rationale:H.suggestions.snapshotEval.rationale,preview:JSON.stringify(H.suggestions.snapshotEval.patch,null,2),applied:E.has(`${H.id}:snapshotEval`),onApply:()=>R(H.id,H.suggestions,"snapshotEval")}),(()=>{const ue=H.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},`${H.id}-note-${fe}`))})]})})()]})]},H.id)),(j?.pendingToolCalls??[]).filter(H=>!(j?.messages??[]).some(ue=>ue.pendingToolCallId===H.id||ue.pendingToolCallIds?.includes(H.id))).map(H=>a.jsx(K1,{call:H,loading:C,onApprove:ue=>{F(ue)},onDeny:ue=>{J(ue)}},H.id)),!j&&C&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(jr,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&C&&a.jsx(Hz,{}),a.jsx("div",{ref:P})]})}),a.jsx(Kz,{input:y,onInputChange:S,onSend:()=>{X(y)},inputPlaceholder:"Get assistance with creating or refining this scenario ...",snippets:ive,snippetsLabel:"Scenario Assistant Snippets",onSnippetSelect:K,loading:C,disabled:!g,inputRef:T,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 Sh({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(Xo,{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 cve({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(Vz,{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(Cs,{className:"h-3.5 w-3.5"})}):void 0})}function ra(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 uve({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(Ya,{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(Xa,{children:a.jsx(Y1,{text:e.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),a.jsx(Ya,{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(Xa,{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(dve,{item:i,fallbackUserPrompt:t},i.id))})})]})})]})}function dve({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=qM(e,"input");return a.jsx(WM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=qM(e,"output"),f=e.ok?a.jsx(Xo,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):a.jsx(vc,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return a.jsx(WM,{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=UM(e.text,e.kind),s=t?UM(t,"user_prompt"):"",o=n&&!r&&s?s:r,i=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?_c: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 qM(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · estimated ${ra(n)} tokens`}function UM(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 WM({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(Ya,{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(Qa,{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(Xa,{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(Ta,{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 fve="mcplab.feature.";function Cg(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${fve}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const pve=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function X1({scenarios:e,scenarioOrigins:t,agents:n,servers:r,configId:s,configPath:o,defaultAssistantAgentName:i,assistantInitialPromptByScenarioId:c,assistantAutoOpenNonceByScenarioId:d,snapshotEval:f,onChange:h,readOnly:p,allowAdd:g=!p,allowStructureEdits:x=!p}){const j=(C,N)=>{const E=e.map((A,P)=>P===C?{...A,...N}:A);h(E)},b=C=>h(e.filter((N,E)=>E!==C)),y=()=>h([...e,pve()]),S=(C,N)=>{const E=C+N;if(E<0||E>=e.length)return;const A=[...e],[P]=A.splice(C,1);A.splice(E,0,P),h(A)};return a.jsxs("div",{className:p?"space-y-2":"space-y-4",children:[!p&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-semibold",children:"Scenarios"}),g&&x&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:y,children:[a.jsx(so,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((C,N)=>a.jsx(hve,{scenario:C,scenarioOrigin:t?.[N],index:N,total:e.length,agents:n,servers:r,configId:s,configPath:o,defaultAssistantAgentName:i,assistantInitialPrompt:c?.[C.id],assistantAutoOpenNonce:d?.[C.id],snapshotEval:f,onUpdate:E=>j(N,E),onMoveUp:()=>S(N,-1),onMoveDown:()=>S(N,1),onRemove:()=>b(N),readOnly:p,allowStructureEdits:x},C.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 hve({scenario:e,scenarioOrigin:t,index:n,total:r,agents:s,servers:o,configId:i,configPath:c,defaultAssistantAgentName:d,assistantInitialPrompt:f,assistantAutoOpenNonce:h,snapshotEval:p,onUpdate:g,onMoveUp:x,onMoveDown:j,onRemove:b,readOnly:y,allowStructureEdits:S}){const{source:C}=Dn(),N=Cg("snapshots",!1),[E,A]=m.useState("required_tool"),[P,T]=m.useState(""),[O,$]=m.useState(""),[z,U]=m.useState(""),[B,V]=m.useState(""),[q,I]=m.useState(null),[W,X]=m.useState(!1),[K,F]=m.useState(null),[J,D]=m.useState(""),[R,ne]=m.useState(""),[te,de]=m.useState(!1),[he,H]=m.useState(d||s[0]?.id||""),[ue,Q]=m.useState(!1),[Z,fe]=m.useState(null),[ae,Oe]=m.useState(""),[we,Ye]=m.useState(null),[L,ie]=m.useState(!y),pe=()=>{if(E==="response_jsonpath"||E==="response_jsonpath_exists"||E==="response_jsonpath_not_exists"){const be=O.trim();if(!be)return;if(E==="response_jsonpath"){const Ct=z.trim();let zt;Ct.length>0&&(Ct==="true"?zt=!0:Ct==="false"?zt=!1:Number.isNaN(Number(Ct))?zt=Ct:zt=Number(Ct)),g({evalRules:[...e.evalRules,{type:E,path:be,...zt!==void 0?{equals:zt}:{}}]})}else g({evalRules:[...e.evalRules,{type:E,path:be}]});$(""),U("");return}P.trim()&&(g({evalRules:[...e.evalRules,{type:E,value:P.trim()}]}),T(""),V(""))},Ee=be=>{g({evalRules:e.evalRules.filter((Ct,zt)=>zt!==be)})},Xe=()=>{!J.trim()||!R.trim()||(g({extractRules:[...e.extractRules,{name:J.trim(),pattern:R.trim()}]}),D(""),ne(""))},pt=be=>{g({extractRules:e.extractRules.filter((Ct,zt)=>zt!==be)})},vt=be=>{const Ct=e.serverIds.includes(be)?e.serverIds.filter(zt=>zt!==be):[...e.serverIds,be];g({serverIds:Ct})},gt={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"},Bt={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"},Lt=E==="required_tool"||E==="forbidden_tool",$t=E==="response_jsonpath"||E==="response_jsonpath_exists"||E==="response_jsonpath_not_exists",Ot=e.serverIds.filter(be=>o.some(Ct=>Ct.id===be)),Ce=s.map(be=>be.id).filter(Boolean),Je=Ot.length>0,Ue=e.snapshotEval?.baselineSnapshotId!==void 0,[ve,Le]=m.useState(""),[Ie,Ze]=m.useState(0);m.useEffect(()=>{const be=(f??"").trim();be&&ve!==be&&(de(!0),Le(be))},[f,ve]),m.useEffect(()=>{h&&h!==Ie&&(de(!0),Ze(h))},[h,Ie]),m.useEffect(()=>{I(null),F(null),V("")},[e.serverIds.join("|")]),m.useEffect(()=>{V(""),$(""),U("")},[E]),m.useEffect(()=>{he&&Ce.includes(he)||H(d||s[0]?.id||"")},[he,d,s,Ce]);const _e=async()=>{if(he){Q(!0),fe(null);try{const be=e.serverIds.filter(zt=>o.find(an=>an.id===zt)?.authType==="oauth2");await ao({serverNames:be,source:C});const Ct=await C.runScenarioPreview({selectedAgentName:he,scenario:{id:e.id,name:e.name,prompt:e.prompt,serverNames:e.serverIds,evalRules:e.evalRules,extractRules:e.extractRules}});Ye(Ct)}catch(be){fe(be instanceof Error?be.message:String(be))}finally{Q(!1)}}},Fe=()=>{if(!we)return;const be=VM(e.evalRules,we.run.failureReasons),Ct=be.length?be.map(Qt=>`${Qt.status.toUpperCase()} - ${mve(Qt.rule)}${Qt.failureReason?` (${Qt.failureReason})`:""}`).join(`
126
- `):"No checks configured.",zt=Object.keys(we.run.extractedValues).length>0?Object.entries(we.run.extractedValues).map(([Qt,mr])=>`${Qt}: ${String(mr)}`).join(`
127
- `):"No extracted values.",Ht=we.run.toolCalls.length>0?we.run.toolCalls.map((Qt,mr)=>`${mr+1}. ${Qt.name} (${Qt.duration}ms)`).join(`
128
- `):"No tool calls.",an=[`I ran a prompt preview for scenario '${e.id}' and want you to suggest concrete updates.`,`Run ID: ${we.runId}`,`Agent: ${we.agentName}`,`Outcome: ${we.run.passed?"passed":"failed"}`,`Duration: ${we.run.duration}ms`,"","Current check outcomes:",Ct,"","Tool sequence:",Ht,"","Extracted values:",zt,"","Final answer:",we.run.finalAnswer||"(empty)","","Please propose concrete updates to the Prompt, Checks, and/or Value Capture Rules based on this preview."].join(`
129
- `);Oe(an),de(!0)},Xt=async()=>{if(!(!Je||y)){X(!0),F(null);try{const be=Ot.filter(zt=>o.find(an=>an.id===zt)?.authType==="oauth2");await ao({serverNames:be,source:C});const Ct=new Set;for(const zt of Ot){const Ht=await C.discoverToolsForAnalysis({serverNames:[zt]});for(const an of Ht.servers)for(const Qt of an.tools)Ct.add(Qt.name)}I(Array.from(Ct).sort((zt,Ht)=>zt.localeCompare(Ht)))}catch(be){F(be instanceof Error?be.message:"Failed to load tools")}finally{X(!1)}}};return a.jsx(Ya,{open:L,onOpenChange:ie,children:a.jsxs(ze,{className:y?"rounded-md border shadow-none":"border-dashed",children:[a.jsxs(At,{className:y?"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:[!y&&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 ${L?"rotate-0":"-rotate-90"}`})})}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[n+1,"."]}),a.jsx(Et,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${n+1}`})]}),y?a.jsxs("div",{className:"flex items-center gap-2",children:[t&&a.jsx(We,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),a.jsx(_a,{asChild:!0,children:a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":L?"Collapse scenario details":"Expand scenario details",children:a.jsx(Yt,{className:`h-4 w-4 transition-transform ${L?"rotate-180":""}`})})})]}):S&&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:()=>de(!0),title:s.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:x,disabled:n===0,"aria-label":"Move scenario up",children:a.jsx(bs,{className:"h-3.5 w-3.5"})}),a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:n===r-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:b,children:a.jsx(Oa,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),a.jsx(Xa,{children:a.jsxs(qe,{className:"space-y-3",children:[a.jsx(lve,{open:te,onOpenChange:be=>{de(be),be||Oe("")},configId:i,configPath:c,scenario:e,agents:s,servers:o,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:ae||f,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($e,{className:"text-xs",children:"Name"}),a.jsx(mt,{value:e.name,onChange:be=>g({name:be.target.value}),disabled:y,placeholder:"e.g. List directory"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Servers"}),a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[o.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:()=>!y&&vt(be.id),children:be.name||be.id},be.id)),o.length===0&&a.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),a.jsxs(ze,{className:"border bg-card",children:[a.jsxs(At,{className:"pb-2",children:[a.jsx(Et,{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(qe,{className:"pt-0",children:a.jsx(ks,{value:e.prompt,onChange:be=>g({prompt:be.target.value}),disabled:y,placeholder:"The prompt to send to the agent...",rows:4,className:"text-xs"})})]}),!y&&a.jsxs(ze,{className:"border bg-muted/20",children:[a.jsxs(At,{className:"pb-2",children:[a.jsx(Et,{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(qe,{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($e,{className:"text-xs",children:"Agent"}),a.jsxs(jn,{value:he,onValueChange:H,children:[a.jsx(vn,{className:"h-8 text-xs",children:a.jsx(Sn,{placeholder:"Select agent"})}),a.jsx(gn,{children:s.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:()=>{_e()},disabled:ue||!he||!e.prompt.trim()||e.serverIds.length===0,children:ue?a.jsxs(a.Fragment,{children:[a.jsx(jr,{className:"h-3.5 w-3.5 animate-spin"}),"Running..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Zs,{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."}),Z&&a.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:Z}),we&&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:we.run.passed?"default":"destructive",children:we.run.passed?"Passed":"Failed"}),a.jsxs(We,{variant:"outline",children:[we.run.duration,"ms"]}),a.jsxs(We,{variant:"outline",children:[we.run.toolCalls.length," tool calls"]}),a.jsx(We,{variant:"outline",className:"font-mono",children:we.agentName}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-6 gap-1.5 px-2 text-[11px]",onClick:Fe,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=VM(e.evalRules,we.run.failureReasons),Ct=be.filter(Ht=>Ht.status==="passed"),zt=be.filter(Ht=>Ht.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:[Ct.length," passed"]}),a.jsxs(We,{variant:"outline",className:`h-5 text-[10px] ${zt.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[zt.length," failed"]})]}),a.jsx("div",{className:"space-y-1",children:be.map((Ht,an)=>a.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Ht.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:[Ht.status==="failed"?a.jsx(vc,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):a.jsx(Xo,{className:"h-3.5 w-3.5 shrink-0 text-success"}),a.jsx("span",{className:"font-medium",children:vve(Ht.rule)})]}),Ht.failureReason&&a.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:gve(Ht.failureReason)})]}),a.jsx(We,{variant:"outline",className:`shrink-0 text-[10px] ${Ht.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Ht.status})]},`${e.id}-preview-check-${an}`))})]})})(),we.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:we.run.failureReasons.map((be,Ct)=>a.jsx("li",{children:be},`${we.runId}-failure-${Ct}`))})]}),Object.keys(we.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(we.run.extractedValues).map(([be,Ct])=>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(Ct)})]},be))})]}),a.jsx(uve,{run:we.run,fallbackUserPrompt:e.prompt})]})]})]}),a.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[a.jsxs(ze,{className:"border bg-muted/20",children:[a.jsx(At,{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(Et,{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."})]}),!y&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>de(!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(qe,{className:"space-y-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx($e,{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,Ct)=>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 ${Bt[be.type]}`,children:gt[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})]})}),!y&&a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>Ee(Ct),"aria-label":`Remove check ${Ct+1}`,children:a.jsx(_s,{className:"h-3.5 w-3.5"})})]},Ct))}),!y&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex gap-2 items-end",children:[a.jsxs(jn,{value:E,onValueChange:be=>A(be),children:[a.jsx(vn,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:a.jsx(Sn,{})}),a.jsxs(gn,{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"})]})]}),$t?a.jsxs(a.Fragment,{children:[a.jsx(mt,{value:O,onChange:be=>$(be.target.value),placeholder:"JSONPath (e.g. $.status)",className:"h-8 text-xs font-mono",onKeyDown:be=>be.key==="Enter"&&(be.preventDefault(),pe())}),E==="response_jsonpath"&&a.jsx(mt,{value:z,onChange:be=>U(be.target.value),placeholder:"Equals (optional)",className:"h-8 w-[12rem] text-xs font-mono",onKeyDown:be=>be.key==="Enter"&&(be.preventDefault(),pe())})]}):a.jsx(mt,{value:P,onChange:be=>T(be.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:be=>be.key==="Enter"&&(be.preventDefault(),pe())}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:pe,children:"Add"})]}),Lt&&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($e,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),a.jsxs(jn,{value:B,onValueChange:be=>{V(be),T(be)},disabled:W||!q||q.length===0,children:[a.jsx(vn,{className:"h-8 text-xs",children:a.jsx(Sn,{placeholder:W?"Loading tools...":q&&q.length>0?"Select tool to insert in value field":"Load tools first"})}),a.jsx(gn,{children:(q??[]).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:Xt,disabled:!Je||W,children:W?"Loading...":q?"Refresh tools":"Load tools"})]}),!Je&&a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),K&&a.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",K]})]})]})]})})]}),a.jsxs(ze,{className:"border bg-muted/10",children:[a.jsx(At,{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(Et,{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."})]}),!y&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>de(!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(qe,{className:"space-y-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx($e,{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,Ct)=>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})]})}),!y&&a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>pt(Ct),"aria-label":`Remove value capture rule ${Ct+1}`,children:a.jsx(_s,{className:"h-3.5 w-3.5"})})]},Ct))}),!y&&a.jsxs("div",{className:"flex gap-2 items-end",children:[a.jsx(mt,{value:J,onChange:be=>D(be.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),a.jsx(mt,{value:R,onChange:be=>ne(be.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:be=>be.key==="Enter"&&(be.preventDefault(),Xe())}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Xe,children:"Add"})]})]})})]})]}),N&&a.jsxs(ze,{className:"border bg-amber-50/40",children:[a.jsxs(At,{className:"pb-2",children:[a.jsx(Et,{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(qe,{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(Gm,{checked:e.snapshotEval?.enabled!==!1,disabled:y,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(Gm,{checked:!Ue,disabled:y,onCheckedChange:be=>{if(be){g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),Ue&&a.jsx(mt,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:be=>g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:be.target.value}}),disabled:y,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||p?.baselineSnapshotId||"Not configured"})]}),a.jsxs("p",{children:["Policy:"," ",a.jsx("span",{className:"font-mono",children:p?.mode??"warn"})," · config-level switch"," ",a.jsx("span",{className:"font-mono",children:p?.enabled?"on":"off"})]})]})]})]})})]})})}function VM(e,t){return e.map(n=>{const r=xve(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function mve(e){return e.path?e.equals!==void 0?`${e.type}: ${e.path} == ${String(e.equals)}`:`${e.type}: ${e.path}`:`${e.type}: ${e.value??""}`}function vve(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 gve(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}function xve(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 p8(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 yve=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),HM=()=>{const{id:e,tab:t}=xl(),n=Ia(),[r,s]=mo(),{getConfig:o,addConfig:i,updateConfig:c,loading:d}=Rf(),{source:f}=Dn(),h=Cg("snapshots",!1),{servers:p,agents:g,scenarios:x}=ns(),j=e==="new",b=!j&&!!e,y=b?o(e):void 0,[S,C]=m.useState(j),[N,E]=m.useState(()=>y?structuredClone(y):yve()),[A,P]=m.useState([]),[T,O]=m.useState(""),[$,z]=m.useState(""),[U,B]=m.useState(""),[V,q]=m.useState(null),[I,W]=m.useState(!1),[X,K]=m.useState(!1),[F,J]=m.useState(""),[D,R]=m.useState(""),[ne,te]=m.useState({}),[de,he]=m.useState({}),[H,ue]=m.useState({}),Q=m.useMemo(()=>{const Y=t||r.get("tab");return Y==="agents"||Y==="scenarios"?Y:"scenarios"},[t,r]);m.useEffect(()=>{y&&!S&&E(structuredClone(y))},[y,S]),m.useEffect(()=>{let Y=!0;return f.listSnapshots().then(xe=>{Y&&P(xe)}).catch(()=>{Y&&P([])}),()=>{Y=!1}},[f]),m.useEffect(()=>{if(!T.trim()){q(null);return}let Y=!0;return f.getResult(T.trim()).then(xe=>{if(!Y)return;if(!xe){q(!1);return}const He=xe.overallPassRate===1&&xe.scenarios.every(ft=>ft.runs.every(qt=>qt.passed));q(He)}).catch(()=>{Y&&q(!1)}),()=>{Y=!1}},[T,f]);const Z=Y=>E(xe=>({...xe,...Y})),fe=m.useMemo(()=>N.serverEntries&&N.serverEntries.length>0?N.serverEntries:(N.servers??[]).map(Y=>({kind:"inline",server:Y})),[N.serverEntries,N.servers]),ae=m.useMemo(()=>N.scenarioEntries&&N.scenarioEntries.length>0?N.scenarioEntries:N.scenarios.map(Y=>({kind:"inline",scenario:Y})),[N.scenarioEntries,N.scenarios]),Oe=Y=>{Z({scenarioEntries:Y,scenarios:Y.filter(xe=>xe.kind==="inline").map(xe=>xe.scenario)})},we=m.useMemo(()=>N.agentEntries&&N.agentEntries.length>0?N.agentEntries:N.agents.map(Y=>({kind:"inline",agent:Y})),[N.agentEntries,N.agents]),Ye=Y=>{Z({agentEntries:Y,agents:Y.filter(xe=>xe.kind==="inline").map(xe=>xe.agent)})},L=!S,ie=N.runDefaults?.selectedAgentNames??[],pe=async Y=>{if(!N.id||L===!1){Z({snapshotEval:{enabled:Y.enabled,mode:Y.mode,baselineSnapshotId:Y.baselineSnapshotId,baselineSourceRunId:Y.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}W(!0);try{const xe=await f.updateSnapshotPolicy(N.id,Y);E(xe),Ae({title:"Snapshot policy updated"})}catch(xe){Ae({title:"Could not update snapshot policy",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}finally{W(!1)}},Ee=async()=>{if(!(!N.id||!T.trim())){K(!0);try{const Y=await f.generateSnapshotEvalBaseline(T.trim(),N.id,$.trim()||void 0);E(Y.config),B(Y.snapshot.id),P(xe=>[Y.snapshot,...xe.filter(He=>He.id!==Y.snapshot.id)]),Ae({title:"Snapshot baseline generated",description:`${Y.snapshot.name} (${Y.snapshot.id})`})}catch(Y){Ae({title:"Could not generate baseline",description:Y instanceof Error?Y.message:String(Y),variant:"destructive"})}finally{K(!1)}}},Xe=async()=>{if(!N.name.trim()){Ae({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const Y=fe.map(Ke=>Ke.kind==="referenced"?{kind:"referenced",ref:p.find(Jt=>Jt.id===Ke.ref)?.id||Ke.ref}:Ke),xe=we.map(Ke=>Ke.kind==="referenced"?{kind:"referenced",ref:g.find(Jt=>Jt.id===Ke.ref)?.id||Ke.ref}:Ke),He=ae.map(Ke=>Ke.kind==="referenced"?{kind:"referenced",ref:x.find(Jt=>Jt.id===Ke.ref)?.id||Ke.ref}:Ke),ft=Y.filter(Ke=>Ke.kind==="inline").map(Ke=>({server:Ke.server,error:p8(Ke.server)})).find(Ke=>!!Ke.error);if(ft?.error){Ae({title:"Validation Error",description:ft.error,variant:"destructive"});return}if(He.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 Gt=new Set(xe.map(Ke=>Ke.kind==="inline"?Ke.agent.id:Ke.ref)),Ut=(N.runDefaults?.selectedAgentNames??[]).filter(Ke=>Gt.has(Ke)),zn={...N,serverEntries:Y,servers:Y.filter(Ke=>Ke.kind==="inline").map(Ke=>Ke.server),agentEntries:xe,agents:xe.filter(Ke=>Ke.kind==="inline").map(Ke=>Ke.agent),scenarioEntries:He,scenarios:He.filter(Ke=>Ke.kind==="inline").map(Ke=>Ke.scenario),runDefaults:Ut.length>0?{...N.runDefaults??{},selectedAgentNames:Ut}:void 0,updatedAt:new Date().toISOString()};if(j){const Ke=await i(zn);E(Ke);const on=Ke.configName?.trim()||Ke.name;Ae({title:"MCP Evaluation Created",description:`"${on}" has been saved.`}),n(`/mcp-evaluations/${Ke.id}`)}else{const Ke=await c(N.id,zn);E(Ke);const on=Ke.configName?.trim()||Ke.name;Ae({title:"MCP Evaluation Updated",description:`"${on}" has been updated.`}),C(!1),Ke.id!==e&&n(`/mcp-evaluations/${Ke.id}`,{replace:!0})}},pt=N.configName?.trim()||N.name,vt=j?"New MCP Evaluation":S?`Editing: ${pt}`:pt,gt=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(N.id||e||"")}`,Bt=!!y?.loadError,Lt=m.useMemo(()=>g.map(Y=>({id:Y.id,ref:Y.id,label:Y.name||Y.id,model:Y.model})).sort((Y,xe)=>Y.label.localeCompare(xe.label)),[g]),$t=(Y,xe)=>{const He=xe?Array.from(new Set([...ie,Y])):ie.filter(ft=>ft!==Y);Z({runDefaults:{...N.runDefaults??{},selectedAgentNames:He}})},Ot=Y=>{const xe=new Set([...we.filter(Gt=>Gt.kind==="inline").map(Gt=>Gt.agent.name||Gt.agent.id),...g.map(Gt=>Gt.name||Gt.id)]),He=`${Y}-custom`;let ft=He,qt=2;for(;xe.has(ft);)ft=`${He}-${qt}`,qt+=1;return ft},Ce=()=>{const xe={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};Ye([{kind:"inline",agent:xe},...we]),te(He=>({...He,[xe.id]:!0}))},Je=()=>{const Y=g.find(ft=>ft.id===D);if(!Y)return;const xe=Y.id;new Set(we.filter(ft=>ft.kind==="referenced").map(ft=>ft.ref)).has(xe)||Ye([...we,{kind:"referenced",ref:xe}]),R("")},Ue=()=>{const Y=new Set(we.filter(He=>He.kind==="referenced").map(He=>He.ref)),xe=g.filter(He=>!Y.has(He.id)).map(He=>({kind:"referenced",ref:He.id}));xe.length>0&&Ye([...we,...xe])},ve=()=>{const Y=g.find(qt=>qt.id===D);if(!Y)return;const xe=Y.name||Y.id,He=Ot(xe),ft={...structuredClone(Y),id:`agt-${Date.now()}`,name:He};Ye([...we,{kind:"inline",agent:ft}]),te(qt=>({...qt,[ft.id]:!0})),R(""),Ae({title:"Imported agent as inline",description:He})},Le=Y=>{const xe=we[Y];if(!xe)return;const He=xe.kind==="inline"?xe.agent.id:xe.ref,ft=ie.filter(qt=>qt!==He);Z({runDefaults:{...N.runDefaults??{},selectedAgentNames:ft}}),xe.kind==="inline"&&te(qt=>{const Gt={...qt};return delete Gt[xe.agent.id],Gt}),Ye(we.filter((qt,Gt)=>Gt!==Y))},Ie=(Y,xe)=>{const He=Y+xe;if(He<0||He>=we.length)return;const ft=[...we],[qt]=ft.splice(Y,1);ft.splice(He,0,qt),Ye(ft)},Ze=Y=>{const xe=we[Y];if(!xe||xe.kind!=="referenced")return;const He=an(xe.ref);if(!He){Ae({title:"Referenced agent not found",variant:"destructive"});return}const ft=He.name||He.id,qt=Ot(ft),Gt={...structuredClone(He),id:`agt-${Date.now()}`,name:qt},Ut=[...we];if(Ut[Y]={kind:"inline",agent:Gt},Ye(Ut),ie.includes(xe.ref)){const zn=ie.map(Ke=>Ke===xe.ref?Gt.id:Ke);Z({runDefaults:{...N.runDefaults??{},selectedAgentNames:Array.from(new Set(zn))}})}te(zn=>({...zn,[Gt.id]:!0})),Ae({title:"Referenced agent converted to inline",description:qt})},_e=()=>{const Y=x.find(He=>He.id===F);if(!Y)return;const xe={...structuredClone(Y),id:`scn-${Date.now()}`,serverIds:[...Y.serverIds]};Oe([...ae,{kind:"inline",scenario:xe}]),ue(He=>({...He,[xe.id]:!0})),J("")},Fe=()=>{const xe={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};Oe([{kind:"inline",scenario:xe},...ae]),ue(He=>({...He,[xe.id]:!0}))},Xt=()=>{const Y=x.find(ft=>ft.id===F);if(!Y)return;const xe=Y.id;new Set(ae.filter(ft=>ft.kind==="referenced").map(ft=>ft.ref)).has(xe)||Oe([...ae,{kind:"referenced",ref:xe}]),J("")},be=Y=>{const xe=ae[Y];xe?.kind==="inline"&&ue(He=>{const ft={...He};return delete ft[xe.scenario.id],ft}),Oe(ae.filter((He,ft)=>ft!==Y))},Ct=(Y,xe)=>{const He=Y+xe;if(He<0||He>=ae.length)return;const ft=[...ae],[qt]=ft.splice(Y,1);ft.splice(He,0,qt),Oe(ft)},zt=Y=>{const xe=ae[Y];if(!xe||xe.kind!=="referenced")return;const He=Qt(xe.ref);if(!He){Ae({title:"Referenced scenario not found",variant:"destructive"});return}const ft=new Set(ae.filter(Jt=>Jt.kind==="inline").map(Jt=>Jt.scenario.name?.trim().toLowerCase()).filter(Boolean)),qt=`${(He.name||He.id).trim()}-custom`;let Gt=qt,Ut=2;for(;ft.has(Gt.toLowerCase());)Gt=`${qt}-${Ut}`,Ut+=1;const zn=Date.now(),Ke={...structuredClone(He),id:`scn-${zn}`,name:Gt,serverIds:[...He.serverIds]},on=[...ae];on[Y]={kind:"inline",scenario:Ke},Oe(on),ue(Jt=>({...Jt,[Ke.id]:!0})),Ae({title:"Referenced scenario converted to inline",description:Gt})},Ht=Y=>p.find(xe=>xe.id===Y),an=Y=>g.find(xe=>xe.id===Y),Qt=Y=>x.find(xe=>xe.id===Y),mr=fe.filter(Y=>Y.kind==="referenced").map(Y=>Y.ref),ht=mr.map(Ht).filter(Y=>!!Y),Tt=we.filter(Y=>Y.kind==="referenced").map(Y=>Y.ref),Dt=Tt.map(an).filter(Y=>!!Y);we.filter(Y=>Y.kind==="inline");const sn=we.flatMap(Y=>{if(Y.kind==="referenced"){const xe=an(Y.ref);return xe?[{agent:xe,origin:"referenced",ref:Y.ref}]:[]}return[{agent:Y.agent,origin:"inline",ref:void 0}]}),Bn=ae.filter(Y=>Y.kind==="referenced").map(Y=>Y.ref),ce=ae.flatMap(Y=>{if(Y.kind==="referenced"){const xe=Qt(Y.ref);return xe?[{scenario:xe,origin:"referenced"}]:[]}return[{scenario:Y.scenario,origin:"inline"}]}),st=Array.from(new Map([...g,...N.agents,...Dt].map(Y=>[Y.id,Y])).values()),St=Array.from(new Map([...p,...N.servers??[],...ht].map(Y=>[Y.id,Y])).values()),en=mr.filter(Y=>!Ht(Y)),xt=Tt.filter(Y=>!an(Y)),Tn=Bn.filter(Y=>!Qt(Y));new Set(en);const ur=new Set(Tn),ma=we.length,wo=ae.length;return m.useEffect(()=>{if(!D)return;g.some(xe=>xe.id===D)||R("")},[g,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(Qi,{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:vt}),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),children:"Edit"}),b&&!S&&y&&!Bt&&a.jsx(se,{size:"sm",variant:"outline",asChild:!0,children:a.jsxs(_t,{to:`/run?configId=${encodeURIComponent(y.id)}`,children:[a.jsx(Zs,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!S&&Bt&&a.jsxs(We,{variant:"destructive",className:"py-1 px-3 text-xs",children:[a.jsx(Eh,{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)},children:"Cancel"}),a.jsxs(se,{size:"sm",onClick:()=>{Xe()},children:[a.jsx(M7,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),Bt&&!S&&a.jsx(ze,{className:"border-destructive/40",children:a.jsxs(qe,{className:"pt-6 space-y-3",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Eh,{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})]}),(en.length>0||xt.length>0||Tn.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"}),en.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",a.jsx("span",{className:"text-destructive",children:en.join(", ")})]}),xt.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",a.jsx("span",{className:"text-destructive",children:xt.join(", ")})]}),Tn.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",a.jsx("span",{className:"text-destructive",children:Tn.join(", ")})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!Bt&&(N.loadWarnings?.length??0)>0&&a.jsx(ze,{className:"border-amber-500/30",children:a.jsxs(qe,{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(Eh,{className:"h-4 w-4"}),"Migration warnings"]}),N.loadWarnings?.map((Y,xe)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:Y},`${Y}-${xe}`))]})}),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:`${gt}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[a.jsx(VE,{className:"h-3 w-3"}),wo," scenario",wo!==1?"s":""]})}),a.jsx(We,{variant:Q==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:a.jsxs(_t,{to:`${gt}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[a.jsx(kr,{className:"h-3 w-3"}),ma," agent",ma!==1?"s":""]})})]}),a.jsx(ze,{children:a.jsx(qe,{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($e,{className:"text-xs",children:"Config ID"}),a.jsx(mt,{value:N.name,onChange:Y=>Z({name:Y.target.value}),disabled:L,placeholder:"e.g. check-weather"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Name (optional)"}),a.jsx(mt,{value:N.configName||"",onChange:Y=>Z({configName:Y.target.value}),disabled:L,placeholder:"e.g. Weather checks baseline"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Description"}),a.jsx(mt,{value:N.description||"",onChange:Y=>Z({description:Y.target.value}),disabled:L,placeholder:"Brief description..."})]})]})})}),h&&a.jsx(ze,{children:a.jsxs(qe,{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($e,{className:"text-xs",children:"Enable snapshot baseline"}),a.jsx(Gm,{checked:N.snapshotEval?.enabled??!1,disabled:I,onCheckedChange:Y=>{const xe=N.snapshotEval;pe({enabled:Y,mode:xe?.mode??"warn",baselineSnapshotId:xe?.baselineSnapshotId,baselineSourceRunId:xe?.baselineSourceRunId})}})]})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Drift mode"}),a.jsxs(jn,{value:N.snapshotEval?.mode??"warn",onValueChange:Y=>{const xe=N.snapshotEval;pe({enabled:xe?.enabled??!1,mode:Y,baselineSnapshotId:xe?.baselineSnapshotId,baselineSourceRunId:xe?.baselineSourceRunId})},children:[a.jsx(vn,{className:"h-8",children:a.jsx(Sn,{})}),a.jsxs(gn,{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($e,{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($e,{className:"text-xs",children:"Generate baseline from passing run"}),a.jsx(mt,{value:T,onChange:Y=>O(Y.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),V===!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($e,{className:"text-xs",children:"Snapshot name (optional)"}),a.jsx(mt,{value:$,onChange:Y=>z(Y.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Switch baseline"}),a.jsxs(jn,{value:U||N.snapshotEval?.baselineSnapshotId||"",onValueChange:Y=>{B(Y),pe({enabled:N.snapshotEval?.enabled??!0,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:Y||void 0,baselineSourceRunId:N.snapshotEval?.baselineSourceRunId})},children:[a.jsx(vn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select snapshot"})}),a.jsx(gn,{children:A.map(Y=>a.jsx(tt,{value:Y.id,children:Y.name},Y.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||!T.trim()||V!==!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:I,children:"Clear Baseline"})]})]})]})}),a.jsxs(wg,{value:Q,onValueChange:Y=>{if(Y!=="servers"&&Y!=="agents"&&Y!=="scenarios")return;const xe=new URLSearchParams(r);if(xe.delete("tab"),s(xe,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${Y}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${Y}`,{replace:!0})},className:"space-y-4",children:[a.jsxs(Gf,{children:[a.jsxs(Ns,{value:"scenarios",className:"gap-1.5",children:[a.jsx(VE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),a.jsxs(Ns,{value:"agents",className:"gap-1.5",children:[a.jsx(kr,{className:"h-3.5 w-3.5"}),"Agents"]})]}),a.jsxs(jf,{value:"agents",children:[!L&&a.jsx(ze,{className:"mb-4",children:a.jsxs(qe,{className:"pt-4 space-y-3",children:[a.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[a.jsxs(jn,{value:D,onValueChange:R,children:[a.jsx(vn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select agent from library"})}),a.jsx(gn,{children:Lt.map(Y=>a.jsx(tt,{value:Y.id,children:Y.label},Y.id))})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!D,onClick:Je,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:g.length===0||g.every(Y=>we.some(xe=>xe.kind==="referenced"&&xe.ref===Y.id)),onClick:Ue,children:"Add All Refs"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Ce,children:"Add agent"})]})]}),a.jsxs("div",{className:"space-y-2",children:[we.map((Y,xe)=>{const He=Y.kind==="referenced"?an(Y.ref):null,ft=Y.kind==="inline"?Y.agent.name?.trim()||Y.agent.id:He?.name||Y.ref,qt=Y.kind==="inline"?Y.agent.model:He?.model||"unknown",Gt=Y.kind==="inline"?Y.agent.id:Y.ref,Ut=Y.kind==="referenced"&&!He,zn=Y.kind==="inline"?Y.agent.id:Y.ref,Ke=ie.includes(zn),on=Y.kind==="inline"&&!!ne[Y.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:()=>Ie(xe,-1),disabled:xe===0,"aria-label":"Move agent up",children:a.jsx(bs,{className:"h-3 w-3"})}),a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ie(xe,1),disabled:xe===we.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:[xe+1,"."]}),a.jsx("span",{className:"truncate font-medium",children:ft}),a.jsx(We,{variant:Y.kind==="inline"?"secondary":"outline",children:Y.kind==="inline"?"Inline":"Referenced"}),a.jsx(We,{variant:"outline",className:"font-mono text-[10px]",children:qt}),Ke&&a.jsx(We,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),Ut&&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=>$t(zn,Jt.target.checked)}),a.jsx("span",{children:"Default"})]}),Y.kind==="inline"&&a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>te(Jt=>({...Jt,[Y.agent.id]:!Jt[Y.agent.id]})),children:on?"Collapse":"Expand"}),Y.kind==="referenced"&&a.jsx(a.Fragment,{children:a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>Ze(xe),disabled:Ut,children:"Convert to inline"})}),a.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Le(xe),"aria-label":"Remove agent entry",children:a.jsx(Oa,{className:"h-3.5 w-3.5"})})]})]}),Y.kind==="inline"&&on&&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($e,{className:"text-xs",children:"Name"}),a.jsx(mt,{value:Y.agent.name,onChange:Jt=>{const qn=[...we];qn[xe]={kind:"inline",agent:{...Y.agent,name:Jt.target.value}},Ye(qn)},placeholder:"e.g. GPT-5 Mini custom"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Provider"}),a.jsxs(jn,{value:Y.agent.provider,onValueChange:Jt=>{const qn=[...we];qn[xe]={kind:"inline",agent:{...Y.agent,provider:Jt}},Ye(qn)},children:[a.jsx(vn,{children:a.jsx(Sn,{})}),a.jsxs(gn,{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($e,{className:"text-xs",children:"Model"}),a.jsx(mt,{value:Y.agent.model,onChange:Jt=>{const qn=[...we];qn[xe]={kind:"inline",agent:{...Y.agent,model:Jt.target.value}},Ye(qn)},className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Max Tokens"}),a.jsx(mt,{type:"number",min:1,max:128e3,value:Y.agent.maxTokens,onChange:Jt=>{const qn=[...we];qn[xe]={kind:"inline",agent:{...Y.agent,maxTokens:parseInt(Jt.target.value)||0}},Ye(qn)},className:"font-mono text-xs"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Temperature"}),a.jsx(mt,{type:"number",min:0,max:2,step:.01,value:Y.agent.temperature,onChange:Jt=>{const qn=[...we];qn[xe]={kind:"inline",agent:{...Y.agent,temperature:Number(Jt.target.value)||0}},Ye(qn)},className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"System Prompt"}),a.jsx(ks,{value:Y.agent.systemPrompt||"",onChange:Jt=>{const qn=[...we];qn[xe]={kind:"inline",agent:{...Y.agent,systemPrompt:Jt.target.value}},Ye(qn)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${xe}-${Gt}`)}),we.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),xt.length>0&&a.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",xt.join(", ")]})]})}),L?a.jsx(ze,{children:a.jsx(qe,{className:"pt-4",children:a.jsxs("div",{className:"space-y-2",children:[sn.map((Y,xe)=>{const He=Y.agent.name||Y.agent.id,ft=ie.includes(Y.origin==="inline"?Y.agent.id:Y.ref||Y.agent.id),qt=Y.ref??Y.agent.id,Gt=!!de[qt];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:[xe+1,"."]}),a.jsx("div",{className:"truncate font-medium text-sm",children:He})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[ft&&a.jsx(We,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),a.jsx(We,{variant:Y.origin==="inline"?"secondary":"outline",children:Y.origin==="inline"?"Inline":"Referenced"}),a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>he(Ut=>({...Ut,[qt]:!Ut[qt]})),"aria-label":Gt?"Collapse agent details":"Expand agent details",children:a.jsx(Yt,{className:`h-4 w-4 transition-transform ${Gt?"rotate-180":""}`})})]})]}),Gt&&a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[a.jsx(Bz,{provider:Y.agent.provider}),a.jsx(We,{variant:"outline",className:"text-xs font-mono",children:Y.agent.model}),a.jsxs(We,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",Y.agent.maxTokens]}),a.jsxs(We,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",Y.agent.temperature]})]})]},`agent-view-${xe}-${Y.ref??Y.agent.id}`)}),sn.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),a.jsxs(jf,{value:"scenarios",children:[!L&&a.jsx(ze,{className:"mb-4",children:a.jsxs(qe,{className:"pt-4 space-y-3",children:[a.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[a.jsxs(jn,{value:F,onValueChange:J,children:[a.jsx(vn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select scenario from library"})}),a.jsx(gn,{children:[...x].sort((Y,xe)=>(Y.name||Y.id).localeCompare(xe.name||xe.id)).map(Y=>a.jsx(tt,{value:Y.id,children:Y.name||Y.id},Y.id))})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:Xt,children:"Add Ref"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:_e,children:"Import Inline"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Fe,children:"Add scenario"})]})]}),a.jsxs("div",{className:"space-y-2",children:[ae.map((Y,xe)=>{const He=Y.kind==="referenced"?Qt(Y.ref):null,ft=Y.kind==="inline"?Y.scenario.name?.trim()||Y.scenario.id:He?.name||Y.ref,qt=Y.kind==="inline"&&!Y.scenario.name?.trim(),Gt=Y.kind==="referenced"&&ur.has(Y.ref),Ut=Y.kind==="inline"&&!!H[Y.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:()=>Ct(xe,-1),disabled:xe===0,"aria-label":"Move scenario up",children:a.jsx(bs,{className:"h-3 w-3"})}),a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ct(xe,1),disabled:xe===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:[xe+1,"."]}),a.jsx("span",{className:"truncate font-medium",children:ft}),a.jsx(We,{variant:Y.kind==="inline"?"secondary":"outline",children:Y.kind==="inline"?"Inline":"Referenced"}),qt&&a.jsx(We,{variant:"destructive",children:"Name required"}),Gt&&a.jsx(We,{variant:"destructive",children:"Missing"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[Y.kind==="inline"&&a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>ue(zn=>({...zn,[Y.scenario.id]:!zn[Y.scenario.id]})),"aria-label":Ut?"Collapse scenario details":"Expand scenario details",children:a.jsx(Yt,{className:`h-3.5 w-3.5 transition-transform ${Ut?"rotate-180":""}`})}),Y.kind==="referenced"&&a.jsx(a.Fragment,{children:a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>zt(xe),disabled:Gt,children:"Convert to inline"})}),a.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>be(xe),"aria-label":"Remove scenario entry",children:a.jsx(Oa,{className:"h-3.5 w-3.5"})})]})]}),Y.kind==="inline"&&Ut&&a.jsx("div",{className:"border-t px-3 py-3",children:a.jsx(X1,{scenarios:[Y.scenario],scenarioOrigins:["inline"],agents:[...N.agents,...Dt],servers:[...N.servers??[],...ht],configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:zn=>{const Ke=zn[0];if(!Ke)return;const on=[...ae];on[xe]={kind:"inline",scenario:Ke},Oe(on)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${xe}-${Y.kind==="inline"?Y.scenario.id:Y.ref}`)}),ae.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),Tn.length>0&&a.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",Tn.join(", ")]})]})}),L?a.jsx(ze,{children:a.jsx(qe,{className:"pt-4",children:a.jsx(X1,{scenarios:ce.map(Y=>Y.scenario),scenarioOrigins:ce.map(Y=>Y.origin),agents:st,servers:St,configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var bve=Symbol("radix.slottable");function wve(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=bve,t}var h8="AlertDialog",[jve]=hr(h8,[w5]),bo=w5(),m8=e=>{const{__scopeAlertDialog:t,...n}=e,r=bo(t);return a.jsx(Nv,{...r,...n,modal:!0})};m8.displayName=h8;var Sve="AlertDialogTrigger",Nve=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=bo(n);return a.jsx(VG,{...s,...r,ref:t})});Nve.displayName=Sve;var Cve="AlertDialogPortal",v8=e=>{const{__scopeAlertDialog:t,...n}=e,r=bo(t);return a.jsx(Cv,{...r,...n})};v8.displayName=Cve;var _ve="AlertDialogOverlay",g8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=bo(n);return a.jsx(du,{...s,...r,ref:t})});g8.displayName=_ve;var Sc="AlertDialogContent",[Ave,Eve]=jve(Sc),Pve=wve("AlertDialogContent"),x8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,o=bo(n),i=m.useRef(null),c=wt(t,i),d=m.useRef(null);return a.jsx(zG,{contentName:Sc,titleName:y8,docsSlug:"alert-dialog",children:a.jsx(Ave,{scope:n,cancelRef:d,children:a.jsxs(fu,{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})]})})})});x8.displayName=Sc;var y8="AlertDialogTitle",b8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=bo(n);return a.jsx(kf,{...s,...r,ref:t})});b8.displayName=y8;var w8="AlertDialogDescription",j8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=bo(n);return a.jsx(Tf,{...s,...r,ref:t})});j8.displayName=w8;var kve="AlertDialogAction",S8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=bo(n);return a.jsx(_v,{...s,...r,ref:t})});S8.displayName=kve;var N8="AlertDialogCancel",C8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=Eve(N8,n),o=bo(n),i=wt(t,s);return a.jsx(_v,{...o,...r,ref:i})});C8.displayName=N8;var Tve=({contentRef:e})=>{const t=`\`${Sc}\` requires a description for the component to be accessible for screen reader users.
130
-
131
- You can add a description to the \`${Sc}\` by passing a \`${w8}\` 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 \`${Sc}\`. 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},Ove=m8,Rve=v8,_8=g8,A8=x8,E8=S8,P8=C8,k8=b8,T8=j8;const Ds=Ove,Ive=Rve,O8=m.forwardRef(({className:e,...t},n)=>a.jsx(_8,{className:Se("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}));O8.displayName=_8.displayName;const as=m.forwardRef(({className:e,...t},n)=>a.jsxs(Ive,{children:[a.jsx(O8,{}),a.jsx(A8,{ref:n,className:Se("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})]}));as.displayName=A8.displayName;const ss=({className:e,...t})=>a.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});ss.displayName="AlertDialogHeader";const os=({className:e,...t})=>a.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});os.displayName="AlertDialogFooter";const is=m.forwardRef(({className:e,...t},n)=>a.jsx(k8,{ref:n,className:Se("text-lg font-semibold",e),...t}));is.displayName=k8.displayName;const ls=m.forwardRef(({className:e,...t},n)=>a.jsx(T8,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));ls.displayName=T8.displayName;const cs=m.forwardRef(({className:e,...t},n)=>a.jsx(E8,{ref:n,className:Se(PN(),e),...t}));cs.displayName=E8.displayName;const us=m.forwardRef(({className:e,...t},n)=>a.jsx(P8,{ref:n,className:Se(PN({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));us.displayName=P8.displayName;const Mve=()=>{const{servers:e,setServers:t,reload:n,loading:r}=ns(),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}.`})},g=async b=>{await t(e.filter(y=>y.id!==b.id)),Ae({title:"Server deleted",description:`${h(b)} was removed.`}),i(null)},x=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,x(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(X$,{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(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(se,{type:"button",size:"sm",onClick:()=>s("/libraries/servers/new"),children:[a.jsx(so,{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(so,{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(ze,{children:a.jsx(qe,{className:"p-0",children:a.jsxs(Ur,{children:[a.jsx(Wr,{children:a.jsxs(Kt,{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(Vr,{children:j.map(b=>a.jsxs(Kt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>s(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[a.jsx(Be,{className:"font-medium",children:h(b)}),a.jsx(Be,{children:a.jsx(We,{variant:"secondary",className:"font-mono text-xs",children:b.transport})}),a.jsx(Be,{children:a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:x(b)})}),a.jsx(Be,{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(Be,{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(Oa,{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(Cs,{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(rv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},b.id))})]})})}),a.jsx(Ds,{open:!!o,onOpenChange:b=>!b&&i(null),children:a.jsxs(as,{children:[a.jsxs(ss,{children:[a.jsx(is,{children:"Delete server?"}),a.jsxs(ls,{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(os,{children:[a.jsx(us,{children:"Cancel"}),a.jsx(cs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{o&&g(o)},children:"Delete Server"})]})]})})]})},KM={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"},GM=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none"}),$ve=()=>{const{serverId:e}=xl(),t=Ia(),{servers:n,setServers:r}=ns(),{source:s}=Dn(),o=e==="new",i=e?decodeURIComponent(e):"",c=o?null:n.find(I=>I.id===i||I.name===i),d=I=>I.name?.trim()||I.id,[f,h]=m.useState(()=>c??GM()),[p,g]=m.useState(!1),[x,j]=m.useState(!1),[b,y]=m.useState({status:"idle"}),[S,C]=m.useState(!1),[N,E]=m.useState(!1),[A,P]=m.useState([]),[T,O]=m.useState(!1),$=m.useRef(null);m.useEffect(()=>{const I=o?`new:${i||"new"}`:`srv:${i}`;if($.current!==I){if(o){h(GM()),O(!1),$.current=I;return}c&&(h(c),O(!1),$.current=I)}},[o,i,c]);const z=I=>{O(!1),h(W=>({...W,authType:I,...I!=="bearer"&&I!=="api-key"?{authValue:void 0}:{},...I!=="api-key"?{apiKeyHeaderName:void 0}:{apiKeyHeaderName:W.apiKeyHeaderName||"X-API-Key"},...I!=="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}}))},U=async()=>{if(C(!0),y({status:"loading"}),P([]),f.authType==="oauth2")try{E(!0),await ao({serverNames:[f.id],source:s,onServerStatus:I=>{const W=new Date().toLocaleTimeString(),X=typeof I.tokenExpiresInSeconds=="number"?` (valid ${G1(I.tokenExpiresInSeconds,{nonPositiveLabel:"expired"})}; until ${new Date(I.tokenExpiresAt||Date.now()).toLocaleTimeString()})`:"";if(I.status==="auth_required"){P(K=>[...K,`[${W}] OAuth debug: callback required for '${I.serverName}'`]);return}I.status==="ready"&&(I.debugState==="refreshed"?P(K=>[...K,`[${W}] OAuth debug: token refreshed (no callback)${X}`]):I.debugState==="reused"?P(K=>[...K,`[${W}] OAuth debug: session/token reused${X}`]):P(K=>[...K,`[${W}] OAuth debug: authorized${X}`]))}})}catch(I){y({status:"error",message:`OAuth login failed: ${I instanceof Error?I.message:String(I)}`,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(I){y({status:"error",message:I instanceof Error?I.message:String(I),testedAt:new Date().toISOString()})}},B=async()=>{if(!f.name.trim()){Ae({title:"Name is required",variant:"destructive"});return}const I=p8(f);if(I){Ae({title:"Validation Error",description:I,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(K=>K.id===c?.id?W:K);await r(X),Ae({title:"Server saved"}),W.id!==i&&t(`/libraries/servers/${encodeURIComponent(W.id)}`,{replace:!0})}}finally{j(!1)}},V=async()=>{const I=n.filter(W=>W.id!==c?.id);await r(I),Ae({title:"Server deleted"}),t("/libraries/servers")},q=()=>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(Qi,{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(Qi,{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:()=>{U()},disabled:b.status==="loading"||N,children:[a.jsx(rD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&a.jsxs(ze,{children:[a.jsxs(At,{className:"flex-row items-center justify-between space-y-0",children:[a.jsx(Et,{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(_s,{className:"h-4 w-4"})})]}),a.jsxs(qe,{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}),q()&&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:q()})]})]}),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(jr,{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((I,W)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:I},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(Cc,{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(I=>a.jsx("li",{className:"font-mono text-xs",children:I},I))})]}),(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((I,W)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:I},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]}),KM[f.transport]&&a.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",KM[f.transport]]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]})]})]}),a.jsxs(ze,{children:[a.jsx(At,{children:a.jsx(Et,{className:"text-base",children:"Configuration"})}),a.jsxs(qe,{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($e,{children:"Name"}),a.jsx(mt,{value:f.name,onChange:I=>h(W=>({...W,name:I.target.value})),placeholder:"e.g. Filesystem MCP"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Transport"}),a.jsxs(jn,{value:f.transport,onValueChange:I=>h(W=>({...W,transport:I})),children:[a.jsx(vn,{children:a.jsx(Sn,{})}),a.jsxs(gn,{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($e,{children:"Command"}),a.jsx(mt,{value:f.command||"",onChange:I=>h(W=>({...W,command:I.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Args (comma-separated)"}),a.jsx(mt,{value:(f.args||[]).join(", "),onChange:I=>h(W=>({...W,args:I.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($e,{children:"URL"}),a.jsx(mt,{value:f.url||"",onChange:I=>h(W=>({...W,url:I.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($e,{children:"Auth Type"}),a.jsxs(jn,{value:f.authType||"none",onValueChange:I=>z(I),children:[a.jsx(vn,{children:a.jsx(Sn,{})}),a.jsxs(gn,{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($e,{children:"Token"}),a.jsx(mt,{value:f.authValue||"",onChange:I=>h(W=>({...W,authValue:I.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($e,{className:"text-xs",children:"Header Name"}),a.jsx(mt,{value:f.apiKeyHeaderName||"X-API-Key",onChange:I=>h(W=>({...W,apiKeyHeaderName:I.target.value})),placeholder:"X-API-Key",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Value"}),a.jsx(mt,{value:f.authValue||"",onChange:I=>h(W=>({...W,authValue:I.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(I=>({...I,oauthMode:"pre_registered"})),children:"Pre-registered"}),a.jsx(se,{type:"button",variant:f.oauthMode==="dcr"?"default":"outline",size:"sm",onClick:()=>h(I=>({...I,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($e,{className:"text-xs",children:"Client ID"}),a.jsx(mt,{value:f.oauthClientId||"",onChange:I=>h(W=>({...W,oauthClientId:I.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Client Secret (optional)"}),a.jsx(mt,{type:"password",value:f.oauthClientSecret||"",onChange:I=>h(W=>({...W,oauthClientSecret:I.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Scope (optional, space-separated)"}),a.jsx(mt,{value:f.oauthScope||"",onChange:I=>h(W=>({...W,oauthScope:I.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]}),a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>O(I=>!I),children:[a.jsx("span",{children:T?"▾":"▸"}),"Advanced — manual endpoint overrides"]}),T&&a.jsxs("div",{className:"mt-2 grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Authorization URL"}),a.jsx(mt,{value:f.oauthAuthorizationUrl||"",onChange:I=>h(W=>({...W,oauthAuthorizationUrl:I.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($e,{className:"text-xs",children:"Token URL"}),a.jsx(mt,{value:f.oauthTokenEndpoint||"",onChange:I=>h(W=>({...W,oauthTokenEndpoint:I.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:()=>g(!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:()=>{B()},disabled:x,children:[x&&a.jsx(jr,{className:"mr-2 h-4 w-4 animate-spin"}),o?"Create Server":"Save"]})]})]})]})]}),a.jsx(Ds,{open:p,onOpenChange:g,children:a.jsxs(as,{children:[a.jsxs(ss,{children:[a.jsx(is,{children:"Delete server?"}),a.jsxs(ls,{children:["This will permanently remove the server"," ",a.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),a.jsxs(os,{children:[a.jsx(us,{children:"Cancel"}),a.jsx(cs,{onClick:()=>{V()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},Dve=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=ns(),s=Ia(),[o,i]=m.useState(null),[c,d]=m.useState(""),f=c.trim().toLowerCase(),h=m.useMemo(()=>f.length===0?e:e.filter(x=>{const j=x.name.toLowerCase(),b=x.model.toLowerCase();return j.includes(f)||b.includes(f)}),[e,f]),p=async x=>{const j=`${x.name}-copy`;let b=j,y=1;for(;e.some(C=>C.name===b);)b=`${j}-${y}`,y+=1;const S={...structuredClone(x),id:`agt-${Date.now()}`,name:b};await t([...e,S]),Ae({title:"Agent duplicated",description:`Created ${b}.`})},g=async x=>{await t(e.filter(j=>j.id!==x.id)),Ae({title:"Agent deleted",description:`${x.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(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(se,{type:"button",size:"sm",onClick:()=>s("/libraries/agents/new"),children:[a.jsx(so,{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(so,{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(ze,{children:a.jsx(qe,{className:"p-0",children:a.jsxs(Ur,{children:[a.jsx(Wr,{children:a.jsxs(Kt,{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(Vr,{children:h.map(x=>a.jsxs(Kt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>s(`/libraries/agents/${encodeURIComponent(x.id)}`),children:[a.jsx(Be,{className:"font-medium",children:x.name}),a.jsx(Be,{children:a.jsx(Bz,{provider:x.provider})}),a.jsx(Be,{children:a.jsx("span",{className:"font-mono text-xs",children:x.model})}),a.jsx(Be,{className:"font-mono text-xs",children:x.maxTokens}),a.jsx(Be,{className:"font-mono text-xs",children:x.temperature.toFixed(2)}),a.jsx(Be,{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(x),children:[a.jsx(Oa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(x)},children:[a.jsx(Cs,{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(x.id)}`),children:[a.jsx(rv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},x.id))})]})})}),a.jsx(Ds,{open:!!o,onOpenChange:x=>!x&&i(null),children:a.jsxs(as,{children:[a.jsxs(ss,{children:[a.jsx(is,{children:"Delete agent?"}),a.jsxs(ls,{children:["This will permanently remove"," ",a.jsx("span",{className:"font-mono",children:o?.name})," from the library. This action cannot be undone."]})]}),a.jsxs(os,{children:[a.jsx(us,{children:"Cancel"}),a.jsx(cs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{o&&g(o)},children:"Delete Agent"})]})]})})]})};var R8=["PageUp","PageDown"],I8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],M8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Su="Slider",[Q1,Lve,Fve]=Sf(Su),[$8]=hr(Su,[Fve]),[Bve,_g]=$8(Su),D8=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:g=()=>{},inverted:x=!1,form:j,...b}=e,y=m.useRef(new Set),S=m.useRef(0),N=i==="horizontal"?zve:qve,[E=[],A]=pa({prop:h,defaultProp:f,onChange:U=>{[...y.current][S.current]?.focus(),p(U)}}),P=m.useRef(E);function T(U){const B=Kve(E,U);z(U,B)}function O(U){z(U,S.current)}function $(){const U=P.current[S.current];E[S.current]!==U&&g(E)}function z(U,B,{commit:V}={commit:!1}){const q=Qve(o),I=Jve(Math.round((U-r)/o)*o+r,q),W=wf(I,[r,s]);A((X=[])=>{const K=Vve(X,W,B);if(Xve(K,d*o)){S.current=K.indexOf(W);const F=String(K)!==String(X);return F&&V&&g(K),F?K: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||(P.current=E)}),min:r,max:s,inverted:x,onSlideStart:c?void 0:T,onSlideMove:c?void 0:O,onSlideEnd:c?void 0:$,onHomeKeyDown:()=>!c&&z(r,0,{commit:!0}),onEndKeyDown:()=>!c&&z(s,E.length-1,{commit:!0}),onStepKeyDown:({event:U,direction:B})=>{if(!c){const I=R8.includes(U.key)||U.shiftKey&&I8.includes(U.key)?10:1,W=S.current,X=E[W],K=o*I*B;z(X+K,W,{commit:!0})}}})})})})});D8.displayName=Su;var[L8,F8]=$8(Su,{startEdge:"left",endEdge:"right",size:"width",direction:1}),zve=m.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:o,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,g]=m.useState(null),x=wt(t,N=>g(N)),j=m.useRef(void 0),b=bu(s),y=b==="ltr",S=y&&!o||!y&&o;function C(N){const E=j.current||p.getBoundingClientRect(),A=[0,E.width],T=JC(A,S?[n,r]:[r,n]);return j.current=E,T(N-E.left)}return a.jsx(L8,{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:x,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=M8[S?"from-left":"from-right"].includes(N.key);f?.({event:N,direction:A?-1:1})}})})}),qve=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),g=m.useRef(void 0),x=!s;function j(b){const y=g.current||h.current.getBoundingClientRect(),S=[0,y.height],N=JC(S,x?[r,n]:[n,r]);return g.current=y,N(b-y.top)}return a.jsx(L8,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?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:()=>{g.current=void 0,c?.()},onStepKeyDown:b=>{const S=M8[x?"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=_g(Su,n);return a.jsx(Ge.span,{...f,ref:t,onKeyDown:Te(e.onKeyDown,p=>{p.key==="Home"?(i(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):R8.concat(I8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Te(e.onPointerDown,p=>{const g=p.target;g.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(g)?g.focus():r(p)}),onPointerMove:Te(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&s(p)}),onPointerUp:Te(e.onPointerUp,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&(g.releasePointerCapture(p.pointerId),o(p))})})}),z8="SliderTrack",q8=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=_g(z8,n);return a.jsx(Ge.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});q8.displayName=z8;var J1="SliderRange",U8=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=_g(J1,n),o=F8(J1,n),i=m.useRef(null),c=wt(t,i),d=s.values.length,f=s.values.map(g=>H8(g,s.min,s.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return a.jsx(Ge.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:c,style:{...e.style,[o.startEdge]:h+"%",[o.endEdge]:p+"%"}})});U8.displayName=J1;var Z1="SliderThumb",W8=m.forwardRef((e,t)=>{const n=Lve(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(Uve,{...e,ref:o,index:i})}),Uve=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...o}=e,i=_g(Z1,n),c=F8(Z1,n),[d,f]=m.useState(null),h=wt(t,C=>f(C)),p=d?i.form||!!d.closest("form"):!0,g=lv(d),x=i.values[r],j=x===void 0?0:H8(x,i.min,i.max),b=Hve(r,i.values.length),y=g?.[c.size],S=y?Gve(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(Ge.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":i.min,"aria-valuenow":x,"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:x===void 0?{display:"none"}:e.style,onFocus:Te(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})})}),p&&a.jsx(V8,{name:s??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:x},r)]})});W8.displayName=Z1;var Wve="RadioBubbleInput",V8=m.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=m.useRef(null),o=wt(s,r),i=mg(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(Ge.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});V8.displayName=Wve;function Vve(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,o)=>s-o)}function H8(e,t,n){const o=100/(n-t)*(e-t);return wf(o,[0,100])}function Hve(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Kve(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 Gve(e,t,n){const r=e/2,o=JC([0,50],[0,r]);return(r-o(t)*n)*n}function Yve(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Xve(e,t){if(t>0){const n=Yve(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 Qve(e){return(String(e).split(".")[1]||"").length}function Jve(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var K8=D8,Zve=q8,ege=U8,tge=W8;const G8=m.forwardRef(({className:e,...t},n)=>a.jsxs(K8,{ref:n,className:Se("relative flex w-full touch-none select-none items-center",e),...t,children:[a.jsx(Zve,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx(ege,{className:"absolute h-full bg-primary"})}),a.jsx(tge,{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"})]}));G8.displayName=K8.displayName;function nge(e){const t=rge(e),n=m.forwardRef((r,s)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(sge);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...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 rge(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const i=ige(s),c=oge(o,s.props);return s.type!==m.Fragment&&(c.ref=r?Tr(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 age=Symbol("radix.slottable");function sge(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===age}function oge(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 ige(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 Ag="Popover",[Y8]=hr(Ag,[li]),Yf=li(),[lge,vi]=Y8(Ag),X8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!1}=e,c=Yf(t),d=m.useRef(null),[f,h]=m.useState(!1),[p,g]=pa({prop:r,defaultProp:s??!1,onChange:o,caller:Ag});return a.jsx(cv,{...c,children:a.jsx(lge,{scope:t,contentId:tr(),triggerRef:d,open:p,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:f,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:i,children:n})})};X8.displayName=Ag;var Q8="PopoverAnchor",cge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=vi(Q8,n),o=Yf(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=s;return m.useEffect(()=>(i(),()=>c()),[i,c]),a.jsx(_f,{...o,...r,ref:t})});cge.displayName=Q8;var J8="PopoverTrigger",Z8=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=vi(J8,n),o=Yf(n),i=wt(t,s.triggerRef),c=a.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":a6(s.open),...r,ref:i,onClick:Te(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx(_f,{asChild:!0,...o,children:c})});Z8.displayName=J8;var ZC="PopoverPortal",[uge,dge]=Y8(ZC,{forceMount:void 0}),e6=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=vi(ZC,t);return a.jsx(uge,{scope:t,forceMount:n,children:a.jsx(Gn,{present:n||o.open,children:a.jsx(vl,{asChild:!0,container:s,children:r})})})};e6.displayName=ZC;var nu="PopoverContent",t6=m.forwardRef((e,t)=>{const n=dge(nu,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=vi(nu,e.__scopePopover);return a.jsx(Gn,{present:r||o.open,children:o.modal?a.jsx(pge,{...s,ref:t}):a.jsx(hge,{...s,ref:t})})});t6.displayName=nu;var fge=nge("PopoverContent.RemoveScroll"),pge=m.forwardRef((e,t)=>{const n=vi(nu,e.__scopePopover),r=m.useRef(null),s=wt(t,r),o=m.useRef(!1);return m.useEffect(()=>{const i=r.current;if(i)return jv(i)},[]),a.jsx(Pf,{as:fge,allowPinchZoom:!0,children:a.jsx(n6,{...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})})})}),hge=m.forwardRef((e,t)=>{const n=vi(nu,e.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(n6,{...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()}})}),n6=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,g=vi(nu,n),x=Yf(n);return bv(),a.jsx(Ef,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(ml,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1),children:a.jsx(uv,{"data-state":a6(g.open),role:"dialog",id:g.contentId,...x,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),r6="PopoverClose",mge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=vi(r6,n);return a.jsx(Ge.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});mge.displayName=r6;var vge="PopoverArrow",gge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Yf(n);return a.jsx(dv,{...s,...r,ref:t})});gge.displayName=vge;function a6(e){return e?"open":"closed"}var xge=X8,yge=Z8,bge=e6,s6=t6;const ru=xge,au=yge,ll=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx(bge,{children:a.jsx(s6,{ref:s,align:t,sideOffset:n,className:Se("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})}));ll.displayName=s6.displayName;var YM=1,wge=.9,jge=.8,Sge=.17,Lj=.1,Fj=.999,Nge=.9999,Cge=.99,_ge=/[\\\/_+.#"@\[\(\{&]/,Age=/[\\\/_+.#"@\[\(\{&]/g,Ege=/[\s-]/,o6=/[\s-]/g;function eN(e,t,n,r,s,o,i){if(o===t.length)return s===e.length?YM:Cge;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,g,x,j;f>=0;)p=eN(e,t,n,r,f+1,o+1,i),p>h&&(f===s?p*=YM:_ge.test(e.charAt(f-1))?(p*=jge,x=e.slice(s,f-1).match(Age),x&&s>0&&(p*=Math.pow(Fj,x.length))):Ege.test(e.charAt(f-1))?(p*=wge,j=e.slice(s,f-1).match(o6),j&&s>0&&(p*=Math.pow(Fj,j.length))):(p*=Sge,s>0&&(p*=Math.pow(Fj,f-s))),e.charAt(f)!==t.charAt(o)&&(p*=Nge)),(p<Lj&&n.charAt(f-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(f-1)!==r.charAt(o))&&(g=eN(e,t,n,r,f+1,o+2,i),g*Lj>p&&(p=g*Lj)),p>h&&(h=p),f=n.indexOf(d,f+1);return i[c]=h,h}function XM(e){return e.toLowerCase().replace(o6," ")}function Pge(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,eN(e,t,XM(e),XM(t),0,0,{})}var vd='[cmdk-group=""]',Bj='[cmdk-group-items=""]',kge='[cmdk-group-heading=""]',i6='[cmdk-item=""]',QM=`${i6}:not([aria-disabled="true"])`,tN="cmdk-item-select",ic="data-value",Tge=(e,t,n)=>Pge(e,t,n),l6=m.createContext(void 0),Xf=()=>m.useContext(l6),c6=m.createContext(void 0),e_=()=>m.useContext(c6),u6=m.createContext(void 0),d6=m.forwardRef((e,t)=>{let n=lc(()=>{var R,ne;return{search:"",value:(ne=(R=e.value)!=null?R:e.defaultValue)!=null?ne:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=lc(()=>new Set),s=lc(()=>new Map),o=lc(()=>new Map),i=lc(()=>new Set),c=f6(e),{label:d,children:f,value:h,onValueChange:p,filter:g,shouldFilter:x,loop:j,disablePointerSelection:b=!1,vimBindings:y=!0,...S}=e,C=tr(),N=tr(),E=tr(),A=m.useRef(null),P=qge();cl(()=>{if(h!==void 0){let R=h.trim();n.current.value=R,T.emit()}},[h]),cl(()=>{P(6,V)},[]);let T=m.useMemo(()=>({subscribe:R=>(i.current.add(R),()=>i.current.delete(R)),snapshot:()=>n.current,setState:(R,ne,te)=>{var de,he,H,ue;if(!Object.is(n.current[R],ne)){if(n.current[R]=ne,R==="search")B(),z(),P(1,U);else if(R==="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(P(7,()=>{var Q;n.current.selectedItemId=(Q=q())==null?void 0:Q.id,T.emit()}),te||P(5,V),((he=c.current)==null?void 0:he.value)!==void 0){let Q=ne??"";(ue=(H=c.current).onValueChange)==null||ue.call(H,Q);return}}T.emit()}},emit:()=>{i.current.forEach(R=>R())}}),[]),O=m.useMemo(()=>({value:(R,ne,te)=>{var de;ne!==((de=o.current.get(R))==null?void 0:de.value)&&(o.current.set(R,{value:ne,keywords:te}),n.current.filtered.items.set(R,$(ne,te)),P(2,()=>{z(),T.emit()}))},item:(R,ne)=>(r.current.add(R),ne&&(s.current.has(ne)?s.current.get(ne).add(R):s.current.set(ne,new Set([R]))),P(3,()=>{B(),z(),n.current.value||U(),T.emit()}),()=>{o.current.delete(R),r.current.delete(R),n.current.filtered.items.delete(R);let te=q();P(4,()=>{B(),te?.getAttribute("id")===R&&U(),T.emit()})}),group:R=>(s.current.has(R)||s.current.set(R,new Set),()=>{o.current.delete(R),s.current.delete(R)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:C,inputId:E,labelId:N,listInnerRef:A}),[]);function $(R,ne){var te,de;let he=(de=(te=c.current)==null?void 0:te.filter)!=null?de:Tge;return R?he(R,n.current.search,ne):0}function z(){if(!n.current.search||c.current.shouldFilter===!1)return;let R=n.current.filtered.items,ne=[];n.current.filtered.groups.forEach(de=>{let he=s.current.get(de),H=0;he.forEach(ue=>{let Q=R.get(ue);H=Math.max(Q,H)}),ne.push([de,H])});let te=A.current;I().sort((de,he)=>{var H,ue;let Q=de.getAttribute("id"),Z=he.getAttribute("id");return((H=R.get(Z))!=null?H:0)-((ue=R.get(Q))!=null?ue:0)}).forEach(de=>{let he=de.closest(Bj);he?he.appendChild(de.parentElement===he?de:de.closest(`${Bj} > *`)):te.appendChild(de.parentElement===te?de:de.closest(`${Bj} > *`))}),ne.sort((de,he)=>he[1]-de[1]).forEach(de=>{var he;let H=(he=A.current)==null?void 0:he.querySelector(`${vd}[${ic}="${encodeURIComponent(de[0])}"]`);H?.parentElement.appendChild(H)})}function U(){let R=I().find(te=>te.getAttribute("aria-disabled")!=="true"),ne=R?.getAttribute(ic);T.setState("value",ne||void 0)}function B(){var R,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 H of r.current){let ue=(ne=(R=o.current.get(H))==null?void 0:R.value)!=null?ne:"",Q=(de=(te=o.current.get(H))==null?void 0:te.keywords)!=null?de:[],Z=$(ue,Q);n.current.filtered.items.set(H,Z),Z>0&&he++}for(let[H,ue]of s.current)for(let Q of ue)if(n.current.filtered.items.get(Q)>0){n.current.filtered.groups.add(H);break}n.current.filtered.count=he}function V(){var R,ne,te;let de=q();de&&(((R=de.parentElement)==null?void 0:R.firstChild)===de&&((te=(ne=de.closest(vd))==null?void 0:ne.querySelector(kge))==null||te.scrollIntoView({block:"nearest"})),de.scrollIntoView({block:"nearest"}))}function q(){var R;return(R=A.current)==null?void 0:R.querySelector(`${i6}[aria-selected="true"]`)}function I(){var R;return Array.from(((R=A.current)==null?void 0:R.querySelectorAll(QM))||[])}function W(R){let ne=I()[R];ne&&T.setState("value",ne.getAttribute(ic))}function X(R){var ne;let te=q(),de=I(),he=de.findIndex(ue=>ue===te),H=de[he+R];(ne=c.current)!=null&&ne.loop&&(H=he+R<0?de[de.length-1]:he+R===de.length?de[0]:de[he+R]),H&&T.setState("value",H.getAttribute(ic))}function K(R){let ne=q(),te=ne?.closest(vd),de;for(;te&&!de;)te=R>0?Bge(te,vd):zge(te,vd),de=te?.querySelector(QM);de?T.setState("value",de.getAttribute(ic)):X(R)}let F=()=>W(I().length-1),J=R=>{R.preventDefault(),R.metaKey?F():R.altKey?K(1):X(1)},D=R=>{R.preventDefault(),R.metaKey?W(0):R.altKey?K(-1):X(-1)};return m.createElement(Ge.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:R=>{var ne;(ne=S.onKeyDown)==null||ne.call(S,R);let te=R.nativeEvent.isComposing||R.keyCode===229;if(!(R.defaultPrevented||te))switch(R.key){case"n":case"j":{y&&R.ctrlKey&&J(R);break}case"ArrowDown":{J(R);break}case"p":case"k":{y&&R.ctrlKey&&D(R);break}case"ArrowUp":{D(R);break}case"Home":{R.preventDefault(),W(0);break}case"End":{R.preventDefault(),F();break}case"Enter":{R.preventDefault();let de=q();if(de){let he=new Event(tN);de.dispatchEvent(he)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:Wge},d),Eg(e,R=>m.createElement(c6.Provider,{value:T},m.createElement(l6.Provider,{value:O},R))))}),Oge=m.forwardRef((e,t)=>{var n,r;let s=tr(),o=m.useRef(null),i=m.useContext(u6),c=Xf(),d=f6(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:i?.forceMount;cl(()=>{if(!f)return c.item(s,i?.id)},[f]);let h=p6(s,o,[e.value,e.children,o],e.keywords),p=e_(),g=ii(P=>P.value&&P.value===h.current),x=ii(P=>f||c.filter()===!1?!0:P.search?P.filtered.items.get(s)>0:!0);m.useEffect(()=>{let P=o.current;if(!(!P||e.disabled))return P.addEventListener(tN,j),()=>P.removeEventListener(tN,j)},[x,e.onSelect,e.disabled]);function j(){var P,T;b(),(T=(P=d.current).onSelect)==null||T.call(P,h.current)}function b(){p.setState("value",h.current,!0)}if(!x)return null;let{disabled:y,value:S,onSelect:C,forceMount:N,keywords:E,...A}=e;return m.createElement(Ge.div,{ref:Tr(o,t),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!g,"data-disabled":!!y,"data-selected":!!g,onPointerMove:y||c.getDisablePointerSelection()?void 0:b,onClick:y?void 0:j},e.children)}),Rge=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...o}=e,i=tr(),c=m.useRef(null),d=m.useRef(null),f=tr(),h=Xf(),p=ii(x=>s||h.filter()===!1?!0:x.search?x.filtered.groups.has(i):!0);cl(()=>h.group(i),[]),p6(i,c,[e.value,e.heading,d]);let g=m.useMemo(()=>({id:i,forceMount:s}),[s]);return m.createElement(Ge.div,{ref:Tr(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),Eg(e,x=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},m.createElement(u6.Provider,{value:g},x))))}),Ige=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=m.useRef(null),o=ii(i=>!i.search);return!n&&!o?null:m.createElement(Ge.div,{ref:Tr(s,t),...r,"cmdk-separator":"",role:"separator"})}),Mge=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,o=e_(),i=ii(f=>f.search),c=ii(f=>f.selectedItemId),d=Xf();return m.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),m.createElement(Ge.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)}})}),$ge=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,o=m.useRef(null),i=m.useRef(null),c=ii(f=>f.selectedItemId),d=Xf();return m.useEffect(()=>{if(i.current&&o.current){let f=i.current,h=o.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let x=f.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(p),g.unobserve(f)}}},[]),m.createElement(Ge.div,{ref:Tr(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},Eg(e,f=>m.createElement("div",{ref:Tr(i,d.listInnerRef),"cmdk-list-sizer":""},f)))}),Dge=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:o,container:i,...c}=e;return m.createElement(Nv,{open:n,onOpenChange:r},m.createElement(Cv,{container:i},m.createElement(du,{"cmdk-overlay":"",className:s}),m.createElement(fu,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(d6,{ref:t,...c}))))}),Lge=m.forwardRef((e,t)=>ii(n=>n.filtered.count===0)?m.createElement(Ge.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Fge=m.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...o}=e;return m.createElement(Ge.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Eg(e,i=>m.createElement("div",{"aria-hidden":!0},i)))}),Xr=Object.assign(d6,{List:$ge,Item:Oge,Input:Mge,Group:Rge,Separator:Ige,Dialog:Dge,Empty:Lge,Loading:Fge});function Bge(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function zge(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function f6(e){let t=m.useRef(e);return cl(()=>{t.current=e}),t}var cl=typeof window>"u"?m.useEffect:m.useLayoutEffect;function lc(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function ii(e){let t=e_(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function p6(e,t,n,r=[]){let s=m.useRef(),o=Xf();return cl(()=>{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(ic,c),s.current=c}),s}var qge=()=>{let[e,t]=m.useState(),n=lc(()=>new Map);return cl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function Uge(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Eg({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(Uge(t),{ref:t.ref},n(t.props.children)):n(t)}var Wge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ul=m.forwardRef(({className:e,...t},n)=>a.jsx(Xr,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));ul.displayName=Xr.displayName;const dl=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(Xr.Input,{ref:n,className:Se("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})]}));dl.displayName=Xr.Input.displayName;const fl=m.forwardRef(({className:e,...t},n)=>a.jsx(Xr.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));fl.displayName=Xr.List.displayName;const pl=m.forwardRef((e,t)=>a.jsx(Xr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));pl.displayName=Xr.Empty.displayName;const hl=m.forwardRef(({className:e,...t},n)=>a.jsx(Xr.Group,{ref:n,className:Se("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}));hl.displayName=Xr.Group.displayName;const Vge=m.forwardRef(({className:e,...t},n)=>a.jsx(Xr.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",e),...t}));Vge.displayName=Xr.Separator.displayName;const ca=m.forwardRef(({className:e,...t},n)=>a.jsx(Xr.Item,{ref:n,className:Se("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}));ca.displayName=Xr.Item.displayName;const JM={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:[]},ZM={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"},e$=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Hge=()=>{const{agentName:e}=xl(),t=Ia(),{agents:n,setAgents:r}=ns(),{source:s}=Dn(),o=e==="new",i=e?decodeURIComponent(e):"",c=o?null:n.find(F=>F.id===i)??n.find(F=>F.name===i),[d,f]=m.useState(()=>c??e$()),[h,p]=m.useState(!1),[g,x]=m.useState(!1),[j,b]=m.useState({status:"idle"}),[y,S]=m.useState(!1),[C,N]=m.useState([]),[E,A]=m.useState(!1),[P,T]=m.useState(!1),[O,$]=m.useState(!1),z=m.useRef(null);m.useEffect(()=>{const F=o?`new:${i||"new"}`:`agt:${i}`;if(z.current!==F){if(o){f(e$()),z.current=F;return}c&&(f(c),z.current=F)}},[o,i,c]);const U=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",B=Array.from(new Set([...JM[d.provider]||[],...C])),V=B.includes(d.model),q=O||!!d.model&&!V,I=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const F=await s.listProviderModels(d.provider);b({status:"success",items:F.items,source:F.source,kind:F.kind,testedAt:new Date().toISOString()})}catch(F){b({status:"error",message:F instanceof Error?F.message:String(F),testedAt:new Date().toISOString()})}},W=async()=>{if(!U){Ae({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}A(!0);try{const F=await s.listProviderModels(d.provider);N(F.items),Ae({title:F.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${F.items.length} ${F.kind} from ${F.source}`})}catch(F){Ae({title:"Could not load provider models",description:String(F instanceof Error?F.message:F),variant:"destructive"})}finally{A(!1)}},X=async()=>{if(!d.name.trim()){Ae({title:"Name is required",variant:"destructive"});return}x(!0);try{if(o)await r([...n,d]),Ae({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const F=n.map(J=>J.id===c?.id?d:J);await r(F),Ae({title:"Agent saved"}),d.id!==i&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{x(!1)}},K=async()=>{const F=n.filter(J=>J.id!==c?.id);await r(F),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(Qi,{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(Qi,{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:()=>{I()},children:[a.jsx(rD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),y&&a.jsxs(ze,{children:[a.jsxs(At,{className:"flex-row items-center justify-between space-y-0",children:[a.jsx(Et,{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(_s,{className:"h-4 w-4"})})]}),a.jsxs(qe,{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(jr,{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(Cc,{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(F=>a.jsx("li",{className:"font-mono text-xs",children:F},F))})]}),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]}),ZM[d.provider]&&a.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",ZM[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(ze,{children:[a.jsx(At,{children:a.jsx(Et,{className:"text-base",children:"Configuration"})}),a.jsxs(qe,{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($e,{children:"Name"}),a.jsx(mt,{value:d.name,onChange:F=>f(J=>({...J,name:F.target.value})),placeholder:"e.g. GPT-4o"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Provider"}),a.jsxs(jn,{value:d.provider,onValueChange:F=>f(J=>({...J,provider:F,model:JM[F]?.[0]||""})),children:[a.jsx(vn,{children:a.jsx(Sn,{})}),a.jsxs(gn,{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($e,{children:d.provider==="azure"?"Deployment":"Model"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ru,{open:P,onOpenChange:T,children:[a.jsx(au,{asChild:!0,children:a.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":P,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(ll,{className:"w-[420px] p-0",align:"start",children:a.jsxs(ul,{children:[a.jsx(dl,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),a.jsxs(fl,{children:[a.jsxs(pl,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),a.jsxs(hl,{heading:d.provider==="azure"?"Deployments":"Models",children:[B.map(F=>a.jsxs(ca,{value:F,onSelect:J=>{f(D=>({...D,model:J})),$(!1),T(!1)},children:[a.jsx(Cc,{className:Se("mr-2 h-4 w-4",d.model===F?"opacity-100":"opacity-0")}),a.jsx("span",{className:"font-mono text-xs",children:F})]},F)),a.jsx(ca,{value:"__custom_model_id__",onSelect:()=>{$(!0),T(!1)},children:a.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),U&&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(jr,{className:"mr-1 h-3 w-3 animate-spin"}):a.jsx(ha,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),q&&a.jsx(mt,{value:d.model,onChange:F=>f(J=>({...J,model:F.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($e,{children:"Max Tokens"}),a.jsx(mt,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:F=>f(J=>({...J,maxTokens:parseInt(F.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($e,{children:"Max Turns"}),a.jsx(mt,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:F=>{const J=F.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($e,{children:"Temperature"}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),a.jsx(G8,{value:[d.temperature],onValueChange:([F])=>f(J=>({...J,temperature:F})),min:0,max:2,step:.01})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"System Prompt"}),a.jsx(ks,{value:d.systemPrompt||"",onChange:F=>f(J=>({...J,systemPrompt:F.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:g,children:[g&&a.jsx(jr,{className:"mr-2 h-4 w-4 animate-spin"}),o?"Create Agent":"Save"]})]})]})]})]}),a.jsx(Ds,{open:h,onOpenChange:p,children:a.jsxs(as,{children:[a.jsxs(ss,{children:[a.jsx(is,{children:"Delete agent?"}),a.jsxs(ls,{children:["This will permanently remove the agent"," ",a.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),a.jsxs(os,{children:[a.jsx(us,{children:"Cancel"}),a.jsx(cs,{onClick:()=>{K()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},t$="mcplab.resultAssistantScenarioHandoff",n$=()=>{const{testCaseId:e}=xl(),[t,n]=mo(),r=Ia(),{source:s}=Dn(),{scenarios:o,setScenarios:i,agents:c,servers:d,reload:f,loading:h}=ns(),[p,g]=m.useState(""),[x,j]=m.useState("all"),[b,y]=m.useState("name"),[S,C]=m.useState("asc"),[N,E]=m.useState(""),[A,P]=m.useState(null),[T,O]=m.useState("idle"),[$,z]=m.useState(""),[U,B]=m.useState(""),[V,q]=m.useState(0),[I,W]=m.useState(null),X=m.useRef(null),K=m.useRef(!1),F=m.useRef(!1),J=m.useRef(null),D=m.useRef(0),R=e?decodeURIComponent(e):void 0,ne=R?o.findIndex(L=>L.id===R):-1,te=ne>=0?o[ne]:void 0,de=async L=>{if(!te||ne<0||!L)return;const ie=[...o];ie[ne]=L,await i(ie)},he=async()=>{const L=J.current;if(!L||!te)return;if(K.current){F.current=!0;return}K.current=!0,F.current=!1;const ie=++D.current;O("saving"),z("");try{await de(L),ie===D.current&&O("saved")}catch(pe){const Ee=pe instanceof Error?pe.message:String(pe);ie===D.current&&(O("error"),z(Ee)),Ae({title:"Could not save scenario",description:Ee,variant:"destructive"})}finally{K.current=!1,F.current&&(F.current=!1,he())}},H=L=>{J.current=L,O("dirty"),z(""),X.current&&window.clearTimeout(X.current),X.current=window.setTimeout(()=>{X.current=null,he()},700)},ue=async()=>{const L=`scn-${Date.now()}`;let ie=L,pe=1;for(;o.some(Xe=>Xe.id===ie);)ie=`${L}-${pe}`,pe+=1;const Ee={id:ie,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await i([...o,Ee]),r(`/libraries/test-cases/${encodeURIComponent(ie)}`),Ae({title:"Test case created",description:`Opened ${ie} for editing.`})},Q=L=>{const ie=(L||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let pe=ie,Ee=1;for(;o.some(Xe=>Xe.id===pe);)pe=`${ie}-${Ee}`,Ee+=1;return pe},Z=async(L,ie=!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}.`}),ie&&r(`/libraries/test-cases/${encodeURIComponent(Ee.id)}`)},fe=async L=>{X.current&&(window.clearTimeout(X.current),X.current=null);const ie=o.filter(pe=>pe.id!==L.id);await i(ie),Ae({title:"Test case deleted",description:`${L.id} was removed.`}),te?.id===L.id&&(P(null),J.current=null,O("idle"),z(""),r("/libraries/test-cases"))},ae=L=>L.map(ie=>d.find(pe=>pe.id===ie)).filter(Boolean).map(ie=>ie?.name||ie?.id).filter(Boolean),Oe=m.useMemo(()=>{const L=new Set;for(const ie of o)for(const pe of ae(ie.serverIds))L.add(pe);return Array.from(L).sort((ie,pe)=>ie.localeCompare(pe))},[o,d]),we=m.useMemo(()=>{const L=p.trim().toLowerCase(),ie=o.filter(pe=>{const Ee=(pe.name||"").toLowerCase(),Xe=pe.id.toLowerCase(),pt=(pe.prompt||"").toLowerCase(),vt=ae(pe.serverIds);return x!=="all"&&!vt.includes(x)?!1:L?Ee.includes(L)||Xe.includes(L)||pt.includes(L)||vt.some(gt=>gt.toLowerCase().includes(L)):!0});return ie.sort((pe,Ee)=>{const Xe=ae(pe.serverIds),pt=ae(Ee.serverIds);let vt=0;switch(b){case"id":vt=pe.id.localeCompare(Ee.id);break;case"servers":vt=Xe.length-pt.length;break;case"evalRules":vt=pe.evalRules.length-Ee.evalRules.length;break;case"extractRules":vt=pe.extractRules.length-Ee.extractRules.length;break;default:vt=(pe.name||pe.id).localeCompare(Ee.name||Ee.id);break}return vt===0&&(vt=pe.id.localeCompare(Ee.id)),S==="asc"?vt:-vt}),ie},[o,p,x,b,S,d]);m.useEffect(()=>{let L=!0;return s.getWorkspaceSettings().then(ie=>{!L||!ie||E(ie.scenarioAssistantAgentName??"")}).catch(()=>{L&&E("")}),()=>{L=!1}},[s]),m.useEffect(()=>{if(R&&t.get("assistantHandoff")==="1")try{const L=window.sessionStorage.getItem(t$);if(!L)return;const ie=JSON.parse(L);if(!ie||ie.scenarioId!==R||!ie.prompt)return;B(String(ie.prompt)),q(Date.now()),window.sessionStorage.removeItem(t$);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{}},[R,t,n]),m.useEffect(()=>{te?(P(structuredClone(te)),J.current=structuredClone(te),O("idle"),z("")):(P(null),J.current=null,O("idle"),z("")),X.current&&(window.clearTimeout(X.current),X.current=null),K.current=!1,F.current=!1},[te]),m.useEffect(()=>()=>{X.current&&window.clearTimeout(X.current)},[]);const Ye=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(Q$,{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(Qi,{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(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!te&&a.jsxs(se,{type:"button",size:"sm",onClick:()=>{ue()},children:[a.jsx(so,{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($e,{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(mt,{value:p,onChange:L=>g(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($e,{className:"text-xs",children:"Server Filter"}),a.jsxs(jn,{value:x,onValueChange:j,children:[a.jsx(vn,{className:"h-8 text-xs",children:a.jsx(Sn,{})}),a.jsxs(gn,{children:[a.jsx(tt,{value:"all",children:"All servers"}),Oe.map(L=>a.jsx(tt,{value:L,children:L},L))]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Sort By"}),a.jsxs(jn,{value:b,onValueChange:L=>y(L),children:[a.jsx(vn,{className:"h-8 text-xs",children:a.jsx(Sn,{})}),a.jsxs(gn,{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($e,{className:"text-xs",children:"Direction"}),a.jsxs(jn,{value:S,onValueChange:L=>C(L),children:[a.jsx(vn,{className:"h-8 w-28 text-xs",children:a.jsx(Sn,{})}),a.jsxs(gn,{children:[a.jsx(tt,{value:"asc",children:"Ascending"}),a.jsx(tt,{value:"desc",children:"Descending"})]})]})]})]}),a.jsx(ze,{children:a.jsxs(qe,{className:"space-y-3 pt-6",children:[a.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",we.length," of ",o.length," test case",o.length!==1?"s":"","."]}),R&&!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:R})," was not found."]}),o.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):we.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:we.map(L=>{const ie=R===L.id,pe=`/libraries/test-cases/${encodeURIComponent(L.id)}`,Ee=ae(L.serverIds);return a.jsx("div",{className:`rounded-lg border p-3 ${ie?"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}),ie&&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(Oa,{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(Cs,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsx(se,{type:"button",size:"sm",variant:ie?"default":"outline",asChild:!0,children:a.jsxs(_t,{to:pe,children:[a.jsx(rv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},L.id)})})]})})]}),te&&A?a.jsxs(ze,{children:[a.jsx(At,{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(Et,{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] ${T==="saving"?"border-amber-300 text-amber-700":T==="saved"?"border-emerald-300 text-emerald-700":T==="error"?"border-destructive/40 text-destructive":T==="dirty"?"border-sky-300 text-sky-700":""}`,children:T==="saving"?"Saving...":T==="saved"?"Saved":T==="error"?"Save failed":T==="dirty"?"Unsaved changes":"Ready"})]}),T==="error"&&$&&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(Cs,{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(Oa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]})]})]})}),a.jsx(qe,{className:"pt-3",children:a.jsx(X1,{scenarios:[A],agents:c,servers:d,defaultAssistantAgentName:Ye,assistantInitialPromptByScenarioId:U&&A?.id?{[A.id]:U}:void 0,assistantAutoOpenNonceByScenarioId:A?.id&&V?{[A.id]:V}:void 0,onChange:L=>{const ie=L[0];ie&&(P(ie),H(ie))},allowAdd:!1})})]}):null,a.jsx(Ds,{open:!!I,onOpenChange:L=>!L&&W(null),children:a.jsxs(as,{children:[a.jsxs(ss,{children:[a.jsx(is,{children:"Delete test case?"}),a.jsxs(ls,{children:["This will permanently remove"," ",a.jsx("span",{className:"font-medium",children:I?.name||I?.id})," ","from the library. This action cannot be undone."]})]}),a.jsxs(os,{children:[a.jsx(us,{children:"Cancel"}),a.jsx(cs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{I&&(fe(I),W(null))},children:"Delete Test Case"})]})]})})]})},Kge=()=>{const{source:e}=Dn(),{agents:t,reload:n,loading:r}=ns(),[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 g=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)}},x=async()=>{await Promise.all([n(),p()])};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(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:()=>{x()},disabled:r||s,children:[a.jsx(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),a.jsxs(ze,{children:[a.jsxs(At,{className:"pb-3",children:[a.jsx(Et,{className:"text-base",children:"Assistant Defaults"}),a.jsx(qr,{children:"Default assistant agent used across assistant flows. If unset, MCP Lab uses the first available agent automatically."})]}),a.jsxs(qe,{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($e,{className:"text-xs",children:"Default Assistant Agent"}),a.jsxs(jn,{value:h||"__none__",onValueChange:j=>{g(j==="__none__"?"":j)},disabled:i,children:[a.jsx(vn,{className:"h-9 text-sm",children:a.jsx(Sn,{placeholder:"Select assistant agent"})}),a.jsxs(gn,{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"})]})]})]})},Gge=gl("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"}}),Gi=m.forwardRef(({className:e,variant:t,...n},r)=>a.jsx("div",{ref:r,role:"alert",className:Se(Gge({variant:t}),e),...n}));Gi.displayName="Alert";const Yi=m.forwardRef(({className:e,...t},n)=>a.jsx("h5",{ref:n,className:Se("mb-1 font-medium leading-none tracking-tight",e),...t}));Yi.displayName="AlertTitle";const Xi=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Se("text-sm [&_p]:leading-relaxed",e),...t}));Xi.displayName="AlertDescription";const Yge="127.0.0.1",Xge=3011,Qge="/mcp",Jge=`http://${Yge}:${Xge}${Qge}`;function Zge(e){return navigator.clipboard.writeText(e)}function h6({text:e,label:t}){const[n,r]=m.useState(!1),s=async()=>{try{await Zge(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(Cs,{className:"mr-2 h-3.5 w-3.5"}),n?"Copied":"Copy"]})}function zj({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(h6,{text:n,label:e})]})})}function r$({title:e,description:t,code:n,iconSrc:r}){return a.jsxs(ze,{children:[a.jsxs(At,{className:"pb-3",children:[a.jsxs(Et,{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(qr,{children:t})]}),a.jsxs(qe,{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(h6,{text:n,label:e})})]})]})}const exe=()=>{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??Jge,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(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),!i&&a.jsxs(Gi,{children:[a.jsx(Jj,{className:"h-4 w-4"}),a.jsx(Yi,{children:"MCP server not reported"}),a.jsx(Xi,{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(ze,{children:[a.jsxs(At,{className:"pb-3",children:[a.jsx(Et,{className:"text-base",children:"Connection Details"}),a.jsx(qr,{children:"The local server is exposed over streamable HTTP."})]}),a.jsx(qe,{className:"space-y-3",children:a.jsxs("div",{className:"grid gap-3",children:[a.jsx(zj,{label:"Direct MCP URL",value:c,copyText:c}),a.jsx(zj,{label:"Transport",value:d}),a.jsx(zj,{label:"Authentication",value:"none"})]})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(r$,{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(r$,{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 Pg="Checkbox",[txe]=hr(Pg),[nxe,t_]=txe(Pg);function rxe(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,[g,x]=pa({prop:n,defaultProp:s??!1,onChange:d,caller:Pg}),[j,b]=m.useState(null),[y,S]=m.useState(null),C=m.useRef(!1),N=j?!!i||!!j.closest("form"):!0,E={checked:g,disabled:o,setChecked:x,control:j,setControl:b,name:c,form:i,value:h,hasConsumerStoppedPropagationRef:C,required:f,defaultChecked:Zo(s)?!1:s,isFormControl:N,bubbleInput:y,setBubbleInput:S};return a.jsx(nxe,{scope:t,...E,children:axe(p)?p(E):r})}var m6="CheckboxTrigger",v6=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:g,isFormControl:x,bubbleInput:j}=t_(m6,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(Ge.button,{type:"button",role:"checkbox","aria-checked":Zo(d)?"mixed":d,"aria-required":f,"data-state":w6(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=>Zo(C)?!0:!C),j&&x&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})})});v6.displayName=m6;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(rxe,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:c,required:i,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:g})=>a.jsxs(a.Fragment,{children:[a.jsx(v6,{...p,ref:t,__scopeCheckbox:n}),g&&a.jsx(b6,{__scopeCheckbox:n})]})})});n_.displayName=Pg;var g6="CheckboxIndicator",x6=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=t_(g6,n);return a.jsx(Gn,{present:r||Zo(o.checked)||o.checked===!0,children:a.jsx(Ge.span,{"data-state":w6(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});x6.displayName=g6;var y6="CheckboxBubbleInput",b6=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:g,setBubbleInput:x}=t_(y6,e),j=wt(n,x),b=mg(o),y=lv(r);m.useEffect(()=>{const C=g;if(!C)return;const N=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(N,"checked").set,P=!s.current;if(b!==o&&A){const T=new Event("click",{bubbles:P});C.indeterminate=Zo(o),A.call(C,Zo(o)?!1:o),C.dispatchEvent(T)}},[g,b,o,s]);const S=m.useRef(Zo(o)?!1:o);return a.jsx(Ge.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%)"}})});b6.displayName=y6;function axe(e){return typeof e=="function"}function Zo(e){return e==="indeterminate"}function w6(e){return Zo(e)?"indeterminate":e?"checked":"unchecked"}const Gr=m.forwardRef(({className:e,...t},n)=>a.jsx(n_,{ref:n,className:Se("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(x6,{className:Se("flex items-center justify-center text-current"),children:a.jsx(Cc,{className:"h-4 w-4"})})}));Gr.displayName=n_.displayName;function sxe(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:g,children:x,...j}=p,b=g?.[e]?.[d]||c,y=m.useMemo(()=>j,Object.values(j));return a.jsx(b.Provider,{value:y,children:x})};f.displayName=o+"Provider";function h(p,g){const x=g?.[e]?.[d]||c,j=m.useContext(x);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,oxe(s,...t)]}function oxe(...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 ixe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],j6=ixe.reduce((e,t)=>{const n=yv(`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,[lxe]=sxe(r_),[cxe,uxe]=lxe(r_),S6=m.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:o=dxe,...i}=e;(s||s===0)&&!a$(s)&&console.error(fxe(`${s}`,"Progress"));const c=a$(s)?s:a_;r!==null&&!s$(r,c)&&console.error(pxe(`${r}`,"Progress"));const d=s$(r,c)?r:null,f=Jm(d)?o(d,c):void 0;return a.jsx(cxe,{scope:n,value:d,max:c,children:a.jsx(j6.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Jm(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":_6(d,c),"data-value":d??void 0,"data-max":c,...i,ref:t})})});S6.displayName=r_;var N6="ProgressIndicator",C6=m.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=uxe(N6,n);return a.jsx(j6.div,{"data-state":_6(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});C6.displayName=N6;function dxe(e,t){return`${Math.round(e/t*100)}%`}function _6(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Jm(e){return typeof e=="number"}function a$(e){return Jm(e)&&!isNaN(e)&&e>0}function s$(e,t){return Jm(e)&&!isNaN(e)&&e<=t&&e>=0}function fxe(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 pxe(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 A6=S6,hxe=C6;const kg=m.forwardRef(({className:e,value:t,...n},r)=>a.jsx(A6,{ref:r,className:Se("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:a.jsx(hxe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));kg.displayName=A6.displayName;function E6(e){const t=e.toLowerCase();return t.includes("side-effectful prefix")||t.includes("destructive behavior")||t.includes("destructivehint")}function o$(e){try{return JSON.stringify(e,null,2)}catch{return"[schema not serializable]"}}const Mi=["critical","high","medium","low","info"];function Nh(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 mxe(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 i$(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 vxe({label:e,reason:t,variantClassName:n}){return a.jsx(ni,{delayDuration:0,children:a.jsxs(ri,{children:[a.jsx(ai,{asChild:!0,children:a.jsx(We,{variant:"outline",className:n,children:e})}),a.jsx(lo,{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]=mo(),[r,s]=m.useState([...Mi]),[o,i]=m.useState(new Set),[c,d]=m.useState(""),[f,h]=m.useState(!1),p=t.get("groupBy")==="severity"?"severity":"tool",g=m.useRef(null),x=c.trim().toLowerCase(),j=m.useMemo(()=>new Set(r),[r]),b=O=>{s($=>{const z=$.includes(O)?$.filter(U=>U!==O):[...$,O];return z.length===0?[...Mi]:z})},y=O=>{const $=new URLSearchParams(t);O==="severity"?$.set("groupBy","severity"):$.delete("groupBy"),n($,{replace:!0})},S=m.useMemo(()=>{const O={critical:[],high:[],medium:[],low:[],info:[]};for(const $ of e.servers)for(const z of $.tools){const U=`tool-${i$(`${$.serverName}-${z.publicToolName}`)}`,B=`${$.serverName}::${z.publicToolName}`,V=z.publicToolName.split("::").pop()??z.publicToolName;for(const q of z.metadataReview?.issues??[]){const I=q.severity;O[I].push({key:`${B}-metadata-${q.id}`,toolAnchorId:U,toolLabel:B,toolDisplayName:V,sourceLabel:"Metadata review",issue:{id:q.id,title:q.title,detail:q.detail,severity:I,suggestion:q.suggestion}})}for(const q of z.deeperAnalysis?.sampleCalls??[])for(const I of q.issues){const W=I.severity;O[W].push({key:`${B}-call-${q.callIndex}-${I.id}`,toolAnchorId:U,toolLabel:B,toolDisplayName:V,sourceLabel:`Sample call ${q.callIndex}`,issue:{id:I.id,title:I.title,detail:I.detail,severity:W,suggestion:I.suggestion}})}}return O},[e.servers]),C=m.useMemo(()=>Array.from(new Set(e.servers.flatMap(O=>O.tools.map($=>$.publicToolName)).map(O=>O.split("::").pop()??O))).sort((O,$)=>O.localeCompare($)),[e.servers]),N=O=>x.length===0?!0:(O.toLowerCase().split("::").pop()??O.toLowerCase()).includes(x),E=O=>{if(!g.current)return;g.current.querySelectorAll("details").forEach(z=>{z.open=O})},A=()=>i(new Set(Mi)),P=()=>i(new Set),T=O=>{i($=>{const z=new Set($);return z.has(O)?z.delete(O):z.add(O),z})};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[a.jsx(ze,{children:a.jsxs(qe,{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(ze,{children:a.jsxs(qe,{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(ze,{children:a.jsxs(qe,{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(ze,{children:[a.jsxs(At,{className:"pb-3",children:[a.jsx(Et,{className:"text-base",children:"Analysis Overview"}),a.jsx(qr,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),a.jsx(qe,{children:a.jsxs("div",{className:"flex flex-wrap gap-2",children:[Mi.filter(O=>e.summary.issueCounts[O]>0).map(O=>{const $=j.has(O);return a.jsx("button",{type:"button",onClick:()=>b(O),className:"rounded-full","aria-pressed":$,children:a.jsxs(We,{variant:"outline",className:`capitalize font-normal ${$?Nh(O):mxe(O)} ${$?"ring-1 ring-current":"opacity-70"}`,children:[O,": ",e.summary.issueCounts[O]]})},O)}),a.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>s([...Mi]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),a.jsxs("div",{className:"space-y-0",children:[a.jsx(wg,{value:p,onValueChange:O=>{(O==="tool"||O==="severity")&&y(O)},className:"min-w-0 px-3 pt-1",children:a.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2 border-b",children:[a.jsxs(Gf,{className:"h-auto justify-start rounded-none bg-transparent p-0",children:[a.jsx(Ns,{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(Ns,{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(ru,{open:f,onOpenChange:h,children:[a.jsx(au,{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(ll,{className:"w-[320px] p-0",align:"end",children:a.jsxs(ul,{children:[a.jsx(dl,{placeholder:"Search tools..."}),a.jsxs(fl,{children:[a.jsx(pl,{children:"No tools found."}),a.jsxs(hl,{children:[a.jsx(ca,{value:"all tools",onSelect:()=>{d(""),h(!1)},children:"All tools"}),C.map(O=>a.jsx(ca,{value:O,onSelect:()=>{d(O),h(!1)},children:O},O))]})]})]})})]}),p==="severity"&&a.jsxs(a.Fragment,{children:[a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:P,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:Mi.filter(O=>j.has(O)).map(O=>{const $=S[O].filter(U=>N(U.toolLabel));if($.length===0)return null;const z=o.has(O);return a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx(Et,{className:"text-base capitalize",children:O}),a.jsxs(qr,{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:()=>T(O),children:z?"Expand":"Collapse"})})]})}),!z&&a.jsx(qe,{className:"space-y-2",children:$.map((U,B)=>a.jsxs("div",{className:"rounded border p-2 text-xs",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:B+1}),a.jsx("span",{className:"min-w-0 font-bold leading-tight",children:U.issue.title})]}),a.jsx(We,{variant:"outline",className:`shrink-0 text-[10px] ${Nh(U.issue.severity)}`,children:U.issue.severity})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",U.issue.detail]}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px]",children:[a.jsx(We,{variant:"secondary",className:"font-normal",children:U.sourceLabel}),a.jsx(se,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 font-mono text-[11px]",title:U.toolLabel,onClick:()=>{y("tool"),requestAnimationFrame(()=>{document.getElementById(U.toolAnchorId)?.scrollIntoView({behavior:"smooth",block:"start"})})},children:U.toolDisplayName})]}),U.issue.suggestion&&a.jsx(qj,{text:U.issue.suggestion})]},U.key))})]},O)})}):a.jsx("div",{ref:g,className:"space-y-4",children:e.servers.map(O=>{const $=O.tools.filter(z=>{const U=`${O.serverName}::${z.publicToolName}`;if(!N(U))return!1;const B=[...z.metadataReview?.issues??[],...z.deeperAnalysis?.sampleCalls.flatMap(V=>V.issues)??[]];return B.length===0?r.length===Mi.length:B.some(V=>j.has(V.severity))});return $.length===0?null:a.jsxs(ze,{children:[a.jsxs(At,{className:"pb-3",children:[a.jsx(Et,{className:"text-base",children:O.serverName}),a.jsxs(qr,{children:["Discovered ",O.toolCountDiscovered," · Showing ",$.length," of ",O.toolCountAnalyzed," analyzed · Skipped ",O.toolCountSkipped]})]}),a.jsxs(qe,{className:"space-y-3",children:[O.warnings.length>0&&a.jsxs(Gi,{children:[a.jsx(Yi,{children:"Warnings"}),a.jsx(Xi,{children:a.jsx("ul",{className:"ml-4 list-disc space-y-1",children:O.warnings.map(z=>a.jsx("li",{children:z},`${O.serverName}-${z}`))})})]}),$.map(z=>{const U=z.publicToolName.split("::").pop()??z.publicToolName,B=E6(z.classificationReason),V=z.safetyClassification==="read_like"?"read-like":B?"write/delete":"unsafe/unknown",q=z.safetyClassification==="read_like"?"border-emerald-200 bg-emerald-50 text-emerald-700":B?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700";return a.jsxs("details",{id:`tool-${i$(`${O.serverName}-${z.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:z.publicToolName,children:U}),a.jsx(vxe,{label:V,reason:z.classificationReason,variantClassName:q})]}),a.jsx(Yt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),z.title&&a.jsx("p",{className:"text-sm text-foreground/85",children:z.title}),z.description&&a.jsx("p",{className:"text-xs text-muted-foreground",children:z.description})]})}),a.jsxs("div",{className:"mt-3 space-y-2",children:[(z.inputSchema!==void 0||z.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:[z.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:o$(z.inputSchema)})]}),z.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:o$(z.outputSchema)})]})]})]}),z.metadataReview&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),z.metadataReview.issues.filter(I=>j.has(I.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:z.metadataReview.issues.filter(I=>j.has(I.severity)).map((I,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:I.title})]}),a.jsx(We,{variant:"outline",className:`shrink-0 text-[10px] ${Nh(I.severity)}`,children:I.severity})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",I.detail]}),I.suggestion&&a.jsx(qj,{text:I.suggestion})]},I.id))})]}),z.deeperAnalysis&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),z.deeperAnalysis.attempted?a.jsx("div",{className:"space-y-2",children:z.deeperAnalysis.sampleCalls.map(I=>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:I.ok?"secondary":"destructive",className:"text-[10px]",children:I.ok?"ok":"error"}),a.jsxs("span",{children:["Call ",I.callIndex]}),I.durationMs!==void 0&&a.jsxs("span",{className:"text-muted-foreground",children:[I.durationMs,"ms"]})]}),I.error&&a.jsx("p",{className:"text-destructive",children:I.error}),I.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:I.observations.map((W,X)=>a.jsx("li",{children:W},`${z.publicToolName}-obs-${I.callIndex}-${X}`))})]}),I.issues.filter(W=>j.has(W.severity)).length>0&&a.jsx("div",{className:"mt-2 space-y-1",children:I.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] ${Nh(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})]},`${I.callIndex}-${W.id}`))})]},`${z.publicToolName}-call-${I.callIndex}`))}):a.jsx("p",{className:"text-xs text-muted-foreground",children:z.deeperAnalysis.skippedReason??"Skipped"})]})]})]},z.publicToolName)})]})]},O.serverName)})})]})]})}function gxe(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 l$(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 c$({text:e}){return a.jsxs(ri,{children:[a.jsx(ai,{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(S7,{className:"h-3.5 w-3.5"})})}),a.jsx(lo,{className:"max-w-xs text-xs",children:a.jsx("p",{children:e})})]})}function xxe(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 yxe({label:e,reason:t,variantClassName:n}){return a.jsx(ni,{delayDuration:0,children:a.jsxs(ri,{children:[a.jsx(ai,{asChild:!0,children:a.jsx(We,{variant:"outline",className:n,children:e})}),a.jsx(lo,{className:"max-w-sm text-xs",children:a.jsx("p",{children:t})})]})})}const bxe=()=>{const{source:e}=Dn(),{servers:t,agents:n,loading:r,reload:s}=ns(),[o,i]=m.useState(""),[c,d]=m.useState([]),[f,h]=m.useState(!1),[p,g]=m.useState([]),[x,j]=m.useState({}),[b,y]=m.useState(""),[S,C]=m.useState(!0),[N,E]=m.useState(!1),[A,P]=m.useState(2),[T,O]=m.useState(1),[$,z]=m.useState(1e4),[U,B]=m.useState(null),[V,q]=m.useState([]),[I,W]=m.useState(null),[X,K]=m.useState(null),[F,J]=m.useState(!1),[D,R]=m.useState("configure"),[ne,te]=m.useState("idle"),[de,he]=m.useState(!1),H=m.useRef(null),ue=m.useRef(null),Q=o||n[0]?.name||"",Z=m.useMemo(()=>gxe(V),[V]);m.useEffect(()=>{let Ce=!0;return e.getWorkspaceSettings().then(Je=>{!Ce||!Je||i(Je.scenarioAssistantAgentName??"")}).catch(()=>{Ce&&i("")}),()=>{Ce=!1}},[e]),m.useEffect(()=>()=>{H.current?.()},[]),m.useEffect(()=>{const Ce=ue.current;Ce&&requestAnimationFrame(()=>{Ce.scrollTop=Ce.scrollHeight})},[V.length]);const fe=()=>{try{sessionStorage.removeItem(Uj)}catch{}},ae=Ce=>{try{sessionStorage.setItem(Uj,Ce)}catch{}},Oe=Ce=>{H.current?.(),H.current=e.subscribeToolAnalysisJob(Ce,Je=>{if(q(Ue=>[...Ue,Je]),Je.type==="completed")e.getToolAnalysisResult(Ce).then(Ue=>{W(Ue.report),K(Ue.savedReportId??null)}).catch(Ue=>Ae({title:"Could not load analysis report",description:Ue instanceof Error?Ue.message:String(Ue),variant:"destructive"})).finally(()=>{fe(),B(null),J(!1),te("idle"),R("run")});else if(Je.type==="error"){const Ue=String(Je.payload?.message??"");fe(),te(Ue.toLowerCase().includes("abort")?"stopped":"error"),B(null),J(!1)}})};m.useEffect(()=>{if(U||I)return;let Ce="";try{Ce=sessionStorage.getItem(Uj)??""}catch{Ce=""}if(Ce)return R("run"),te("running"),J(!0),B(Ce),q([]),Oe(Ce),()=>{}},[e,U,I]);const we=async()=>{if(c.length===0){g([]),j({});return}const Ce=c.filter(Je=>t.find(ve=>ve.id===Je)?.authType==="oauth2");try{Ce.length>0&&(he(!0),await ao({serverNames:Ce,source:e,onServerAuthStart:Je=>{Ae({title:`OAuth login required for ${Je}`,description:"Complete login in the opened browser tab. Discovery will continue automatically."})}}))}catch(Je){Ae({title:"OAuth login failed",description:Je instanceof Error?Je.message:String(Je),variant:"destructive"}),he(!1);return}finally{he(!1)}h(!0);try{const Je=await e.discoverToolsForAnalysis({serverNames:c});g(Je.servers),j(Ue=>{const ve={};for(const Le of Je.servers){const Ie=Ue[Le.serverName]??[],Ze=Le.tools.map(Fe=>Fe.name),_e=Ie.filter(Fe=>Ze.includes(Fe));ve[Le.serverName]=_e.length>0?_e:Ze}return ve})}catch(Je){Ae({title:"Could not discover MCP tools",description:Je instanceof Error?Je.message:String(Je),variant:"destructive"})}finally{h(!1)}};m.useEffect(()=>{we()},[c.join("|")]);const Ye=m.useMemo(()=>{const Ce=b.trim().toLowerCase();return Ce?p.map(Je=>({...Je,tools:Je.tools.filter(Ue=>Ue.name.toLowerCase().includes(Ce)||(Ue.description||"").toLowerCase().includes(Ce))})).filter(Je=>Je.tools.length>0):p},[p,b]),L=m.useMemo(()=>Object.values(x).reduce((Ce,Je)=>Ce+Je.length,0),[x]),ie=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),q([]),W(null),K(null),R("run"),te("running");try{const Ce=c[0];t.find(ve=>ve.id===Ce)?.authType==="oauth2"&&(he(!0),await ao({serverNames:[Ce],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:Ue}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:x,maxParallelTools:A,modes:{metadataReview:S,deeperAnalysis:N},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:T,toolCallTimeoutMs:$}});B(Ue),ae(Ue),Oe(Ue)}catch(Ce){J(!1),te("error"),R("run"),Ae({title:"Could not start tool analysis",description:Ce instanceof Error?Ce.message:String(Ce),variant:"destructive"})}finally{he(!1)}},Ee=async()=>{if(!U)return;const Ce=U;try{const Je=await e.stopToolAnalysis(Ce);if(Je.status==="completed"){H.current?.(),H.current=null;const Ue=await e.getToolAnalysisResult(Ce);W(Ue.report),K(Ue.savedReportId??null),fe(),B(null),J(!1),te("idle"),R("run"),Ae({title:"Analysis already finished",description:"Showing the result overview."});return}if(Je.status==="stopped"){H.current?.(),H.current=null,fe(),B(null),J(!1),te("stopped"),Ae({title:"Analysis stopped"});return}if(Je.status==="error"){H.current?.(),H.current=null,fe(),B(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(Je){Ae({title:"Could not stop analysis",description:Je instanceof Error?Je.message:String(Je),variant:"destructive"})}},Xe=()=>{R("configure"),te("idle"),B(null)},pt=(Ce,Je)=>{d(Ue=>Je?[Ce]:Ue.filter(ve=>ve!==Ce))},vt=(Ce,Je,Ue)=>{j(ve=>{const Le=new Set(ve[Ce]??[]);return Ue?Le.add(Je):Le.delete(Je),{...ve,[Ce]:Array.from(Le)}})},gt=(Ce,Je)=>{j(Ue=>({...Ue,[Ce]:Je}))},Bt=!0,Lt=U!==null||V.length>0||ne==="stopped"||ne==="error",$t=!!I,Ot=Ce=>{if(Ce==="configure"&&Bt){R("configure");return}if(Ce==="run"&&Lt){R("run");return}Ce==="report"&&$t&&R("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(eD,{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:()=>Ot("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:()=>Ot("run"),disabled:!Lt,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:Lt?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),a.jsx("button",{type:"button",onClick:()=>Ot("report"),disabled:!$t,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:a.jsx(We,{variant:D==="report"?"default":"outline",className:$t?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),D==="configure"&&a.jsxs(ze,{children:[a.jsxs(At,{children:[a.jsx(Et,{className:"text-base",children:"Run MCP analysis"}),a.jsx(qr,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),a.jsxs(qe,{className:"space-y-5",children:[!Q&&a.jsxs(Gi,{children:[a.jsx(Yi,{children:"No assistant agent available"}),a.jsxs(Xi,{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($e,{className:"text-xs",children:"Servers"}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{s()},disabled:r||de,children:[a.jsx(ha,{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(Ce=>{const Je=c.includes(Ce.id);return a.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[a.jsx(Gr,{checked:Je,onCheckedChange:Ue=>pt(Ce.id,!!Ue)}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-medium",children:Ce.name||Ce.id}),Ce.url&&a.jsx("div",{className:"truncate text-xs text-muted-foreground",children:Ce.url})]})]},Ce.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($e,{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(mt,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:Ce=>y(Ce.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($e,{className:"text-xs",children:ie?`Tools for ${ie}`:"Tools"}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{we()},disabled:f||de||c.length===0,children:[f&&a.jsx(jr,{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..."}):Ye.length===0&&!f?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):Ye.map(Ce=>{const Je=new Set(x[Ce.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:Ce.serverName}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>gt(Ce.serverName,Ce.tools.map(Ue=>Ue.name)),children:"Select all"}),a.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>gt(Ce.serverName,[]),children:"Clear"})]})]}),Ce.warnings.length>0&&a.jsx("div",{className:"mb-2 space-y-1",children:Ce.warnings.map(Ue=>a.jsx("div",{className:"text-xs text-amber-700",children:xxe(Ce.serverName,Ue)},`${Ce.serverName}-${Ue}`))}),a.jsx("div",{className:"grid gap-2",children:Ce.tools.map(Ue=>{const ve=E6(Ue.classificationReason),Le=Ue.safetyClassification==="read_like"?"read-like":ve?"write/delete":"unsafe/unknown",Ie=Ue.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(Gr,{checked:Je.has(Ue.name),onCheckedChange:Ze=>vt(Ce.serverName,Ue.name,!!Ze)}),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:Ue.name}),Ue.title&&a.jsx("span",{className:"text-xs text-muted-foreground",children:Ue.title}),a.jsx(yxe,{label:Le,reason:Ue.classificationReason,variantClassName:Ie}),Ue.inputSchema&&a.jsx(We,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: input"}),Ue.outputSchema&&a.jsx(We,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: output"})]}),Ue.description&&a.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ue.description})]})]},`${Ce.serverName}-${Ue.name}`)})})]},Ce.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(Gr,{checked:S,onCheckedChange:Ce=>C(!!Ce)}),a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",a.jsx(c$,{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(Gr,{checked:N,onCheckedChange:Ce=>E(!!Ce)}),a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",a.jsx(c$,{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($e,{className:"text-xs",children:"Max parallel tools"}),a.jsx(mt,{type:"number",min:1,max:8,value:A,onChange:Ce=>P(Math.max(1,Math.min(8,Number(Ce.target.value)||2))),className:"h-8"})]}),N?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{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($e,{className:"text-xs",children:"Sample calls per tool"}),a.jsx(mt,{type:"number",min:1,max:5,value:T,onChange:Ce=>O(Math.max(1,Math.min(5,Number(Ce.target.value)||1))),className:"h-8"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Tool call timeout (ms)"}),a.jsx(mt,{type:"number",min:1e3,max:6e4,step:500,value:$,onChange:Ce=>z(Math.max(1e3,Math.min(6e4,Number(Ce.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:F||de||!!U,children:[(F||!!U)&&a.jsx(jr,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),D==="run"&&a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(Et,{className:"flex items-center gap-2 text-base",children:a.jsx("span",{children:"Progress"})}),a.jsx(qr,{children:U?"Live tool-analysis job events:":I?"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."})]}),U?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(qe,{className:"space-y-2",children:[U&&a.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-muted/20 px-2.5 py-1 text-xs text-muted-foreground",children:[a.jsx(jr,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(Z.totalTools>0||U)&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[a.jsx("span",{children:Z.totalTools>0?`${Z.finishedTools}/${Z.totalTools} tools finished`:"Preparing analysis..."}),a.jsx("span",{children:Z.totalTools>0?`${Z.percent}%`:"0%"})]}),a.jsx(kg,{value:Z.totalTools>0?Z.percent:0,className:"h-2"})]}),V.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:U?"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:V.map((Ce,Je)=>a.jsxs("div",{className:"text-xs",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}),a.jsx("span",{className:"break-all",children:typeof Ce.payload.message=="string"?Ce.payload.message:JSON.stringify(Ce.payload)})]},`${Ce.ts}-${Je}`))}),!U&&I&&a.jsx(ze,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:a.jsxs(qe,{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:[I.summary.toolsAnalyzed," tools analyzed, ",I.summary.toolsSkipped," skipped, across"," ",I.summary.serversAnalyzed," server",I.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:()=>Ot("report"),children:"View inline report"})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.summary.issueCounts.critical>0&&a.jsxs(We,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",I.summary.issueCounts.critical]}),I.summary.issueCounts.high>0&&a.jsxs(We,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",I.summary.issueCounts.high]}),I.summary.issueCounts.medium>0&&a.jsxs(We,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",I.summary.issueCounts.medium]}),I.summary.issueCounts.low>0&&a.jsxs(We,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",I.summary.issueCounts.low]}),I.summary.issueCounts.info>0&&a.jsxs(We,{variant:"outline",children:["Info: ",I.summary.issueCounts.info]}),Object.values(I.summary.issueCounts).every(Ce=>Ce===0)&&a.jsx(We,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),D==="report"&&I&&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:[I.summary.toolsAnalyzed," tools analyzed across ",I.summary.serversAnalyzed," server",I.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:()=>l$(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(I,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:()=>l$(`tool-analysis-${Date.now()}.md`,s_(I),"text/markdown"),children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),a.jsx(P6,{report:I})]})]})};function u$(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 wxe(){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,g]=m.useState(!1),x=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(()=>{x()},[]);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"?u$(`${N}.json`,`${JSON.stringify(A,null,2)}
144
- `,"application/json"):u$(`${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(tD,{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(ru,{open:p,onOpenChange:g,children:[a.jsx(au,{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(ll,{className:"w-[240px] p-0",align:"start",children:a.jsxs(ul,{children:[a.jsx(dl,{placeholder:"Search MCP servers..."}),a.jsxs(fl,{children:[a.jsx(pl,{children:"No servers found."}),a.jsxs(hl,{children:[a.jsx(ca,{value:"all servers",onSelect:()=>{h("all"),g(!1)},children:"All servers"}),j.map(N=>a.jsx(ca,{value:N,onSelect:()=>{h(N),g(!1)},children:N},N))]})]})]})})]})]}),a.jsx(se,{variant:"outline",onClick:()=>{x()},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(ze,{children:a.jsx(qe,{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(Ur,{children:[a.jsx(Wr,{children:a.jsxs(Kt,{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(Vr,{children:b.map(N=>a.jsxs(Kt,{children:[a.jsx(Be,{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(Be,{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(Be,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(po,{className:"h-3 w-3"}),new Date(N.createdAt).toLocaleString()]})}),a.jsx(Be,{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(Be,{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(Be,{children:a.jsxs(Hf,{children:[a.jsx(Kf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(nv,{className:"h-4 w-4"})})}),a.jsxs(wu,{align:"end",children:[a.jsx(Kr,{asChild:!0,children:a.jsx(_t,{to:`/tool-analysis-results/${N.reportId}`,children:"View"})}),a.jsxs(Kr,{onSelect:()=>{C(N.reportId,"json")},children:[a.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),a.jsxs(Kr,{onSelect:()=>{C(N.reportId,"markdown")},children:[a.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),a.jsxs(Kr,{className:"text-destructive",onSelect:E=>{E.preventDefault(),i(N.reportId)},children:[a.jsx(Oa,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},N.reportId))})]})]})})}),a.jsx(Ds,{open:!!o,onOpenChange:N=>!N&&i(null),children:a.jsxs(as,{children:[a.jsxs(ss,{children:[a.jsx(is,{children:"Delete tool analysis report?"}),a.jsx(ls,{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(os,{children:[a.jsx(us,{disabled:c,children:"Cancel"}),a.jsx(cs,{onClick:N=>{N.preventDefault(),S()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}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{id:e=""}=xl(),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,g]=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 x=async()=>{g(!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{g(!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(po,{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:()=>d$(`${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:()=>d$(`${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(Oa,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),a.jsx(P6,{report:r.report}),a.jsx(Ds,{open:f,onOpenChange:h,children:a.jsxs(as,{children:[a.jsxs(ss,{children:[a.jsx(is,{children:"Delete tool analysis report?"}),a.jsxs(ls,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),a.jsxs(os,{children:[a.jsx(us,{disabled:p,children:"Cancel"}),a.jsx(cs,{onClick:j=>{j.preventDefault(),x()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const Sxe=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function Cr({text:e}){return a.jsx(ni,{delayDuration:200,children:a.jsxs(ri,{children:[a.jsx(ai,{type:"button",className:"inline-flex shrink-0 items-center",onClick:t=>t.preventDefault(),children:a.jsx(k7,{className:"h-3.5 w-3.5 text-muted-foreground/50 hover:text-muted-foreground"})}),a.jsx(lo,{className:"max-w-xs text-xs leading-relaxed",children:e})]})})}function f$(e){return navigator.clipboard.writeText(e)}function Wj(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function Nxe(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 Cxe(){const{source:e}=Dn(),{servers:t,reload:n,loading:r}=ns(),[s,o]=m.useState("configure"),[i,c]=m.useState(""),[d,f]=m.useState("pre_registered"),[h,p]=m.useState("local_callback"),[g,x]=m.useState(!0),[j,b]=m.useState(!0),[y,S]=m.useState(!0),[C,N]=m.useState(""),[E,A]=m.useState(""),[P,T]=m.useState(""),[O,$]=m.useState(""),[z,U]=m.useState("__default__"),[B,V]=m.useState("{}"),[q,I]=m.useState(""),[W,X]=m.useState(""),[K,F]=m.useState(""),[J,D]=m.useState(""),[R,ne]=m.useState(""),[te,de]=m.useState(""),[he,H]=m.useState(""),[ue,Q]=m.useState(""),[Z,fe]=m.useState(null),[ae,Oe]=m.useState(null),[we,Ye]=m.useState([]),[L,ie]=m.useState(!1),[pe,Ee]=m.useState(!1),[Xe,pt]=m.useState(!1),[vt,gt]=m.useState("all"),[Bt,Lt]=m.useState("all"),[$t,Ot]=m.useState("inspector"),Ce=m.useRef(null),Je=m.useRef(null),Ue=m.useRef(!1),ve=m.useRef(j);m.useEffect(()=>{ve.current=j},[j]),m.useEffect(()=>()=>{Ce.current?.(),Ce.current=null},[]),m.useEffect(()=>{Je.current?.scrollIntoView({behavior:"smooth",block:"end"})},[we.length]);const Le=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]),Ie=Le.find(ce=>ce.id===i);m.useEffect(()=>{i&&(Le.some(ce=>ce.id===i)||c(""))},[Le,i]),m.useEffect(()=>{Ie&&(Ie.oauthMode==="dcr"?(f("dcr"),T(""),$("")):(f("pre_registered"),T(Ie.oauthClientId??""),$(Ie.oauthClientSecret??"")),N(Ie.oauthScope??""),D(Ie.oauthAuthorizationUrl??""),ne(Ie.oauthTokenEndpoint??""))},[Ie?.id]);const Ze=m.useMemo(()=>{const ce=Z?.stepStates.length??0,st=Z?.stepStates.filter(xt=>xt.status==="completed"||xt.status==="skipped").length??0,St=Z?.stepStates.filter(xt=>xt.status==="failed").length??0,en=ce>0?Math.round((st+St)/ce*100):0;return{total:ce,completed:st,failed:St,percent:en}},[Z]),_e=m.useMemo(()=>{const ce=Z?.network??[],st=new Map,St=[],en=xt=>`${xt.stepId}::${xt.label}::${xt.url}`;for(const xt of ce){if(xt.phase==="request"){const wo=St.length;St.push({key:xt.id,stepId:xt.stepId,label:xt.label,method:xt.method,url:xt.url,request:xt});const Y=en(xt),xe=st.get(Y)??[];xe.push(wo),st.set(Y,xe);continue}const Tn=en(xt),ur=st.get(Tn),ma=ur?.shift();if(typeof ma=="number"){St[ma]={...St[ma],response:xt},ur&&ur.length>0?st.set(Tn,ur):st.delete(Tn);continue}St.push({key:xt.id,stepId:xt.stepId,label:xt.label,method:xt.method,url:xt.url,response:xt})}return St.filter(xt=>vt!=="all"&&xt.stepId!==vt?!1:Bt==="error"?typeof xt.response?.status=="number"&&xt.response.status>=400:Bt==="ok"?typeof xt.response?.status=="number"&&xt.response.status<400:!0)},[Z?.network,vt,Bt]),Fe=!!ae,Xt=!!(Z&&(Z.status==="completed"||Z.status==="error"||Z.status==="stopped")),be=m.useMemo(()=>{const ce=new Map;return(Z?.stepStates??[]).forEach((st,St)=>{ce.set(st.id,St+1)}),ce},[Z?.stepStates]),Ct=ce=>{if(ce==="configure"||ce==="run"&&Fe||ce==="report"&&Xt)return o(ce)},zt=()=>{let ce;if(d==="dcr"&&B.trim())try{ce=JSON.parse(B)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Ie)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Ie.id,overrides:{authorizationServerMetadataUrl:K||void 0,authorizationEndpoint:J||void 0,tokenEndpoint:R||void 0,registrationEndpoint:te||void 0,cimdUrl:q||void 0,resourceBaseUrl:he||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:P.trim(),clientSecret:O.trim()||void 0,tokenEndpointAuthMethod:z==="__default__"?void 0:z||void 0}:void 0,dcr:d==="dcr"?{metadata:ce,tokenEndpointAuthMethod:z==="__default__"?void 0:z||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:q||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:g}}},Ht=ce=>{Ce.current?.(),Ce.current=e.subscribeOAuthDebuggerSession(ce,st=>{Ye(en=>[...en,st]),(st.type==="completed"||st.type==="error"||st.type==="stopped")&&ie(!1),e.getOAuthDebuggerSession(ce).then(en=>{fe(en.session),en.session.uiHints.authorizationUrl&&an(`${Wj()}/api/oauth-debugger/sessions/${ce}/authorize`),en.session.status==="completed"&&o("report")}).catch(()=>{})})},an=ce=>{!ve.current||Ue.current||!ce||(Ue.current=!0,window.open(ce,"_blank","noopener,noreferrer"))},Qt=async()=>{Ee(!0),Ue.current=!1;try{const ce=zt(),st=await e.createOAuthDebuggerSession(ce);Oe(st.sessionId),fe(st.session),Ye([]),o("run"),Ht(st.sessionId);const St=await e.startOAuthDebuggerSession(st.sessionId);fe(St.session),ie(!0),(St.session.status==="waiting_for_user"||St.session.status==="waiting_for_browser_callback")&&(ie(!1),St.session.uiHints.authorizationUrl&&an(`${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)}},mr=async()=>{if(ae)try{Ee(!0);const ce=await e.submitOAuthDebuggerManualCallback(ae,{redirectUrl:ue.trim()||void 0});fe(ce.session),Q(""),ie(!0)}catch(ce){Ae({title:"Could not submit callback",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{Ee(!1)}},ht=async()=>{if(ae){pt(!0);try{const ce=await e.stopOAuthDebuggerSession(ae);if(ie(!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{pt(!1)}}},Tt=async()=>{Ce.current?.(),Ce.current=null,fe(null),Oe(null),Ye([]),ie(!1),pt(!1),Ee(!1),Q(""),gt("all"),Lt("all"),Ot("inspector"),o("run"),await Qt()},Dt=async ce=>{if(!(!ae||!Z))try{const st=await e.exportOAuthDebuggerSession(ae,ce);let St="";const en=ce==="json"?"json":ce==="raw"?"txt":"md";typeof st=="string"?St=st:St=`${JSON.stringify(st,null,2)}
148
- `;const xt=new Blob([St],{type:"text/plain;charset=utf-8"}),Tn=URL.createObjectURL(xt),ur=document.createElement("a");ur.href=Tn,ur.download=`oauth-debugger-${ae}.${en}`,ur.click(),URL.revokeObjectURL(Tn)}catch(st){if(ce==="markdown"){const St=Nxe(Z,we),en=new Blob([St],{type:"text/markdown;charset=utf-8"}),xt=URL.createObjectURL(en),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"})}},sn=ae?`${Wj()}/api/oauth-debugger/sessions/${ae}/authorize`:void 0,Bn=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:Sxe.map(ce=>{const st=s===ce.id,St=ce.id==="configure"||ce.id==="run"&&Fe||ce.id==="report"&&Xt;return a.jsx("button",{type:"button",onClick:()=>St&&Ct(ce.id),disabled:!St,className:"rounded-full",children:a.jsx(We,{variant:st?"default":"outline",className:St?"":"opacity-50",children:ce.label})},ce.id)})})]}),s==="configure"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(Et,{className:"text-base",children:"Target MCP Server"}),a.jsx(qr,{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(ha,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),a.jsx(qe,{className:"space-y-3",children:a.jsxs("div",{className:"max-w-xl space-y-2",children:[a.jsx($e,{children:"MCP Server"}),a.jsxs(jn,{value:i,onValueChange:c,children:[a.jsx(vn,{children:a.jsx(Sn,{placeholder:"Select an MCP server"})}),a.jsx(gn,{children:Le.map(ce=>a.jsx(tt,{value:ce.id,children:ce.name||ce.id},ce.id))})]}),Le.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"}),"."]}),Ie&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:[Ie.transport," · ",Ie.url||Ie.command||"No URL/command"," · ",a.jsxs("span",{className:"text-primary",children:[Ie.oauthMode==="dcr"?"DCR":"pre-registered"," fields pre-filled"]})]})]})})]}),a.jsxs(ze,{children:[a.jsxs(At,{className:"pb-3",children:[a.jsx(Et,{className:"text-base",children:"Client Registration Method"}),a.jsx(qr,{children:"How your OAuth client is identified with the authorization server."})]}),a.jsxs(qe,{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($e,{className:"text-xs flex items-center gap-1",children:["Redirect mode",a.jsx(Cr,{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(jn,{value:h,onValueChange:ce=>p(ce),children:[a.jsx(vn,{children:a.jsx(Sn,{})}),a.jsxs(gn,{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($e,{className:"text-xs flex items-center gap-1",children:["client_id",a.jsx(Cr,{text:"The unique identifier for your application, issued by the authorization server when you registered the client."})]}),a.jsx(mt,{value:P,onChange:ce=>T(ce.target.value)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["client_secret",a.jsx(Cr,{text:"Leave empty for public clients (e.g. SPAs or mobile apps). Required for confidential clients that authenticate with the token endpoint."})]}),a.jsx(mt,{value:O,onChange:ce=>$(ce.target.value),type:"password",placeholder:"optional"})]})]}),d==="cimd"&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["CIMD URL",a.jsx(Cr,{text:"A publicly reachable URL hosting a JSON document that describes this client. The authorization server fetches it to identify the client."})]}),a.jsx(mt,{value:q,onChange:ce=>I(ce.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),a.jsxs(ze,{children:[a.jsxs(At,{className:"pb-3",children:[a.jsx(Et,{className:"text-base",children:"Runtime OAuth Inputs"}),a.jsx(qr,{children:"Parameters sent in the authorization request."})]}),a.jsxs(qe,{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Scopes"}),a.jsx(mt,{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(Gr,{checked:y,onCheckedChange:ce=>S(!!ce)}),a.jsxs($e,{className:"flex items-center gap-1",children:["Use PKCE (S256)",a.jsx(Cr,{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(Gr,{checked:j,onCheckedChange:ce=>b(!!ce)}),a.jsx($e,{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($e,{className:"text-xs flex items-center gap-1",children:["Token endpoint auth method",a.jsx(Cr,{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(jn,{value:z,onValueChange:U,children:[a.jsx(vn,{children:a.jsx(Sn,{placeholder:"Server default (recommended)"})}),a.jsxs(gn,{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($e,{className:"text-xs flex items-center gap-1",children:["Resource / audience",a.jsx(Cr,{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(mt,{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($e,{className:"text-xs flex items-center gap-1",children:["DCR metadata JSON",a.jsx(Cr,{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(ks,{value:B,onChange:ce=>V(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($e,{className:"text-xs flex items-center gap-1",children:["Expected client_id",a.jsx(Cr,{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(mt,{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($e,{className:"text-xs flex items-center gap-1",children:["Authorization server metadata URL",a.jsx(Cr,{text:"The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path."})]}),a.jsx(mt,{value:K,onChange:ce=>F(ce.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Resource server base URL",a.jsx(Cr,{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(mt,{value:he,onChange:ce=>H(ce.target.value),placeholder:"https://resource.example.com"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Authorization endpoint",a.jsx(Cr,{text:"The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata."})]}),a.jsx(mt,{value:J,onChange:ce=>D(ce.target.value),placeholder:"https://.../authorize"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Token endpoint",a.jsx(Cr,{text:"The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically."})]}),a.jsx(mt,{value:R,onChange:ce=>ne(ce.target.value),placeholder:"https://.../token"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Registration endpoint (DCR)",a.jsx(Cr,{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(mt,{value:te,onChange:ce=>de(ce.target.value),placeholder:"https://.../register"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["CIMD URL override",a.jsx(Cr,{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(mt,{value:q,onChange:ce=>I(ce.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),a.jsxs(Gi,{children:[a.jsx(yy,{className:"h-4 w-4"}),a.jsx(Yi,{children:"Secrets display"}),a.jsxs(Xi,{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(Gr,{checked:!g,onCheckedChange:ce=>x(ce===!1)}),a.jsx($e,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),a.jsx("div",{className:"flex justify-end",children:a.jsxs(se,{type:"button",onClick:()=>{Qt()},disabled:pe,children:[pe&&a.jsx(jr,{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(ze,{className:"xl:col-span-1 min-w-0",children:[a.jsx(At,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(Et,{className:"text-base",children:"Progress"}),a.jsx(qr,{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&&sn&&a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsxs("a",{href:sn,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(Ih,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Tt()},disabled:pe,children:[a.jsx(ha,{className:"mr-2 h-4 w-4"}),"Restart"]}),ae&&a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ht()},disabled:Xe||!ae,children:[(Xe||L)&&Xe&&a.jsx(jr,{className:"mr-2 h-4 w-4 animate-spin"}),a.jsx(Ah,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),a.jsxs(qe,{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:[Ze.completed+Ze.failed,"/",Ze.total," steps"]}),a.jsxs("span",{children:[Ze.percent,"%"]})]}),a.jsx(kg,{value:Ze.percent,className:"h-2"})]}),Z?.status==="waiting_for_user"&&a.jsx(ze,{children:a.jsxs(qe,{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(ks,{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:()=>{mr()},disabled:pe||!ue.trim(),children:[pe&&a.jsx(jr,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),Z.uiHints.authorizationUrl&&sn&&a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsx("a",{href:sn,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),Z?.status==="waiting_for_browser_callback"&&a.jsxs(Gi,{children:[a.jsx(yy,{className:"h-4 w-4"}),a.jsx(Yi,{children:"Waiting for browser callback"}),a.jsxs(Xi,{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&&sn&&a.jsx("div",{className:"pt-2",children:a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsxs("a",{href:sn,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(Ih,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),a.jsx("div",{className:"space-y-2",children:Z?.stepStates.map(ce=>{const st=be.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(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(Et,{className:"text-base",children:"Inspect"}),a.jsx(qr,{children:"Live events and network requests/responses for the OAuth flow."})]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Dt("raw")},disabled:!ae||!Z,children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})}),a.jsx(qe,{className:"space-y-3",children:a.jsxs(wg,{value:$t,onValueChange:ce=>Ot(ce),className:"min-w-0",children:[a.jsxs(Gf,{className:"grid grid-cols-2",children:[a.jsx(Ns,{value:"inspector",children:"Network Inspector"}),a.jsx(Ns,{value:"events",children:"Live Debug"})]}),a.jsx(jf,{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:[we.length===0?a.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):we.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:Je})]})}),a.jsxs(jf,{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($e,{className:"text-xs",children:"Filter by step"}),a.jsxs(jn,{value:vt,onValueChange:gt,children:[a.jsx(vn,{className:"h-8",children:a.jsx(Sn,{})}),a.jsxs(gn,{children:[a.jsx(tt,{value:"all",children:"All steps"}),(Z?.stepStates??[]).map(ce=>a.jsxs(tt,{value:ce.id,children:[be.get(ce.id),". ",ce.title]},ce.id))]})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Filter by status"}),a.jsxs(jn,{value:Bt,onValueChange:Lt,children:[a.jsx(vn,{className:"h-8",children:a.jsx(Sn,{})}),a.jsxs(gn,{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:_e.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):_e.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:be.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:()=>{f$(JSON.stringify(ce,null,2))},children:[a.jsx(Cs,{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:()=>{Dt("json")},children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Dt("markdown")},children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Dt("raw")},children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),a.jsxs(Gi,{children:[a.jsx(yy,{className:"h-4 w-4"}),a.jsx(Yi,{children:"Secrets display mode"}),a.jsx(Xi,{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(ze,{children:a.jsxs(qe,{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(ze,{children:a.jsxs(qe,{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(ze,{children:a.jsxs(qe,{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(ze,{children:a.jsxs(qe,{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(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Key values"})}),a.jsxs(qe,{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Issuer"}),a.jsx("p",{className:"text-sm break-all",children:Z.summary?.issuer||"-"})]}),a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Client ID"}),a.jsx("p",{className:"text-sm break-all",children:Z.summary?.clientId||"-"})]}),a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Redirect URI"}),a.jsx("p",{className:"text-sm break-all",children:Z.summary?.redirectUri||"-"})]}),a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Token endpoint status"}),a.jsx("p",{className:"text-sm",children:Z.summary?.tokenEndpointStatus??"-"})]}),a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Token type"}),a.jsx("p",{className:"text-sm",children:Z.summary?.tokenType||"-"})]}),a.jsxs("div",{children:[a.jsx($e,{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($e,{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($e,{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($e,{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:()=>{f$(Z.summary.accessToken)},children:[a.jsx(Cs,{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(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Validation findings"})}),a.jsx(qe,{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:Bn(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",_xe=()=>{const[e]=mo(),[t,n]=m.useState(""),[r,s]=m.useState("1"),[o,i]=m.useState(!1),[c,d]=m.useState(0),[f,h]=m.useState([]),[p,g]=m.useState(!1),[x,j]=m.useState(!1),[b,y]=m.useState(""),[S,C]=m.useState(null),[N,E]=m.useState([]),[A,P]=m.useState([]),[T,O]=m.useState(!0),[$,z]=m.useState(""),[U,B]=m.useState(""),[V,q]=m.useState(!1),[I,W]=m.useState([]),[X,K]=m.useState(null),[F,J]=m.useState(!1),[D,R]=m.useState(null),ne=m.useRef(null),te=m.useRef(null),de=m.useRef(!1),{configs:he,reload:H}=Rf(),{source:ue}=Dn(),Q=Cg("snapshots",!1),{agents:Z,scenarios:fe,servers:ae,reload:Oe}=ns(),we=b.trim(),Ye=we?`/results/${encodeURIComponent(we)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",L=he.find(ve=>ve.id===t),ie=e.get("configId"),pe=m.useMemo(()=>{if(!L)return[];const ve=new Map,Le=L.agentEntries&&L.agentEntries.length>0?L.agentEntries:L.agents.map(Ie=>({kind:"inline",agent:Ie}));for(const Ie of Le){if(Ie.kind==="inline"){const _e=Ie.agent.id;ve.has(_e)||ve.set(_e,Ie.agent);continue}const Ze=Z.find(_e=>_e.id===Ie.ref);Ze&&!ve.has(Ze.id)&&ve.set(Ze.id,Ze)}for(const Ie of Z)ve.has(Ie.id)||ve.set(Ie.id,Ie);return Array.from(ve.values())},[L,Z]),Ee=m.useMemo(()=>{if(!L)return[];const ve=new Map,Le=L.scenarioEntries&&L.scenarioEntries.length>0?L.scenarioEntries:L.scenarios.map(Ie=>({kind:"inline",scenario:Ie}));for(const Ie of Le){if(Ie.kind==="inline"){ve.has(Ie.scenario.id)||ve.set(Ie.scenario.id,Ie.scenario);continue}const Ze=fe.find(_e=>_e.id===Ie.ref);Ze&&!ve.has(Ze.id)&&ve.set(Ze.id,Ze)}return Array.from(ve.values())},[L,fe]);m.useEffect(()=>{ie&&he.some(ve=>ve.id===ie)&&n(ie)},[ie,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([]),P([]);return}const Le=pe.filter(Ie=>(L.runDefaults?.selectedAgentNames??[]).includes(Ie.id)).map(Ie=>Ie.id);E(Le.length>0?Le:pe.map(Ie=>Ie.id)),P(Ee.map(Ie=>Ie.id)),O(!0)},[L?.id,L?.sourcePath,pe,Ee]);const pt=async()=>{if(!L?.sourcePath){h(_e=>[..._e,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const ve=pe.filter(_e=>N.includes(_e.id));if(ve.length===0){h(_e=>[..._e,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const Le=Ee.filter(_e=>A.includes(_e.id));if(Le.length===0){h(_e=>[..._e,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}const Ie=Array.from(new Set(Le.flatMap(_e=>_e.serverIds||[]).filter(_e=>{const Fe=(L.servers??[]).find(be=>be.id===_e),Xt=ae.find(be=>be.id===_e);return(Fe||Xt)?.authType==="oauth2"})));try{Ie.length>0&&(J(!0),await ao({serverNames:Ie,source:ue,onServerAuthStart:_e=>{h(Fe=>[...Fe,`[${new Date().toLocaleTimeString()}] OAuth login required for '${_e}'. Complete the browser sign-in flow...`])}}),h(_e=>[..._e,`[${new Date().toLocaleTimeString()}] OAuth login completed for required server(s): ${Ie.join(", ")}.`]))}catch(_e){const Fe=_e instanceof Error?_e.message:String(_e);h(Xt=>[...Xt,`[${new Date().toLocaleTimeString()}] OAuth error: ${Fe}`]),J(!1);return}finally{J(!1)}i(!0),g(!1),j(!1),y("");const Ze=(L.serverEntries??[]).some(_e=>_e.kind==="referenced")||(L.agentEntries??[]).some(_e=>_e.kind==="referenced")||(L.scenarioEntries??[]).some(_e=>_e.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${L.name} mode=${Ze} agents=${ve.map(_e=>_e.name||_e.id).join(", ")} tests=${Le.map(_e=>_e.id).join(", ")} runs=${Number(r)} snapshotEval=${Q&&T?"on":"off"}${$.trim()?` note=${$.trim()}`:""}`]),d(10);try{const{jobId:_e}=await ue.startRun({configPath:L.sourcePath,runsPerScenario:Number(r),agents:ve.map(Fe=>Fe.id),scenarioIds:Le.map(Fe=>Fe.id),applySnapshotEval:Q?T:!1,runNote:$.trim()?$.trim():void 0});C(_e),$t(_e),Ue(_e),Ot()}catch(_e){const Fe=_e instanceof Error?_e.message:String(_e),Xt=Fe.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(be=>[...be,`[${new Date().toLocaleTimeString()}] Error: ${Fe}${Xt}`]),i(!1),d(0),C(null),J(!1)}},vt=()=>{pt()},gt=()=>{S&&ue.stopRun(S),te.current?.(),te.current=null,Lt(),C(null),i(!1),g(!1),j(!0),h(ve=>[...ve,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),Ot()},Bt=async()=>{if(b){q(!0);try{const ve=await ue.createSnapshotFromRun(b,U.trim()||void 0);Ae({title:"Snapshot saved",description:`Created ${ve.name} (${ve.id})`}),U.trim()||B(ve.name)}catch(ve){Ae({title:"Could not save snapshot",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{q(!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),g(!1),j(!1),h(Le=>Le.length>0?Le:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),Ue(ve),()=>{}},[S,p]);const Lt=()=>{try{sessionStorage.removeItem(Vj)}catch{}},$t=ve=>{try{sessionStorage.setItem(Vj,ve)}catch{}},Ot=async()=>{try{const ve=await ue.getRunQueue();W(ve.queued),K(ve.active);const Le=ve.queued.find(Ie=>Ie.status==="blocked_auth"&&Ie.blockedReason==="oauth_required");Le&&(Le.requiredServers??[]).length>0?R(Ie=>Ie?.jobId===Le.jobId?Ie:{jobId:Le.jobId,servers:Le.requiredServers}):ve.queued.some(Ie=>Ie.status==="blocked_auth")||R(null)}catch{}},Ce=()=>{H(),Oe()};m.useEffect(()=>{Ce(),Ot();const ve=()=>{Ce(),Ot()};return window.addEventListener("focus",ve),()=>{window.removeEventListener("focus",ve)}},[H,Oe]);const Je=async ve=>{try{await ue.removeQueuedRun(ve),W(Le=>Le.filter(Ie=>Ie.jobId!==ve))}catch(Le){const Ie=Le instanceof Error?Le.message:String(Le);if(Ie.includes("Use the /stop endpoint"))try{await ue.stopRun(ve)}catch{}else Ae({title:"Could not remove queued run",description:Ie,variant:"destructive"})}Ot()},Ue=ve=>{S===ve&&te.current||(te.current?.(),te.current=ue.subscribeRunJob(ve,Le=>{const Ie=new Date(Le.ts).toLocaleTimeString();if(Le.type==="queued"){h(Ze=>{const _e=Le.payload.position?` (position ${Le.payload.position})`:"",Fe=`[${Ie}] Run queued${_e}. Waiting for active run to finish...`;return Ze.includes(Fe)?Ze:[...Ze,Fe]}),d(5);return}if(Le.type==="oauth_required"){const Ze=Array.isArray(Le.payload.servers)?Le.payload.servers:[],_e=String(Le.payload.jobId??"");R({jobId:_e,servers:Ze}),h(Fe=>{const Xt=`[${Ie}] OAuth required for server(s): ${Ze.join(", ")}. Click "Connect & Resume" to authenticate.`;return Fe.includes(Xt)?Fe:[...Fe,Xt]});return}if(Le.type==="started"&&(R(null),de.current=!1,i(!0),g(!1),j(!1),h(Ze=>{const _e=`[${Ie}] Run started.`;return Ze.includes(_e)?Ze:[...Ze,_e]}),d(Ze=>Math.max(Ze,30)),Ot()),Le.type==="log"){const Ze=String(Le.payload.message??"").trim();Ze&&(h(_e=>{const Fe=`[${Ie}] ${Ze}`;return _e.includes(Fe)?_e:[..._e,Fe]}),d(_e=>{const Fe=Ze.toLowerCase();if(Fe.startsWith("loading mcp evaluation config"))return Math.max(_e,15);if(Fe.startsWith("loaded config"))return Math.max(_e,20);if(Fe.startsWith("selected "))return Math.max(_e,30);if(Fe.startsWith("using requested agents")||Fe.startsWith("using resolved default agents"))return Math.max(_e,35);if(Fe.startsWith("expanded to "))return Math.max(_e,45);if(Fe.startsWith("running evaluation"))return Math.max(_e,50);const Xt=Fe.match(/^scenario (\d+)\/(\d+) finished:/);if(Xt){const be=Number(Xt[1]),Ct=Number(Xt[2]);return Math.max(_e,50+Math.round(be/Ct*25))}return Fe.startsWith("evaluation execution finished")?Math.max(_e,78):Fe.startsWith("applying snapshot evaluation policy")?Math.max(_e,82):Fe.includes("snapshot evaluation applied")||Fe.includes("snapshot evaluation enabled")?Math.max(_e,88):Fe.startsWith("writing results to ")?Math.max(_e,94):Fe.startsWith("run finished:")?Math.max(_e,98):_e}))}if(Le.type==="completed"){const Ze=String(Le.payload.runId??"").trim();if(R(null),de.current=!1,h(_e=>{const Fe=`[${Ie}] Run completed.`;return _e.includes(Fe)?_e:[..._e,Fe]}),Le.payload.snapshotEval&&typeof Le.payload.snapshotEval=="object"){const _e=Le.payload.snapshotEval;h(Fe=>{const Xt=`[${Ie}] Snapshot eval (${_e.mode??"warn"}) baseline=${_e.baseline_snapshot_id??"-"} score=${_e.overall_score??"-"} status=${_e.status??"-"}`;return Fe.includes(Xt)?Fe:[...Fe,Xt]})}d(100),i(!1),g(!0),j(!1),y(Ze),Lt(),C(null),te.current?.(),te.current=null,Ot()}if(Le.type==="error"){const Ze=String(Le.payload.message??"Unknown error"),_e=Ze.includes("Anthropic model not found")?" Hint: this usually means the API key works but the model ID is not enabled for that Anthropic account. Change the agent model in Manage Agents (library) or inline config.":"";R(null),de.current=!1,h(Fe=>[...Fe,`[${Ie}] Error: ${Ze}${_e}`]),i(!1),g(!1),j(!1),d(0),Lt(),C(null),te.current?.(),te.current=null,Ot()}}))};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(Zs,{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(ze,{children:a.jsxs(qe,{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($e,{children:"MCP Evaluation"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(jn,{value:t,onValueChange:n,children:[a.jsx(vn,{children:a.jsx(Sn,{placeholder:"Select a config"})}),a.jsx(gn,{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:Ce,"aria-label":"Refresh configs",title:"Refresh configs",children:a.jsx(ha,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx($e,{children:"Variance Runs"}),a.jsx(mt,{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($e,{htmlFor:"run-note",children:"Run Note"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[$.length,"/500"]})]}),a.jsx(ks,{id:"run-note",value:$,onChange:ve=>z(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($e,{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 Le=N.includes(ve.id);return a.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[a.jsx(Gr,{checked:Le,onCheckedChange:Ie=>{const Ze=Ie===!0;E(_e=>Ze?[..._e,ve.id]:_e.filter(Fe=>Fe!==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($e,{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:()=>P(Ee.map(ve=>ve.id)),children:"Select all"}),a.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>P([]),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 Le=A.includes(ve.id);return a.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[a.jsx(Gr,{checked:Le,onCheckedChange:Ie=>{const Ze=Ie===!0;P(_e=>Ze?[..._e,ve.id]:_e.filter(Fe=>Fe!==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(Gr,{checked:T,onCheckedChange:ve=>O(ve===!0)}),a.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(se,{onClick:vt,disabled:!t||F||pe.length>0&&N.length===0||Ee.length>0&&A.length===0,children:[a.jsx(Zs,{className:"mr-2 h-4 w-4"}),X?"Queue Run":"Run"]}),o&&a.jsxs(se,{variant:"destructive",onClick:gt,children:[a.jsx(Ah,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(o||f.length>0)&&a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Et,{className:"text-base",children:"Progress"}),a.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),a.jsxs(qe,{className:"space-y-4",children:[a.jsx(kg,{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:F,onClick:()=>{de.current||(de.current=!0,J(!0),ao({serverNames:D.servers,source:ue,onServerAuthStart:ve=>{h(Le=>[...Le,`[${new Date().toLocaleTimeString()}] OAuth sign-in opened for '${ve}'...`])}}).then(()=>ue.resumeQueue()).then(()=>{const ve=D?.jobId;h(Le=>[...Le,`[${new Date().toLocaleTimeString()}] OAuth complete. Resuming run...`]),ve&&(C(ve),$t(ve),i(!0),g(!1),Ue(ve))}).catch(ve=>{const Le=ve instanceof Error?ve.message:String(ve);h(Ie=>[...Ie,`[${new Date().toLocaleTimeString()}] OAuth error: ${Le}`]),de.current=!1}).finally(()=>{J(!1)}))},children:F?"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,Le)=>a.jsx("div",{className:ve.includes("✓")?"text-success":ve.includes("aborted")?"text-destructive":"text-foreground",children:ve},Le))})]})]}),a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Et,{className:"inline-flex items-center gap-2 text-base",children:[a.jsx(po,{className:"h-4 w-4"}),"Run Queue"]}),a.jsx(se,{variant:"ghost",size:"sm",onClick:()=>{Ot()},children:a.jsx(ha,{className:"h-3 w-3"})})]})}),a.jsx(qe,{children:!X&&I.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),$t(X.jobId),i(!0),g(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${X.jobId}...`]),d(10),Ue(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),Ot())},title:"Stop running job",children:[a.jsx(Ah,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),I.map((ve,Le)=>{const Ie=ve.runParams.configPath.split("/").pop()??ve.runParams.configPath,Ze=ve.status==="blocked_auth";return a.jsxs("div",{className:`flex items-center justify-between rounded-md border p-2 text-sm ${Ze?"border-yellow-500/40 bg-yellow-500/5":""}`,children:[a.jsxs("div",{className:"min-w-0 flex items-center gap-2 flex-wrap",children:[Ze?a.jsxs("span",{className:"inline-flex items-center rounded-full bg-yellow-500/15 px-2 py-0.5 text-xs font-medium text-yellow-700 dark:text-yellow-400",children:["#",Le+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:["#",Le+1," Queued"]}),a.jsx("span",{className:"font-mono text-xs",children:Ie}),Ze&&(ve.requiredServers??[]).length>0&&a.jsxs("span",{className:"text-xs text-yellow-700 dark:text-yellow-400",children:["OAuth: ",ve.requiredServers.join(", ")]}),!Ze&&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:[Ze&&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:F,onClick:()=>{if(de.current)return;const _e=ve.requiredServers??[];_e.length!==0&&(de.current=!0,R({jobId:ve.jobId,servers:_e}),J(!0),ao({serverNames:_e,source:ue,onServerAuthStart:Fe=>{h(Xt=>[...Xt,`[${new Date().toLocaleTimeString()}] OAuth sign-in opened for '${Fe}'...`])}}).then(()=>ue.resumeQueue()).then(()=>{h(Fe=>[...Fe,`[${new Date().toLocaleTimeString()}] OAuth complete. Resuming run...`]),C(ve.jobId),$t(ve.jobId),i(!0),g(!1),Ue(ve.jobId)}).catch(Fe=>{const Xt=Fe instanceof Error?Fe.message:String(Fe);h(be=>[...be,`[${new Date().toLocaleTimeString()}] OAuth error: ${Xt}`]),de.current=!1}).finally(()=>{J(!1)}))},children:F&&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:()=>{Je(ve.jobId)},title:"Remove from queue",children:a.jsx(_s,{className:"h-4 w-4"})})]})]},ve.jobId)})]})})]}),x&&!o&&!p&&a.jsx(ze,{className:"border-amber-300/60 bg-amber-50/40",children:a.jsx(qe,{className:"pt-6",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(Ah,{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:vt,disabled:!t,children:[a.jsx(Zs,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&a.jsx(ze,{className:"border-success/50",children:a.jsxs(qe,{className:"pt-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Xo,{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:Ye,children:we?"View Results":"View Runs"})})]}),Q&&we&&a.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Snapshot name (optional)"}),a.jsx(mt,{value:U,onChange:ve=>B(ve.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>{Bt()},disabled:V,children:V?"Saving...":"Save Snapshot"})]})]})})]})};function k6({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:g,snippetsLabel:x="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:P="flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1"}){return a.jsxs(ze,{className:A,children:[a.jsx(At,{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(Et,{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(qe,{className:P,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((T,O)=>{const $=T.role==="user",z=T.role==="assistant",U=T.role==="system",B=T.role==="tool",V=T.pendingToolCallId?i.find(I=>I.id===T.pendingToolCallId):void 0;return N?N({message:T,index:O,linkedPendingToolCall:V,isUser:$,isAssistant:z,isSystem:U,isTool:B}):z&&!!T.pendingToolCallId?a.jsxs("div",{className:"rounded-md border bg-background p-3",children:[a.jsx(Ta,{text:T.text,className:"text-sm"}),V&&a.jsx(K1,{call:V,loading:c,onApprove:b,onDeny:y,className:"mt-3"})]},`${T.id??`${T.role}-${O}`}-tool`):a.jsx(Vz,{message:T},T.id??`${T.role}-${O}`)}),E,c&&a.jsx(Hz,{}),a.jsx("div",{ref:S})]})}),a.jsx("div",{className:"border-t bg-background px-4 py-3",children:a.jsx(Kz,{input:d,onInputChange:f,onSend:h,inputPlaceholder:p,snippets:g,snippetsLabel:x,onSnippetSelect:j,loading:c,inputRef:C})})]})]})}function gd(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([]),[g,x]=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((V,q)=>{c(q??V.id),f(I=>I.length>V.messages.length?I:V.messages),p(V.pendingToolCalls),C.current?.(V)},[]),P=m.useCallback(async(V,q)=>{const I=q.session.id||V;A(q.session,I)},[A]),T=m.useCallback(async()=>{const V=g.trim();if(!V||r==="run"&&!s)return;const q=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,I={id:q,role:"user",text:V,createdAt:new Date().toISOString()};x(""),f(W=>[...W,I]),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(K=>K.some(J=>J.id===q)?[...X.session.messages,I]:X.session.messages)}try{const X=await t.sendResultAssistantMessage(W,V);await P(W,X)}catch(X){if(!gd(X))throw X;const K=r==="run"&&s?await t.createResultAssistantSession({runId:s,scope:"run"}):await t.createResultAssistantSession({scope:"all_runs"}),F=K.sessionId||K.session.id;A(K.session,F),f(D=>D.some(ne=>ne.id===q)?[...K.session.messages,I]:K.session.messages);const J=await t.sendResultAssistantMessage(F,V);await P(F,J)}}catch(W){f(X=>X.filter(K=>K.id!==q)),Ae({title:"MCP Lab Assistant error",description:W instanceof Error?W.message:String(W),variant:"destructive"})}finally{b(!1)}},[g,r,s,i,t,A,P]),O=m.useCallback(async V=>{if(i){b(!0);try{const q=await t.approveResultAssistantToolCall(i,V);await P(i,q)}catch(q){gd(q)&&(c(null),p([])),Ae({title:"Could not approve assistant action",description:gd(q)?"Assistant session expired. Ask a new question to start a fresh session.":q instanceof Error?q.message:String(q),variant:"destructive"})}finally{b(!1)}}},[i,t,P]),$=m.useCallback(async V=>{if(i){b(!0);try{const q=await t.denyResultAssistantToolCall(i,V);await P(i,q)}catch(q){gd(q)&&(c(null),p([])),Ae({title:"Could not deny assistant action",description:gd(q)?"Assistant session expired. Ask a new question to start a fresh session.":q instanceof Error?q.message:String(q),variant:"destructive"})}finally{b(!1)}}},[i,t,P]),z=m.useCallback(()=>{const V=y.current;V&&t.closeResultAssistantSession(V).catch(()=>{}),y.current=null,c(null),f([]),p([]),x("")},[t]),U=m.useCallback(V=>{f(q=>q.length>0?q:[{id:`msg-${Date.now()}`,role:"assistant",text:V,createdAt:new Date().toISOString()}])},[]),B=m.useCallback(V=>{x(V),requestAnimationFrame(()=>E.current?.focus())},[]);return m.useEffect(()=>{if(!n)return;const V=window.setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(V)},[n,d.length,j]),m.useEffect(()=>{const V=E.current;if(!V)return;V.style.height="0px";const q=Math.min(V.scrollHeight,160);V.style.height=`${Math.max(40,q)}px`},[g,n]),m.useEffect(()=>{if(!(!n||!i))return S.current.subscribeResultAssistantSessionEvents(i,V=>{A(V.payload.session,V.payload.sessionId)})},[n,i,A]),m.useEffect(()=>()=>{const V=y.current;V&&S.current.closeResultAssistantSession(V).catch(()=>{})},[]),{assistantSessionId:i,assistantMessages:d,assistantPendingToolCalls:h,assistantInput:g,assistantLoading:j,assistantChatEndRef:N,assistantInputRef:E,setAssistantInput:x,setAssistantMessages:f,askAssistant:T,approveResultAssistantToolCall:O,denyResultAssistantToolCall:$,applyResultAssistantSnippet:B,ensureIntroMessage:U,resetAssistantSession:z}}function Rh(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 Axe(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 Exe=[{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]=mo(),{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"),[g,x]=m.useState("desc"),[j,b]=m.useState("all"),[y,S]=m.useState(!1),[C,N]=m.useState(!1),[E,A]=m.useState(!1),P=Q=>{if(h===Q){x(Z=>Z==="asc"?"desc":"asc");return}p(Q),x(Q==="timestamp"?"desc":"asc")},T=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:O,assistantPendingToolCalls:$,assistantInput:z,assistantLoading:U,assistantChatEndRef:B,assistantInputRef:V,setAssistantInput:q,askAssistant:I,approveResultAssistantToolCall:W,denyResultAssistantToolCall:X,applyResultAssistantSnippet:K,ensureIntroMessage:F}=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(),Oe=String(fe.scenarioId??"").trim();if(Oe){Q.set(Oe,ae||Oe);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]),R=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:g==="asc"?fe-ae:ae-fe;return[...D].sort((fe,ae)=>{if(h==="toolTokens")return Q(fe.toolTokenUsage?.totalTokens??null,ae.toolTokenUsage?.totalTokens??null);let Oe=0;return h==="id"&&(Oe=fe.id.localeCompare(ae.id)),h==="timestamp"&&(Oe=new Date(fe.timestamp).getTime()-new Date(ae.timestamp).getTime()),h==="passRate"&&(Oe=fe.overallPassRate-ae.overallPassRate),h==="scenarios"&&(Oe=fe.totalScenarios-ae.totalScenarios),h==="avgToolCalls"&&(Oe=fe.avgToolCalls-ae.avgToolCalls),g==="asc"?Oe:-Oe})},[D,h,g]),te=Q=>h!==Q?a.jsx(mc,{className:"h-3.5 w-3.5 text-muted-foreground"}):g==="asc"?a.jsx(bs,{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,Axe(Z));return Q},[ne]),H=()=>{N(!0),F("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(Ds,{open:i!==null,onOpenChange:Q=>{!Q&&!d&&c(null)},children:a.jsxs(as,{children:[a.jsxs(ss,{children:[a.jsx(is,{children:"Delete run?"}),a.jsxs(ls,{children:["This will permanently remove the run artifacts from disk for"," ",a.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),a.jsxs(os,{children:[a.jsx(us,{disabled:d,children:"Cancel"}),a.jsx(cs,{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(Nc,{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(ru,{open:y,onOpenChange:S,children:[a.jsx(au,{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:R}),a.jsx(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(ll,{className:"w-[260px] p-0",align:"start",children:a.jsxs(ul,{children:[a.jsx(dl,{placeholder:"Search scenarios..."}),a.jsxs(fl,{children:[a.jsx(pl,{children:"No scenarios found."}),a.jsxs(hl,{children:[a.jsx(ca,{value:"all scenarios",onSelect:()=>{b("all"),S(!1)},children:"All scenarios"}),J.map(Q=>a.jsx(ca,{value:`${Q.label} ${Q.value}`,onSelect:()=>{b(Q.value),S(!1)},children:Q.label},Q.value))]})]})]})})]}),a.jsx(se,{variant:"outline",onClick:()=>{T()},disabled:s,children:s?"Refreshing...":"Refresh"}),a.jsxs(se,{type:"button",variant:"outline",className:"gap-1.5",onClick:H,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(ze,{children:a.jsx(qe,{className:"p-0",children:a.jsxs(Ur,{children:[a.jsx(Wr,{children:a.jsxs(Kt,{children:[a.jsx(at,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>P("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:()=>P("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:()=>P("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:()=>P("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:()=>P("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:()=>P("toolTokens"),children:["Tool Tokens",te("toolTokens")]})}),a.jsx(at,{className:"w-10"})]})}),a.jsx(Vr,{children:ne.map(Q=>a.jsxs(Kt,{children:[a.jsx(Be,{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(Be,{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(Be,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(po,{className:"h-3 w-3"}),new Date(Q.timestamp).toLocaleString()]})}),a.jsx(Be,{children:a.jsx(Xs,{rate:Q.overallPassRate})}),a.jsx(Be,{className:"font-mono text-sm",children:Q.totalScenarios}),a.jsx(Be,{className:"font-mono text-sm",children:Q.avgToolCalls.toFixed(0)}),a.jsx(Be,{className:"font-mono text-sm",children:de(Q)}),a.jsx(Be,{children:a.jsxs(Hf,{children:[a.jsx(Kf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(nv,{className:"h-4 w-4"})})}),a.jsxs(wu,{align:"end",children:[a.jsx(Kr,{asChild:!0,children:a.jsxs(_t,{to:`/results/${Q.id}`,children:[a.jsx(_7,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),a.jsxs(Kr,{children:[a.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),a.jsxs(Kr,{className:"text-destructive",onSelect:Z=>{Z.preventDefault();const fe=document.activeElement;fe instanceof HTMLElement&&fe.blur(),c(Q.id)},children:[a.jsx(Oa,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},Q.id))})]})})}),C&&a.jsx(k6,{title:"MCP Lab Assistant",description:"Analyze historical differences and trends across all result runs.",expanded:E,onToggleExpanded:()=>A(Q=>!Q),onHide:()=>N(!1),messages:O,pendingToolCalls:$,loading:U,input:z,onInputChange:q,onSend:()=>{I()},inputPlaceholder:"Ask about historical run differences...",snippets:Exe,onSnippetSelect:Q=>{N(!0),K(Q)},onApproveToolCall:Q=>{W(Q)},onDenyToolCall:Q=>{X(Q)},chatEndRef:B,inputRef:V,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:Oe,isSystem:we,isTool:Ye})=>{const L=Oe&&!!Q.pendingToolCallId;if(Ye&&/^(Approved|Denied) tool call\b/i.test(String(Q.text??"").trim()))return null;if(L){const ie=Rh(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(Qa,{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 ${ie}`}),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(Ta,{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:we?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":we?"border-amber-400/30 bg-amber-50/70":Ye?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:a.jsx(Ta,{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(_c,{className:"h-3 w-3"})})]},Q.id??`${Q.role}-${Z}`)}})]})]})};function kxe(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">${$i(c.scenarioName)}</span>
153
- <span class="scenario-agent">${$i(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">${$i(f.name)} <small>${f.duration}ms</small></span>`).join("")}
166
- </div>
167
- ${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>$i(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 — ${$i(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">${$i(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">${$i(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 $i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const Txe="mcplab.resultAssistantScenarioHandoff",Oxe=[{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 p$(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function h$(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const Rxe=()=>{const{id:e}=xl(),t=Ia(),[n]=mo(),{source:r}=Dn(),s=n.get("embed")==="1",o=Cg("snapshots",!1),{configs:i}=Rf(),{scenarios:c}=ns(),[d,f]=m.useState(void 0),[h,p]=m.useState(!0),[g,x]=m.useState(!1),[j,b]=m.useState(""),[y,S]=m.useState(!1),[C,N]=m.useState(new Set),[E,A]=m.useState(new Set),[P,T]=m.useState([]),[O,$]=m.useState(""),[z,U]=m.useState(null),[B,V]=m.useState(!1),[q,I]=m.useState(""),[W,X]=m.useState(""),[K,F]=m.useState(!1),[J,D]=m.useState(!1),[R,ne]=m.useState(!1),[te,de]=m.useState("assistant"),[he,H]=m.useState(null),[ue,Q]=m.useState(!1),[Z,fe]=m.useState(""),[ae,Oe]=m.useState(""),[we,Ye]=m.useState(!1),[L,ie]=m.useState(!1),[pe,Ee]=m.useState(!1),[Xe,pt]=m.useState([]),[vt,gt]=m.useState(!1),[Bt,Lt]=m.useState(""),[$t,Ot]=m.useState(null),[Ce,Je]=m.useState(!1),[Ue,ve]=m.useState(null),{assistantMessages:Le,assistantPendingToolCalls:Ie,assistantInput:Ze,assistantLoading:_e,assistantChatEndRef:Fe,assistantInputRef:Xt,setAssistantInput:be,askAssistant:Ct,approveResultAssistantToolCall:zt,denyResultAssistantToolCall:Ht,applyResultAssistantSnippet:an,ensureIntroMessage:Qt,resetAssistantSession:mr}=T6({source:r,open:J,scope:"run",runId:e,onSessionSync:void 0}),ht=m.useCallback(async(re,Ne)=>{gt(!0);try{const Me=(await r.listMarkdownReports()).filter(Wt=>{const Pt=String(Wt.relativePath??""),_n=String(Wt.name??"");return Pt.includes(re)||_n.includes(re)});if(pt(Me),Ne&&Me.length>0){const Wt=Me.find(Pt=>Pt.relativePath===Ne||Pt.path===Ne||Pt.relativePath.endsWith(Ne)||Pt.path.endsWith(Ne));Wt&&Lt(Wt.relativePath)}return Me}catch{return pt([]),[]}finally{gt(!1)}},[r]);m.useEffect(()=>{if(!e)return;let re=!0;return mr(),p(!0),r.getResult(e).then(Ne=>{re&&(f(Ne),b(Ne?.runNote??""),x(!1),p(!1))}),()=>{re=!1}},[e,r,mr]),m.useEffect(()=>{let re=!0;return r.listSnapshots().then(Ne=>{re&&T(Ne)}).catch(()=>{re&&T([])}),()=>{re=!1}},[r]),m.useEffect(()=>{if(!d?.id){pt([]);return}let re=!0;return(async()=>{const Ne=await ht(d.id)})(),()=>{re=!1}},[d?.id,ht]),m.useEffect(()=>{if(Xe.length===0){Lt(""),Ot(null),ve(null);return}(!Bt||!Xe.some(re=>re.relativePath===Bt))&&Lt(Xe[0].relativePath)},[Xe,Bt]),m.useEffect(()=>{if(!J||te!=="reports")return;if(!Bt){Ot(null),ve(null);return}let re=!0;return Je(!0),ve(null),r.getMarkdownReport(Bt).then(Ne=>{re&&Ot(Ne)}).catch(Ne=>{re&&(Ot(null),ve(Ne instanceof Error?Ne.message:String(Ne)))}).finally(()=>{re&&Je(!1)}),()=>{re=!1}},[J,te,Bt,r]);const Tt=n.get("configId")??"",Dt=(n.get("agent")??"").trim(),sn=m.useMemo(()=>{const re=Tt?i.find(Ne=>Ne.id===Tt):void 0;return re||(d?i.find(Ne=>Ne.id===d.configId):void 0)},[i,Tt,d]),Bn=m.useMemo(()=>{const re=new Map;if(sn){for(const Ne of sn.scenarios)re.set(Ne.id,Ne),Ne.name&&!re.has(Ne.name)&&re.set(Ne.name,Ne);for(const Ne of sn.scenarioEntries??[]){if(Ne.kind!=="referenced")continue;const ut=c.find(Me=>Me.id===Ne.ref);ut&&(re.set(ut.id,ut),ut.name&&re.set(ut.name,ut),re.has(Ne.ref)||re.set(Ne.ref,ut))}}for(const Ne of c)re.has(Ne.id)||re.set(Ne.id,Ne),Ne.name&&!re.has(Ne.name)&&re.set(Ne.name,Ne);return re},[sn,c]),ce=m.useMemo(()=>{if(!d?.snapshotEval?.baselineSnapshotId)return"";const re=i.filter(Ne=>Ne.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(Tt&&i.some(re=>re.id===Tt)){I(Tt);return}ce&&I(re=>re||ce)},[Tt,i,ce]);const{filteredScenarios:st,filteredTotalRuns:St,filteredPassCount:en,displayPassRate:xt,displayAvgToolCalls:Tn,displayAvgLatency:ur,displayToolTokenUsage:ma}=m.useMemo(()=>{if(!d)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayToolTokenUsage:null};const re=Dt?d.scenarios.filter(Pt=>Pt.agentId===Dt||Pt.agentName===Dt):d.scenarios,Ne=re.reduce((Pt,_n)=>Pt+_n.runs.length,0),ut=re.reduce((Pt,_n)=>Pt+_n.runs.filter(vr=>vr.passed).length,0),Me=re.reduce((Pt,_n)=>Pt+_n.runs.reduce((vr,fn)=>vr+fn.toolCalls.length,0),0),Wt=re.reduce((Pt,_n)=>Pt+_n.runs.reduce((vr,fn)=>vr+fn.duration,0),0);return{filteredScenarios:re,filteredTotalRuns:Ne,filteredPassCount:ut,displayPassRate:Ne===0?0:ut/Ne,displayAvgToolCalls:Ne===0?0:Me/Ne,displayAvgLatency:Ne===0?0:Math.round(Wt/Ne),displayToolTokenUsage:mY(re.map(Pt=>Pt.toolTokenUsage))}},[d,Dt]),wo=m.useMemo(()=>{const re={};return st.forEach(Ne=>Ne.runs.forEach(ut=>ut.toolCalls.forEach(Me=>{re[Me.name]=(re[Me.name]||0)+1}))),Object.entries(re).map(([Ne,ut])=>({name:Ne,count:ut})).sort((Ne,ut)=>ut.count-Ne.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 xe=Object.entries(d.mcpServerVersions??{}).map(([re,Ne])=>`${re}: ${Ne??"unknown"}`).join(", "),He=en,ft=Math.max(0,St-He),qt=[{name:"Pass",value:He,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:ft,color:"hsl(0, 72%, 51%)"}],Gt=re=>{N(Ne=>{const ut=new Set(Ne);return ut.has(re)?ut.delete(re):ut.add(re),ut})},Ut=(re,Ne,ut,Me)=>`${re}:${Ne}:${ut}:${Me}`,zn=(re,Ne)=>`${re}::${Ne}`,Ke=re=>{A(Ne=>{const ut=new Set(Ne);return ut.has(re)?ut.delete(re):ut.add(re),ut})},on=re=>{const Ne=!re.endsWith(":conversation");return E.has(re)?!Ne:Ne},Jt=new Map((z?.scenario_results??[]).map(re=>[re.scenario_id,re])),qn=async()=>{if(!(!d||!O)){V(!0);try{const re=await r.compareSnapshot(O,d.id);U(re)}finally{V(!1)}}},Cn=async re=>{const Ne=re||d.snapshotEval?.baselineSnapshotId;if(Ne){$(Ne),V(!0);try{const ut=await r.compareSnapshot(Ne,d.id);U(ut)}catch(ut){Ae({title:"Could not review drift",description:ut instanceof Error?ut.message:String(ut),variant:"destructive"})}finally{V(!1)}}},Tg=async()=>{if(!q){Ae({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}F(!0);try{const re=await r.generateSnapshotEvalBaseline(d.id,q,W.trim()||void 0);T(Ne=>[re.snapshot,...Ne.filter(ut=>ut.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&&Cn(re.snapshot.id)}catch(re){Ae({title:"Could not accept new baseline",description:re instanceof Error?re.message:String(re),variant:"destructive"})}finally{F(!1)}},jo=(re,Ne)=>{de("assistant"),D(!0),H(Ne?.scenarioId??null),Qt("Ask me to explain failures, tool usage, snapshot drift, or suggest what to inspect next in this result."),re&&be(re)},Nu=Ie.filter(re=>re.status==="pending"&&!Le.some(Ne=>Ne.pendingToolCallId===re.id)),Al=re=>{de("reports"),D(!0)},Og=()=>{de("note"),D(!0)},Qf=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 Ne=c.find(Me=>Me.id===he)??c.find(Me=>Me.name===he);if(!Ne){Ae({title:"Scenario not found in library",description:`Could not find library scenario '${he}' to open in Scenario Assistant.`,variant:"destructive"});return}const ut=[`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:Tt||d.configId||"",scenarioId:Ne.id,prompt:ut,sourceReply:re})),t(`/libraries/test-cases/${encodeURIComponent(Ne.id)}?assistantHandoff=1`)}catch(Me){Ae({title:"Could not create handoff",description:Me instanceof Error?Me.message:String(Me),variant:"destructive"})}},gi=re=>{d&&(Ee(!1),fe(re),Oe(p$(d.id)),Ye(!1),Q(!0))},va=()=>{d&&(Ee(!0),fe(""),Oe(p$(d.id)),Ye(!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}ie(!0);try{const Ne=await r.applyResultAssistantReport({runId:d.id,markdown:Z,outputPath:ae.trim()||void 0,overwrite:we});Ae({title:"Markdown report written",description:typeof Ne.path=="string"&&Ne.path?Ne.path:Ne.outputPath}),await ht(d.id,typeof Ne.path=="string"&&Ne.path||Ne.outputPath||void 0),J&&de("reports"),Q(!1)}catch(Ne){Ae({title:"Could not write markdown report",description:Ne instanceof Error?Ne.message:String(Ne),variant:"destructive"})}finally{ie(!1)}},Qr=async re=>{try{await navigator.clipboard.writeText(re),Ae({title:"Copied"})}catch(Ne){Ae({title:"Could not copy",description:Ne instanceof Error?Ne.message:String(Ne),variant:"destructive"})}},Ig=async()=>{if(d){S(!0);try{const re=j.trim();await r.updateRunNote(d.id,re||void 0),f(Ne=>Ne&&{...Ne,runNote:re||void 0}),b(re),x(!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(Qi,{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(Xs,{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(C7,{className:"h-3 w-3 shrink-0"}),new Date(d.timestamp).toLocaleString()]}),a.jsx("span",{className:"mx-1",children:"·"}),Dt?a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"inline-flex items-center align-middle",children:["Agent: ",Dt]}),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:[xe?a.jsxs("span",{className:"inline-flex max-w-[18rem] min-w-0 items-center rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] text-muted-foreground",children:[a.jsx("span",{className:"font-medium",children:"MCP:"}),a.jsx("span",{className:"ml-1 min-w-0 truncate font-mono",children:xe})]}):null,a.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-end gap-2",children:[o&&d.snapshotEval?.applied&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>{Cn()},disabled:B,children:[a.jsx(cN,{className:"h-3.5 w-3.5"}),B?"Reviewing drift...":"Review Drift"]}),a.jsxs(se,{variant:"outline",size:"sm",className:`max-w-full gap-1.5 ${s?"px-2":""}`,onClick:()=>{const re=kxe(d),Ne=new Blob([re],{type:"text/html"}),ut=URL.createObjectURL(Ne),Me=document.createElement("a");Me.href=ut,Me.download=`mcplab-report-${d.id}.html`,Me.click(),URL.revokeObjectURL(ut)},"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:()=>Al(),disabled:vt,children:[a.jsx(cc,{className:"h-3.5 w-3.5"}),vt?"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:()=>Og(),children:[a.jsx(cc,{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:()=>jo(),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?R?"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(ze,{className:"border-amber-500/30",children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Snapshot Drift Review"})}),a.jsxs(qe,{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(jn,{value:q,onValueChange:I,children:[a.jsx(vn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select config to update"})}),a.jsx(gn,{children:i.map(re=>a.jsx(tt,{value:re.id,children:re.name},re.id))})]}),!q&&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:()=>{Cn()},disabled:B,children:[a.jsx(ha,{className:`h-3.5 w-3.5 ${B?"animate-spin":""}`}),"Review Drift"]}),a.jsx(se,{type:"button",size:"sm",className:"h-8",onClick:()=>{Tg()},disabled:K||xt!==1,children:K?"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(ms,{title:"Scenarios",value:st.length,icon:Qj}),a.jsx(ms,{title:"Total Runs",value:St,icon:G$}),a.jsx(ms,{title:"Pass Rate",value:`${Math.round(xt*100)}%`,icon:Nc}),a.jsx(ms,{title:"Avg Tool Calls",value:h$(Tn),icon:Xo}),a.jsx(ms,{title:"Avg Latency",value:`${ur}ms`,icon:nD}),a.jsx(ms,{title:"Tool Tokens",value:ra(ma?.totalTokens),icon:Qa})]}),a.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[a.jsxs(ze,{children:[a.jsx(At,{className:"pb-2",children:a.jsx(Et,{className:"text-base",children:"Pass / Fail"})}),a.jsxs(qe,{className:"flex items-center justify-center",children:[a.jsxs(rpe,{width:180,height:180,children:[a.jsx(yo,{data:qt,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:qt.map((re,Ne)=>a.jsx(Fv,{fill:re.color},Ne))}),a.jsx(Br,{})]}),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"}),He," 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"}),ft," failed"]})]})]})]}),a.jsxs(ze,{children:[a.jsx(At,{className:"pb-2",children:a.jsx(Et,{className:"text-base",children:"Tool Usage"})}),a.jsx(qe,{children:a.jsx(tm,{width:"100%",height:180,children:a.jsxs(npe,{data:wo,layout:"vertical",children:[a.jsx(si,{type:"number",tick:{fontSize:11}}),a.jsx(oi,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),a.jsx(Br,{}),a.jsx(Nl,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(Et,{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:()=>jo("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(qe,{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(jn,{value:O,onValueChange:$,children:[a.jsx(vn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select snapshot"})}),a.jsx(gn,{children:P.map(re=>a.jsx(tt,{value:re.id,children:re.name},re.id))})]})]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",disabled:!O||B,onClick:()=>{qn()},children:B?"Comparing...":"Compare Snapshot"}),z&&a.jsxs(We,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",z.overall_score]})]}),a.jsxs(Ur,{children:[a.jsx(Wr,{children:a.jsxs(Kt,{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(Vr,{children:st.map(re=>{const Ne=zn(re.scenarioId,re.agentName),ut=re.scenarioName||re.scenarioId;return a.jsx(Ya,{open:C.has(Ne),onOpenChange:()=>Gt(Ne),asChild:!0,children:a.jsxs(a.Fragment,{children:[a.jsx(_a,{asChild:!0,children:a.jsxs(Kt,{className:"cursor-pointer hover:bg-muted/50",children:[a.jsx(Be,{children:a.jsx(Yt,{className:`h-4 w-4 transition-transform ${C.has(Ne)?"rotate-180":""}`})}),a.jsx(Be,{className:"font-medium text-sm",children:re.scenarioName}),a.jsxs(Be,{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?Ym(re.provider):null,re.model].filter(Boolean).join(" · ")})]}),a.jsx(Be,{className:"font-mono text-sm",children:re.runs.length}),a.jsx(Be,{children:a.jsx(Xs,{rate:re.passRate})}),a.jsx(Be,{className:"font-mono text-sm",children:h$(re.avgToolCalls)}),a.jsx(Be,{className:"font-mono text-sm",children:ra(re.toolTokenUsage?.totalTokens)}),a.jsx(Be,{children:(()=>{const Me=Jt.get(re.scenarioId);if(!Me)return a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const Wt=Me.status==="Match"?"bg-success/15 text-success":Me.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return a.jsxs(We,{variant:"outline",className:`text-xs ${Wt}`,children:[Me.status," · ",Me.score]})})()})]})}),a.jsx(Xa,{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:[ut," · ",re.agentName," · ",Math.round(re.passRate*100),"% pass rate · ",ra(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:()=>jo(`Explain why scenario '${ut}' 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 Me=Jt.get(re.scenarioId);return!Me||Me.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: ",Me.baseline_agents.join(", ")||"—"," · observed agents: ",Me.observed_agents.join(", ")||"—"]}),a.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:Me.reasons.map((Wt,Pt)=>a.jsxs("li",{children:["• ",Wt]},Pt))})]})})(),re.runs.map(Me=>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:Me.passed?a.jsx(Xo,{className:"h-4 w-4 text-success"}):a.jsx(vc,{className:"h-4 w-4 text-destructive"})}),a.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const Wt=Bn.get(re.scenarioId),Pt=Wt?$xe(Wt.evalRules,Me.failureReasons):[],_n=Pt.filter(fn=>fn.status==="failed"),vr=Pt.filter(fn=>fn.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 #",Me.runIndex+1]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[Me.duration,"ms"]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[ra(Me.toolTokenUsage?.totalTokens)," tool tokens"]}),!Me.passed&&a.jsx(We,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),Me.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(vc,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),a.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:Me.failureReasons.map((fn,So)=>a.jsxs("li",{children:["• ",x$(fn)]},So))})]}),Pt.length>0&&a.jsx(Ya,{open:on(Ut(re.scenarioId,re.agentName,Me.runIndex,"checks")),onOpenChange:()=>Ke(Ut(re.scenarioId,re.agentName,Me.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 ${on(Ut(re.scenarioId,re.agentName,Me.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:[vr.length," passed"]}),a.jsxs(We,{variant:"outline",className:`h-5 text-[10px] ${_n.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[_n.length," failed"]})]})}),a.jsx(Xa,{children:a.jsx("div",{className:"space-y-1",children:Pt.map((fn,So)=>a.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${fn.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:[fn.status==="failed"?a.jsx(vc,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):a.jsx(Xo,{className:"h-3.5 w-3.5 shrink-0 text-success"}),a.jsx("span",{className:"font-medium",children:Lxe(fn.rule)})]}),fn.failureReason&&a.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:x$(fn.failureReason)})]}),a.jsx(We,{variant:"outline",className:`shrink-0 text-[10px] ${fn.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:fn.status})]},`${fn.rule.type}-${fn.rule.value??fn.rule.path??""}-${So}`))})})]})})]})})(),a.jsx(Ya,{open:on(Ut(re.scenarioId,re.agentName,Me.runIndex,"extracts")),onOpenChange:()=>Ke(Ut(re.scenarioId,re.agentName,Me.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 ${on(Ut(re.scenarioId,re.agentName,Me.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(Me.extractedValues??{}).length," total"]})]})}),a.jsx(Xa,{children:Object.keys(Me.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(Me.extractedValues??{}).map(([Wt,Pt])=>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:Wt}),a.jsx("div",{className:"font-mono break-all text-foreground",children:Pt===null?"null":String(Pt)})]},Wt))})})]})}),a.jsx(Ya,{open:on(Ut(re.scenarioId,re.agentName,Me.runIndex,"tools")),onOpenChange:()=>Ke(Ut(re.scenarioId,re.agentName,Me.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 ${on(Ut(re.scenarioId,re.agentName,Me.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(Qa,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),a.jsxs(We,{variant:"outline",className:"h-5 text-[10px]",children:[Me.toolCalls.length," total"]})]})}),a.jsx(Xa,{children:Me.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(ni,{delayDuration:0,children:Me.toolCalls.map((Wt,Pt)=>{const _n=Me.conversation.filter(fn=>fn.kind==="tool_call")[Pt]?.estimatedTokens,vr=typeof _n?.totalTokens=="number";return a.jsxs(ri,{children:[a.jsx(ai,{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:["#",Pt+1]}),Wt.name,a.jsxs("span",{className:"ml-1 text-muted-foreground",children:[Wt.duration,"ms"]}),vr&&a.jsxs("span",{className:"ml-1 text-muted-foreground",children:["· ",ra(_n?.totalTokens),"tok"]})]})}),vr&&a.jsx(lo,{className:"text-xs",children:`${Wt.name} · tokens total: ${ra(_n?.totalTokens)} · in: ${ra(_n?.inputTokens)} · out: ${ra(_n?.outputTokens)}`})]},Pt)})})}),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(Me.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(Me.toolTokenUsageByTool??{}).map(([Wt,Pt])=>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:Wt}),a.jsxs("div",{className:"text-muted-foreground",children:["total: ",ra(Pt.totalTokens)," · in: ",ra(Pt.inputTokens)," · out: ",ra(Pt.outputTokens)]})]},Wt))})]})]})})]})}),a.jsx(Ya,{open:on(Ut(re.scenarioId,re.agentName,Me.runIndex,"final")),onOpenChange:()=>Ke(Ut(re.scenarioId,re.agentName,Me.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 ${on(Ut(re.scenarioId,re.agentName,Me.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(Xa,{children:a.jsx(nN,{text:Me.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),a.jsx(Ya,{open:on(Ut(re.scenarioId,re.agentName,Me.runIndex,"conversation")),onOpenChange:()=>Ke(Ut(re.scenarioId,re.agentName,Me.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 ${on(Ut(re.scenarioId,re.agentName,Me.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:()=>jo(`Explain Run #${Me.runIndex+1} for scenario '${ut}'. It ${Me.passed?"passed":"failed"} in ${Me.duration}ms. Focus on the tool sequence and ${Me.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(Xa,{children:a.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:Me.conversation.length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):Me.conversation.map(Wt=>a.jsx(Ixe,{item:Wt,fallbackUserPrompt:Bn.get(re.scenarioId)?.prompt},Wt.id))})}),!on(Ut(re.scenarioId,re.agentName,Me.runIndex,"conversation"))&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},Me.runIndex))]})})})})]})},Ne)})})]})]})]})]}),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(wg,{value:te,onValueChange:re=>de(re),className:"min-w-0 -mb-px px-3 pt-1",children:a.jsxs(Gf,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[a.jsx(Ns,{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(Ns,{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(Ns,{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(k6,{title:"MCP Lab Assistant",description:"Ask questions about this run result, failures, tool usage, and snapshot drift.",expanded:R,onToggleExpanded:()=>ne(re=>!re),onHide:()=>D(!1),messages:Le,pendingToolCalls:Ie,loading:_e,input:Ze,onInputChange:be,onSend:()=>{Ct()},inputPlaceholder:"Ask about this result...",snippets:Oxe,onSnippetSelect:an,onApproveToolCall:re=>{zt(re)},onDenyToolCall:re=>{Ht(re)},chatEndRef:Fe,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:Ne,linkedPendingToolCall:ut,isUser:Me,isAssistant:Wt,isSystem:Pt,isTool:_n})=>{const vr=Wt&&!!re.pendingToolCallId;if(_n&&/^(Approved|Denied) tool call\\b/i.test(String(re.text??"").trim()))return null;const fn=ut?.tool??re.toolRequestName,So=ut?.publicToolName??re.toolRequestPublicName,El=Wt&&!vr&&Mxe(re.text,!!he);if(vr){const Cu=ut?.status==="pending",_u=Rh(fn??So??"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:!!ut,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(Qa,{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 ${_u}`}),a.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${Cu?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:Cu?"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(Ta,{text:re.text,className:"text-sm"}),Cu&&ut&&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(ut.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:_e,onClick:()=>{Ht(ut.id)},children:"Deny"}),a.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:_e,onClick:()=>{zt(ut.id)},children:"Approve"})]})]})]})]})]},`${re.id??`${re.role}-${Ne}`}:${ut?"pending":"completed"}`)}const xi=Me||Wt&&!_n&&!Pt;return a.jsxs("div",{className:`flex items-start gap-2 ${Me?"justify-end":"justify-start"}`,children:[!Me&&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:Pt?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 ${Me?"border-primary/20 bg-primary/10":Pt?"border-amber-400/30 bg-amber-50/70":_n?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(Me||Pt)&&a.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${Me?"text-right":""}`,children:_n?"Tool":"Assistant"}),a.jsx(Ta,{text:re.text,className:"text-sm"}),El&&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:()=>Qf(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:()=>gi(re.text),children:[a.jsx(Qa,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!El&&Wt&&!vr&&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:()=>gi(re.text),children:[a.jsx(Qa,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),xi&&a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{Qr(re.text)},"aria-label":"Copy message",title:"Copy message",children:a.jsx(Cs,{className:"h-3.5 w-3.5"})})]}),Me&&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"})})]},re.id??`${re.role}-${Ne}`)},renderMessageExtras:Nu.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)"}),Nu.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:Rh(re.publicToolName)}),a.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[re.server,"::",Rh(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:_e,onClick:()=>{Ht(re.id)},children:"Deny"}),a.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:_e,onClick:()=>{zt(re.id)},children:"Approve"})]})]})]},re.id))]}):null}):te==="reports"?a.jsxs(ze,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[a.jsx(At,{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(Et,{className:"flex items-center gap-2 text-base",children:[a.jsx(cc,{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:[R?a.jsx(Zj,{className:"h-3.5 w-3.5"}):a.jsx(eS,{className:"h-3.5 w-3.5"}),R?"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(qe,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(vt||Xe.length===0||Xe.length>1)&&a.jsx("div",{className:"border-b px-4 py-3",children:vt?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(so,{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(jn,{value:Bt,onValueChange:Lt,children:[a.jsx(vn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select a report"})}),a.jsx(gn,{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."}):Ce?a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(jr,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):Ue?a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",Ue]}):$t?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:$t.name}),a.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:$t.relativePath}),a.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date($t.mtime).toLocaleString()})]}),a.jsx("div",{className:"rounded-md border bg-background p-3",children:a.jsx(Ta,{text:$t.content,className:"text-sm"})})]}):a.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):a.jsxs(ze,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[a.jsx(At,{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(Et,{className:"flex items-center gap-2 text-base",children:[a.jsx(cc,{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:[R?a.jsx(Zj,{className:"h-3.5 w-3.5"}):a.jsx(eS,{className:"h-3.5 w-3.5"}),R?"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(qe,{className:"flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1",children:g?a.jsxs("div",{className:"w-full max-w-xl space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-xs font-medium",children:"Run note"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[j.length,"/500"]})]}),a.jsx(ks,{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??""),x(!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:()=>x(!0),children:d.runNote?"Edit":"Add note"})]})})]})]}),a.jsx(Ds,{open:ue,onOpenChange:re=>!L&&Q(re),children:a.jsxs(as,{className:"max-w-2xl",children:[a.jsxs(ss,{children:[a.jsx(is,{children:pe?"Create markdown report":"Approve MCP action: write markdown report"}),a.jsx(ls,{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(mt,{value:ae,onChange:re=>Oe(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(Gr,{checked:we,onCheckedChange:re=>Ye(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(ks,{value:Z,onChange:re=>fe(re.target.value),rows:10,className:"font-mono text-xs",disabled:L})]})]}),a.jsxs(os,{children:[a.jsx(us,{disabled:L,children:"Cancel"}),a.jsx(cs,{onClick:re=>{re.preventDefault(),Rg()},disabled:L,children:L?"Writing...":pe?"Save Report":"Approve & Write"})]})]})})]})]})};function Ixe({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=m$(e,"input");return a.jsx(g$,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=m$(e,"output"),f=e.ok?a.jsx(Xo,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):a.jsx(vc,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return a.jsx(g$,{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=v$(e.text,e.kind),s=t?v$(t,"user_prompt"):"",o=n&&!r&&s?s:r,i=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?_c: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 m$(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · ${ra(n)} tokens`}function v$(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 Mxe(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 g$({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(Ya,{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(Qa,{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(Xa,{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(Ta,{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 $xe(e,t){return e.map(n=>{const r=Dxe(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function Dxe(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 Lxe(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 x$(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 Fxe(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 zxe(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 qxe=()=>{const{source:e}=Dn(),[t,n]=mo(),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"),[g,x]=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,P]=m.useState(C),[T,O]=m.useState(N),[$,z]=m.useState(E),[U,B]=m.useState(!1),V=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(ie=>{L&&o(ie)}).catch(ie=>{L&&Ae({title:"Could not load results",description:ie instanceof Error?ie.message:String(ie),variant:"destructive"})}).finally(()=>{L&&c(!1)}),()=>{L=!1}},[e]);const q=L=>{if(h===L){x(ie=>ie==="asc"?"desc":"asc");return}p(L),x(L==="timestamp"?"desc":"asc")},I=L=>{f(ie=>{const pe=new Set(ie);return pe.has(L)?pe.delete(L):pe.add(L),pe})},W=m.useMemo(()=>{const L=new Set;return s.forEach(ie=>{ie.scenarios.forEach(pe=>{const Ee=String(pe.scenarioName??"").trim(),Xe=String(pe.scenarioId??"").trim(),pt=Ee||Xe;pt&&L.add(pt)})}),Array.from(L).sort((ie,pe)=>ie.localeCompare(pe))},[s]),X=m.useMemo(()=>j==="all"?s:s.filter(L=>L.scenarios.some(ie=>{const pe=String(ie.scenarioName??"").trim(),Ee=String(ie.scenarioId??"").trim();return(pe||Ee)===j})),[s,j]),K=m.useMemo(()=>[...X].sort((L,ie)=>{let pe=0;return h==="id"&&(pe=L.id.localeCompare(ie.id)),h==="timestamp"&&(pe=new Date(L.timestamp).getTime()-new Date(ie.timestamp).getTime()),h==="passRate"&&(pe=L.overallPassRate-ie.overallPassRate),h==="scenarios"&&(pe=L.totalScenarios-ie.totalScenarios),g==="asc"?pe:-pe}),[X,h,g]),F=m.useMemo(()=>K.filter(L=>d.has(L.id)),[K,d]),J=L=>h!==L?a.jsx(mc,{className:"h-3.5 w-3.5 text-muted-foreground"}):g==="asc"?a.jsx(bs,{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 ie of K)L.set(ie.id,Bxe(ie));return L},[K]),R=L=>{const ie=Array.from(new Set(L.scenarios.map(pe=>pe.agentId).filter(Boolean)));return ie.slice(0,Math.min(2,ie.length))},ne=L=>{const ie=R(L);P(L.id),O(ie),z("all");const pe=new URLSearchParams(t);pe.set("mode","within-run"),pe.set("runId",L.id),ie.length>0?pe.set("agents",ie.join(",")):pe.delete("agents"),pe.delete("scenario"),n(pe,{replace:!0})},te=m.useMemo(()=>[...new Set(F.flatMap(L=>L.scenarios.map(ie=>ie.scenarioId)))],[F]),de=m.useMemo(()=>{const L=new Map;for(const ie of F)for(const pe of ie.scenarios){const Ee=String(pe.scenarioId??"").trim();if(!Ee)continue;const Xe=String(pe.scenarioName??"").trim();L.set(Ee,Xe||Ee)}return L},[F]),he=m.useMemo(()=>s.find(L=>L.id===A),[s,A]),H=m.useMemo(()=>{if(!he)return[];const L=new Map;for(const ie of he.scenarios)L.set(ie.agentId,ie.agentName||ie.agentId);return Array.from(L.entries()).map(([ie,pe])=>({id:ie,name:pe})).sort((ie,pe)=>ie.name.localeCompare(pe.name))},[he]),ue=m.useMemo(()=>{if(!he)return[];const L=new Set;for(const ie of he.scenarios){const pe=String(ie.scenarioName??"").trim(),Ee=String(ie.scenarioId??"").trim(),Xe=pe||Ee;Xe&&L.add(Xe)}return Array.from(L).sort((ie,pe)=>ie.localeCompare(pe))},[he]),Q=m.useMemo(()=>T.join(","),[T]);m.useEffect(()=>{if(r==="within-run"){const L=t.get("runId")??"",ie=(t.get("agents")??"").split(",").map(Ee=>Ee.trim()).filter(Boolean),pe=t.get("scenario")??"all";P(Ee=>Ee===L?Ee:L),O(Ee=>Fxe(Ee,ie)?Ee:ie),z(Ee=>Ee===pe?Ee:pe)}},[r,t]),m.useEffect(()=>{if(r!=="within-run"||s.length===0)return;let L=A;(!L||!s.some(gt=>gt.id===L))&&(L=s[0].id);const ie=s.find(gt=>gt.id===L),pe=(()=>{if(!ie)return[];const gt=new Map;for(const Bt of ie.scenarios)gt.set(Bt.agentId,Bt.agentName||Bt.agentId);return Array.from(gt.keys())})(),Ee=new Set(pe);let Xe=Q.split(",").map(gt=>gt.trim()).filter(gt=>!!gt).filter(gt=>Ee.has(gt));Xe.length===0&&pe.length>0&&(Xe=pe.slice(0,Math.min(2,pe.length)));const pt=(()=>{if(!ie)return new Set;const gt=new Set;for(const Bt of ie.scenarios){const Lt=String(Bt.scenarioName??"").trim(),$t=String(Bt.scenarioId??"").trim(),Ot=Lt||$t;Ot&&gt.add(Ot)}return new Set(gt)})(),vt=$!=="all"&&!pt.has($)?"all":$;L!==A&&P(L),Xe.join(",")!==Q&&O(Xe),vt!==$&&z(vt)},[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"),T.length>0?L.set("agents",T.join(",")):L.delete("agents"),$!=="all"?L.set("scenario",$):L.delete("scenario")):(L.delete("mode"),L.delete("runId"),L.delete("agents"),L.delete("scenario"));const ie=t.toString(),pe=L.toString();ie!==pe&&n(L,{replace:!0})},[r,A,T,$,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(),pt=Xe||Ee;if(!Ee&&!pt)continue;const vt=Ee||pt,gt=L.get(vt);if(gt){gt.byAgent[pe.agentId]=pe;continue}L.set(vt,{scenarioId:Ee||pt,scenarioName:Xe,displayLabel:pt||Ee,byAgent:{[pe.agentId]:pe}})}const ie=Array.from(L.values()).sort((pe,Ee)=>{const Xe=(pe.displayLabel||pe.scenarioId).toLowerCase(),pt=(Ee.displayLabel||Ee.scenarioId).toLowerCase();return Xe.localeCompare(pt)});return $==="all"?ie:ie.filter(pe=>pe.displayLabel===$)},[he,$]),fe=m.useMemo(()=>{const L=new Map(H.map(ie=>[ie.id,ie]));return T.map(ie=>L.get(ie)).filter(ie=>!!ie)},[T,H]),ae=m.useMemo(()=>{if(!he||fe.length!==2)return null;const[L,ie]=fe;return{left:L,right:ie,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(ie.id)}`}},[he,fe]),Oe=m.useMemo(()=>!he||fe.length===0?[]:fe.map(L=>{const ie=Z.map(Lt=>Lt.byAgent[L.id]).filter(Lt=>!!Lt),pe=ie.flatMap(Lt=>Lt.runs),Ee=pe.length,Xe=pe.filter(Lt=>Lt.passed).length,pt=pe.reduce((Lt,$t)=>Lt+$t.toolCalls.length,0),vt=pe.reduce((Lt,$t)=>Lt+$t.duration,0),{provider:gt,model:Bt}=zxe(ie);return{agentId:L.id,agentName:L.name,provider:gt,model:Bt,passRate:Ee===0?0:Xe/Ee,totalRuns:Ee,avgToolCalls:Ee===0?0:pt/Ee,avgLatency:Ee===0?0:vt/Ee}}),[he,fe,Z]),we=L=>{O(ie=>ie.includes(L)?ie.filter(pe=>pe!==L):[...ie,L])},Ye=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(Y$,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]}),r==="runs"&&a.jsxs(ru,{open:y,onOpenChange:S,children:[a.jsx(au,{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(ll,{className:"w-[260px] p-0",align:"start",children:a.jsxs(ul,{children:[a.jsx(dl,{placeholder:"Search scenarios..."}),a.jsxs(fl,{children:[a.jsx(pl,{children:"No scenarios found."}),a.jsxs(hl,{children:[a.jsx(ca,{value:"all scenarios",onSelect:()=>{b("all"),S(!1)},children:"All scenarios"}),W.map(L=>a.jsx(ca,{value:L,onSelect:()=>{b(L),S(!1)},children:L},L))]})]})]})})]}),a.jsx(se,{variant:"outline",onClick:()=>{V()},disabled:i,children:i?"Refreshing...":"Refresh"})]})]}),r==="within-run"&&a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Within One Run Controls"})}),a.jsxs(qe,{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(jn,{value:A,onValueChange:P,children:[a.jsx(vn,{children:a.jsx(Sn,{placeholder:"Select run"})}),a.jsx(gn,{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(ru,{open:U,onOpenChange:B,children:[a.jsx(au,{asChild:!0,children:a.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":U,className:"w-full justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:$==="all"?"All scenarios":$}),a.jsx(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(ll,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:a.jsxs(ul,{children:[a.jsx(dl,{placeholder:"Search scenarios..."}),a.jsxs(fl,{children:[a.jsx(pl,{children:"No scenarios found."}),a.jsxs(hl,{children:[a.jsx(ca,{value:"all scenarios",onSelect:()=>{z("all"),B(!1)},children:"All scenarios"}),ue.map(L=>a.jsx(ca,{value:L,onSelect:()=>{z(L),B(!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:[H.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available for selected run."}),H.map(L=>a.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[a.jsx(Gr,{checked:T.includes(L.id),onCheckedChange:()=>we(L.id)}),a.jsx("span",{children:L.name})]},L.id))]})]})]})]}),r==="runs"&&a.jsx(ze,{children:a.jsx(qe,{className:"p-0",children:a.jsxs(Ur,{containerClassName:"max-h-[36rem] overflow-auto",children:[a.jsx(Wr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Kt,{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:()=>q("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:()=>q("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:()=>q("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:()=>q("scenarios"),children:["Scenarios",J("scenarios")]})}),a.jsx(at,{children:"Agents"}),a.jsx(at,{className:"w-[140px] text-right",children:"Action"})]})}),a.jsx(Vr,{children:K.map(L=>a.jsxs(Kt,{children:[a.jsx(Be,{children:a.jsx(Gr,{checked:d.has(L.id),onCheckedChange:()=>I(L.id),disabled:!d.has(L.id)&&d.size>=5})}),a.jsx(Be,{className:"font-mono text-xs",children:L.id}),a.jsx(Be,{className:"text-[11px] text-muted-foreground",children:(()=>{const ie=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: ",ie.scenarioCount," scenario",ie.scenarioCount===1?"":"s"," · ",ie.agentCount," agent",ie.agentCount===1?"":"s",ie.modelSummary?` · ${ie.modelSummary}`:""]}),a.jsx("div",{className:"font-mono text-xs text-foreground/80",children:ie.scenarioPreview})]})})()}),a.jsx(Be,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(po,{className:"h-3 w-3"}),new Date(L.timestamp).toLocaleString()]})}),a.jsx(Be,{children:a.jsx(Xs,{rate:L.overallPassRate})}),a.jsx(Be,{className:"font-mono text-sm",children:L.totalScenarios}),a.jsx(Be,{className:"font-mono text-sm",children:D.get(L.id)?.agentCount??0}),a.jsx(Be,{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"&&F.length===0&&a.jsx(ze,{children:a.jsxs(qe,{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"&&F.length>=2&&a.jsxs(a.Fragment,{children:[F.length===2&&a.jsx(ze,{children:a.jsx(qe,{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(F[0].id)}&right=${encodeURIComponent(F[1].id)}&leftConfig=${encodeURIComponent(F[0].configId)}&rightConfig=${encodeURIComponent(F[1].configId)}`,children:"Compare full results"})})]})})}),a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Summary Comparison"})}),a.jsx(qe,{className:"max-h-[24rem] overflow-auto p-0",children:a.jsxs(Ur,{className:"table-fixed",children:[a.jsx(Wr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Kt,{children:[a.jsx(at,{className:"w-[220px]",children:"Metric"}),F.map((L,ie)=>a.jsx(at,{style:{color:Hj[ie]},className:"font-mono text-xs",children:L.id},L.id))]})}),a.jsxs(Vr,{children:[a.jsxs(Kt,{children:[a.jsx(Be,{className:"font-medium",children:"Pass Rate"}),F.map(L=>a.jsx(Be,{children:a.jsx(Xs,{rate:L.overallPassRate})},L.id))]}),a.jsxs(Kt,{children:[a.jsx(Be,{className:"font-medium",children:"Total Runs"}),F.map(L=>a.jsx(Be,{className:"font-mono",children:L.totalRuns},L.id))]}),a.jsxs(Kt,{children:[a.jsx(Be,{className:"font-medium",children:"Tool Calls"}),F.map(L=>a.jsx(Be,{className:"font-mono",children:L.avgToolCalls.toFixed(1)},L.id))]}),a.jsxs(Kt,{children:[a.jsx(Be,{className:"font-medium",children:"Avg Latency"}),F.map(L=>a.jsxs(Be,{className:"font-mono",children:[L.avgLatency,"ms"]},L.id))]})]})]})})]}),a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Scenario Breakdown"})}),a.jsx(qe,{className:"max-h-[26rem] overflow-auto p-0",children:a.jsxs(Ur,{className:"table-fixed",children:[a.jsx(Wr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Kt,{children:[a.jsx(at,{className:"w-[220px]",children:"Scenario"}),F.map((L,ie)=>a.jsx(at,{style:{color:Hj[ie]},className:"font-mono text-xs",children:L.id},L.id))]})}),a.jsx(Vr,{children:te.map(L=>a.jsxs(Kt,{children:[a.jsx(Be,{className:"font-medium text-sm",children:de.get(L)??L}),F.map(ie=>{const pe=ie.scenarios.find(Ee=>Ee.scenarioId===L);return a.jsx(Be,{children:pe?a.jsx(Xs,{rate:pe.passRate}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},ie.id)})]},L))})]})})]})]}),r==="runs"&&F.length>=2&&a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Pass Rate Trend"})}),a.jsx(qe,{className:"h-72",children:a.jsx(tm,{width:"100%",height:"100%",children:a.jsxs(F1,{data:F.map((L,ie)=>({idx:ie+1,runId:L.id,passRate:Number((L.overallPassRate*100).toFixed(1))})),children:[a.jsx(si,{dataKey:"idx",tickFormatter:L=>String(L)}),a.jsx(oi,{unit:"%",domain:[0,100]}),a.jsx(Br,{formatter:L=>[`${L}%`,"Pass Rate"],labelFormatter:L=>`Run ${L}`}),a.jsx(Vi,{}),a.jsx(sl,{type:"monotone",dataKey:"passRate",stroke:Hj[0],strokeWidth:2.5,dot:!0})]})})})]}),r==="within-run"&&he&&fe.length<2&&a.jsx(ze,{children:a.jsx(qe,{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(ze,{children:a.jsx(qe,{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(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Agent Summary"})}),a.jsx(qe,{className:"max-h-[24rem] overflow-auto p-0",children:a.jsxs(Ur,{children:[a.jsx(Wr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Kt,{children:[a.jsx(at,{children:"Metric"}),Oe.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?Ym(L.provider):null,L.model].filter(Boolean).join(" · ")})]},L.agentId))]})}),a.jsxs(Vr,{children:[a.jsxs(Kt,{children:[a.jsx(Be,{className:"font-medium",children:"Pass Rate"}),Oe.map(L=>a.jsx(Be,{children:a.jsx(Xs,{rate:L.passRate})},L.agentId))]}),a.jsxs(Kt,{children:[a.jsx(Be,{className:"font-medium",children:"Total Runs"}),Oe.map(L=>a.jsx(Be,{className:"font-mono",children:L.totalRuns},L.agentId))]}),a.jsxs(Kt,{children:[a.jsx(Be,{className:"font-medium",children:"Avg Tool Calls"}),Oe.map(L=>a.jsx(Be,{className:"font-mono",children:L.avgToolCalls.toFixed(1)},L.agentId))]}),a.jsxs(Kt,{children:[a.jsx(Be,{className:"font-medium",children:"Avg Latency"}),Oe.map(L=>a.jsxs(Be,{className:"font-mono",children:[Math.round(L.avgLatency),"ms"]},L.agentId))]})]})]})})]}),a.jsxs(ze,{children:[a.jsx(At,{className:"pb-3",children:a.jsx(Et,{className:"text-base",children:"Scenario × Agent Matrix"})}),a.jsx(qe,{className:"max-h-[34rem] overflow-auto p-0",children:a.jsxs(Ur,{className:"table-fixed",children:[a.jsx(Wr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Kt,{children:[a.jsx(at,{className:"w-[260px]",children:"Scenario"}),fe.map(L=>{const ie=Oe.find(pe=>pe.agentId===L.id);return a.jsxs(at,{children:[a.jsx("div",{className:"font-medium text-sm",children:L.name}),(ie?.provider||ie?.model)&&a.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[ie.provider?Ym(ie.provider):null,ie.model].filter(Boolean).join(" · ")})]},L.id)})]})}),a.jsx(Vr,{children:Z.map(L=>a.jsxs(Kt,{children:[a.jsx(Be,{className:"font-medium text-sm",children:L.displayLabel}),fe.map(ie=>{const pe=L.byAgent[ie.id];return pe?a.jsx(Be,{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(Xs,{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=>Ye(Ee))}):a.jsx("div",{className:"text-xs text-muted-foreground",children:"No runs captured."})]})},ie.id):a.jsx(Be,{children:a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},ie.id)})]},L.scenarioId))})]})})]})]})]})},y$=(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()}`},b$=(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}`:""}`},Uxe=()=>{const[e]=mo(),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(ze,{children:[a.jsx(At,{children:a.jsx(Et,{className:"text-base",children:"Full Result Compare"})}),a.jsxs(qe,{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(Y$,{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:b$(t,r,o),target:"_blank",rel:"noreferrer",children:["Open Left",a.jsx(Ih,{className:"ml-1.5 h-3.5 w-3.5"})]})}),a.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs("a",{href:b$(n,s,i),target:"_blank",rel:"noreferrer",children:["Open Right",a.jsx(Ih,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[a.jsxs(ze,{className:"overflow-hidden",children:[a.jsx(At,{className:"py-3",children:a.jsx(Et,{className:"text-sm font-mono",children:c})}),a.jsx(qe,{className:"p-0",children:a.jsx("iframe",{title:`Result ${c}`,src:y$(t,r,o),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),a.jsxs(ze,{className:"overflow-hidden",children:[a.jsx(At,{className:"py-3",children:a.jsx(Et,{className:"text-sm font-mono",children:d})}),a.jsx(qe,{className:"p-0",children:a.jsx("iframe",{title:`Result ${d}`,src:y$(n,s,i),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function Wxe(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function Vxe(){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(x){Ae({title:"Could not load markdown reports",description:x instanceof Error?x.message:String(x),variant:"destructive"})}finally{s(!1)}};m.useEffect(()=>{f()},[]);const h=m.useMemo(()=>t[0],[t]),p=m.useMemo(()=>t.find(x=>x.relativePath===o)??null,[t,o]),g=async()=>{if(o){d(!0);try{await e.deleteMarkdownReport(o),n(x=>x.filter(j=>j.relativePath!==o)),Ae({title:"Markdown report deleted"}),i(null)}catch(x){Ae({title:"Could not delete markdown report",description:x instanceof Error?x.message:String(x),variant:"destructive"})}finally{d(!1)}}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(cc,{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(ze,{children:a.jsx(qe,{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(Ur,{children:[a.jsx(Wr,{children:a.jsxs(Kt,{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(Vr,{children:t.map(x=>a.jsxs(Kt,{children:[a.jsx(Be,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(_t,{to:`/markdown-reports/view?path=${encodeURIComponent(x.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:x.name}),a.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:x.relativePath})]})}),a.jsx(Be,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=Wxe(x.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(Be,{className:"text-xs text-muted-foreground font-mono",children:x.relativePath.includes("/")?x.relativePath.slice(0,x.relativePath.lastIndexOf("/")):"."}),a.jsx(Be,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(po,{className:"h-3 w-3"}),new Date(x.mtime).toLocaleString()]})}),a.jsx(Be,{children:a.jsxs(Hf,{children:[a.jsx(Kf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(nv,{className:"h-4 w-4"})})}),a.jsxs(wu,{align:"end",children:[a.jsx(Kr,{asChild:!0,children:a.jsx(_t,{to:`/markdown-reports/view?path=${encodeURIComponent(x.relativePath)}`,children:"View"})}),a.jsxs(Kr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),i(x.relativePath)},children:[a.jsx(Oa,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},x.path))})]})})}),a.jsx(Ds,{open:!!o,onOpenChange:x=>!x&&i(null),children:a.jsxs(as,{children:[a.jsxs(ss,{children:[a.jsx(is,{children:"Delete markdown report?"}),a.jsx(ls,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),a.jsxs(os,{children:[a.jsx(us,{disabled:c,children:"Cancel"}),a.jsx(cs,{onClick:x=>{x.preventDefault(),g()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function Hxe(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Kxe(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 Gxe(){const{source:e}=Dn(),[t]=mo(),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 g=!0;if(s(null),d(!1),!n){i(!1);return}return i(!0),e.getMarkdownReport(n).then(x=>{g&&s(x)}).catch(x=>{if(!g)return;const j=x instanceof Error?x.message:String(x);if(j.includes("(404)")){d(!0);return}Ae({title:"Could not load markdown report",description:j,variant:"destructive"})}).finally(()=>{g&&i(!1)}),()=>{g=!1}},[n,e]),!n)return a.jsxs("div",{className:"space-y-4",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Missing report path."}),a.jsx(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=Kxe(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(po,{className:"h-3 w-3 shrink-0"}),new Date(r.mtime).toLocaleString()]}),a.jsx("span",{"aria-hidden":!0,children:"·"}),a.jsx("span",{children:Hxe(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(ze,{children:a.jsx(qe,{className:"pt-6",children:a.jsx(Ta,{text:r.content,variant:"assistant"})})}),p?a.jsx(D5,{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(F5,{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 Yxe=()=>{const e=Rs();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"})]})})},Xxe=new hH;function Qxe(){const{scenarioId:e}=xl();return a.jsx(s5,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const Jxe=()=>a.jsx(vH,{client:Xxe,children:a.jsx(ni,{children:a.jsx(AY,{children:a.jsx(TY,{children:a.jsxs(kY,{children:[a.jsx(b9,{}),a.jsx(J9,{}),a.jsx(gK,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:a.jsxs(lK,{children:[a.jsxs(pn,{element:a.jsx(PY,{}),children:[a.jsx(pn,{path:"/",element:a.jsx(ape,{})}),a.jsx(pn,{path:"/mcp-evaluations",element:a.jsx(Sme,{})}),a.jsx(pn,{path:"/mcp-evaluations/:id",element:a.jsx(HM,{})}),a.jsx(pn,{path:"/mcp-evaluations/:id/:tab",element:a.jsx(HM,{})}),a.jsx(pn,{path:"/tool-analysis",element:a.jsx(bxe,{})}),a.jsx(pn,{path:"/tool-analysis-results",element:a.jsx(wxe,{})}),a.jsx(pn,{path:"/tool-analysis-results/:id",element:a.jsx(jxe,{})}),a.jsx(pn,{path:"/oauth-debugger",element:a.jsx(Cxe,{})}),a.jsx(pn,{path:"/libraries/servers",element:a.jsx(Mve,{})}),a.jsx(pn,{path:"/libraries/servers/:serverId",element:a.jsx($ve,{})}),a.jsx(pn,{path:"/libraries/agents",element:a.jsx(Dve,{})}),a.jsx(pn,{path:"/libraries/agents/:agentName",element:a.jsx(Hge,{})}),a.jsx(pn,{path:"/libraries/test-cases",element:a.jsx(n$,{})}),a.jsx(pn,{path:"/libraries/test-cases/:testCaseId",element:a.jsx(n$,{})}),a.jsx(pn,{path:"/libraries/scenarios",element:a.jsx(s5,{to:"/libraries/test-cases",replace:!0})}),a.jsx(pn,{path:"/libraries/scenarios/:scenarioId",element:a.jsx(Qxe,{})}),a.jsx(pn,{path:"/settings",element:a.jsx(Kge,{})}),a.jsx(pn,{path:"/settings/mcp",element:a.jsx(exe,{})}),a.jsx(pn,{path:"/run",element:a.jsx(_xe,{})}),a.jsx(pn,{path:"/results",element:a.jsx(Pxe,{})}),a.jsx(pn,{path:"/results/:id",element:a.jsx(Rxe,{})}),a.jsx(pn,{path:"/markdown-reports",element:a.jsx(Vxe,{})}),a.jsx(pn,{path:"/markdown-reports/view",element:a.jsx(Gxe,{})}),a.jsx(pn,{path:"/compare",element:a.jsx(qxe,{})}),a.jsx(pn,{path:"/compare/results",element:a.jsx(Uxe,{})})]}),a.jsx(pn,{path:"*",element:a.jsx(Yxe,{})})]})})]})})})})});xU.createRoot(document.getElementById("root")).render(a.jsx(Jxe,{}));